amd/virtio: clear DRM_SYNCOBJ_WAIT_FLAGS_WAIT_FOR_SUBMIT

Calls to radv_amdgpu_cs_submit will come with either no waits
or through vk_queue.
vk_queue uses VK_SYNC_WAIT_PENDING which is translated as
DRM_SYNCOBJ_WAIT_FLAGS_WAIT_AVAILABLE.

WAIT_AVAILABLE will wait for the fence to materialize, so
it means it's safe to pass the syncobj in a
AMDGPU_CHUNK_ID_SYNCOBJ_TIMELINE_WAIT chunk without the
WAIT_FOR_SUBMIT flag.

Tested-by: Dmitry Osipenko <dmitry.osipenko@collabora.com>
Acked-by: Marek Olšák <marek.olsak@amd.com>
Acked-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/34470>
This commit is contained in:
Pierre-Eric Pelloux-Prayer 2025-04-17 12:07:42 +02:00 committed by Marge Bot
parent f0ab43ec1b
commit 7c6fb24067

View file

@ -414,7 +414,12 @@ amdvgpu_cs_submit_raw2(amdvgpu_device_handle dev, uint32_t ctx_id,
for (int j = 0; j < new_syncobj_count; j++) {
if (amd_syncobj) {
(*syncobjs)[start + j].handle = amd_syncobj[j].handle;
(*syncobjs)[start + j].flags = amd_syncobj[j].flags;
/* radv uses DRM_SYNCOBJ_WAIT_FLAGS_WAIT_FOR_SUBMIT but vk_queue already used
* WAIT_AVAILABLE, so clear the flag. This is not 100% correct as between
* the wait and the submit the syncobj fence might get changed but since
* virtgpu doesn't support WAIT_FOR_SUBMIT yet, this is the best we can do.
*/
(*syncobjs)[start + j].flags = 0;
(*syncobjs)[start + j].point = amd_syncobj[j].point;
} else {
(*syncobjs)[start + j].handle = amd_sem[j].handle;