radeonsi: Use dma_copy when possible for si_blit.
authorAxel Davy <axel.davy@ens.fr>
Wed, 28 May 2014 00:04:08 +0000 (20:04 -0400)
committerDave Airlie <airlied@gmail.com>
Tue, 1 Jul 2014 03:10:01 +0000 (13:10 +1000)
This improves GLX DRI3 GPU offloading significantly on CPU
bound benchmarks particularly.
No performance impact for DRI2 GPU offloading.

v2: Add missing tests

Signed-off-by: Axel Davy <axel.davy@ens.fr>
Reviewed-by: Marek Olšák<marek.olsak@amd.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
src/gallium/drivers/radeonsi/si_blit.c

index 8c3e136..6162dfa 100644 (file)
@@ -730,6 +730,25 @@ static void si_blit(struct pipe_context *ctx,
                return;
        }
 
+       if (info->src.box.width ==  info->dst.box.width &&
+           info->src.box.height ==  info->dst.box.height &&
+           info->src.format == info->dst.format &&
+           info->src.box.width > 0 &&
+           info->src.box.height > 0 &&
+           info->src.resource->nr_samples <= 1 &&
+           info->dst.resource->nr_samples <= 1 &&
+           info->src.box.depth == info->dst.box.depth &&
+           info->mask == PIPE_MASK_RGBA &&
+           !info->scissor_enable &&
+           (!info->render_condition_enable ||
+            !sctx->b.current_render_cond)) {
+               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