sna: Only check for all-damaged CPU bo if we may discard the GPU bo
The goal of the optimisation is to discard the GPU bo early, so we can skip the extra damage reduction if there is no gpu bo. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
This commit is contained in:
parent
ccee730e45
commit
f11e9f1891
|
|
@ -741,7 +741,8 @@ done:
|
|||
DBG(("%s: applying cpu damage\n", __FUNCTION__));
|
||||
assert_pixmap_contains_box(pixmap, RegionExtents(region));
|
||||
sna_damage_add(&priv->cpu_damage, region);
|
||||
if (sna_damage_is_all(&priv->cpu_damage,
|
||||
if (priv->gpu_bo &&
|
||||
sna_damage_is_all(&priv->cpu_damage,
|
||||
pixmap->drawable.width,
|
||||
pixmap->drawable.height)) {
|
||||
DBG(("%s: replaced entire pixmap\n", __FUNCTION__));
|
||||
|
|
@ -1437,7 +1438,8 @@ sna_put_zpixmap_blt(DrawablePtr drawable, GCPtr gc, RegionPtr region,
|
|||
assert_pixmap_contains_box(pixmap, RegionExtents(region));
|
||||
sna_damage_subtract(&priv->gpu_damage, region);
|
||||
sna_damage_add(&priv->cpu_damage, region);
|
||||
if (sna_damage_is_all(&priv->cpu_damage,
|
||||
if (priv->gpu_bo &&
|
||||
sna_damage_is_all(&priv->cpu_damage,
|
||||
pixmap->drawable.width,
|
||||
pixmap->drawable.height)) {
|
||||
DBG(("%s: replaced entire pixmap\n", __FUNCTION__));
|
||||
|
|
|
|||
Loading…
Reference in New Issue