anv: Add DRM_RDWR flag in anv_gem_handle_to_fd

The DRM_RDWR flag is needed for mmap with PROT_WRITE to work.

Cc: mesa-stable
Signed-off-by: Robin Ole Heinemann <robin.ole.heinemann@gmail.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8075>
(cherry picked from commit df76963a5c)
This commit is contained in:
Robin Ole Heinemann 2020-12-13 02:22:57 +01:00 committed by Dylan Baker
parent 786273a03b
commit d741a0714a
2 changed files with 2 additions and 2 deletions

View file

@ -121,7 +121,7 @@
"description": "anv: Add DRM_RDWR flag in anv_gem_handle_to_fd",
"nominated": true,
"nomination_type": 0,
"resolution": 0,
"resolution": 1,
"master_sha": null,
"because_sha": null
},

View file

@ -426,7 +426,7 @@ anv_gem_handle_to_fd(struct anv_device *device, uint32_t gem_handle)
{
struct drm_prime_handle args = {
.handle = gem_handle,
.flags = DRM_CLOEXEC,
.flags = DRM_CLOEXEC | DRM_RDWR,
};
int ret = gen_ioctl(device->fd, DRM_IOCTL_PRIME_HANDLE_TO_FD, &args);