pvr: Allow signal_sync pointer to be NULL in job submission.

This allows the common driver to pass NULL signal_sync for cases
where there are multiple jobs (of the same type) to be processed.
In that case, it's useless to maintain the signal_syncs other than
the one returned by the last submission.

Signed-off-by: Rajnesh Kanwal <rajnesh.kanwal@imgtec.com>
Reviewed-by: Frank Binns <frank.binns@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16897>
This commit is contained in:
Rajnesh Kanwal 2022-05-16 14:28:43 +01:00
parent ce36859b95
commit 72c634fb23
2 changed files with 19 additions and 6 deletions

View file

@ -222,8 +222,12 @@ VkResult pvr_srv_winsys_compute_submit(
if (result != VK_SUCCESS)
goto err_close_in_fd;
srv_signal_sync = to_srv_sync(signal_sync);
pvr_srv_set_sync_payload(srv_signal_sync, fence);
if (signal_sync) {
srv_signal_sync = to_srv_sync(signal_sync);
pvr_srv_set_sync_payload(srv_signal_sync, fence);
} else if (fence != -1) {
close(fence);
}
return VK_SUCCESS;

View file

@ -680,10 +680,19 @@ VkResult pvr_srv_winsys_render_submit(
if (result != VK_SUCCESS)
goto err_close_in_fds;
srv_signal_sync_geom = to_srv_sync(signal_sync_geom);
srv_signal_sync_frag = to_srv_sync(signal_sync_frag);
pvr_srv_set_sync_payload(srv_signal_sync_geom, fence_geom);
pvr_srv_set_sync_payload(srv_signal_sync_frag, fence_frag);
if (signal_sync_geom) {
srv_signal_sync_geom = to_srv_sync(signal_sync_geom);
pvr_srv_set_sync_payload(srv_signal_sync_geom, fence_geom);
} else if (fence_geom != -1) {
close(fence_geom);
}
if (signal_sync_frag) {
srv_signal_sync_frag = to_srv_sync(signal_sync_frag);
pvr_srv_set_sync_payload(srv_signal_sync_frag, fence_frag);
} else if (fence_frag != -1) {
close(fence_frag);
}
return VK_SUCCESS;