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>
This commit is contained in:
Chris Wilson 2011-12-24 08:57:49 +00:00
parent 8c987b6ccf
commit 7f9ed3ca56
1 changed files with 16 additions and 0 deletions

View File

@ -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));