[PATCH 3/4] etnaviv: enable full overwrite in a few more cases

Philipp Zabel p.zabel at pengutronix.de
Thu Nov 15 15:22:55 UTC 2018


On Thu, 2018-11-15 at 15:37 +0100, Lucas Stach wrote:
> Take into account the render target format when checking if the color
> mask affects all channels of the RT. This allows to enable full
> override in a few cases where a non-alpha format is used.
> 
> Signed-off-by: Lucas Stach <l.stach at pengutronix.de>
> ---
>  src/gallium/drivers/etnaviv/etnaviv_blend.c | 7 +++++--
>  1 file changed, 5 insertions(+), 2 deletions(-)
> 
> diff --git a/src/gallium/drivers/etnaviv/etnaviv_blend.c b/src/gallium/drivers/etnaviv/etnaviv_blend.c
> index 1792fd0fdd67..2bf081c2e710 100644
> --- a/src/gallium/drivers/etnaviv/etnaviv_blend.c
> +++ b/src/gallium/drivers/etnaviv/etnaviv_blend.c
> @@ -114,6 +114,7 @@ etna_update_blend(struct etna_context *ctx)
>     struct pipe_blend_state *pblend = ctx->blend;
>     struct etna_blend_state *blend = etna_blend_state(pblend);
>     const struct pipe_rt_blend_state *rt0 = &pblend->rt[0];
> +   const struct util_format_description *desc;
>     uint32_t colormask;
>  
>     if (pfb->cbufs[0] &&
> @@ -131,8 +132,10 @@ etna_update_blend(struct etna_context *ctx)
>      * - The color mask is 1111
>      * - No blending is used
>      */
> -   bool full_overwrite = ((rt0->colormask == 0xf) && blend->fo_allowed) ||
> -                         !pfb->cbufs[0];
> +   if (pfb->cbufs[0])
> +      desc = util_format_description(pfb->cbufs[0]->format);
> +   bool full_overwrite = !pfb->cbufs[0] || ((blend->fo_allowed &&
> +                         util_format_colormask_full(desc, colormask)));

Is the comment above still accurate with this change?

regards
Philipp


More information about the etnaviv mailing list