This lets a DRM client map between X outputs and kernel connectors.
v2:
Change CONNECTOR_ID to enum -- Adam Jackson <[email protected]>
Signed-off-by: Keith Packard <[email protected]>
Reviewed-by: Adam Jackson <[email protected]>
---
src/drmmode_display.c | 23 +++++++++++++++++++++++
1 file changed, 23 insertions(+)
diff --git a/src/drmmode_display.c b/src/drmmode_display.c
index b0fc7ea..fe319eb 100644
--- a/src/drmmode_display.c
+++ b/src/drmmode_display.c
@@ -1662,6 +1662,29 @@ static void
drmmode_output_create_resources(xf86OutputPtr output)
drmmode_output->tear_free = info->tear_free;
drmmode_output->num_props++;
+ /* 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];
drmmode_prop = p->mode_prop;
--
2.16.2
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx