How would it be possible to exclusively control the HDMI output from the application, not allowing the OS to automatically configure it to be displayed on the screen?
For example, using standard DVI / VGA as the main display, but sending the Mplayer video signal to HDMI using the device file.
This is a tough question to answer through Google. Almost every result is connected with the work of audio via HDMI.
(edited here)
The comment below is mentioned using separate Xorg servers. Although this is a useful idea, it does not answer the one question I asked, and the one I meant:
1) How can I make Linux refuse to place the console on this display if it is loaded in front of another display or if it is the only screen (when only SSH is used for login)? 2) What if there is no X? I want to connect graphics directly to the adapter. Can I do this from code using standard functions without interacting directly with drivers (possibly outdated, but using SVGALib or some other non-X-graphic layer)?
(edited here)
I looked at SVGALib (old) and SDL. The latter works both inside and outside X and even provides access to OpenGL. I found version 1.3 through a link to a forum somewhere, but both on the site and FTP seem to be up to 1.2. SDL is a great solution, in general, but it has the following two special drawbacks:
1) The general create-device call accepts the device index, but completely ignores it:
(src/video/bwindow/SDL_bvideo.cc) BE_CreateDevice(int devindex)
The specific driver seems to have the same drawback. For example, DirectFB (which, I suppose, provides graphics under the console):
(src/video/directfb/SDL_DirectFB_video.c) DirectFB_CreateDevice(int devindex)
None of the bodies of these functions has a place to set the device index ... Without a doubt, due to the lack of support in the standard interface for which they are created.
2) On any adapter that needs to be selected, SDL seems to automatically attach all displays together. The example "testsprite2.c" (supplied with the library) accepts the parameter "--display", which is processed in "common.c" (common functionality for all examples). You can see that everything he does with the --display option calculates the X / Y coordinate of this screen within one large combined canvas:
if (SDL_strcasecmp(argv[index], "--display") == 0) { ++index; if (!argv[index]) { return -1; } state->display = SDL_atoi(argv[index]); if (SDL_WINDOWPOS_ISUNDEFINED(state->window_x)) { state->window_x = SDL_WINDOWPOS_UNDEFINED_DISPLAY(state->display); state->window_y = SDL_WINDOWPOS_UNDEFINED_DISPLAY(state->display); } if (SDL_WINDOWPOS_ISCENTERED(state->window_x)) { state->window_x = SDL_WINDOWPOS_CENTERED_DISPLAY(state->display); state->window_y = SDL_WINDOWPOS_CENTERED_DISPLAY(state->display); } return 2; }
So, there is no way to isolate one display from another if they are on the same adapter. SDL will not work.
If there is no comparable solution for the SDL, or it turns out to be trivial to install a specific device (devindex) in the appropriate place (which is probably not the case, and therefore probably the reason why this remains unfulfilled), it seems that the best option An exclusive and fully dedicated use of the screen is to create your own window manager under a separate Xorg instance assigned to your second device.