diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2014-03-14 11:32:38 +0000 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2014-03-14 11:38:19 +0000 |
commit | b61e6398f0cf94d3c483e30c05ceae4a8383d16c (patch) | |
tree | 7167b5fc9f47976ad11e178cb44587bcecaa1b5d /src | |
parent | f47f192f2240d19ede0a3a59b7970e4f563f3195 (diff) |
sna: Ensure we flush SHM pixmaps if rendering to a GPU shadow
Normally, we try to render into the CPU bo of a SHM pixmap. However, under
the right circumstances we may try to do a series of rendering into the
GPU bo and then copy it back to the CPU bo. In that case, we need to be
sure to mark the pixmap as requiring the flush.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'src')
-rw-r--r-- | src/sna/sna_accel.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/sna/sna_accel.c b/src/sna/sna_accel.c index 716a9fe2..4f08e99d 100644 --- a/src/sna/sna_accel.c +++ b/src/sna/sna_accel.c @@ -3438,7 +3438,7 @@ sna_drawable_use_bo(DrawablePtr drawable, unsigned flags, const BoxRec *box, flags &= ~PREFER_GPU; if ((flags & (PREFER_GPU | IGNORE_CPU)) == IGNORE_CPU) { - if (box_inplace(pixmap, box)) + if (priv->gpu_bo && box_inplace(pixmap, box)) flags |= PREFER_GPU; } @@ -3618,6 +3618,7 @@ move_to_gpu: } done: + assert(priv->move_to_gpu == NULL); assert(priv->gpu_bo != NULL); assert(priv->gpu_bo->refcnt); if (sna_damage_is_all(&priv->gpu_damage, @@ -3635,6 +3636,7 @@ done: assert(priv->gpu_bo->proxy == NULL); assert(priv->clear == false); assert(priv->cpu == false); + assert(!priv->shm); return priv->gpu_bo; use_gpu_bo: @@ -3654,6 +3656,11 @@ use_gpu_bo: } } + if (priv->shm) { + assert(!priv->flush); + list_move(&priv->flush_list, &sna->flush_pixmaps); + } + DBG(("%s: using whole GPU bo\n", __FUNCTION__)); assert(priv->gpu_bo != NULL); assert(priv->gpu_bo->refcnt); |