diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2019-07-23 18:29:26 +0100 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2019-07-24 11:22:17 +0100 |
commit | 364c91697805e3d6504c14128ec21d95026a2551 (patch) | |
tree | 463f6a10bd391ef768a5d2668584e64325d9ae88 | |
parent | 95ea05645a3abe7fa69922fe40e0839940706f9d (diff) |
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 <chris@chris-wilson.co.uk>
-rw-r--r-- | src/sna/sna_dri2.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/sna/sna_dri2.c b/src/sna/sna_dri2.c index 9cddb57f..4acb04c2 100644 --- a/src/sna/sna_dri2.c +++ b/src/sna/sna_dri2.c @@ -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); |