summaryrefslogtreecommitdiff
path: root/src/sna/sna_dri2.c
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2016-08-12 17:01:22 +0100
committerChris Wilson <chris@chris-wilson.co.uk>2016-08-12 17:24:09 +0100
commit8586813169e6be75f93e3e15620fbb4e72912515 (patch)
tree980dfb28e32908b76590671dcd9def5de8adc07b /src/sna/sna_dri2.c
parentc26a148541e321f90870bd937a6ff1967f9873ed (diff)
sna/dri2: Force the render to be flushed before reporting new buffers
When filling out the set of buffers for the DRI2GetBuffers request, ensure that any pending rendering to them is flushed to hardware. 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.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/sna/sna_dri2.c b/src/sna/sna_dri2.c
index 876a9095..3328d873 100644
--- a/src/sna/sna_dri2.c
+++ b/src/sna/sna_dri2.c
@@ -434,25 +434,29 @@ sna_dri2_swap_limit_validate(DrawablePtr draw, int swap_limit)
static void
sna_dri2_reuse_buffer(DrawablePtr draw, DRI2BufferPtr buffer)
{
+ struct sna *sna = to_sna_from_drawable(draw);
+
DBG(("%s: reusing buffer pixmap=%ld, attachment=%d, handle=%d, name=%d\n",
__FUNCTION__, get_drawable_pixmap(draw)->drawable.serialNumber,
buffer->attachment, get_private(buffer)->bo->handle, buffer->name));
assert(get_private(buffer)->refcnt);
assert(get_private(buffer)->bo->refcnt >= get_private(buffer)->bo->active_scanout);
- assert(kgem_bo_flink(&to_sna_from_drawable(draw)->kgem, get_private(buffer)->bo) == buffer->name);
+ assert(kgem_bo_flink(&sna->kgem, get_private(buffer)->bo) == buffer->name);
if (buffer->attachment == DRI2BufferBackLeft &&
draw->type != DRAWABLE_PIXMAP) {
DBG(("%s: replacing back buffer on window %ld\n", __FUNCTION__, draw->id));
- sna_dri2_get_back(to_sna_from_drawable(draw), draw, buffer);
+ sna_dri2_get_back(sna, draw, buffer);
assert(get_private(buffer)->bo->refcnt);
assert(get_private(buffer)->bo->active_scanout == 0);
- assert(kgem_bo_flink(&to_sna_from_drawable(draw)->kgem, get_private(buffer)->bo) == buffer->name);
+ assert(kgem_bo_flink(&sna->kgem, get_private(buffer)->bo) == buffer->name);
DBG(("%s: reusing back buffer handle=%d, name=%d, pitch=%d, age=%d\n",
__FUNCTION__, get_private(buffer)->bo->handle,
buffer->name, buffer->pitch, buffer->flags));
}
+
+ kgem_bo_submit(&sna->kgem, get_private(buffer)->bo);
}
static bool swap_limit(DrawablePtr draw, int limit)