summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKeith Packard <keithp@keithp.com>2018-02-12 13:51:55 -0800
committerAdam Jackson <ajax@redhat.com>2018-02-27 12:38:48 -0500
commit023d4aba8d45e9e3630b944ecfb650c081799b96 (patch)
treece3dd48b1259cd5639e7848fc732eaeef5b4c389
parent39573605050f6253d14a4786bb79ce2b48537039 (diff)
xf86-video-modesetting: Create CONNECTOR_ID properties for outputs [v2]
This lets a DRM client map between X outputs and kernel connectors. v2: Change CONNECTOR_ID to enum -- Adam Jackson <ajax@nwnk.net> Signed-off-by: Keith Packard <keithp@keithp.com> Reviewed-by: Adam Jackson <ajax@nwnk.net>
-rw-r--r--hw/xfree86/drivers/modesetting/drmmode_display.c23
1 files changed, 23 insertions, 0 deletions
diff --git a/hw/xfree86/drivers/modesetting/drmmode_display.c b/hw/xfree86/drivers/modesetting/drmmode_display.c
index c86eb6082..1db514fc6 100644
--- a/hw/xfree86/drivers/modesetting/drmmode_display.c
+++ b/hw/xfree86/drivers/modesetting/drmmode_display.c
@@ -1510,6 +1510,29 @@ drmmode_output_create_resources(xf86OutputPtr output)
j++;
}
+ /* Create CONNECTOR_ID property */
+ {
+ Atom name = MakeAtom("CONNECTOR_ID", 12, TRUE);
+ INT32 value = mode_output->connector_id;
+
+ if (name != BAD_RESOURCE) {
+ err = RRConfigureOutputProperty(output->randr_output, name,
+ FALSE, FALSE, TRUE,
+ 1, &value);
+ 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];