Commit 364c9169 authored by Chris Wilson's avatar Chris Wilson 🤔
Browse files

sna/dri2: Skip stale client swap before asserting

Check for a stale backbuffer (the client didn't call DRI2GetBuffers
between DRI2SwapBuffers) before asserting so that we should be
more resilient with asserts enabled for client errors.

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

Signed-off-by: Chris Wilson's avatarChris Wilson <chris@chris-wilson.co.uk>
parent 95ea0564
......@@ -3284,7 +3284,7 @@ sna_dri2_schedule_swap(ClientPtr client, DrawablePtr draw, DRI2BufferPtr front,
CARD64 current_msc;
bool immediate;
DBG(("%s: draw=%lu %dx%d, pixmap=%ld %dx%d, back=%u (refs=%d/%d, flush=%d, active=%d) , front=%u (refs=%d/%d, flush=%d, active=%d)\n",
DBG(("%s: draw=%lu %dx%d, pixmap=%ld %dx%d, back=%u (refs=%d/%d, flush=%d, active=%d, stale=%d) , front=%u (refs=%d/%d, flush=%d, active=%d)\n",
__FUNCTION__,
(long)draw->id, draw->width, draw->height,
get_drawable_pixmap(draw)->drawable.serialNumber,
......@@ -3295,6 +3295,7 @@ sna_dri2_schedule_swap(ClientPtr client, DrawablePtr draw, DRI2BufferPtr front,
get_private(back)->bo->refcnt,
get_private(back)->bo->flush,
get_private(back)->bo->active_scanout,
get_private(back)->stale,
get_private(front)->bo->handle,
get_private(front)->refcnt,
get_private(front)->bo->refcnt,
......@@ -3317,9 +3318,6 @@ sna_dri2_schedule_swap(ClientPtr client, DrawablePtr draw, DRI2BufferPtr front,
assert(get_private(front)->bo->refcnt);
assert(get_private(back)->bo->refcnt);
assert(get_private(front)->bo->active_scanout);
assert(!get_private(back)->bo->active_scanout);
if (get_private(front)->pixmap != get_drawable_pixmap(draw)) {
DBG(("%s: decoupled DRI2 front pixmap=%ld, actual pixmap=%ld\n",
__FUNCTION__,
......@@ -3333,6 +3331,9 @@ sna_dri2_schedule_swap(ClientPtr client, DrawablePtr draw, DRI2BufferPtr front,
goto skip;
}
assert(get_private(front)->bo->active_scanout);
assert(!get_private(back)->bo->active_scanout);
if (draw->type != DRAWABLE_PIXMAP) {
WindowPtr win = (WindowPtr)draw;
struct dri2_window *priv = dri2_window(win);
......
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