diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2013-01-29 18:04:40 +0000 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2013-01-29 18:04:40 +0000 |
commit | f743cd5734ca502aa8bdb0e1327fe84d6ce82755 (patch) | |
tree | ecce897853d7b2e3e588657387e05eb7802ac0f3 /src/sna/sna_render.c | |
parent | 9383c5efe9ace34970abddc5e3c84c32505b537f (diff) |
sna: Avoid promoting SHM CPU bo to GPU to maintain coherence with SHM clients
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'src/sna/sna_render.c')
-rw-r--r-- | src/sna/sna_render.c | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/src/sna/sna_render.c b/src/sna/sna_render.c index 4b32b82d..82be2975 100644 --- a/src/sna/sna_render.c +++ b/src/sna/sna_render.c @@ -322,6 +322,14 @@ use_cpu_bo(struct sna *sna, PixmapPtr pixmap, const BoxRec *box, bool blt) return NULL; } + if (priv->shm) { + DBG(("%s: shm CPU bo, avoiding promotion to GPU\n", + __FUNCTION__)); + assert(!priv->flush); + sna_add_flush_pixmap(sna, priv, priv->cpu_bo); + return priv->cpu_bo; + } + if (priv->cpu_bo->snoop && priv->source_count > SOURCE_BIAS) { DBG(("%s: promoting snooped CPU bo due to reuse\n", __FUNCTION__)); @@ -385,11 +393,6 @@ use_cpu_bo(struct sna *sna, PixmapPtr pixmap, const BoxRec *box, bool blt) } } - if (priv->shm) { - assert(!priv->flush); - sna_add_flush_pixmap(sna, priv, priv->cpu_bo); - } - DBG(("%s for box=(%d, %d), (%d, %d)\n", __FUNCTION__, box->x1, box->y1, box->x2, box->y2)); ++priv->source_count; |