Mesa (main): freedreno/drm/virtio: Don't try to mmap imported bo's

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Thu May 12 22:41:12 UTC 2022


Module: Mesa
Branch: main
Commit: a31c34e0d69aea178ccac6bc2fa22bec13464a25
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=a31c34e0d69aea178ccac6bc2fa22bec13464a25

Author: Rob Clark <robdclark at chromium.org>
Date:   Thu May 12 08:04:56 2022 -0700

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 at chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16477>

---

 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,
    };



More information about the mesa-commit mailing list