summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2014-06-13 19:59:16 +0100
committerChris Wilson <chris@chris-wilson.co.uk>2014-06-13 20:00:05 +0100
commit8a92261b22a8c134a48d1491627ac05136563603 (patch)
tree13ca2d138bcc151d6d44e4f527e68375101cbe40
parent0c6fa0cdf0cebcd592281e578da7a7f53cbfe186 (diff)
intel-virtual-output: Disable outputs on remote displays upon shutdown
References: https://bugs.freedesktop.org/show_bug.cgi?id=79994 Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
-rw-r--r--tools/virtual.c22
1 files changed, 21 insertions, 1 deletions
diff --git a/tools/virtual.c b/tools/virtual.c
index 95541bda..f1a60573 100644
--- a/tools/virtual.c
+++ b/tools/virtual.c
@@ -3054,16 +3054,36 @@ static int first_display_sibling(struct context *ctx, int i)
return 1;
}
-
#define first_display_for_each_sibling(CTX, i) \
for (i = first_display_first_sibling(CTX); first_display_sibling(CTX, i); i++)
+static void display_cleanup(struct display *display)
+{
+ Display *dpy = display->dpy;
+ int n;
+
+ XGrabServer(dpy);
+
+ res = _XRRGetScreenResourcesCurrent(dpy, display->root);
+ if (res != NULL) {
+ for (n = 0; n < res->ncrtc; n++)
+ disable_crtc(display->dpy, res, res->crtc[n]);
+
+ XRRFreeScreenResources(res);
+ }
+
+ XUngrabServer(dpy);
+}
+
static void context_cleanup(struct context *ctx)
{
Display *dpy = ctx->display->dpy;
XRRScreenResources *res;
int i, j;
+ for (i = 1; i < ctx->ndisplay; i++)
+ display_cleanup(&ctx.display[i]);
+
res = _XRRGetScreenResourcesCurrent(dpy, ctx->display->root);
if (res == NULL)
return;