summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2014-08-08 10:26:13 +0100
committerChris Wilson <chris@chris-wilson.co.uk>2014-08-08 10:26:13 +0100
commit59f0374188e6d2eb2fd18e3dfb517087e09ae13f (patch)
treeef275fa633296b609bfbef4baa205171f1e186bd
parentafea9ba0790a951c6a00b57d0d71876dd1ce98c3 (diff)
sna: Restore the clear before pwriting the cursor
Along the legacy phys cursor path, we use a common scratch buffer. As this is global, we need to be careful not to trust the cursor local dirty tracking and be sure to clear the image before uploading. Reported-by: Dirk Griesbach Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=82337 Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
-rw-r--r--src/sna/sna_display.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/sna/sna_display.c b/src/sna/sna_display.c
index 87defbef..277e2386 100644
--- a/src/sna/sna_display.c
+++ b/src/sna/sna_display.c
@@ -4232,6 +4232,7 @@ static struct sna_cursor *__sna_create_cursor(struct sna *sna, int size)
c->serial = 0;
c->rotation = 0;
c->last_width = c->last_height = 0; /* all clear */
+ c->size = size;
sna->cursor.num_stash--;
sna->cursor.stash = c->next;
@@ -4317,8 +4318,10 @@ static struct sna_cursor *__sna_get_cursor(struct sna *sna, xf86CrtcPtr crtc)
pitch = BitmapBytePad(width);
image = cursor->image;
- if (image == NULL)
+ if (image == NULL) {
image = sna->cursor.scratch;
+ cursor->last_width = cursor->last_height = size;
+ }
if (size > cursor->size ||
width < cursor->last_width ||
height < cursor->last_height ||