[Mesa-dev] [PATCH 4/6] etnaviv: don't read back resource if transfer discards contents

Wladimir J. van der Laan laanwj at gmail.com
Tue Jun 6 11:38:39 UTC 2017


On Fri, May 19, 2017 at 11:41:10AM +0200, Lucas Stach wrote:
> Reduces bandwidth usage of transfers which discard the buffer contents,
> as well as skipping unnecessary command stream flushes and CPU/GPU
> synchronization.

Looks obviously correct. The contents of the temporary resource
don't matter if DISCARD_WHOLE_RESOURCE.

Reviewed-By: Wladimir J. van der Laan

> Signed-off-by: Lucas Stach <l.stach at pengutronix.de>
> ---
>  src/gallium/drivers/etnaviv/etnaviv_transfer.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/src/gallium/drivers/etnaviv/etnaviv_transfer.c b/src/gallium/drivers/etnaviv/etnaviv_transfer.c
> index a2cd4e6234dd..f7871f485371 100644
> --- a/src/gallium/drivers/etnaviv/etnaviv_transfer.c
> +++ b/src/gallium/drivers/etnaviv/etnaviv_transfer.c
> @@ -188,7 +188,9 @@ etna_transfer_map(struct pipe_context *pctx, struct pipe_resource *prsc,
>           return NULL;
>        }
>  
> -      etna_copy_resource(pctx, trans->rsc, prsc, level, trans->rsc->last_level);
> +      if (!(usage & PIPE_TRANSFER_DISCARD_WHOLE_RESOURCE))
> +         etna_copy_resource(pctx, trans->rsc, prsc, level,
> +                            trans->rsc->last_level);
>  
>        /* Switch to using the temporary resource instead */
>        rsc = etna_resource(trans->rsc);
> -- 
> 2.11.0
> 
> _______________________________________________
> etnaviv mailing list
> etnaviv at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/etnaviv


More information about the mesa-dev mailing list