freedreno: Flush resources harder

pctx->flush_resource() has the same expectations that the resource can
be shared with an external client as pctx->flush(), but without the
convenience of a fence to know *when* the resource must be visible to
that external client.  So we need to ensure the batch is flushed all the
way to the kernel so that implicit-sync can do it's job.

Fixes: e9a9ac6f77 ("freedreno/drm: Async submit support")
Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10530>
This commit is contained in:
Rob Clark
2021-04-29 11:10:46 -07:00
parent 5181f40670
commit bc3f66311d
@@ -641,9 +641,18 @@ flush_resource(struct fd_context *ctx, struct fd_resource *rsc,
}
static void
fd_flush_resource(struct pipe_context *pctx, struct pipe_resource *prsc) in_dt
fd_flush_resource(struct pipe_context *pctx, struct pipe_resource *prsc)
in_dt
{
flush_resource(fd_context(pctx), fd_resource(prsc), PIPE_MAP_READ);
struct fd_context *ctx = fd_context(pctx);
struct fd_resource *rsc = fd_resource(prsc);
flush_resource(ctx, rsc, PIPE_MAP_READ);
/* If we had to flush a batch, make sure it makes it's way all the
* way to the kernel:
*/
fd_resource_wait(ctx, rsc, FD_BO_PREP_FLUSH);
}
static void