Mesa (main): r600g: Remove streamout-based buffer copy path

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Thu Jun 23 22:46:27 UTC 2022


Module: Mesa
Branch: main
Commit: 21f5c6ea873bb767a14a9c1eb4e6907e8bd76d48
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=21f5c6ea873bb767a14a9c1eb4e6907e8bd76d48

Author: Alyssa Rosenzweig <alyssa at collabora.com>
Date:   Mon Jun 20 11:04:58 2022 -0400

r600g: Remove streamout-based buffer copy path

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 <alyssa at collabora.com>
Acked-by: Marek Olšák <marek.olsak at amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17142>

---

 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 257f79963b9..dc338d0740f 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);
-	}
 }
 
 /**



More information about the mesa-commit mailing list