From cbf68450f85f7bf18186cd8792948e0855c654d7 Mon Sep 17 00:00:00 2001 From: Chia-I Wu Date: Thu, 3 Nov 2022 16:17:33 -0700 Subject: [PATCH] freedreno/a6xx: set CHROMA_LINEAR This seems to have no effect on a618, but restores linear filtering on a635 when the texture is yuv. The blob sets it on a635 as well (but not on a618). Fixed android.media.cts.DecodeAccuracyTest#* on a635. Part-of: --- src/gallium/drivers/freedreno/a6xx/fd6_texture.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/gallium/drivers/freedreno/a6xx/fd6_texture.c b/src/gallium/drivers/freedreno/a6xx/fd6_texture.c index 647cf425cbb..14353bc0bad 100644 --- a/src/gallium/drivers/freedreno/a6xx/fd6_texture.c +++ b/src/gallium/drivers/freedreno/a6xx/fd6_texture.c @@ -294,6 +294,13 @@ fd6_sampler_state_create(struct pipe_context *pctx, if (needs_border) so->texsamp2 = A6XX_TEX_SAMP_2_BCOLOR(get_bcolor_offset(ctx, cso)); + /* We don't know if the format is going to be YUV. Setting CHROMA_LINEAR + * unconditionally seems fine. + */ + if (cso->mag_img_filter == PIPE_TEX_FILTER_LINEAR && + cso->min_img_filter == PIPE_TEX_FILTER_LINEAR) + so->texsamp2 |= A6XX_TEX_SAMP_2_CHROMA_LINEAR; + return so; }