summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKeith Packard <keithp@keithp.com>2017-06-15 01:48:31 -0700
committerKeith Packard <keithp@keithp.com>2017-10-10 17:54:32 -0700
commit555ce321d6b03b356b83e11fc588216294ab6d7c (patch)
treeb3d09603179c6ad166c7e310b2e23823b391cbcf
parent7673b34e038cb38d78ba27e4df8b881b317c46e8 (diff)
xf86-video-modesetting: Create CONNECTOR_ID properties for outputs
This lets a DRM client map between X outputs and kernel connectors. Signed-off-by: Keith Packard <keithp@keithp.com>
-rw-r--r--hw/xfree86/drivers/modesetting/drmmode_display.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/hw/xfree86/drivers/modesetting/drmmode_display.c b/hw/xfree86/drivers/modesetting/drmmode_display.c
index e211e57eb..9b337fe5a 100644
--- a/hw/xfree86/drivers/modesetting/drmmode_display.c
+++ b/hw/xfree86/drivers/modesetting/drmmode_display.c
@@ -1448,6 +1448,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];