From b3b6b00ac8b7cda04ebbad71f256a57071714cf5 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Marek=20Ol=C5=A1=C3=A1k?= Date: Wed, 21 Feb 2018 23:07:05 +0100 Subject: [PATCH] radeonsi: assume has_virtual_memory == true --- .../drivers/radeon/r600_buffer_common.c | 28 ++++++------------- src/gallium/drivers/radeon/r600_pipe_common.c | 24 ++++++---------- 2 files changed, 18 insertions(+), 34 deletions(-) diff --git a/src/gallium/drivers/radeon/r600_buffer_common.c b/src/gallium/drivers/radeon/r600_buffer_common.c index 2106b9b3a5e..2b4b7bb7f4f 100644 --- a/src/gallium/drivers/radeon/r600_buffer_common.c +++ b/src/gallium/drivers/radeon/r600_buffer_common.c @@ -217,21 +217,16 @@ bool si_alloc_resource(struct si_screen *sscreen, * the others are using it. */ old_buf = res->buf; res->buf = new_buf; /* should be atomic */ + res->gpu_address = sscreen->ws->buffer_get_virtual_address(res->buf); - if (sscreen->info.has_virtual_memory) { - res->gpu_address = sscreen->ws->buffer_get_virtual_address(res->buf); + if (res->flags & RADEON_FLAG_32BIT) { + uint64_t start = res->gpu_address; + uint64_t last = start + res->bo_size - 1; + (void)start; + (void)last; - if (res->flags & RADEON_FLAG_32BIT) { - uint64_t start = res->gpu_address; - uint64_t last = start + res->bo_size - 1; - (void)start; - (void)last; - - assert((start >> 32) == sscreen->info.address32_hi); - assert((last >> 32) == sscreen->info.address32_hi); - } - } else { - res->gpu_address = 0; + assert((start >> 32) == sscreen->info.address32_hi); + assert((last >> 32) == sscreen->info.address32_hi); } pb_reference(&old_buf, NULL); @@ -685,12 +680,7 @@ si_buffer_from_user_memory(struct pipe_screen *screen, return NULL; } - if (sscreen->info.has_virtual_memory) - rbuffer->gpu_address = - ws->buffer_get_virtual_address(rbuffer->buf); - else - rbuffer->gpu_address = 0; - + rbuffer->gpu_address = ws->buffer_get_virtual_address(rbuffer->buf); rbuffer->vram_usage = 0; rbuffer->gart_usage = templ->width0; diff --git a/src/gallium/drivers/radeon/r600_pipe_common.c b/src/gallium/drivers/radeon/r600_pipe_common.c index d46cb646519..3496d6e8643 100644 --- a/src/gallium/drivers/radeon/r600_pipe_common.c +++ b/src/gallium/drivers/radeon/r600_pipe_common.c @@ -135,9 +135,6 @@ unsigned si_gfx_write_fence_dwords(struct si_screen *screen) screen->info.chip_class == VI) dwords *= 2; - if (!screen->info.has_virtual_memory) - dwords += 2; - return dwords; } @@ -222,18 +219,15 @@ void si_need_dma_space(struct r600_common_context *ctx, unsigned num_dw, RADEON_USAGE_WRITE))) r600_dma_emit_wait_idle(ctx); - /* If GPUVM is not supported, the CS checker needs 2 entries - * in the buffer list per packet, which has to be done manually. - */ - if (ctx->screen->info.has_virtual_memory) { - if (dst) - radeon_add_to_buffer_list(ctx, &ctx->dma, dst, - RADEON_USAGE_WRITE, - RADEON_PRIO_SDMA_BUFFER); - if (src) - radeon_add_to_buffer_list(ctx, &ctx->dma, src, - RADEON_USAGE_READ, - RADEON_PRIO_SDMA_BUFFER); + if (dst) { + radeon_add_to_buffer_list(ctx, &ctx->dma, dst, + RADEON_USAGE_WRITE, + RADEON_PRIO_SDMA_BUFFER); + } + if (src) { + radeon_add_to_buffer_list(ctx, &ctx->dma, src, + RADEON_USAGE_READ, + RADEON_PRIO_SDMA_BUFFER); } /* this function is called before all DMA calls, so increment this. */ -- 2.30.2