diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2013-07-30 11:17:52 +0100 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2013-07-30 12:46:18 +0100 |
commit | 7e3445a330340c1aa2ca5a13d838344438336749 (patch) | |
tree | 5acfb59a19e1dd02b6b38584d64fc455be4f7fc6 /src | |
parent | c507f621c932393a8b87912f71a86e29a8c1c190 (diff) |
sna/dri: Tidy up applying damage to the Pixmap when copying regions
Now that we are doing a true move-to-gpu first, we can drop the hacks
from damage().
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'src')
-rw-r--r-- | src/sna/sna_dri.c | 17 |
1 files changed, 4 insertions, 13 deletions
diff --git a/src/sna/sna_dri.c b/src/sna/sna_dri.c index 8d0b424d..a48c8d00 100644 --- a/src/sna/sna_dri.c +++ b/src/sna/sna_dri.c @@ -482,19 +482,9 @@ static void sna_dri_reference_buffer(DRI2Buffer2Ptr buffer) get_private(buffer)->refcnt++; } -static void damage(PixmapPtr pixmap, RegionPtr region) +static void damage(PixmapPtr pixmap, struct sna_pixmap *priv, RegionPtr region) { - struct sna_pixmap *priv; - - priv = sna_pixmap(pixmap); - assert(priv != NULL); assert(priv->gpu_bo); - - if (priv->cow) { - sna_pixmap_undo_cow(to_sna_from_pixmap(pixmap), priv, - region ? MOVE_READ : 0); - } - if (DAMAGE_IS_ALL(priv->gpu_damage)) return; @@ -779,6 +769,8 @@ __sna_dri_copy_region(struct sna *sna, DrawablePtr draw, RegionPtr region, priv = sna_pixmap_move_to_gpu(pixmap, flags); if (priv) dst_bo = priv->gpu_bo; + + damage(pixmap, priv, region); } else sync = false; @@ -795,8 +787,6 @@ __sna_dri_copy_region(struct sna *sna, DrawablePtr draw, RegionPtr region, &clip.extents)); } - if (dst->attachment == DRI2BufferFrontLeft) - damage(pixmap, region); if (region) { boxes = REGION_RECTS(region); n = REGION_NUM_RECTS(region); @@ -807,6 +797,7 @@ __sna_dri_copy_region(struct sna *sna, DrawablePtr draw, RegionPtr region, n = 1; } DamageRegionAppend(&pixmap->drawable, region); + if (wedged(sna)) { sna_dri_copy_fallback(sna, draw->bitsPerPixel, src_bo, sx, sy, |