From 89e669d2fd512e99922b095a34192b8fc6509d28 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Marek=20Ol=C5=A1=C3=A1k?= Date: Tue, 7 Nov 2017 19:19:07 +0100 Subject: [PATCH] radeonsi: remove has_cp_dma, has_streamout flags (v2) v2: remove r600_can_dma_copy_buffer --- src/gallium/drivers/radeon/r600_buffer_common.c | 17 ++--------------- src/gallium/drivers/radeon/r600_pipe_common.h | 2 -- src/gallium/drivers/radeonsi/si_pipe.c | 3 --- 3 files changed, 2 insertions(+), 20 deletions(-) diff --git a/src/gallium/drivers/radeon/r600_buffer_common.c b/src/gallium/drivers/radeon/r600_buffer_common.c index f0cfd0979a2..770f4e980fd 100644 --- a/src/gallium/drivers/radeon/r600_buffer_common.c +++ b/src/gallium/drivers/radeon/r600_buffer_common.c @@ -349,17 +349,6 @@ static void *r600_buffer_get_transfer(struct pipe_context *ctx, return data; } -static bool r600_can_dma_copy_buffer(struct r600_common_context *rctx, - unsigned dstx, unsigned srcx, unsigned size) -{ - bool dword_aligned = !(dstx % 4) && !(srcx % 4) && !(size % 4); - - return rctx->screen->has_cp_dma || - (dword_aligned && (rctx->dma.cs || - rctx->screen->has_streamout)); - -} - static void *r600_buffer_transfer_map(struct pipe_context *ctx, struct pipe_resource *resource, unsigned level, @@ -436,8 +425,7 @@ static void *r600_buffer_transfer_map(struct pipe_context *ctx, if ((usage & PIPE_TRANSFER_DISCARD_RANGE) && ((!(usage & (PIPE_TRANSFER_UNSYNCHRONIZED | - PIPE_TRANSFER_PERSISTENT)) && - r600_can_dma_copy_buffer(rctx, box->x, 0, box->width)) || + PIPE_TRANSFER_PERSISTENT))) || (rbuffer->flags & RADEON_FLAG_SPARSE))) { assert(usage & PIPE_TRANSFER_WRITE); @@ -473,8 +461,7 @@ static void *r600_buffer_transfer_map(struct pipe_context *ctx, else if (((usage & PIPE_TRANSFER_READ) && !(usage & PIPE_TRANSFER_PERSISTENT) && (rbuffer->domains & RADEON_DOMAIN_VRAM || - rbuffer->flags & RADEON_FLAG_GTT_WC) && - r600_can_dma_copy_buffer(rctx, 0, box->x, box->width)) || + rbuffer->flags & RADEON_FLAG_GTT_WC)) || (rbuffer->flags & RADEON_FLAG_SPARSE)) { struct r600_resource *staging; diff --git a/src/gallium/drivers/radeon/r600_pipe_common.h b/src/gallium/drivers/radeon/r600_pipe_common.h index 1219a86d96c..adfcc7c8a70 100644 --- a/src/gallium/drivers/radeon/r600_pipe_common.h +++ b/src/gallium/drivers/radeon/r600_pipe_common.h @@ -391,8 +391,6 @@ struct r600_common_screen { enum chip_class chip_class; struct radeon_info info; uint64_t debug_flags; - bool has_cp_dma; - bool has_streamout; bool has_rbplus; /* if RB+ registers exist */ bool rbplus_allowed; /* if RB+ is allowed */ diff --git a/src/gallium/drivers/radeonsi/si_pipe.c b/src/gallium/drivers/radeonsi/si_pipe.c index 6c4420c1baf..b3d8ae508bd 100644 --- a/src/gallium/drivers/radeonsi/si_pipe.c +++ b/src/gallium/drivers/radeonsi/si_pipe.c @@ -1114,9 +1114,6 @@ struct pipe_screen *radeonsi_screen_create(struct radeon_winsys *ws, */ sscreen->llvm_has_working_vgpr_indexing = sscreen->b.chip_class <= VI; - sscreen->b.has_cp_dma = true; - sscreen->b.has_streamout = true; - /* Some chips have RB+ registers, but don't support RB+. Those must * always disable it. */ -- 2.30.2