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

Chris Wilson ickle at kemper.freedesktop.org
Wed Nov 16 06:59:40 UTC 2016


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

New commits:
commit a1a0f76e55d8dfbbf27a288b71b4bd3edbfbe836
Author: Matt Roper <matthew.d.roper at intel.com>
Date:   Tue Nov 15 14:36:19 2016 -0800

    sna: Ensure we re-calculate fb_to_cursor transform if sharing cursor
    
    If we find that we're sharing the cursor, we wind up bailing out of
    __sna_get_cursor() before the fb_to_cursor transform is computed.  For
    rotated displays, this can prevent the hotspot transformation from
    happening properly, so the cursor's visible position won't match the
    software's idea of where it is.
    
    Cc: Chris Wilson <chris at chris-wilson.co.uk>
    Signed-off-by: Matt Roper <matthew.d.roper at intel.com>

diff --git a/src/sna/sna_display.c b/src/sna/sna_display.c
index ebfeb6a..9f8f862 100644
--- a/src/sna/sna_display.c
+++ b/src/sna/sna_display.c
@@ -5839,20 +5839,6 @@ static struct sna_cursor *__sna_get_cursor(struct sna *sna, xf86CrtcPtr crtc)
 	transformed = to_sna_crtc(crtc)->cursor_transform;
 	rotation = (!transformed && crtc->transform_in_use) ? crtc->rotation : RR_Rotate_0;
 
-	/* Don't allow phys cursor sharing */
-	if (sna->cursor.use_gtt && !transformed) {
-		for (cursor = sna->cursor.cursors; cursor; cursor = cursor->next) {
-			if (cursor->serial == sna->cursor.serial &&
-			    cursor->rotation == rotation &&
-			    !cursor->transformed) {
-				__DBG(("%s: reusing handle=%d, serial=%d, rotation=%d, size=%d\n",
-				       __FUNCTION__, cursor->handle, cursor->serial, cursor->rotation, cursor->size));
-				assert(cursor->size == sna->cursor.size);
-				return cursor;
-			}
-		}
-	}
-
 	if (transformed) {
 		struct pixman_box16 box;
 
@@ -5910,6 +5896,20 @@ static struct sna_cursor *__sna_get_cursor(struct sna *sna, xf86CrtcPtr crtc)
 		       to_sna_crtc(crtc)->cursor_to_fb.m[2][2]));
 	}
 
+	/* Don't allow phys cursor sharing */
+	if (sna->cursor.use_gtt && !transformed) {
+		for (cursor = sna->cursor.cursors; cursor; cursor = cursor->next) {
+			if (cursor->serial == sna->cursor.serial &&
+			    cursor->rotation == rotation &&
+			    !cursor->transformed) {
+				__DBG(("%s: reusing handle=%d, serial=%d, rotation=%d, size=%d\n",
+				       __FUNCTION__, cursor->handle, cursor->serial, cursor->rotation, cursor->size));
+				assert(cursor->size == sna->cursor.size);
+				return cursor;
+			}
+		}
+	}
+
 	cursor = to_sna_crtc(crtc)->cursor;
 	if (cursor && cursor->alloc < 4*size*size)
 		cursor = NULL;


More information about the xorg-commit mailing list