[PATCH xserver 2/3] xf86-video-modesetting: Create CONNECTOR_ID properties for outputs

Keith Packard keithp at keithp.com
Wed Aug 2 10:42:12 UTC 2017


This lets a DRM client map between X outputs and kernel connectors.

Signed-off-by: Keith Packard <keithp at keithp.com>
---
 hw/xfree86/drivers/modesetting/drmmode_display.c | 24 ++++++++++++++++++++++++
 1 file changed, 24 insertions(+)

diff --git a/hw/xfree86/drivers/modesetting/drmmode_display.c b/hw/xfree86/drivers/modesetting/drmmode_display.c
index 89e972538..837421efe 100644
--- a/hw/xfree86/drivers/modesetting/drmmode_display.c
+++ b/hw/xfree86/drivers/modesetting/drmmode_display.c
@@ -1467,6 +1467,30 @@ drmmode_output_create_resources(xf86OutputPtr output)
         j++;
     }
 
+    /* Create CONNECTOR_ID property */
+    {
+        Atom    name = MakeAtom("CONNECTOR_ID", 12, TRUE);
+        INT32   value = mode_output->connector_id;
+        INT32   prop_range[2] = { 0, 0x7fffffff };
+
+        if (name != BAD_RESOURCE) {
+            err = RRConfigureOutputProperty(output->randr_output, name,
+                                            FALSE, TRUE, TRUE,
+                                            2, prop_range);
+            if (err != 0) {
+                xf86DrvMsg(output->scrn->scrnIndex, X_ERROR,
+                           "RRConfigureOutputProperty error, %d\n", err);
+            }
+            err = RRChangeOutputProperty(output->randr_output, name,
+                                         XA_INTEGER, 32, PropModeReplace, 1,
+                                         &value, FALSE, FALSE);
+            if (err != 0) {
+                xf86DrvMsg(output->scrn->scrnIndex, X_ERROR,
+                           "RRChangeOutputProperty error, %d\n", err);
+            }
+        }
+    }
+
     for (i = 0; i < drmmode_output->num_props; i++) {
         drmmode_prop_ptr p = &drmmode_output->props[i];
 
-- 
2.11.0



More information about the xorg-devel mailing list