xf86-video-intel: tools/virtual.c

Chris Wilson ickle at kemper.freedesktop.org
Mon May 5 06:34:41 PDT 2014


 tools/virtual.c |   37 +++++++++++++++++++++++++++++++++----
 1 file changed, 33 insertions(+), 4 deletions(-)

New commits:
commit 194f9332d35601178ae3595bc17a3f52f5644cb9
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Mon May 5 14:29:16 2014 +0100

    intel-virtual-output: Try disabling Panning after disabling CRTC
    
    Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>

diff --git a/tools/virtual.c b/tools/virtual.c
index d35e585..9d498a4 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)


More information about the xorg-commit mailing list