From b4f0f44a9f67f2eafd4a2b5ab919e6ea7fa2acf7 Mon Sep 17 00:00:00 2001 From: Keith Packard Date: Wed, 11 Jul 2018 19:10:20 +0200 Subject: modesetting: Create CONNECTOR_ID properties for outputs [v2] MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This lets a DRM client map between X outputs and kernel connectors. v2: Change CONNECTOR_ID to enum -- Adam Jackson Signed-off-by: Keith Packard (Ported from xserver commit 023d4aba8d45e9e3630b944ecfb650c081799b96) Signed-off-by: Michel Dänzer (Ported from amdgpu commit ab7e39c5a03e24c3ce3ee2f22ada7572bc2d9aa7) Acked-by: Alex Deucher --- src/drmmode_display.c | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/src/drmmode_display.c b/src/drmmode_display.c index 27aa5a6c..d4bd76e1 100644 --- a/src/drmmode_display.c +++ b/src/drmmode_display.c @@ -1643,6 +1643,33 @@ drmmode_output_create_resources(xf86OutputPtr output) RADEONEntPtr pRADEONEnt = RADEONEntPriv(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)); + if (!drmmode_output->props) + return; drmmode_output->props = calloc(mode_output->count_props + 1, sizeof(drmmode_prop_rec)); if (!drmmode_output->props) -- cgit v1.2.3