freedreno/drm/virtio: Don't try to mmap imported bo's

Previously it would fail, and then we'd fall back to the transfer path
for things like readpix.  But it would spam logcat w/ bo_mmap fail
messages.  Since gralloc allocated buffers for GPU usage are allocate
without _USE_MAPPABLE, let's just assume we can't map imported bo's.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16477>
This commit is contained in:
Rob Clark 2022-05-12 08:04:56 -07:00 committed by Marge Bot
parent 62f3e703c8
commit a31c34e0d6

View file

@ -280,6 +280,9 @@ bo_from_handle(struct fd_device *dev, uint32_t size, uint32_t handle)
bo->funcs = &funcs;
bo->handle = handle;
/* Don't assume we can mmap an imported bo: */
bo->alloc_flags = FD_BO_NOMAP;
struct drm_virtgpu_resource_info args = {
.bo_handle = handle,
};