mesa/src/amd/common/virtio
Wang Ruitang e11c04c0cc amd/common/virtio: use device fd to init sync provider
Use fd after dup instead of the one before dup to avoid
drm_syncobj_find failed in guest kernel when dev is found in
dev_list.

When dev is not found in dev_list, it uses device fd which is
duplicated, to init sync provider. And when it's found, the same
device fd should be used. Otherwise, it would caused inconsistency
and failures like in the Android domU CTS test where the guest
kernel attempts to locate a syncobj. This occurs because
vdrm_device_connect and VIRTGPU_EXECBUFFER ioctl use fd after dup
while util_sync_provider_drm uses the one before dup.

The fix has been validated with the CtsSdkSandboxWebkitTestCases in
Android domU, and the previously failing test cases no longer occur.

Signed-off-by: Ruitang.Wang@amd.com
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39520>
2026-01-27 08:24:35 +00:00
..
amdgpu_virtio.c ac/info: get vm_always_valid support through ac_linux_drm 2025-11-20 10:21:47 +00:00
amdgpu_virtio.h ac/info: get vm_always_valid support through ac_linux_drm 2025-11-20 10:21:47 +00:00
amdgpu_virtio_bo.c amdgpu/virtio: unmap bo in destroy_host_blob 2025-11-17 05:35:31 +00:00
amdgpu_virtio_device.c amd/common/virtio: use device fd to init sync provider 2026-01-27 08:24:35 +00:00
amdgpu_virtio_private.h
amdgpu_virtio_proto.h