diff options
Diffstat (limited to 'src/sna')
-rw-r--r-- | src/sna/sna_accel.c | 5 | ||||
-rw-r--r-- | src/sna/sna_composite.c | 47 |
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(®ion, &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(®ion, &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; |