mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-06 13:48:06 +02:00
iris: export GEM handle with RDWR access rights
There is a regression that made it impossible to export gem
handles with write access.
That is, a client may export gem handles of each buffer plane, then
export dmabuf fds using these handles, and mmap these dmabuf in
a different process (this is what Chromium does).
After https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4861,
it became impossible as mmap resulted in EACCESS error as slightly
different approach was taken for exporting these gem handles.
This CL fixes exporting gem handles (which are exported from dmabuf
fds) by adding the DRM_RDWR flag.
Cc: mesa-stable
Fixes #3119
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10851>
(cherry picked from commit b74898ef69)
This commit is contained in:
parent
db18d9c247
commit
66dc7dbb33
2 changed files with 2 additions and 2 deletions
|
|
@ -553,7 +553,7 @@
|
|||
"description": "iris: export GEM handle with RDWR access rights",
|
||||
"nominated": true,
|
||||
"nomination_type": 0,
|
||||
"resolution": 0,
|
||||
"resolution": 1,
|
||||
"master_sha": null,
|
||||
"because_sha": null
|
||||
},
|
||||
|
|
|
|||
|
|
@ -1505,7 +1505,7 @@ iris_bo_export_dmabuf(struct iris_bo *bo, int *prime_fd)
|
|||
iris_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;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue