[Mesa-dev] [PATCH 02/13] i965: If cache has no BO don't try to unmap BO

Juha-Pekka Heikkila juhapekka.heikkila at gmail.com
Tue May 5 04:25:18 PDT 2015


Signed-off-by: Juha-Pekka Heikkila <juhapekka.heikkila at gmail.com>
---
 src/mesa/drivers/dri/i965/brw_state_cache.c | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)

diff --git a/src/mesa/drivers/dri/i965/brw_state_cache.c b/src/mesa/drivers/dri/i965/brw_state_cache.c
index 157b33d..f56fd85 100644
--- a/src/mesa/drivers/dri/i965/brw_state_cache.c
+++ b/src/mesa/drivers/dri/i965/brw_state_cache.c
@@ -427,10 +427,13 @@ brw_destroy_cache(struct brw_context *brw, struct brw_cache *cache)
 
    DBG("%s\n", __func__);
 
-   if (brw->has_llc)
-      drm_intel_bo_unmap(cache->bo);
-   drm_intel_bo_unreference(cache->bo);
-   cache->bo = NULL;
+   if (cache->bo) {
+      if (brw->has_llc)
+         drm_intel_bo_unmap(cache->bo);
+      drm_intel_bo_unreference(cache->bo);
+      cache->bo = NULL;
+   }
+
    brw_clear_cache(brw, cache);
    free(cache->items);
    cache->items = NULL;
-- 
1.8.5.1



More information about the mesa-dev mailing list