From b191e2d79df5630d532f0801ff0cd3e58058d897 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Marek=20Ol=C5=A1=C3=A1k?= Date: Sat, 25 Nov 2017 20:45:21 +0100 Subject: [PATCH] radeonsi: move r600_test_dma.c into si_test_dma.c MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Reviewed-by: Nicolai Hähnle --- src/gallium/drivers/radeon/Makefile.sources | 1 - src/gallium/drivers/radeon/meson.build | 1 - src/gallium/drivers/radeon/r600_pipe_common.h | 3 -- src/gallium/drivers/radeonsi/Makefile.sources | 1 + src/gallium/drivers/radeonsi/meson.build | 1 + src/gallium/drivers/radeonsi/si_pipe.c | 2 +- src/gallium/drivers/radeonsi/si_pipe.h | 3 ++ .../si_test_dma.c} | 28 +++++++++---------- 8 files changed, 20 insertions(+), 20 deletions(-) rename src/gallium/drivers/{radeon/r600_test_dma.c => radeonsi/si_test_dma.c} (93%) diff --git a/src/gallium/drivers/radeon/Makefile.sources b/src/gallium/drivers/radeon/Makefile.sources index ebb194ccf97..b756d7225d1 100644 --- a/src/gallium/drivers/radeon/Makefile.sources +++ b/src/gallium/drivers/radeon/Makefile.sources @@ -7,7 +7,6 @@ C_SOURCES := \ r600_pipe_common.h \ r600_query.c \ r600_query.h \ - r600_test_dma.c \ r600_texture.c \ radeon_uvd.c \ radeon_uvd.h \ diff --git a/src/gallium/drivers/radeon/meson.build b/src/gallium/drivers/radeon/meson.build index 561fd286319..8563060480b 100644 --- a/src/gallium/drivers/radeon/meson.build +++ b/src/gallium/drivers/radeon/meson.build @@ -27,7 +27,6 @@ files_libradeon = files( 'r600_pipe_common.h', 'r600_query.c', 'r600_query.h', - 'r600_test_dma.c', 'r600_texture.c', 'radeon_uvd.c', 'radeon_uvd.h', diff --git a/src/gallium/drivers/radeon/r600_pipe_common.h b/src/gallium/drivers/radeon/r600_pipe_common.h index 36df0c4068a..a1ec0b8fb28 100644 --- a/src/gallium/drivers/radeon/r600_pipe_common.h +++ b/src/gallium/drivers/radeon/r600_pipe_common.h @@ -720,9 +720,6 @@ void si_init_query_functions(struct r600_common_context *rctx); void si_suspend_queries(struct r600_common_context *ctx); void si_resume_queries(struct r600_common_context *ctx); -/* r600_test_dma.c */ -void si_test_dma(struct r600_common_screen *rscreen); - /* r600_texture.c */ bool si_prepare_for_dma_blit(struct r600_common_context *rctx, struct r600_texture *rdst, diff --git a/src/gallium/drivers/radeonsi/Makefile.sources b/src/gallium/drivers/radeonsi/Makefile.sources index 18cd7d14c18..10c99f6173e 100644 --- a/src/gallium/drivers/radeonsi/Makefile.sources +++ b/src/gallium/drivers/radeonsi/Makefile.sources @@ -36,4 +36,5 @@ C_SOURCES := \ si_state_streamout.c \ si_state_viewport.c \ si_state.h \ + si_test_dma.c \ si_uvd.c diff --git a/src/gallium/drivers/radeonsi/meson.build b/src/gallium/drivers/radeonsi/meson.build index a04ea4c03fb..7eae9d6e19a 100644 --- a/src/gallium/drivers/radeonsi/meson.build +++ b/src/gallium/drivers/radeonsi/meson.build @@ -52,6 +52,7 @@ files_libradeonsi = files( 'si_state_streamout.c', 'si_state_viewport.c', 'si_state.h', + 'si_test_dma.c', 'si_uvd.c', ) diff --git a/src/gallium/drivers/radeonsi/si_pipe.c b/src/gallium/drivers/radeonsi/si_pipe.c index f0a9ad197af..bf2867759c1 100644 --- a/src/gallium/drivers/radeonsi/si_pipe.c +++ b/src/gallium/drivers/radeonsi/si_pipe.c @@ -1158,7 +1158,7 @@ struct pipe_screen *radeonsi_screen_create(struct radeon_winsys *ws, sscreen->b.aux_context = si_create_context(&sscreen->b.b, 0); if (sscreen->b.debug_flags & DBG(TEST_DMA)) - si_test_dma(&sscreen->b); + si_test_dma(sscreen); if (sscreen->b.debug_flags & (DBG(TEST_VMFAULT_CP) | DBG(TEST_VMFAULT_SDMA) | diff --git a/src/gallium/drivers/radeonsi/si_pipe.h b/src/gallium/drivers/radeonsi/si_pipe.h index 820e5b2d85a..c0846f435b8 100644 --- a/src/gallium/drivers/radeonsi/si_pipe.h +++ b/src/gallium/drivers/radeonsi/si_pipe.h @@ -640,6 +640,9 @@ void si_init_compute_functions(struct si_context *sctx); /* si_perfcounters.c */ void si_init_perfcounters(struct si_screen *screen); +/* si_test_dma.c */ +void si_test_dma(struct si_screen *sscreen); + /* si_uvd.c */ struct pipe_video_codec *si_uvd_create_decoder(struct pipe_context *context, const struct pipe_video_codec *templ); diff --git a/src/gallium/drivers/radeon/r600_test_dma.c b/src/gallium/drivers/radeonsi/si_test_dma.c similarity index 93% rename from src/gallium/drivers/radeon/r600_test_dma.c rename to src/gallium/drivers/radeonsi/si_test_dma.c index f7002bc3905..beb3be50ee6 100644 --- a/src/gallium/drivers/radeon/r600_test_dma.c +++ b/src/gallium/drivers/radeonsi/si_test_dma.c @@ -24,7 +24,7 @@ /* This file implements randomized SDMA texture blit tests. */ -#include "r600_pipe_common.h" +#include "si_pipe.h" #include "util/u_surface.h" #include "util/rand_xor.h" @@ -135,10 +135,10 @@ static enum pipe_format get_format_from_bpp(int bpp) } } -static const char *array_mode_to_string(struct r600_common_screen *rscreen, +static const char *array_mode_to_string(struct si_screen *sscreen, struct radeon_surf *surf) { - if (rscreen->chip_class >= GFX9) { + if (sscreen->b.chip_class >= GFX9) { /* TODO */ return " UNKNOWN"; } else { @@ -171,11 +171,11 @@ static unsigned generate_max_tex_side(unsigned max_tex_side) } } -void si_test_dma(struct r600_common_screen *rscreen) +void si_test_dma(struct si_screen *sscreen) { - struct pipe_screen *screen = &rscreen->b; + struct pipe_screen *screen = &sscreen->b.b; struct pipe_context *ctx = screen->context_create(screen, NULL, 0); - struct r600_common_context *rctx = (struct r600_common_context*)ctx; + struct si_context *sctx = (struct si_context*)ctx; uint64_t max_alloc_size; unsigned i, iterations, num_partial_copies, max_levels, max_tex_side; unsigned num_pass = 0, num_fail = 0; @@ -283,16 +283,16 @@ void si_test_dma(struct r600_common_screen *rscreen) printf("%4u: dst = (%5u x %5u x %u, %s), " " src = (%5u x %5u x %u, %s), bpp = %2u, ", i, tdst.width0, tdst.height0, tdst.array_size, - array_mode_to_string(rscreen, &rdst->surface), + array_mode_to_string(sscreen, &rdst->surface), tsrc.width0, tsrc.height0, tsrc.array_size, - array_mode_to_string(rscreen, &rsrc->surface), bpp); + array_mode_to_string(sscreen, &rsrc->surface), bpp); fflush(stdout); /* set src pixels */ set_random_pixels(ctx, src, &src_cpu); /* clear dst pixels */ - rctx->clear_buffer(ctx, dst, 0, rdst->surface.surf_size, 0, true); + sctx->b.clear_buffer(ctx, dst, 0, rdst->surface.surf_size, 0, true); memset(dst_cpu.ptr, 0, dst_cpu.layer_stride * tdst.array_size); /* preparation */ @@ -305,8 +305,8 @@ void si_test_dma(struct r600_common_screen *rscreen) int width, height, depth; int srcx, srcy, srcz, dstx, dsty, dstz; struct pipe_box box; - unsigned old_num_draw_calls = rctx->num_draw_calls; - unsigned old_num_dma_calls = rctx->num_dma_calls; + unsigned old_num_draw_calls = sctx->b.num_draw_calls; + unsigned old_num_dma_calls = sctx->b.num_dma_calls; if (!do_partial_copies) { /* copy whole src to dst */ @@ -361,11 +361,11 @@ void si_test_dma(struct r600_common_screen *rscreen) /* GPU copy */ u_box_3d(srcx, srcy, srcz, width, height, depth, &box); - rctx->dma_copy(ctx, dst, 0, dstx, dsty, dstz, src, 0, &box); + sctx->b.dma_copy(ctx, dst, 0, dstx, dsty, dstz, src, 0, &box); /* See which engine was used. */ - gfx_blits += rctx->num_draw_calls > old_num_draw_calls; - dma_blits += rctx->num_dma_calls > old_num_dma_calls; + gfx_blits += sctx->b.num_draw_calls > old_num_draw_calls; + dma_blits += sctx->b.num_dma_calls > old_num_dma_calls; /* CPU copy */ util_copy_box(dst_cpu.ptr, tdst.format, dst_cpu.stride, -- 2.30.2