summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2013-11-26 09:41:42 +0000
committerChris Wilson <chris@chris-wilson.co.uk>2013-11-26 09:41:42 +0000
commit36ac68bedd3b30d7bdf0f40b438b45a7c4dec9e5 (patch)
tree8d6883addce8773ad9cabee8507553b779ce0685
parent63a964d6d0cb0e4ffce70d8e1b672dd65fae6703 (diff)
intel-virtual-output: Clone remote EDID for virtual outputs
References: https://bugs.freedesktop.org/show_bug.cgi?id=72020 Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
-rw-r--r--tools/virtual.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/tools/virtual.c b/tools/virtual.c
index f3259fdf..3ee9cd0a 100644
--- a/tools/virtual.c
+++ b/tools/virtual.c
@@ -417,6 +417,23 @@ static XRRModeInfo *lookup_mode(XRRScreenResources *res, int id)
return NULL;
}
+static void clone_update_edid(struct clone *clone)
+{
+ unsigned long nitems, after;
+ unsigned char *data;
+ int format;
+ Atom type;
+
+ if (XRRGetOutputProperty(clone->dst.dpy, clone->dst.rr_output,
+ XInternAtom(clone->dst.dpy, "EDID", False),
+ 0, 100, False, False, AnyPropertyType,
+ &type, &format, &nitems, &after, &data) == Success) {
+ XRRChangeOutputProperty(clone->src.dpy, clone->src.rr_output,
+ XInternAtom(clone->src.dpy, "EDID", False),
+ type, format, PropModeReplace, data, nitems);
+ }
+}
+
static int clone_update_modes__randr(struct clone *clone)
{
XRRScreenResources *from_res = NULL, *to_res = NULL;
@@ -534,6 +551,7 @@ static int clone_update_modes__randr(struct clone *clone)
XRRAddOutputMode(clone->src.dpy, clone->src.rr_output, id);
}
+ clone_update_edid(clone);
XUngrabServer(clone->src.dpy);
done:
ret = 0;