[PATCH xserver 03/10] xfree86/modes: Check for non-desktop monitors during PreInit

Keith Packard keithp at keithp.com
Fri Dec 22 02:54:35 UTC 2017


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.

Signed-off-by: Keith Packard <keithp at keithp.com>
---
 hw/xfree86/modes/xf86Crtc.c | 4 ++--
 hw/xfree86/modes/xf86Crtc.h | 5 +++++
 2 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/hw/xfree86/modes/xf86Crtc.c b/hw/xfree86/modes/xf86Crtc.c
index 1a401af4b..67e4096e8 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 215eb2a04..83a7b73dc 100644
--- a/hw/xfree86/modes/xf86Crtc.h
+++ b/hw/xfree86/modes/xf86Crtc.h
@@ -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



More information about the xorg-devel mailing list