pan/kmod: set DRM_RDWR for exported dma-bufs
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run

This allows the exported fds to be mapped for writing. This is needed
for virtgpu native ctx support where the fds are mapped rw when the
mappings are added to the guest by kvm. This aligns with other mesa
drivers, and unblocks the extended testing with venus on top.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/34017>
This commit is contained in:
Yiwei Zhang 2025-03-11 21:28:24 -07:00 committed by Marge Bot
parent cac4287aab
commit 06369caa40

View file

@ -565,7 +565,8 @@ pan_kmod_bo_export(struct pan_kmod_bo *bo)
{
int fd;
if (drmPrimeHandleToFD(bo->dev->fd, bo->handle, DRM_CLOEXEC, &fd)) {
if (drmPrimeHandleToFD(bo->dev->fd, bo->handle, DRM_CLOEXEC | DRM_RDWR,
&fd)) {
mesa_loge("drmPrimeHandleToFD() failed (err=%d)", errno);
return -1;
}