Commit fffb1f52 authored by Chris Wilson's avatar Chris Wilson 🤔
Browse files

sna/dri2: Skip asserting distinct front/back for stale swaps

If the backbuffer is stale (i.e. the client didn't call DRI2GetBuffers
before swapping) the front/back bo may not be distinct. Move the
assertion for a valid swap after the handling of a stale swap so that
the assertions are more robust for a client error.

References: https://bugs.freedesktop.org/show_bug.cgi?id=111197

Signed-off-by: Chris Wilson's avatarChris Wilson <chris@chris-wilson.co.uk>
parent 364c9169
...@@ -3314,10 +3314,6 @@ sna_dri2_schedule_swap(ClientPtr client, DrawablePtr draw, DRI2BufferPtr front, ...@@ -3314,10 +3314,6 @@ sna_dri2_schedule_swap(ClientPtr client, DrawablePtr draw, DRI2BufferPtr front,
assert(get_private(front)->refcnt); assert(get_private(front)->refcnt);
assert(get_private(back)->refcnt); assert(get_private(back)->refcnt);
assert(get_private(back)->bo != get_private(front)->bo);
assert(get_private(front)->bo->refcnt);
assert(get_private(back)->bo->refcnt);
if (get_private(front)->pixmap != get_drawable_pixmap(draw)) { if (get_private(front)->pixmap != get_drawable_pixmap(draw)) {
DBG(("%s: decoupled DRI2 front pixmap=%ld, actual pixmap=%ld\n", DBG(("%s: decoupled DRI2 front pixmap=%ld, actual pixmap=%ld\n",
__FUNCTION__, __FUNCTION__,
...@@ -3331,6 +3327,10 @@ sna_dri2_schedule_swap(ClientPtr client, DrawablePtr draw, DRI2BufferPtr front, ...@@ -3331,6 +3327,10 @@ sna_dri2_schedule_swap(ClientPtr client, DrawablePtr draw, DRI2BufferPtr front,
goto skip; goto skip;
} }
assert(get_private(back)->bo != get_private(front)->bo);
assert(get_private(front)->bo->refcnt);
assert(get_private(back)->bo->refcnt);
assert(get_private(front)->bo->active_scanout); assert(get_private(front)->bo->active_scanout);
assert(!get_private(back)->bo->active_scanout); assert(!get_private(back)->bo->active_scanout);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment