summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2012-12-14 12:47:46 +0000
committerChris Wilson <chris@chris-wilson.co.uk>2012-12-14 13:48:05 +0000
commit0d3ba44e448c152a570cc469d289ab057fa7be5c (patch)
tree24c783a5cec816decdbdd4a7c4c14bbde026c726 /src
parentd867fd01cb0060342102a79600daf43e3dc44a07 (diff)
sna/gen2+: Experiment with not forcing migration to GPU after CPU rasterisation
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'src')
-rw-r--r--src/sna/gen2_render.c2
-rw-r--r--src/sna/gen3_render.c14
-rw-r--r--src/sna/gen4_render.c2
-rw-r--r--src/sna/gen5_render.c2
-rw-r--r--src/sna/gen6_render.c2
-rw-r--r--src/sna/gen7_render.c2
-rw-r--r--src/sna/sna_render_inline.h9
7 files changed, 21 insertions, 12 deletions
diff --git a/src/sna/gen2_render.c b/src/sna/gen2_render.c
index c4242f46..8f923382 100644
--- a/src/sna/gen2_render.c
+++ b/src/sna/gen2_render.c
@@ -1716,7 +1716,7 @@ gen2_composite_fallback(struct sna *sna,
DBG(("%s: dst is not on the GPU and the operation should not fallback\n",
__FUNCTION__));
- return false;
+ return dst_use_cpu(dst_pixmap);
}
static int
diff --git a/src/sna/gen3_render.c b/src/sna/gen3_render.c
index 5c17a8f4..b9a1e01d 100644
--- a/src/sna/gen3_render.c
+++ b/src/sna/gen3_render.c
@@ -2676,9 +2676,9 @@ gen3_composite_fallback(struct sna *sna,
if (mask &&
mask->componentAlpha && PICT_FORMAT_RGB(mask->format) &&
- op != PictOpOver &&
- gen3_blend_op[op].src_blend != BLENDFACT_ZERO)
- {
+ gen3_blend_op[op].src_alpha &&
+ gen3_blend_op[op].src_blend != BLENDFACT_ZERO &&
+ op != PictOpOver) {
DBG(("%s: component-alpha mask with op=%d, should fallback\n",
__FUNCTION__, op));
return true;
@@ -2725,9 +2725,9 @@ gen3_composite_fallback(struct sna *sna,
return true;
}
- DBG(("%s: dst is not on the GPU and the operation should not fallback\n",
- __FUNCTION__));
- return false;
+ DBG(("%s: dst is not on the GPU and the operation should not fallback: use-cpu? %d\n",
+ __FUNCTION__, dst_use_cpu(dst_pixmap)));
+ return dst_use_cpu(dst_pixmap);
}
static int
@@ -2916,7 +2916,7 @@ gen3_render_composite(struct sna *sna,
tmp->mask.u.gen3.type = SHADER_NONE;
tmp->has_component_alpha = false;
} else if (gen3_blend_op[op].src_alpha &&
- (gen3_blend_op[op].src_blend != BLENDFACT_ZERO)) {
+ gen3_blend_op[op].src_blend != BLENDFACT_ZERO) {
if (op != PictOpOver)
goto cleanup_mask;
diff --git a/src/sna/gen4_render.c b/src/sna/gen4_render.c
index f80fa835..27cf9757 100644
--- a/src/sna/gen4_render.c
+++ b/src/sna/gen4_render.c
@@ -2247,7 +2247,7 @@ gen4_composite_fallback(struct sna *sna,
DBG(("%s: dst is not on the GPU and the operation should not fallback\n",
__FUNCTION__));
- return false;
+ return dst_use_cpu(dst_pixmap);
}
static int
diff --git a/src/sna/gen5_render.c b/src/sna/gen5_render.c
index 6e6389a1..9b779b67 100644
--- a/src/sna/gen5_render.c
+++ b/src/sna/gen5_render.c
@@ -2256,7 +2256,7 @@ gen5_composite_fallback(struct sna *sna,
DBG(("%s: dst is not on the GPU and the operation should not fallback\n",
__FUNCTION__));
- return false;
+ return dst_use_cpu(dst_pixmap);
}
static int
diff --git a/src/sna/gen6_render.c b/src/sna/gen6_render.c
index 801236f0..ec29124f 100644
--- a/src/sna/gen6_render.c
+++ b/src/sna/gen6_render.c
@@ -2604,7 +2604,7 @@ gen6_composite_fallback(struct sna *sna,
DBG(("%s: dst is not on the GPU and the operation should not fallback\n",
__FUNCTION__));
- return false;
+ return dst_use_cpu(dst_pixmap);
}
static int
diff --git a/src/sna/gen7_render.c b/src/sna/gen7_render.c
index 270488cb..29b1cdc3 100644
--- a/src/sna/gen7_render.c
+++ b/src/sna/gen7_render.c
@@ -2721,7 +2721,7 @@ gen7_composite_fallback(struct sna *sna,
DBG(("%s: dst is not on the GPU and the operation should not fallback\n",
__FUNCTION__));
- return false;
+ return dst_use_cpu(dst_pixmap);
}
static int
diff --git a/src/sna/sna_render_inline.h b/src/sna/sna_render_inline.h
index 2468b891..e31db156 100644
--- a/src/sna/sna_render_inline.h
+++ b/src/sna/sna_render_inline.h
@@ -233,6 +233,15 @@ inline static bool dst_use_gpu(PixmapPtr pixmap)
return priv->cpu_bo && kgem_bo_is_busy(priv->cpu_bo);
}
+inline static bool dst_use_cpu(PixmapPtr pixmap)
+{
+ struct sna_pixmap *priv = sna_pixmap(pixmap);
+ if (priv == NULL)
+ return true;
+
+ return priv->cpu_damage && priv->cpu;
+}
+
inline static bool dst_is_cpu(PixmapPtr pixmap)
{
struct sna_pixmap *priv = sna_pixmap(pixmap);