freedreno: Avoid flushing deferred submits for u_trace

This is a bit ugly, but with userspace fences and deferred submits it is
better to poll until the timestamp buffer is ready.  Otherwise we could
be triggering deferred submits to flush sooner than they normally would,
changing the behavior of what we are trying to measure.

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-17 12:56:58 -07:00 committed by Marge Bot
parent cccdc513e3
commit 55eb75d3e6
1 changed files with 5 additions and 0 deletions

View File

@ -477,6 +477,11 @@ fd_trace_read_ts(struct u_trace_context *utctx,
/* Only need to stall on results for the first entry: */
if (idx == 0) {
/* Avoid triggering deferred submits from flushing, since that
* changes the behavior of what we are trying to measure:
*/
while (fd_bo_cpu_prep(ts_bo, ctx->pipe, FD_BO_PREP_NOSYNC))
usleep(10000);
int ret = fd_bo_cpu_prep(ts_bo, ctx->pipe, FD_BO_PREP_READ);
if (ret)
return U_TRACE_NO_TIMESTAMP;