xfree86/modes: Check for non-desktop monitors during PreInit [v2]

At startup, we want to ignore non-desktop monitors unless we don't
find any desktop monitors. Because there are no DIX RandR resources
allocated, let the driver store this information in a new field in the
xf86Output structure and then use that value to help decide whether to
include an output as part of the default configuration.

v2:
  Suggested-by: Michel Dänzer <michel@daenzer.net>

  Bump XF86_CRTC_VERSION from 7 to 8. This will let out-of-tree
  drivers know whether this field is available.

Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Adam Jackson <ajax@nwnk.net>
This commit is contained in:
Keith Packard 2018-02-12 13:51:52 -08:00 committed by Adam Jackson
parent 80d4f4b6c2
commit fabbaa8d62
2 changed files with 8 additions and 3 deletions

View File

@ -538,9 +538,9 @@ xf86OutputEnabled(xf86OutputPtr output, Bool strict)
return FALSE;
}
/* If not, try to only light up the ones we know are connected */
/* If not, try to only light up the ones we know are connected which are supposed to be on the desktop */
if (strict) {
enable = output->status == XF86OutputStatusConnected;
enable = output->status == XF86OutputStatusConnected && !output->non_desktop;
}
/* But if that fails, try to light up even outputs we're unsure of */
else {

View File

@ -247,7 +247,7 @@ typedef struct _xf86CrtcFuncs {
} xf86CrtcFuncsRec, *xf86CrtcFuncsPtr;
#define XF86_CRTC_VERSION 7
#define XF86_CRTC_VERSION 8
struct _xf86Crtc {
/**
@ -627,6 +627,11 @@ struct _xf86Output {
/** Whether to use the old per-screen Monitor config section */
Bool use_screen_monitor;
/** For pre-init, whether the output should be excluded from the
* desktop when there are other viable outputs to use
*/
Bool non_desktop;
#ifdef RANDR_12_INTERFACE
/**
* RandR 1.2 output structure.