Mesa (staging/22.0): crocus: export GEM handle with RDWR access rights

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Thu Apr 21 22:22:07 UTC 2022


Module: Mesa
Branch: staging/22.0
Commit: 62d38b16007956c7466a39f7e06919d403bc8999
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=62d38b16007956c7466a39f7e06919d403bc8999

Author: Michael Olbrich <m.olbrich at pengutronix.de>
Date:   Wed Apr 20 16:26:28 2022 +0200

crocus: export GEM handle with RDWR access rights

Without this, it is impossible to export gem handles with write access.

This was fixed the same way for
i965 (https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10850) and
iris (https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10851).

Cc: mesa-stable
Reviewed-by: Dave Airlie <airlied at redhat.com>`
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16057>
(cherry picked from commit 5c4906dc0f0b9609760dc0a18805045e568b2d0b)

---

 .pick_status.json                          | 2 +-
 src/gallium/drivers/crocus/crocus_bufmgr.c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/.pick_status.json b/.pick_status.json
index a9b287742db..24327e840f6 100644
--- a/.pick_status.json
+++ b/.pick_status.json
@@ -276,7 +276,7 @@
         "description": "crocus: export GEM handle with RDWR access rights",
         "nominated": true,
         "nomination_type": 0,
-        "resolution": 0,
+        "resolution": 1,
         "because_sha": null
     },
     {
diff --git a/src/gallium/drivers/crocus/crocus_bufmgr.c b/src/gallium/drivers/crocus/crocus_bufmgr.c
index d3fe5ee42f5..de1de0beb7d 100644
--- a/src/gallium/drivers/crocus/crocus_bufmgr.c
+++ b/src/gallium/drivers/crocus/crocus_bufmgr.c
@@ -1370,7 +1370,7 @@ crocus_bo_export_dmabuf(struct crocus_bo *bo, int *prime_fd)
    crocus_bo_make_external(bo);
 
    if (drmPrimeHandleToFD(bufmgr->fd, bo->gem_handle,
-                          DRM_CLOEXEC, prime_fd) != 0)
+                          DRM_CLOEXEC | DRM_RDWR, prime_fd) != 0)
       return -errno;
 
    return 0;



More information about the mesa-commit mailing list