Mesa (master): radeonsi: move si_screen_clear_buffer into si_compute_blit.c w/o SDMA option

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Wed Dec 9 01:09:46 UTC 2020


Module: Mesa
Branch: master
Commit: ab1377cf9267d9ff79a3b6b8da0dfe8b1784b2a2
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=ab1377cf9267d9ff79a3b6b8da0dfe8b1784b2a2

Author: Marek Olšák <marek.olsak at amd.com>
Date:   Thu Dec  3 17:10:06 2020 -0500

radeonsi: move si_screen_clear_buffer into si_compute_blit.c w/o SDMA option

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer at amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7908>

---

 src/gallium/drivers/radeonsi/si_compute_blit.c | 11 +++++++++++
 src/gallium/drivers/radeonsi/si_dma_cs.c       | 11 -----------
 src/gallium/drivers/radeonsi/si_pipe.h         |  4 ++--
 3 files changed, 13 insertions(+), 13 deletions(-)

diff --git a/src/gallium/drivers/radeonsi/si_compute_blit.c b/src/gallium/drivers/radeonsi/si_compute_blit.c
index 80365915bec..b350c9fe3f7 100644
--- a/src/gallium/drivers/radeonsi/si_compute_blit.c
+++ b/src/gallium/drivers/radeonsi/si_compute_blit.c
@@ -372,6 +372,17 @@ void si_clear_buffer(struct si_context *sctx, struct pipe_resource *dst, uint64_
    }
 }
 
+void si_screen_clear_buffer(struct si_screen *sscreen, struct pipe_resource *dst, uint64_t offset,
+                            uint64_t size, unsigned value)
+{
+   struct si_context *ctx = (struct si_context *)sscreen->aux_context;
+
+   simple_mtx_lock(&sscreen->aux_context_lock);
+   ctx->b.clear_buffer(&ctx->b, dst, offset, size, &value, 4);
+   sscreen->aux_context->flush(sscreen->aux_context, NULL, 0);
+   simple_mtx_unlock(&sscreen->aux_context_lock);
+}
+
 static void si_pipe_clear_buffer(struct pipe_context *ctx, struct pipe_resource *dst,
                                  unsigned offset, unsigned size, const void *clear_value,
                                  int clear_value_size)
diff --git a/src/gallium/drivers/radeonsi/si_dma_cs.c b/src/gallium/drivers/radeonsi/si_dma_cs.c
index 2fa77871918..77dc9d81dc0 100644
--- a/src/gallium/drivers/radeonsi/si_dma_cs.c
+++ b/src/gallium/drivers/radeonsi/si_dma_cs.c
@@ -317,14 +317,3 @@ void si_flush_dma_cs(struct si_context *ctx, unsigned flags, struct pipe_fence_h
       si_clear_saved_cs(&saved);
    }
 }
-
-void si_screen_clear_buffer(struct si_screen *sscreen, struct pipe_resource *dst, uint64_t offset,
-                            uint64_t size, unsigned value)
-{
-   struct si_context *ctx = (struct si_context *)sscreen->aux_context;
-
-   simple_mtx_lock(&sscreen->aux_context_lock);
-   si_sdma_clear_buffer(ctx, dst, offset, size, value);
-   sscreen->aux_context->flush(sscreen->aux_context, NULL, 0);
-   simple_mtx_unlock(&sscreen->aux_context_lock);
-}
diff --git a/src/gallium/drivers/radeonsi/si_pipe.h b/src/gallium/drivers/radeonsi/si_pipe.h
index 743f112aa26..7eb286bfa6e 100644
--- a/src/gallium/drivers/radeonsi/si_pipe.h
+++ b/src/gallium/drivers/radeonsi/si_pipe.h
@@ -1356,6 +1356,8 @@ void si_launch_grid_internal(struct si_context *sctx, struct pipe_grid_info *inf
 void si_clear_buffer(struct si_context *sctx, struct pipe_resource *dst, uint64_t offset,
                      uint64_t size, uint32_t *clear_value, uint32_t clear_value_size,
                      enum si_coherency coher, bool force_cpdma);
+void si_screen_clear_buffer(struct si_screen *sscreen, struct pipe_resource *dst, uint64_t offset,
+                            uint64_t size, unsigned value);
 void si_copy_buffer(struct si_context *sctx, struct pipe_resource *dst, struct pipe_resource *src,
                     uint64_t dst_offset, uint64_t src_offset, unsigned size);
 void si_compute_copy_image(struct si_context *sctx, struct pipe_resource *dst, unsigned dst_level,
@@ -1427,8 +1429,6 @@ void si_sdma_copy_buffer(struct si_context *sctx, struct pipe_resource *dst,
 void si_need_dma_space(struct si_context *ctx, unsigned num_dw, struct si_resource *dst,
                        struct si_resource *src);
 void si_flush_dma_cs(struct si_context *ctx, unsigned flags, struct pipe_fence_handle **fence);
-void si_screen_clear_buffer(struct si_screen *sscreen, struct pipe_resource *dst, uint64_t offset,
-                            uint64_t size, unsigned value);
 
 /* si_fence.c */
 void si_cp_release_mem(struct si_context *ctx, struct radeon_cmdbuf *cs, unsigned event,



More information about the mesa-commit mailing list