diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2017-06-07 09:20:53 +0100 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2017-06-07 09:43:01 +0100 |
commit | 8eed38e03a057bb1a7517b22a3b5557bcc4d3b84 (patch) | |
tree | 95bf4e46d4c646ba8cb7ca03b91a96003ad351fb /src/sna/sna_dri2.c | |
parent | abbc59087995fd6394003c67d4eb2bd55b74b778 (diff) |
sna/dri2: Check active state on front/back before swap
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'src/sna/sna_dri2.c')
-rw-r--r-- | src/sna/sna_dri2.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/src/sna/sna_dri2.c b/src/sna/sna_dri2.c index d89525cc..714595d8 100644 --- a/src/sna/sna_dri2.c +++ b/src/sna/sna_dri2.c @@ -3295,7 +3295,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) , front=%u (refs=%d/%d, flush=%d)\n", + 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", __FUNCTION__, (long)draw->id, draw->width, draw->height, get_drawable_pixmap(draw)->drawable.serialNumber, @@ -3305,10 +3305,12 @@ sna_dri2_schedule_swap(ClientPtr client, DrawablePtr draw, DRI2BufferPtr front, get_private(back)->refcnt, get_private(back)->bo->refcnt, get_private(back)->bo->flush, + get_private(back)->bo->active_scanout, get_private(front)->bo->handle, get_private(front)->refcnt, get_private(front)->bo->refcnt, - get_private(front)->bo->flush)); + get_private(front)->bo->flush, + get_private(front)->bo->active_scanout)); DBG(("%s(target_msc=%llu, divisor=%llu, remainder=%llu)\n", __FUNCTION__, @@ -3316,6 +3318,9 @@ sna_dri2_schedule_swap(ClientPtr client, DrawablePtr draw, DRI2BufferPtr front, (long long)divisor, (long long)remainder)); + assert(front != back); + assert(get_private(front) != get_private(back)); + assert(get_private(front)->refcnt); assert(get_private(back)->refcnt); @@ -3323,6 +3328,9 @@ 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__, |