diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2014-05-05 14:29:16 +0100 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2014-05-05 14:34:12 +0100 |
commit | 194f9332d35601178ae3595bc17a3f52f5644cb9 (patch) | |
tree | 3ddd9d271f29724d41999875dd309fdf854dd54d | |
parent | 5279ebf56449a9b9edd28ff23e9c8a20af792795 (diff) |
intel-virtual-output: Try disabling Panning after disabling CRTC
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
-rw-r--r-- | tools/virtual.c | 37 |
1 files changed, 33 insertions, 4 deletions
diff --git a/tools/virtual.c b/tools/virtual.c index d35e5852..9d498a49 100644 --- a/tools/virtual.c +++ b/tools/virtual.c @@ -451,11 +451,40 @@ static int disable_crtc(Display *dpy, XRRScreenResources *res, RRCrtc crtc) { XRRPanning panning; - if (crtc == 0) - return 1; + if (crtc) { + XRRSetPanning(dpy, res, crtc, memset(&panning, 0, sizeof(panning))); + + if (XRRSetCrtcConfig(dpy, res, crtc, CurrentTime, 0, 0, None, RR_Rotate_0, NULL, 0) != Success) + return 0; + + if (XRRSetPanning(dpy, res, crtc, memset(&panning, 0, sizeof(panning))) != Success) { + DBG(("%s failed to clear panning on CRTC:%ld\n", DisplayString(dpy), (long)crtc)); + if (EXTRA_DBG) { + XRRCrtcInfo *c; + XRRPanning *p; + + c = XRRGetCrtcInfo(dpy, res, crtc); + if (c) { + DBG(("%s CRTC:%ld x=%d, y=%d, rotation=%d, mode=%ld\n", + DisplayString(dpy), (long)crtc, + c->x, c->y, c->rotation, c->mode)); + XRRFreeCrtcInfo(c); + } - XRRSetPanning(dpy, res, crtc, memset(&panning, 0, sizeof(panning))); - return XRRSetCrtcConfig(dpy, res, crtc, CurrentTime, 0, 0, None, RR_Rotate_0, NULL, 0) == Success; + p = XRRGetPanning(dpy, res, crtc); + if (p) { + DBG(("%s CRTC:%ld panning (%d, %d)x(%d, %d), tracking (%d, %d)x(%d, %d), border (%d, %d),(%d, %d)\n", + DisplayString(dpy), (long)crtc, + p->left, p->top, p->width, p->height, + p->track_left, p->track_top, p->track_width, p->track_height, + p->border_left, p->border_top, p->border_right, p->border_bottom)); + XRRFreePanning(p); + } + } + } + } + + return 1; } static int clone_update_modes__randr(struct clone *clone) |