Hi Axel,

Could you please describe what "GPU offloading" means?

Some checks can be modified to:

info->src.box.width > 0 &&
info->src.box.height > 0 &&
... resource->nr_samples <= 1

You don't have to check if the box depth equals 1. You just need to
make sure the box depths are equal to each other, like widths and
heights.

Marek

On Thu, May 29, 2014 at 5:22 AM, Axel Davy <axel.d...@ens.fr> wrote:
> 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.d...@ens.fr>
> ---
>  src/gallium/drivers/radeonsi/si_blit.c | 20 ++++++++++++++++++++
>  1 file changed, 20 insertions(+)
>
> diff --git a/src/gallium/drivers/radeonsi/si_blit.c 
> b/src/gallium/drivers/radeonsi/si_blit.c
> index 6bc89ab..c885a6d 100644
> --- a/src/gallium/drivers/radeonsi/si_blit.c
> +++ b/src/gallium/drivers/radeonsi/si_blit.c
> @@ -712,6 +712,26 @@ 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 == 0 &&
> +           info->dst.resource->nr_samples == 0 &&
> +           info->src.box.depth == 1 &&
> +           info->dst.box.depth == 1 &&
> +           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
> --
> 1.9.1
>
> _______________________________________________
> mesa-dev mailing list
> mesa-dev@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/mesa-dev
_______________________________________________
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev

Reply via email to