radeonsi: add a cs parameter into si_cp_copy_data
authorMarek Olšák <marek.olsak@amd.com>
Tue, 12 Feb 2019 20:03:13 +0000 (15:03 -0500)
committerMarek Olšák <marek.olsak@amd.com>
Thu, 16 May 2019 17:06:57 +0000 (13:06 -0400)
Tested-by: Dieter Nützel <Dieter@nuetzel-hh.de>
Acked-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
src/gallium/drivers/radeonsi/si_compute.c
src/gallium/drivers/radeonsi/si_cp_dma.c
src/gallium/drivers/radeonsi/si_perfcounter.c
src/gallium/drivers/radeonsi/si_pipe.h
src/gallium/drivers/radeonsi/si_state_draw.c

index f92ab59103696b2b590b6d8ef5de0a12329b21df..51da06fe550732578d2278bd8892d13fdeaefe7f 100644 (file)
@@ -722,7 +722,7 @@ static void si_setup_tgsi_user_data(struct si_context *sctx,
        if (info->indirect) {
                if (program->uses_grid_size) {
                        for (unsigned i = 0; i < 3; ++i) {
-                               si_cp_copy_data(sctx,
+                               si_cp_copy_data(sctx, sctx->gfx_cs,
                                                COPY_DATA_REG, NULL, (grid_size_reg >> 2) + i,
                                                COPY_DATA_SRC_MEM, si_resource(info->indirect),
                                                info->indirect_offset + 4 * i);
index f5c54ca0d52490eae00ad16d9924169a858bed2b..37ab31a410b5b5978c078ab8af7da4780078d0cf 100644 (file)
@@ -607,18 +607,17 @@ void si_cp_write_data(struct si_context *sctx, struct si_resource *buf,
        radeon_emit_array(cs, (const uint32_t*)data, size/4);
 }
 
-void si_cp_copy_data(struct si_context *sctx,
+void si_cp_copy_data(struct si_context *sctx, struct radeon_cmdbuf *cs,
                     unsigned dst_sel, struct si_resource *dst, unsigned dst_offset,
                     unsigned src_sel, struct si_resource *src, unsigned src_offset)
 {
-       struct radeon_cmdbuf *cs = sctx->gfx_cs;
-
+       /* cs can point to the compute IB, which has the buffer list in gfx_cs. */
        if (dst) {
-               radeon_add_to_buffer_list(sctx, cs, dst,
+               radeon_add_to_buffer_list(sctx, sctx->gfx_cs, dst,
                                          RADEON_USAGE_WRITE, RADEON_PRIO_CP_DMA);
        }
        if (src) {
-               radeon_add_to_buffer_list(sctx, cs, src,
+               radeon_add_to_buffer_list(sctx, sctx->gfx_cs, src,
                                          RADEON_USAGE_READ, RADEON_PRIO_CP_DMA);
        }
 
index c777dc0ae49f37da0b219e5c3a089a62ee762f34..ad7f1eb3d995e3e3f20802b8601680a0c74ecfdb 100644 (file)
@@ -671,7 +671,7 @@ static void si_pc_emit_start(struct si_context *sctx,
 {
        struct radeon_cmdbuf *cs = sctx->gfx_cs;
 
-       si_cp_copy_data(sctx,
+       si_cp_copy_data(sctx, sctx->gfx_cs,
                        COPY_DATA_DST_MEM, buffer, va - buffer->gpu_address,
                        COPY_DATA_IMM, NULL, 1);
 
index 369d090d77c13fdb6536d7832616b75ee1adfe22..488ae74f4c11180cf88f7bb3e3790c1c98a6ecf0 100644 (file)
@@ -1240,7 +1240,7 @@ void si_test_gds(struct si_context *sctx);
 void si_cp_write_data(struct si_context *sctx, struct si_resource *buf,
                      unsigned offset, unsigned size, unsigned dst_sel,
                      unsigned engine, const void *data);
-void si_cp_copy_data(struct si_context *sctx,
+void si_cp_copy_data(struct si_context *sctx, struct radeon_cmdbuf *cs,
                     unsigned dst_sel, struct si_resource *dst, unsigned dst_offset,
                     unsigned src_sel, struct si_resource *src, unsigned src_offset);
 
index a5dcc042406f470f65a572e167141555ba07448a..4483cee4f4aa883ad600d3115fda095a09297869 100644 (file)
@@ -681,7 +681,7 @@ static void si_emit_draw_packets(struct si_context *sctx,
 
                radeon_set_context_reg(cs, R_028B30_VGT_STRMOUT_DRAW_OPAQUE_VERTEX_STRIDE,
                                       t->stride_in_dw);
-               si_cp_copy_data(sctx,
+               si_cp_copy_data(sctx, sctx->gfx_cs,
                                COPY_DATA_REG, NULL,
                                R_028B2C_VGT_STRMOUT_DRAW_OPAQUE_BUFFER_FILLED_SIZE >> 2,
                                COPY_DATA_SRC_MEM, t->buf_filled_size,