radeonsi: move si_screen_clear_buffer into si_compute_blit.c w/o SDMA option
authorMarek Olšák <marek.olsak@amd.com>
Thu, 3 Dec 2020 22:10:06 +0000 (17:10 -0500)
committerMarge Bot <eric+marge@anholt.net>
Wed, 9 Dec 2020 00:52:26 +0000 (00:52 +0000)
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7908>

src/gallium/drivers/radeonsi/si_compute_blit.c
src/gallium/drivers/radeonsi/si_dma_cs.c
src/gallium/drivers/radeonsi/si_pipe.h

index 8036591..b350c9f 100644 (file)
@@ -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)
index 2fa7787..77dc9d8 100644 (file)
@@ -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);
-}
index 743f112..7eb286b 100644 (file)
@@ -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,