xf86-video-intel: src/sna/sna_display.c

Chris Wilson ickle at kemper.freedesktop.org
Tue May 19 03:20:50 PDT 2015


 src/sna/sna_display.c |   14 ++++++++++++--
 1 file changed, 12 insertions(+), 2 deletions(-)

New commits:
commit 276a628827c126a36f66e5f1b572aff2ff61de04
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Tue May 19 11:11:21 2015 +0100

    sna: Disable HW cursor if we fail to update it
    
    If we cannot control the HW cursor, flag it as invalid and enable the SW
    cursor next time. The flag will remain set until the next modeset and we
    then try the HW cursor again.
    
    Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>

diff --git a/src/sna/sna_display.c b/src/sna/sna_display.c
index e96040d..e62c6be 100644
--- a/src/sna/sna_display.c
+++ b/src/sna/sna_display.c
@@ -5474,8 +5474,10 @@ disable:
 		       __FUNCTION__, __sna_crtc_id(sna_crtc), arg.x, arg.y, arg.handle, arg.flags, sna_crtc->cursor ? sna_crtc->cursor->handle : 0,
 		       arg.flags & DRM_MODE_CURSOR_MOVE, arg.flags & DRM_MODE_CURSOR_BO));
 
-		if (arg.flags &&
-		    drmIoctl(sna->kgem.fd, DRM_IOCTL_MODE_CURSOR, &arg) == 0) {
+		if (arg.flags == 0)
+			continue;
+
+		if (drmIoctl(sna->kgem.fd, DRM_IOCTL_MODE_CURSOR, &arg) == 0) {
 			if (arg.flags & DRM_MODE_CURSOR_BO) {
 				if (sna_crtc->cursor) {
 					assert(sna_crtc->cursor->ref > 0);
@@ -5488,6 +5490,14 @@ disable:
 				} else
 					sna_crtc->last_cursor_size = 0;
 			}
+		} else {
+			ERR(("%s: failed to update cursor on CRTC:%d [pipe=%d], disabling hwcursor\n",
+			     __FUNCTION__, sna_crtc_id(crtc), sna_crtc_pipe(crtc)));
+			sna_crtc->hwcursor = false;
+			/* XXX How to force switch back to SW cursor?
+			 * Right now we just want until the next cursor image
+			 * change, which is fairly frequent.
+			 */
 		}
 	}
 	sigio_unblock(sigio);


More information about the xorg-commit mailing list