diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2012-08-01 23:37:35 +0100 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2012-08-01 23:39:13 +0100 |
commit | 7404e3085b2ee36fa24f77a02d156b4b1d2dff60 (patch) | |
tree | 1a62a1c036cf8923b94739ea328db10163d3efea /src | |
parent | ca46d1c7a18596ea9fe2b0577ccf1d110e3e42ac (diff) |
sna: Ensure we only mark a clear for a fill on the GPU bo
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'src')
-rw-r--r-- | src/sna/sna_accel.c | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/src/sna/sna_accel.c b/src/sna/sna_accel.c index 8760f915..06c9fcc8 100644 --- a/src/sna/sna_accel.c +++ b/src/sna/sna_accel.c @@ -9035,7 +9035,6 @@ sna_poly_fill_rect_blt(DrawablePtr drawable, sna_damage_all(damage, pixmap->drawable.width, pixmap->drawable.height); - sna_pixmap(pixmap)->undamaged = false; } else sna_damage_add_box(damage, &r); } @@ -9045,12 +9044,19 @@ sna_poly_fill_rect_blt(DrawablePtr drawable, r.x2 - r.x1 == pixmap->drawable.width && r.y2 - r.y1 == pixmap->drawable.height) { struct sna_pixmap *priv = sna_pixmap(pixmap); + if (bo == priv->gpu_bo) { + sna_damage_all(&priv->gpu_damage, + pixmap->drawable.width, + pixmap->drawable.height); + sna_damage_destroy(&priv->cpu_damage); + list_del(&priv->list); + priv->undamaged = false; + priv->clear = true; + priv->clear_color = gc->alu == GXcopy ? pixel : 0; - priv->clear = true; - priv->clear_color = gc->alu == GXcopy ? pixel : 0; - - DBG(("%s: pixmap=%ld, marking clear [%08x]\n", - __FUNCTION__, pixmap->drawable.serialNumber, priv->clear_color)); + DBG(("%s: pixmap=%ld, marking clear [%08x]\n", + __FUNCTION__, pixmap->drawable.serialNumber, priv->clear_color)); + } } } else success = false; |