summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2014-04-10 16:08:48 +0100
committerChris Wilson <chris@chris-wilson.co.uk>2014-04-10 16:08:48 +0100
commitf94684db1a694820ff508d8aec77bf19cea86fbd (patch)
tree26b942ea845d6a7f9ee60bd5fbf7200a283fb0e9 /src
parentd364a881effb2fd87f11648b10d126eb18fcb6be (diff)
sna: Validate the cursor everytime for hw support
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'src')
-rw-r--r--src/sna/sna_display.c31
1 files changed, 15 insertions, 16 deletions
diff --git a/src/sna/sna_display.c b/src/sna/sna_display.c
index 528f21e5..0b03cfae 100644
--- a/src/sna/sna_display.c
+++ b/src/sna/sna_display.c
@@ -3533,22 +3533,21 @@ sna_use_hw_cursor(ScreenPtr screen, CursorPtr cursor)
struct sna *sna = to_sna_from_screen(screen);
/* cursors are invariant */
- if (cursor == sna->cursor.ref)
- return TRUE;
-
- cursor->refcnt++;
- if (sna->cursor.ref)
- FreeCursor(sna->cursor.ref, None);
- sna->cursor.ref = cursor;
- sna->cursor.size = __cursor_size(cursor);
- sna->cursor.serial++;
-
- __DBG(("%s(%dx%d): ARGB?=%d, serial->%d, size->%d\n", __FUNCTION__,
- cursor->bits->width,
- cursor->bits->height,
- cursor->bits->argb!=NULL,
- sna->cursor.serial,
- sna->cursor.size));
+ if (cursor != sna->cursor.ref) {
+ cursor->refcnt++;
+ if (sna->cursor.ref)
+ FreeCursor(sna->cursor.ref, None);
+ sna->cursor.ref = cursor;
+ sna->cursor.size = __cursor_size(cursor);
+ sna->cursor.serial++;
+
+ __DBG(("%s(%dx%d): ARGB?=%d, serial->%d, size->%d\n", __FUNCTION__,
+ cursor->bits->width,
+ cursor->bits->height,
+ cursor->bits->argb!=NULL,
+ sna->cursor.serial,
+ sna->cursor.size));
+ }
return sna->cursor.size <= sna->cursor.max_size;
}