freedreno/drm: Assume explicit fences if in_fence_fd

If we ever see explicit fencing used, then we can disable implicit
fencing, even for internal or unfenced batches.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10444>
This commit is contained in:
Rob Clark 2021-04-20 08:57:54 -07:00 committed by Marge Bot
parent e9a9ac6f77
commit f92f31455a
2 changed files with 12 additions and 1 deletions

View File

@ -63,6 +63,12 @@ struct msm_pipe {
uint32_t last_submit_fence;
uint32_t last_enqueue_fence; /* just for debugging */
/**
* If we *ever* see an in-fence-fd, assume that userspace is
* not relying on implicit fences.
*/
bool no_implicit_sync;
};
FD_DEFINE_CAST(fd_pipe, msm_pipe);

View File

@ -334,8 +334,13 @@ flush_submit_list(struct list_head *submit_list)
}
if (msm_submit->in_fence_fd != -1) {
req.flags |= MSM_SUBMIT_FENCE_FD_IN | MSM_SUBMIT_NO_IMPLICIT;
req.flags |= MSM_SUBMIT_FENCE_FD_IN;
req.fence_fd = msm_submit->in_fence_fd;
msm_pipe->no_implicit_sync = true;
}
if (msm_pipe->no_implicit_sync) {
req.flags |= MSM_SUBMIT_NO_IMPLICIT;
}
if (msm_submit->out_fence && msm_submit->out_fence->use_fence_fd) {