summaryrefslogtreecommitdiff
path: root/src/sna/sna_render_inline.h
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2012-11-01 09:30:18 +0000
committerChris Wilson <chris@chris-wilson.co.uk>2012-11-01 09:30:18 +0000
commit72bcd8f85c98502b13a67d9c606371afe513584c (patch)
tree99b922737b112c75ab027dddb57f5c79ceede8fd /src/sna/sna_render_inline.h
parent4e363906a5ef15e1eb0a387cfb6b3445ac185b9d (diff)
sna: Try to reduce ping-pong migration for intermixed render/legacy code paths
References: https://bugs.freedesktop.org/show_bug.cgi?id=56591 Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'src/sna/sna_render_inline.h')
-rw-r--r--src/sna/sna_render_inline.h19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/sna/sna_render_inline.h b/src/sna/sna_render_inline.h
index 750faf54..2468b891 100644
--- a/src/sna/sna_render_inline.h
+++ b/src/sna/sna_render_inline.h
@@ -220,4 +220,23 @@ color_convert(uint32_t pixel,
return pixel;
}
+inline static bool dst_use_gpu(PixmapPtr pixmap)
+{
+ struct sna_pixmap *priv = sna_pixmap(pixmap);
+ if (priv == NULL)
+ return false;
+
+ if (priv->gpu_damage && !priv->clear &&
+ (!priv->cpu || !priv->cpu_damage || kgem_bo_is_busy(priv->gpu_bo)))
+ return true;
+
+ return priv->cpu_bo && kgem_bo_is_busy(priv->cpu_bo);
+}
+
+inline static bool dst_is_cpu(PixmapPtr pixmap)
+{
+ struct sna_pixmap *priv = sna_pixmap(pixmap);
+ return priv == NULL || DAMAGE_IS_ALL(priv->cpu_damage);
+}
+
#endif /* SNA_RENDER_INLINE_H */