[PATCH xserver 2/7] xf86-video-modesetting: Record non-desktop kernel property at PreInit time

Keith Packard keithp at keithp.com
Mon Feb 12 21:51:53 UTC 2018


Save any value of the kernel non-desktop property in the xf86Output
structure to avoid non-desktop outputs in the default configuration.

Signed-off-by: Keith Packard <keithp at keithp.com>
Reviewed-by: Adam Jackson <ajax at nwnk.net>
---
 hw/xfree86/drivers/modesetting/drmmode_display.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/hw/xfree86/drivers/modesetting/drmmode_display.c b/hw/xfree86/drivers/modesetting/drmmode_display.c
index 9c3856378..1ec232f70 100644
--- a/hw/xfree86/drivers/modesetting/drmmode_display.c
+++ b/hw/xfree86/drivers/modesetting/drmmode_display.c
@@ -1768,6 +1768,7 @@ drmmode_output_init(ScrnInfoPtr pScrn, drmmode_ptr drmmode, drmModeResPtr mode_r
     drmmode_output_private_ptr drmmode_output;
     char name[32];
     int i;
+    Bool nonDesktop = FALSE;
     drmModePropertyBlobPtr path_blob = NULL;
     const char *s;
     koutput =
@@ -1776,6 +1777,9 @@ drmmode_output_init(ScrnInfoPtr pScrn, drmmode_ptr drmmode, drmModeResPtr mode_r
         return 0;
 
     path_blob = koutput_get_prop_blob(drmmode->fd, koutput, "PATH");
+    i = koutput_get_prop_idx(drmmode->fd, koutput, DRM_MODE_PROP_RANGE, RR_PROPERTY_NON_DESKTOP);
+    if (i >= 0)
+        nonDesktop = koutput->prop_values[i] != 0;
 
     drmmode_create_name(pScrn, koutput, name, path_blob);
 
@@ -1794,6 +1798,7 @@ drmmode_output_init(ScrnInfoPtr pScrn, drmmode_ptr drmmode, drmModeResPtr mode_r
             drmmode_output = output->driver_private;
             drmmode_output->output_id = mode_res->connectors[num];
             drmmode_output->mode_output = koutput;
+            output->non_desktop = nonDesktop;
             return 1;
         }
     }
@@ -1844,6 +1849,7 @@ drmmode_output_init(ScrnInfoPtr pScrn, drmmode_ptr drmmode, drmModeResPtr mode_r
     output->interlaceAllowed = TRUE;
     output->doubleScanAllowed = TRUE;
     output->driver_private = drmmode_output;
+    output->non_desktop = nonDesktop;
 
     output->possible_crtcs = 0x7f;
     for (i = 0; i < koutput->count_encoders; i++) {
-- 
2.15.1



More information about the xorg-devel mailing list