diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2012-02-06 15:59:21 +0000 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2012-02-06 15:59:21 +0000 |
commit | f30be6f74392f5687ffe8bc9dd2c6dc024ae06c8 (patch) | |
tree | 301ffff2c2f32d6527f0c28ca922b98924c96388 | |
parent | f009386de87acccadb1803567e4c494e5e80a2a9 (diff) |
sna/gen2+: Exclude solids from being classed as requiring an upload
We treat any pixmap that is not attached to either a CPU or GPU bo as
requiring the pixel data to be uploaded to the GPU before we can
composite. Normally this is true, except for the solid cache.
References: https://bugs.freedesktop.org/show_bug.cgi?id=45672
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
-rw-r--r-- | src/sna/gen2_render.c | 7 | ||||
-rw-r--r-- | src/sna/gen3_render.c | 7 | ||||
-rw-r--r-- | src/sna/gen4_render.c | 7 | ||||
-rw-r--r-- | src/sna/gen5_render.c | 7 | ||||
-rw-r--r-- | src/sna/gen6_render.c | 7 | ||||
-rw-r--r-- | src/sna/gen7_render.c | 7 |
6 files changed, 30 insertions, 12 deletions
diff --git a/src/sna/gen2_render.c b/src/sna/gen2_render.c index 97b558db..606ecfe1 100644 --- a/src/sna/gen2_render.c +++ b/src/sna/gen2_render.c @@ -1523,6 +1523,9 @@ need_upload(PicturePtr p) static bool source_fallback(PicturePtr p) { + if (is_solid(p)) + return false; + return (has_alphamap(p) || is_unhandled_gradient(p) || !gen2_check_filter(p) || @@ -1572,7 +1575,7 @@ gen2_composite_fallback(struct sna *sna, return FALSE; } - if (src_pixmap && !is_solid(src) && !source_fallback(src)) { + if (src_pixmap && !source_fallback(src)) { priv = sna_pixmap(src_pixmap); if (priv && priv->gpu_damage && !priv->cpu_damage) { DBG(("%s: src is already on the GPU, try to use GPU\n", @@ -1580,7 +1583,7 @@ gen2_composite_fallback(struct sna *sna, return FALSE; } } - if (mask_pixmap && !is_solid(mask) && !source_fallback(mask)) { + if (mask_pixmap && !source_fallback(mask)) { priv = sna_pixmap(mask_pixmap); if (priv && priv->gpu_damage && !priv->cpu_damage) { DBG(("%s: mask is already on the GPU, try to use GPU\n", diff --git a/src/sna/gen3_render.c b/src/sna/gen3_render.c index d5f56176..de6a3adf 100644 --- a/src/sna/gen3_render.c +++ b/src/sna/gen3_render.c @@ -2435,6 +2435,9 @@ need_upload(PicturePtr p) static bool source_fallback(PicturePtr p) { + if (is_solid(p)) + return false; + return (has_alphamap(p) || !gen3_check_xformat(p) || !gen3_check_filter(p) || @@ -2494,7 +2497,7 @@ gen3_composite_fallback(struct sna *sna, return FALSE; } - if (src_pixmap && !is_solid(src) && !source_fallback(src)) { + if (src_pixmap && !source_fallback(src)) { priv = sna_pixmap(src_pixmap); if (priv && ((priv->gpu_damage && !priv->cpu_damage) || @@ -2504,7 +2507,7 @@ gen3_composite_fallback(struct sna *sna, return FALSE; } } - if (mask_pixmap && !is_solid(mask) && !source_fallback(mask)) { + if (mask_pixmap && !source_fallback(mask)) { priv = sna_pixmap(mask_pixmap); if (priv && ((priv->gpu_damage && !priv->cpu_damage) || diff --git a/src/sna/gen4_render.c b/src/sna/gen4_render.c index b3a64d9f..3cb0fbb5 100644 --- a/src/sna/gen4_render.c +++ b/src/sna/gen4_render.c @@ -2032,6 +2032,9 @@ need_upload(PicturePtr p) static bool source_fallback(PicturePtr p) { + if (is_solid(p)) + return false; + return (has_alphamap(p) || is_gradient(p) || !gen4_check_filter(p) || @@ -2082,7 +2085,7 @@ gen4_composite_fallback(struct sna *sna, return FALSE; } - if (src_pixmap && !is_solid(src) && !source_fallback(src)) { + if (src_pixmap && !source_fallback(src)) { priv = sna_pixmap(src_pixmap); if (priv && priv->gpu_damage && !priv->cpu_damage) { DBG(("%s: src is already on the GPU, try to use GPU\n", @@ -2090,7 +2093,7 @@ gen4_composite_fallback(struct sna *sna, return FALSE; } } - if (mask_pixmap && !is_solid(mask) && !source_fallback(mask)) { + if (mask_pixmap && !source_fallback(mask)) { priv = sna_pixmap(mask_pixmap); if (priv && priv->gpu_damage && !priv->cpu_damage) { DBG(("%s: mask is already on the GPU, try to use GPU\n", diff --git a/src/sna/gen5_render.c b/src/sna/gen5_render.c index 933c51f6..f15342d8 100644 --- a/src/sna/gen5_render.c +++ b/src/sna/gen5_render.c @@ -2060,6 +2060,9 @@ need_upload(PicturePtr p) static bool source_fallback(PicturePtr p) { + if (is_solid(p)) + return false; + return (has_alphamap(p) || is_gradient(p) || !gen5_check_filter(p) || @@ -2110,7 +2113,7 @@ gen5_composite_fallback(struct sna *sna, return FALSE; } - if (src_pixmap && !is_solid(src) && !source_fallback(src)) { + if (src_pixmap && !source_fallback(src)) { priv = sna_pixmap(src_pixmap); if (priv && priv->gpu_damage && !priv->cpu_damage) { DBG(("%s: src is already on the GPU, try to use GPU\n", @@ -2118,7 +2121,7 @@ gen5_composite_fallback(struct sna *sna, return FALSE; } } - if (mask_pixmap && !is_solid(mask) && !source_fallback(mask)) { + if (mask_pixmap && !source_fallback(mask)) { priv = sna_pixmap(mask_pixmap); if (priv && priv->gpu_damage && !priv->cpu_damage) { DBG(("%s: mask is already on the GPU, try to use GPU\n", diff --git a/src/sna/gen6_render.c b/src/sna/gen6_render.c index d73fda85..06c33c46 100644 --- a/src/sna/gen6_render.c +++ b/src/sna/gen6_render.c @@ -2339,6 +2339,9 @@ need_upload(PicturePtr p) static bool source_fallback(PicturePtr p) { + if (is_solid(p)) + return false; + return (has_alphamap(p) || is_gradient(p) || !gen6_check_filter(p) || @@ -2391,7 +2394,7 @@ gen6_composite_fallback(struct sna *sna, return FALSE; } - if (src_pixmap && !is_solid(src) && !source_fallback(src)) { + if (src_pixmap && !source_fallback(src)) { priv = sna_pixmap(src_pixmap); if (priv && priv->gpu_damage && !priv->cpu_damage) { DBG(("%s: src is already on the GPU, try to use GPU\n", @@ -2399,7 +2402,7 @@ gen6_composite_fallback(struct sna *sna, return FALSE; } } - if (mask_pixmap && !is_solid(mask) && !source_fallback(mask)) { + if (mask_pixmap && !source_fallback(mask)) { priv = sna_pixmap(mask_pixmap); if (priv && priv->gpu_damage && !priv->cpu_damage) { DBG(("%s: mask is already on the GPU, try to use GPU\n", diff --git a/src/sna/gen7_render.c b/src/sna/gen7_render.c index 5385a473..5a867b19 100644 --- a/src/sna/gen7_render.c +++ b/src/sna/gen7_render.c @@ -2345,6 +2345,9 @@ need_upload(PicturePtr p) static bool source_fallback(PicturePtr p) { + if (is_solid(p)) + return false; + return (has_alphamap(p) || is_gradient(p) || !gen7_check_filter(p) || @@ -2397,7 +2400,7 @@ gen7_composite_fallback(struct sna *sna, return FALSE; } - if (src_pixmap && !is_solid(src) && !source_fallback(src)) { + if (src_pixmap && !source_fallback(src)) { priv = sna_pixmap(src_pixmap); if (priv && priv->gpu_damage && !priv->cpu_damage) { DBG(("%s: src is already on the GPU, try to use GPU\n", @@ -2405,7 +2408,7 @@ gen7_composite_fallback(struct sna *sna, return FALSE; } } - if (mask_pixmap && !is_solid(mask) && !source_fallback(mask)) { + if (mask_pixmap && !source_fallback(mask)) { priv = sna_pixmap(mask_pixmap); if (priv && priv->gpu_damage && !priv->cpu_damage) { DBG(("%s: mask is already on the GPU, try to use GPU\n", |