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:
e9a9ac6f77f ("freedreno/drm: Async submit support")
Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10530>
}
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