panfrost_bo_unreference() should be used instead.
The only difference caused by this change is that the scratchpad,
tiler_heap and tiler_dummy BOs are now returned to the cache instead
of being freed when a context is destroyed. This is only a problem if
we care about context isolation, which apparently is not the case since
transient BOs are already returned to the per-FD cache (and all contexts
share the same address space anyway, so enforcing context isolation
is almost impossible).
Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
return &screen->bo_cache[pan_bucket_index(size)];
}
+static void
+panfrost_bo_release(struct panfrost_bo *bo, bool cacheable);
+
/* Tries to fetch a BO of sufficient size with the appropriate flags from the
* BO cache. If it succeeds, it returns that BO and removes the BO from the
* cache. If it fails, it returns NULL signaling the caller to allocate a new
return bo;
}
-void
+static void
panfrost_bo_release(struct panfrost_bo *bo, bool cacheable)
{
if (!bo)
uint32_t flags);
void
panfrost_bo_mmap(struct panfrost_bo *bo);
-void
-panfrost_bo_release(struct panfrost_bo *bo, bool cacheable);
struct panfrost_bo *
panfrost_bo_import(struct panfrost_screen *screen, int fd);
int
if (panfrost->blitter_wallpaper)
util_blitter_destroy(panfrost->blitter_wallpaper);
- panfrost_bo_release(panfrost->scratchpad, false);
- panfrost_bo_release(panfrost->tiler_heap, false);
- panfrost_bo_release(panfrost->tiler_dummy, false);
+ panfrost_bo_unreference(panfrost->scratchpad);
+ panfrost_bo_unreference(panfrost->tiler_heap);
+ panfrost_bo_unreference(panfrost->tiler_dummy);
ralloc_free(pipe);
}
/* If we grew in size, reallocate the BO */
if (new_size > rsrc->bo->size) {
- panfrost_bo_release(rsrc->bo, true);
+ panfrost_bo_unreference(rsrc->bo);
rsrc->bo = panfrost_bo_create(screen, new_size, PAN_BO_DELAY_MMAP);
}
}