summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2011-12-24 08:57:49 +0000
committerChris Wilson <chris@chris-wilson.co.uk>2011-12-24 09:15:08 +0000
commit7f9ed3ca56466f319d9ec06aebb7055552fb1fe1 (patch)
tree6dee2ba0820c2cf54421d774a3b3b72efb9411f4
parent8c987b6ccfa83b99a316a7da49a6d7e30fcdf295 (diff)
sna: reset the pixmap on the initial clear after being swapped out
Pixmaps are swapped out into the CPU after a period of inactivity. This then prevents the core rendering routines from migrating the pixmap back to the GPU until it gets used again on a Render path. However, we can clear that CPU damage and enable migration before a number of key steps in the expose process. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
-rw-r--r--src/sna/sna_accel.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/sna/sna_accel.c b/src/sna/sna_accel.c
index 460b29f0..af13658b 100644
--- a/src/sna/sna_accel.c
+++ b/src/sna/sna_accel.c
@@ -7373,6 +7373,19 @@ sna_poly_fill_rect_extents(DrawablePtr drawable, GCPtr gc,
return 1 | clipped << 1;
}
+static bool alu_overwrites(uint8_t alu)
+{
+ switch (alu) {
+ case GXclear:
+ case GXcopy:
+ case GXcopyInverted:
+ case GXset:
+ return true;
+ default:
+ return false;
+ }
+}
+
static void
sna_poly_fill_rect(DrawablePtr draw, GCPtr gc, int n, xRectangle *rect)
{
@@ -7417,6 +7430,9 @@ sna_poly_fill_rect(DrawablePtr draw, GCPtr gc, int n, xRectangle *rect)
struct sna_damage **damage;
uint32_t color = gc->fillStyle == FillTiled ? gc->tile.pixel : gc->fgPixel;
+ if (alu_overwrites(gc->alu))
+ sna_damage_subtract(&priv->cpu_damage, &region);
+
DBG(("%s: solid fill [%08x], testing for blt\n",
__FUNCTION__, color));