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 <mic...@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 <kei...@keithp.com>
Reviewed-by: Adam Jackson <a...@nwnk.net>
---
 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.
-- 
2.15.1

_______________________________________________
xorg-devel@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: https://lists.x.org/mailman/listinfo/xorg-devel

Reply via email to