summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/panfrost/pan_drm.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/gallium/drivers/panfrost/pan_drm.c')
-rw-r--r--src/gallium/drivers/panfrost/pan_drm.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/gallium/drivers/panfrost/pan_drm.c b/src/gallium/drivers/panfrost/pan_drm.c
index 36a6b975680..28a4287202b 100644
--- a/src/gallium/drivers/panfrost/pan_drm.c
+++ b/src/gallium/drivers/panfrost/pan_drm.c
@@ -163,6 +163,8 @@ panfrost_drm_release_bo(struct panfrost_screen *screen, struct panfrost_bo *bo,
/* Rather than freeing the BO now, we'll cache the BO for later
* allocations if we're allowed to */
+ panfrost_drm_munmap_bo(screen, bo);
+
if (cacheable) {
bool cached = panfrost_bo_cache_put(screen, bo);
@@ -172,8 +174,6 @@ panfrost_drm_release_bo(struct panfrost_screen *screen, struct panfrost_bo *bo,
/* Otherwise, if the BO wasn't cached, we'll legitimately free the BO */
- panfrost_drm_munmap_bo(screen, bo);
-
ret = drmIoctl(screen->fd, DRM_IOCTL_GEM_CLOSE, &gem_close);
if (ret) {
fprintf(stderr, "DRM_IOCTL_GEM_CLOSE failed: %m\n");