summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2012-12-15 17:56:27 +0000
committerChris Wilson <chris@chris-wilson.co.uk>2012-12-16 10:02:42 +0000
commit2a21c8b351052be9c32c5669264fb05a8510c957 (patch)
tree8503dd1aa5e45d22fb28b219cce21eb2c1e8998b /src
parenta467102a9539c7f4fa8d0700ecdcaba49d77b3f7 (diff)
sna: Include shm hint in render placement
The goal is to reduce the preference of rendering to a SHM pixmap - only if it is already active, will we consider continuing to use it on the GPU. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'src')
-rw-r--r--src/sna/sna_render_inline.h13
1 files changed, 9 insertions, 4 deletions
diff --git a/src/sna/sna_render_inline.h b/src/sna/sna_render_inline.h
index e31db156..51c78bc2 100644
--- a/src/sna/sna_render_inline.h
+++ b/src/sna/sna_render_inline.h
@@ -226,17 +226,22 @@ inline static bool dst_use_gpu(PixmapPtr pixmap)
if (priv == NULL)
return false;
- if (priv->gpu_damage && !priv->clear &&
- (!priv->cpu || !priv->cpu_damage || kgem_bo_is_busy(priv->gpu_bo)))
+ if (priv->cpu_bo && kgem_bo_is_busy(priv->cpu_bo))
+ return true;
+
+ if (priv->clear)
+ return false;
+
+ if (priv->gpu_bo && kgem_bo_is_busy(priv->gpu_bo))
return true;
- return priv->cpu_bo && kgem_bo_is_busy(priv->cpu_bo);
+ return priv->gpu_damage && (!priv->cpu || !priv->cpu_damage);
}
inline static bool dst_use_cpu(PixmapPtr pixmap)
{
struct sna_pixmap *priv = sna_pixmap(pixmap);
- if (priv == NULL)
+ if (priv == NULL || priv->shm)
return true;
return priv->cpu_damage && priv->cpu;