sna/dri: Refactor to use the common GPU damage routine

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
This commit is contained in:
Chris Wilson 2013-10-17 11:32:39 +01:00
parent ec0866e86d
commit efe5c737ed
1 changed files with 3 additions and 8 deletions

View File

@ -460,7 +460,7 @@ static void sna_dri_reference_buffer(DRI2BufferPtr buffer)
get_private(buffer)->refcnt++;
}
static void damage(PixmapPtr pixmap, struct sna_pixmap *priv, RegionPtr region)
static inline void damage(PixmapPtr pixmap, struct sna_pixmap *priv, RegionPtr region)
{
assert(priv->gpu_bo);
if (DAMAGE_IS_ALL(priv->gpu_damage))
@ -472,6 +472,7 @@ damage_all:
pixmap->drawable.width,
pixmap->drawable.height);
sna_damage_destroy(&priv->cpu_damage);
list_del(&priv->flush_list);
} else {
sna_damage_subtract(&priv->cpu_damage, region);
if (priv->cpu_damage == NULL)
@ -512,13 +513,7 @@ static void set_bo(PixmapPtr pixmap, struct kgem_bo *bo)
region.data = NULL;
DamageRegionAppend(&pixmap->drawable, &region);
sna_damage_all(&priv->gpu_damage,
pixmap->drawable.width,
pixmap->drawable.height);
sna_damage_destroy(&priv->cpu_damage);
list_del(&priv->flush_list);
priv->cpu = false;
priv->clear = false;
damage(pixmap, priv, NULL);
assert(bo->refcnt);
if (priv->gpu_bo != bo) {