summaryrefslogtreecommitdiff
path: root/src/sna/sna_accel.c
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2014-06-14 06:51:34 +0100
committerChris Wilson <chris@chris-wilson.co.uk>2014-06-14 06:53:02 +0100
commitb27837d5372facde0f9f69eb8df664d2798f0911 (patch)
tree75931d3d613e00fc17c29fe78113461c5ce09df1 /src/sna/sna_accel.c
parent15485602d8451bcf6c2e979ccbd9cdc11111bcce (diff)
sna: Fix assertions for discarding upload caches
The upload caches are special, along with having a bo->proxy, they also claim to be completely damaged on both the GPU and CPU. Allow that to pass through when discarding the proxy. Reported-by: Nick Bowler <nbowler@draconx.ca> Bugzilla; https://bugs.freedesktop.org/show_bug.cgi?id=79992 Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'src/sna/sna_accel.c')
-rw-r--r--src/sna/sna_accel.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/sna/sna_accel.c b/src/sna/sna_accel.c
index ce04ca0d..930c40a2 100644
--- a/src/sna/sna_accel.c
+++ b/src/sna/sna_accel.c
@@ -2090,7 +2090,7 @@ _sna_pixmap_move_to_cpu(PixmapPtr pixmap, unsigned int flags)
if (kgem_bo_discard_cache(priv->gpu_bo, flags & MOVE_WRITE)) {
DBG(("%s: discarding cached upload buffer\n", __FUNCTION__));
assert(DAMAGE_IS_ALL(priv->cpu_damage));
- assert(priv->gpu_damage == NULL);
+ assert(priv->gpu_damage == NULL || DAMAGE_IS_ALL(priv->gpu_damage)); /* magical upload buffer */
assert(!priv->pinned);
assert(!priv->mapped);
kgem_bo_destroy(&sna->kgem, priv->gpu_bo);
@@ -2500,7 +2500,7 @@ sna_drawable_move_region_to_cpu(DrawablePtr drawable,
if (kgem_bo_discard_cache(priv->gpu_bo, flags & MOVE_WRITE)) {
DBG(("%s: discarding cached upload buffer\n", __FUNCTION__));
assert(DAMAGE_IS_ALL(priv->cpu_damage));
- assert(priv->gpu_damage == NULL);
+ assert(priv->gpu_damage == NULL || DAMAGE_IS_ALL(priv->gpu_damage)); /* magical upload buffer */
assert(!priv->pinned);
assert(!priv->mapped);
kgem_bo_destroy(&sna->kgem, priv->gpu_bo);
@@ -3212,7 +3212,7 @@ sna_pixmap_move_area_to_gpu(PixmapPtr pixmap, const BoxRec *box, unsigned int fl
if (kgem_bo_discard_cache(priv->gpu_bo, flags & (MOVE_WRITE | __MOVE_FORCE))) {
DBG(("%s: discarding cached upload buffer\n", __FUNCTION__));
assert(DAMAGE_IS_ALL(priv->cpu_damage));
- assert(priv->gpu_damage == NULL);
+ assert(priv->gpu_damage == NULL || DAMAGE_IS_ALL(priv->gpu_damage)); /* magical upload buffer */
assert(!priv->pinned);
assert(!priv->mapped);
kgem_bo_destroy(&sna->kgem, priv->gpu_bo);
@@ -3455,7 +3455,7 @@ sna_drawable_use_bo(DrawablePtr drawable, unsigned flags, const BoxRec *box,
if (kgem_bo_discard_cache(priv->gpu_bo, true)) {
DBG(("%s: cached upload proxy, discard and revert to GPU\n", __FUNCTION__));
assert(DAMAGE_IS_ALL(priv->cpu_damage));
- assert(priv->gpu_damage == NULL);
+ assert(priv->gpu_damage == NULL || DAMAGE_IS_ALL(priv->gpu_damage)); /* magical upload buffer */
assert(!priv->pinned);
assert(!priv->mapped);
kgem_bo_destroy(&to_sna_from_pixmap(pixmap)->kgem,
@@ -3951,7 +3951,7 @@ sna_pixmap_move_to_gpu(PixmapPtr pixmap, unsigned flags)
if (kgem_bo_discard_cache(priv->gpu_bo, flags & (MOVE_WRITE | __MOVE_FORCE))) {
DBG(("%s: discarding cached upload buffer\n", __FUNCTION__));
assert(DAMAGE_IS_ALL(priv->cpu_damage));
- assert(priv->gpu_damage == NULL);
+ assert(priv->gpu_damage == NULL || DAMAGE_IS_ALL(priv->gpu_damage)); /* magical upload buffer */
assert(!priv->pinned);
assert(!priv->mapped);
kgem_bo_destroy(&sna->kgem, priv->gpu_bo);
@@ -4537,7 +4537,7 @@ try_upload__inplace(PixmapPtr pixmap, RegionRec *region,
if (kgem_bo_discard_cache(priv->gpu_bo, true)) {
DBG(("%s: discarding cached upload buffer\n", __FUNCTION__));
assert(DAMAGE_IS_ALL(priv->cpu_damage));
- assert(priv->gpu_damage == NULL);
+ assert(priv->gpu_damage == NULL || DAMAGE_IS_ALL(priv->gpu_damage)); /* magical upload buffer */
assert(!priv->pinned);
assert(!priv->mapped);
kgem_bo_destroy(&sna->kgem, priv->gpu_bo);
@@ -5996,7 +5996,7 @@ static void discard_cpu_damage(struct sna *sna, struct sna_pixmap *priv)
if (kgem_bo_discard_cache(priv->gpu_bo, true)) {
DBG(("%s: discarding cached upload buffer\n", __FUNCTION__));
assert(DAMAGE_IS_ALL(priv->cpu_damage));
- assert(priv->gpu_damage == NULL);
+ assert(priv->gpu_damage == NULL || DAMAGE_IS_ALL(priv->gpu_damage)); /* magical upload buffer */
assert(!priv->pinned);
assert(!priv->mapped);
kgem_bo_destroy(&sna->kgem, priv->gpu_bo);