[Mesa-dev] [PATCH 11/11] Radeonsi: Use dma_copy when possible for si_blit.

Axel Davy axel.davy at ens.fr
Tue May 27 17:55:16 PDT 2014


This improves GLX DRI3 Gpu offloading significantly on cpu
bound benchmarks particularly.
No performance impact for DRI2 Gpu offloading.

Signed-off-by: Axel Davy <axel.davy at ens.fr>
---
 src/gallium/drivers/radeonsi/si_blit.c | 15 +++++++++++++++
 1 file changed, 15 insertions(+)

diff --git a/src/gallium/drivers/radeonsi/si_blit.c b/src/gallium/drivers/radeonsi/si_blit.c
index 6bc89ab..0e327b5 100644
--- a/src/gallium/drivers/radeonsi/si_blit.c
+++ b/src/gallium/drivers/radeonsi/si_blit.c
@@ -712,6 +712,21 @@ static void si_blit(struct pipe_context *ctx,
 		return;
 	}
 
+	if (info->src.box.width ==  info->dst.box.width &&
+	    info->src.format == info->dst.format &&
+	    info->src.box.width >=0 &&
+	    info->src.resource->nr_samples == 0 &&
+	    info->dst.resource->nr_samples == 0 &&
+	    info->src.box.depth == 1 &&
+	    info->dst.box.depth == 1 &&
+	    info->mask == PIPE_MASK_RGBA) {
+		sctx->b.dma_copy(ctx, info->dst.resource, info->dst.level,
+				 info->dst.box.x, info->dst.box.y,
+				 info->dst.box.z, info->src.resource,
+				 info->src.level, &(info->src.box));
+		return;
+	}
+
 	assert(util_blitter_is_blit_supported(sctx->blitter, info));
 
 	/* The driver doesn't decompress resources automatically while
-- 
1.9.1



More information about the mesa-dev mailing list