summaryrefslogtreecommitdiff
path: root/src/sna/sna_accel.c
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2013-03-05 13:45:45 +0000
committerChris Wilson <chris@chris-wilson.co.uk>2013-03-05 13:45:45 +0000
commit99b30203ba1c26d89d869691a743488a5dc32935 (patch)
tree04037272738108d89952c32319ebf7f9a484a906 /src/sna/sna_accel.c
parentd31dc1343d59f8ef8876e1dc8ddfec9c6be1a602 (diff)
sna: Fix deference of just nullified GPU bo in previous commit
One last minute refactor too far, combining the too if(priv->gpu_bo) blocks forgot that the first block tried to free gpu_bo... 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.c19
1 files changed, 9 insertions, 10 deletions
diff --git a/src/sna/sna_accel.c b/src/sna/sna_accel.c
index a2e5be3b..700eaa8c 100644
--- a/src/sna/sna_accel.c
+++ b/src/sna/sna_accel.c
@@ -1397,19 +1397,18 @@ sna_pixmap_create_mappable_gpu(PixmapPtr pixmap,
assert_pixmap_damage(pixmap);
- if (priv->gpu_bo) {
- if (can_replace &&
- (!kgem_bo_is_mappable(&sna->kgem, priv->gpu_bo) ||
- __kgem_bo_is_busy(&sna->kgem, priv->gpu_bo))) {
- if (priv->pinned)
- return false;
+ if (can_replace && priv->gpu_bo &&
+ (!kgem_bo_is_mappable(&sna->kgem, priv->gpu_bo) ||
+ __kgem_bo_is_busy(&sna->kgem, priv->gpu_bo))) {
+ if (priv->pinned)
+ return false;
- DBG(("%s: discard busy GPU bo\n", __FUNCTION__));
- sna_pixmap_free_gpu(sna, priv);
- }
+ DBG(("%s: discard busy GPU bo\n", __FUNCTION__));
+ sna_pixmap_free_gpu(sna, priv);
+ }
+ if (priv->gpu_bo)
return kgem_bo_is_mappable(&sna->kgem, priv->gpu_bo);
- }
assert_pixmap_damage(pixmap);