From fabbaa8d6260da14fe5b7ca0f3f8748af16253a2 Mon Sep 17 00:00:00 2001 From: Keith Packard Date: Mon, 12 Feb 2018 13:51:52 -0800 Subject: [PATCH] xfree86/modes: Check for non-desktop monitors during PreInit [v2] MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 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 Reviewed-by: Adam Jackson --- hw/xfree86/modes/xf86Crtc.c | 4 ++-- hw/xfree86/modes/xf86Crtc.h | 7 ++++++- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/hw/xfree86/modes/xf86Crtc.c b/hw/xfree86/modes/xf86Crtc.c index 80aebce8a..3ed7347df 100644 --- a/hw/xfree86/modes/xf86Crtc.c +++ b/hw/xfree86/modes/xf86Crtc.c @@ -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 { diff --git a/hw/xfree86/modes/xf86Crtc.h b/hw/xfree86/modes/xf86Crtc.h index e6ae9cc4d..ae81417f6 100644 --- a/hw/xfree86/modes/xf86Crtc.h +++ b/hw/xfree86/modes/xf86Crtc.h @@ -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.