i965/miptree: Set refcount before failing via _release()
[mesa.git] / src / mesa / drivers / dri / i965 / brw_program_cache.c
index 079e2ae53b5c363ad4b3ce22b78a8c5a5bad25e9..2fd989a41c9f15488815cae9bf499fc22c7a81d2 100644 (file)
@@ -220,14 +220,14 @@ brw_cache_new_bo(struct brw_cache *cache, uint32_t new_size)
    if (can_do_exec_capture(brw->screen))
       new_bo->kflags = EXEC_OBJECT_CAPTURE;
    if (brw->has_llc)
-      llc_map = brw_bo_map_unsynchronized(brw, new_bo);
+      llc_map = brw_bo_map(brw, new_bo, MAP_READ | MAP_ASYNC);
 
    /* Copy any existing data that needs to be saved. */
    if (cache->next_offset != 0) {
       if (brw->has_llc) {
          memcpy(llc_map, cache->map, cache->next_offset);
       } else {
-         void *map = brw_bo_map_cpu(brw, cache->bo, MAP_READ);
+         void *map = brw_bo_map(brw, cache->bo, MAP_READ);
          brw_bo_subdata(new_bo, 0, cache->next_offset, map);
          brw_bo_unmap(cache->bo);
       }
@@ -268,7 +268,7 @@ brw_lookup_prog(const struct brw_cache *cache,
 
          void *map;
          if (!brw->has_llc)
-            map = brw_bo_map_cpu(brw, cache->bo, MAP_READ);
+            map = brw_bo_map(brw, cache->bo, MAP_READ);
          else
             map = cache->map;
 
@@ -417,7 +417,7 @@ brw_init_caches(struct brw_context *brw)
    if (can_do_exec_capture(brw->screen))
       cache->bo->kflags = EXEC_OBJECT_CAPTURE;
    if (brw->has_llc)
-      cache->map = brw_bo_map_unsynchronized(brw, cache->bo);
+      cache->map = brw_bo_map(brw, cache->bo, MAP_READ | MAP_WRITE | MAP_ASYNC);
 }
 
 static void
@@ -550,7 +550,7 @@ brw_print_program_cache(struct brw_context *brw)
    void *map;
 
    if (!brw->has_llc)
-      map = brw_bo_map_cpu(brw, cache->bo, MAP_READ);
+      map = brw_bo_map(brw, cache->bo, MAP_READ);
    else
       map = cache->map;