panfrost: Remove BO mapping from import

BOs will be mapped when needed, so there is no need to mmap BOs when
importing them.

Fixes crashes when exporting a non-AFBC resource and importing it back
in the same context.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15818>
This commit is contained in:
Icecream95 2022-04-08 23:05:02 +12:00 committed by Marge Bot
parent 279eea5bda
commit 5da8c280b7
1 changed files with 0 additions and 3 deletions

View File

@ -494,8 +494,6 @@ panfrost_bo_import(struct panfrost_device *dev, int fd)
bo->flags = PAN_BO_SHARED;
bo->gem_handle = gem_handle;
p_atomic_set(&bo->refcnt, 1);
// TODO map and unmap on demand?
panfrost_bo_mmap(bo);
} else {
/* bo->refcnt == 0 can happen if the BO
* was being released but panfrost_bo_import() acquired the
@ -511,7 +509,6 @@ panfrost_bo_import(struct panfrost_device *dev, int fd)
p_atomic_set(&bo->refcnt, 1);
else
panfrost_bo_reference(bo);
assert(bo->ptr.cpu);
}
pthread_mutex_unlock(&dev->bo_map_lock);