From 21f5c6ea873bb767a14a9c1eb4e6907e8bd76d48 Mon Sep 17 00:00:00 2001 From: Alyssa Rosenzweig Date: Mon, 20 Jun 2022 11:04:58 -0400 Subject: [PATCH] r600g: Remove streamout-based buffer copy path MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit r600g is the only user of util_blitter_copy_buffer in tree, which implements buffer copies with streamout. This path for r600g was added in 8ac9801669c ("r600g: accelerate buffer copying"), a commit from 2012. At that point there was no DMA path for buffer copies. Since then, a DMA path has been added, conditional only on the kernel version -- not the hardware. It appears the required kernel support has been mainline for at least 4 years now. Mesa 22.2 doesn't need to provide optimal performance on an old kernel -- for performance, a DMA-capable kernel should be used, and for compatability, the CPU fallback (used for unaligned buffers as it is) is still available. Remove the streamout path "in the middle" that appears ~unused today. Signed-off-by: Alyssa Rosenzweig Acked-by: Marek Olšák Part-of: --- src/gallium/drivers/r600/r600_blit.c | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/src/gallium/drivers/r600/r600_blit.c b/src/gallium/drivers/r600/r600_blit.c index 257f7996..dc338d0 100644 --- a/src/gallium/drivers/r600/r600_blit.c +++ b/src/gallium/drivers/r600/r600_blit.c @@ -575,19 +575,10 @@ static void r600_copy_buffer(struct pipe_context *ctx, struct pipe_resource *dst { struct r600_context *rctx = (struct r600_context*)ctx; - if (rctx->screen->b.has_cp_dma) { + if (rctx->screen->b.has_cp_dma) r600_cp_dma_copy_buffer(rctx, dst, dstx, src, src_box->x, src_box->width); - } - else if (rctx->screen->b.has_streamout && - /* Require 4-byte alignment. */ - dstx % 4 == 0 && src_box->x % 4 == 0 && src_box->width % 4 == 0) { - - r600_blitter_begin(ctx, R600_COPY_BUFFER); - util_blitter_copy_buffer(rctx->blitter, dst, dstx, src, src_box->x, src_box->width); - r600_blitter_end(ctx); - } else { + else util_resource_copy_region(ctx, dst, 0, dstx, 0, 0, src, 0, src_box); - } } /** -- 2.7.4