summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2014-05-05 14:49:31 +0100
committerChris Wilson <chris@chris-wilson.co.uk>2014-05-05 14:50:44 +0100
commit464ef44ab1d691a4bffecbe88be8182adf9fd4ff (patch)
treebb4b040bfc8d1ec6832644e532a43f16213c7234 /tools
parent194f9332d35601178ae3595bc17a3f52f5644cb9 (diff)
intel-virtual-output: Copy existing CRTC information
If we fail to disable the remote output during initialisation, copy the current configuration in order to try and keep the bookkeeping in order. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'tools')
-rw-r--r--tools/virtual.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/tools/virtual.c b/tools/virtual.c
index 9d498a49..0966590c 100644
--- a/tools/virtual.c
+++ b/tools/virtual.c
@@ -560,6 +560,15 @@ static int clone_update_modes__randr(struct clone *clone)
if (disable_crtc(clone->dst.dpy, from_res, from_info->crtc)) {
clone->dst.rr_crtc = 0;
clone->dst.mode.id = 0;
+ } else {
+ XRRCrtcInfo *c = XRRGetCrtcInfo(clone->dst.dpy, from_res, from_info->crtc);
+ if (c) {
+ clone->dst.x = c->x;
+ clone->dst.y = c->y;
+ clone->dst.rotation = c->rotation;
+ clone->dst.mode.id = c->mode;
+ XRRFreeCrtcInfo(c);
+ }
}
}