diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2014-02-01 17:37:42 +0000 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2014-02-01 17:46:14 +0000 |
commit | 2814748b91c80c8935ea2f366e954a80bef69bb0 (patch) | |
tree | 32c04f34f0b2e90e775e9d7b8f22f6eceddb59ab /src/sna/sna.h | |
parent | 3e784832a52686cd29d62bdeac7b1c539c640c5b (diff) |
sna: Only discard CPU damage for an replacing region
When considering move-region-to-cpu, we need to take into account that
the region may not replace the whole drawable, in which case we cannot
simply dispose of an active CPU bo.
Reported-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Reported-by: Conley Moorhous <conleymoorhous@gmail.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=74327
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'src/sna/sna.h')
-rw-r--r-- | src/sna/sna.h | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/sna/sna.h b/src/sna/sna.h index ff8b27dc..78330953 100644 --- a/src/sna/sna.h +++ b/src/sna/sna.h @@ -637,6 +637,16 @@ region_subsumes_drawable(RegionPtr region, DrawablePtr drawable) } static inline bool +region_subsumes_pixmap(RegionPtr region, PixmapPtr pixmap) +{ + if (region->data) + return false; + + return (region->extents.x2 - region->extents.x1 >= pixmap->drawable.width && + region->extents.y2 - region->extents.y1 >= pixmap->drawable.height); +} + +static inline bool region_subsumes_damage(const RegionRec *region, struct sna_damage *damage) { const BoxRec *re, *de; |