summaryrefslogtreecommitdiff
path: root/src/sna/gen5_render.c
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2012-11-02 09:10:32 +0000
committerChris Wilson <chris@chris-wilson.co.uk>2012-11-02 13:14:58 +0000
commite1a63de8991a6586b83c06bcb3369208871cf43d (patch)
tree114902172077ce57d99e9d652edc23ab121ed65b /src/sna/gen5_render.c
parent72bcd8f85c98502b13a67d9c606371afe513584c (diff)
sna/gen4+: Prefer GPU spans if the destination is active
Trying to avoid using the inplace scanline rasteriser for large shapes. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'src/sna/gen5_render.c')
-rw-r--r--src/sna/gen5_render.c30
1 files changed, 22 insertions, 8 deletions
diff --git a/src/sna/gen5_render.c b/src/sna/gen5_render.c
index 79431c4b..95ff30f8 100644
--- a/src/sna/gen5_render.c
+++ b/src/sna/gen5_render.c
@@ -2631,21 +2631,35 @@ gen5_check_composite_spans(struct sna *sna,
int16_t width, int16_t height,
unsigned flags)
{
- if ((flags & COMPOSITE_SPANS_RECTILINEAR) == 0)
- return false;
+ DBG(("%s: op=%d, width=%d, height=%d, flags=%x\n",
+ __FUNCTION__, op, width, height, flags));
if (op >= ARRAY_SIZE(gen5_blend_op))
return false;
- if (gen5_composite_fallback(sna, src, NULL, dst))
+ if (gen5_composite_fallback(sna, src, NULL, dst)) {
+ DBG(("%s: operation would fallback\n", __FUNCTION__));
return false;
+ }
- if (need_tiling(sna, width, height)) {
- if (!is_gpu(dst->pDrawable)) {
- DBG(("%s: fallback, tiled operation not on GPU\n",
- __FUNCTION__));
- return false;
+ if (need_tiling(sna, width, height) && !is_gpu(dst->pDrawable)) {
+ DBG(("%s: fallback, tiled operation not on GPU\n",
+ __FUNCTION__));
+ return false;
+ }
+
+ if ((flags & (COMPOSITE_SPANS_RECTILINEAR | COMPOSITE_SPANS_INPLACE_HINT)) == 0) {
+ struct sna_pixmap *priv = sna_pixmap_from_drawable(dst->pDrawable);
+ assert(priv);
+
+ if ((priv->cpu_bo && kgem_bo_is_busy(priv->cpu_bo)) ||
+ (priv->gpu_bo && kgem_bo_is_busy(priv->gpu_bo))) {
+ return true;
}
+
+ DBG(("%s: fallback, non-rectilinear spans to idle bo\n",
+ __FUNCTION__));
+ return false;
}
return true;