From a31c34e0d69aea178ccac6bc2fa22bec13464a25 Mon Sep 17 00:00:00 2001 From: Rob Clark Date: Thu, 12 May 2022 08:04:56 -0700 Subject: [PATCH] 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 Part-of: --- src/freedreno/drm/virtio/virtio_bo.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/freedreno/drm/virtio/virtio_bo.c b/src/freedreno/drm/virtio/virtio_bo.c index b05964cc330..e2c6bb57135 100644 --- a/src/freedreno/drm/virtio/virtio_bo.c +++ b/src/freedreno/drm/virtio/virtio_bo.c @@ -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, };