freedreno: add pctx->memory_barrier()
authorRob Clark <robdclark@gmail.com>
Sun, 25 Feb 2018 20:01:07 +0000 (15:01 -0500)
committerRob Clark <robdclark@gmail.com>
Mon, 5 Mar 2018 13:05:33 +0000 (08:05 -0500)
Signed-off-by: Rob Clark <robdclark@gmail.com>
src/gallium/drivers/freedreno/freedreno_context.c

index 7dd088730d0d7783bcf177a41a0cf22147394a6f..9c6a21ca5b8bd8ef6e8f7c4dd921adc43980400f 100644 (file)
@@ -80,6 +80,13 @@ fd_texture_barrier(struct pipe_context *pctx, unsigned flags)
        fd_context_flush(pctx, NULL, 0);
 }
 
+static void
+fd_memory_barrier(struct pipe_context *pctx, unsigned flags)
+{
+       fd_context_flush(pctx, NULL, 0);
+       /* TODO do we need to check for persistently mapped buffers and fd_bo_cpu_prep()?? */
+}
+
 /**
  * emit marker string as payload of a no-op packet, which can be
  * decoded by cffdump.
@@ -295,6 +302,7 @@ fd_context_init(struct fd_context *ctx, struct pipe_screen *pscreen,
        pctx->create_fence_fd = fd_create_fence_fd;
        pctx->fence_server_sync = fd_fence_server_sync;
        pctx->texture_barrier = fd_texture_barrier;
+       pctx->memory_barrier = fd_memory_barrier;
 
        pctx->stream_uploader = u_upload_create_default(pctx);
        if (!pctx->stream_uploader)