sna: Rearrange cursor reuse to avoid sharing rotations
Try not to steal a rotated cursor that is currently in use, or else we may see a brief flash of corruption. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
This commit is contained in:
parent
fd700c37ee
commit
cb35b39739
|
|
@ -3160,13 +3160,25 @@ static struct sna_cursor *__sna_get_cursor(struct sna *sna, xf86CrtcPtr crtc)
|
|||
|
||||
size = sna->cursor.size;
|
||||
for (cursor = sna->cursor.cursors; cursor; cursor = cursor->next) {
|
||||
if (cursor->alloc >= 4*size*size && cursor->serial != sna->cursor.serial) {
|
||||
if (cursor->alloc >= 4*size*size && cursor->rotation == rotation) {
|
||||
__DBG(("%s: stealing handle=%d, serial=%d, rotation=%d, alloc=%d\n",
|
||||
__FUNCTION__, cursor->handle, cursor->serial, cursor->rotation, cursor->alloc));
|
||||
assert(cursor->serial != sna->cursor.serial);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (cursor == NULL) {
|
||||
for (cursor = sna->cursor.cursors; cursor; cursor = cursor->next) {
|
||||
if (cursor->alloc >= 4*size*size && cursor->serial != sna->cursor.serial) {
|
||||
__DBG(("%s: stealing handle=%d, serial=%d, rotation=%d, alloc=%d\n",
|
||||
__FUNCTION__, cursor->handle, cursor->serial, cursor->rotation, cursor->alloc));
|
||||
assert(cursor->rotation != sna->cursor.rotation);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (cursor == NULL) {
|
||||
cursor = __sna_create_cursor(sna);
|
||||
if (cursor == NULL)
|
||||
|
|
|
|||
Loading…
Reference in New Issue