summaryrefslogtreecommitdiff
path: root/src/sna
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2012-07-31 11:58:24 +0100
committerChris Wilson <chris@chris-wilson.co.uk>2012-07-31 13:11:46 +0100
commit8f166d26b8a93592939068c5a8d160981c724cfd (patch)
tree7c7ed9e44ef2e465508dbda8b3b6b577653ca02c /src/sna
parente6cb5d93eaa01e7f4763f797bba341f3cc481d98 (diff)
sna: Be more careful with damage reduction during CompositeRectangles
We actually need to force DAMAGE_ALL in case we are promoting the GPU pixmap. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'src/sna')
-rw-r--r--src/sna/sna_accel.c5
-rw-r--r--src/sna/sna_composite.c47
2 files changed, 32 insertions, 20 deletions
diff --git a/src/sna/sna_accel.c b/src/sna/sna_accel.c
index d2fd298e..a4287f75 100644
--- a/src/sna/sna_accel.c
+++ b/src/sna/sna_accel.c
@@ -314,9 +314,12 @@ static void assert_pixmap_damage(PixmapPtr p)
if (priv == NULL)
return;
- if (DAMAGE_IS_ALL(priv->gpu_damage) && DAMAGE_IS_ALL(priv->cpu_damage))
+ if (DAMAGE_IS_ALL(priv->gpu_damage) && DAMAGE_IS_ALL(priv->cpu_damage)) {
/* special upload buffer */
+ assert(priv->gpu_bo && priv->gpu_bo->proxy);
+ assert(priv->cpu_bo == NULL);
return;
+ }
assert(!DAMAGE_IS_ALL(priv->gpu_damage) || priv->cpu_damage == NULL);
assert(!DAMAGE_IS_ALL(priv->cpu_damage) || priv->gpu_damage == NULL);
diff --git a/src/sna/sna_composite.c b/src/sna/sna_composite.c
index 36287c65..0ca66c7e 100644
--- a/src/sna/sna_composite.c
+++ b/src/sna/sna_composite.c
@@ -855,25 +855,34 @@ sna_composite_rectangles(CARD8 op,
/* Clearing a pixmap after creation is a common operation, so take
* advantage and reduce further damage operations.
*/
- if (op <= PictOpSrc &&
- region_subsumes_drawable(&region, &pixmap->drawable)) {
- bool ok;
-
- assert(DAMAGE_IS_ALL(priv->gpu_damage));
-
- priv->undamaged = false;
- priv->clear_color = 0;
- ok = true;
- if (op == PictOpSrc)
- ok = sna_get_pixel_from_rgba(&priv->clear_color,
- color->red,
- color->green,
- color->blue,
- color->alpha,
- dst->format);
- priv->clear = ok;
- DBG(("%s: marking clear [%08x]? %d\n",
- __FUNCTION__, priv->clear_color, ok));
+ if (region_subsumes_drawable(&region, &pixmap->drawable)) {
+ if (damage) {
+ sna_damage_all(damage,
+ pixmap->drawable.width,
+ pixmap->drawable.height);
+ sna_damage_destroy(damage == &priv->gpu_damage ?
+ &priv->cpu_damage : &priv->gpu_damage);
+ priv->undamaged = false;
+ }
+
+ if (op <= PictOpSrc && bo == priv->gpu_bo) {
+ bool ok;
+
+ assert(DAMAGE_IS_ALL(priv->gpu_damage));
+
+ priv->clear_color = 0;
+ ok = true;
+ if (op == PictOpSrc)
+ ok = sna_get_pixel_from_rgba(&priv->clear_color,
+ color->red,
+ color->green,
+ color->blue,
+ color->alpha,
+ dst->format);
+ priv->clear = ok;
+ DBG(("%s: marking clear [%08x]? %d\n",
+ __FUNCTION__, priv->clear_color, ok));
+ }
}
goto done;