summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorKeith Packard <keithp@keithp.com>2018-02-12 13:51:55 -0800
committerMichel Dänzer <michel@daenzer.net>2018-07-10 11:43:23 +0200
commitab7e39c5a03e24c3ce3ee2f22ada7572bc2d9aa7 (patch)
treebf16c93f96cb1f1ed516a0c5d8669b4582bc8007 /src
parent14db71a606128c4a207f43298809af279b77e2a8 (diff)
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> (Ported from xserver commit 023d4aba8d45e9e3630b944ecfb650c081799b96) Reviewed-by: Keith Packard <keithp@keithp.com> Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
Diffstat (limited to 'src')
-rw-r--r--src/drmmode_display.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/src/drmmode_display.c b/src/drmmode_display.c
index ca8a617..031d826 100644
--- a/src/drmmode_display.c
+++ b/src/drmmode_display.c
@@ -2192,6 +2192,28 @@ static void drmmode_output_create_resources(xf86OutputPtr output)
AMDGPUEntPtr pAMDGPUEnt = AMDGPUEntPriv(output->scrn);
drmModePropertyPtr drmmode_prop, tearfree_prop;
int i, j, err;
+ Atom name;
+
+ /* Create CONNECTOR_ID property */
+ name = MakeAtom("CONNECTOR_ID", 12, TRUE);
+ if (name != BAD_RESOURCE) {
+ INT32 value = mode_output->connector_id;
+
+ err = RRConfigureOutputProperty(output->randr_output, name,
+ FALSE, FALSE, TRUE, 1, &value);
+ if (err != Success) {
+ 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 != Success) {
+ xf86DrvMsg(output->scrn->scrnIndex, X_ERROR,
+ "RRChangeOutputProperty error, %d\n", err);
+ }
+ }
drmmode_output->props =
calloc(mode_output->count_props + 1, sizeof(drmmode_prop_rec));