mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-25 06:30:10 +01:00
etnaviv: drm: Add DRM_RDWR permissions to drmPrimeHandleToFD() call.
Currently it is not possible to mmap() the exported dma-bufs from etnaviv for writing, through the GBM APIs, such as gbm_bo_get_fd(). etna_bo_dmabuf() calls drmPrimeHandleToFD() only with DRM_CLOEXEC flag, omitting DRM_RDWR. A typical call sequence, ending in etna_bo_dmabuf, for illustration: gbm_bo_get_fd -> gbm_dri_bo_get_fd -> dri2_query_image -> dri2_query_image_by_resource_handle -> etna_resource_get_handle -> etna_bo_dmabuf. Signed-off-by: Nikolas Zimmermann <nzimmermann@igalia.com> Reviewed-by: Lucas Stach <l.stach@pengutronix.de> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/34213>
This commit is contained in:
parent
a88c9ea192
commit
1e72fbcfd1
1 changed files with 1 additions and 1 deletions
|
|
@ -362,7 +362,7 @@ int etna_bo_dmabuf(struct etna_bo *bo)
|
|||
{
|
||||
int ret, prime_fd;
|
||||
|
||||
ret = drmPrimeHandleToFD(bo->dev->fd, bo->handle, DRM_CLOEXEC,
|
||||
ret = drmPrimeHandleToFD(bo->dev->fd, bo->handle, DRM_CLOEXEC | DRM_RDWR,
|
||||
&prime_fd);
|
||||
if (ret) {
|
||||
ERROR_MSG("failed to get dmabuf fd: %d", ret);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue