<pre>
Hi, Angelo:

On Fri, 2023-08-04 at 09:28 +0200, AngeloGioacchino Del Regno wrote:
> Disable relay mode at the end of LUT programming to make sure that
> the
> processed image goes through in both DISP_GAMMA and DISP_AAL for
> gamma
> setting.
>
> Signed-off-by: AngeloGioacchino Del Regno <
> angelogioacchino.delregno@collabora.com>
> Reviewed-by: Jason-JH.Lin <jason-jh.lin@mediatek.com>
> Reviewed-by: Alexandre Mergnat <amergnat@baylibre.com>
> ---
> drivers/gpu/drm/mediatek/mtk_disp_aal.c | 3 +++
> drivers/gpu/drm/mediatek/mtk_disp_gamma.c | 4 ++++
> 2 files changed, 7 insertions(+)
>
> diff --git a/drivers/gpu/drm/mediatek/mtk_disp_aal.c
> b/drivers/gpu/drm/mediatek/mtk_disp_aal.c
> index 21b25470e9b7..992dc1424c91 100644
> --- a/drivers/gpu/drm/mediatek/mtk_disp_aal.c
> +++ b/drivers/gpu/drm/mediatek/mtk_disp_aal.c
> @@ -122,6 +122,9 @@ void mtk_aal_gamma_set(struct device *dev, struct
> drm_crtc_state *state)
> writel(word, (aal->regs + DISP_AAL_GAMMA_LUT) + (i *
> 4));
> }
>
> +/* Disable RELAY mode to pass the processed image */
> +cfg_val &= ~AAL_RELAY_MODE;

It seems that the relay mode is default turned off. But explicitly
setting it is good to me. After adding AAL_RELAY_MODE definition in
this patch,

Reviewed-by: CK Hu <ck.hu@mediatek.com>

> +
> writel(cfg_val, aal->regs + DISP_AAL_CFG);
> }
>
> diff --git a/drivers/gpu/drm/mediatek/mtk_disp_gamma.c
> b/drivers/gpu/drm/mediatek/mtk_disp_gamma.c
> index 7d2f8042ace0..fbff9f97b737 100644
> --- a/drivers/gpu/drm/mediatek/mtk_disp_gamma.c
> +++ b/drivers/gpu/drm/mediatek/mtk_disp_gamma.c
> @@ -19,6 +19,7 @@
> #define DISP_GAMMA_EN0x0000
> #define GAMMA_ENBIT(0)
> #define DISP_GAMMA_CFG0x0020
> +#define GAMMA_RELAY_MODEBIT(0)
> #define GAMMA_LUT_ENBIT(1)
> #define GAMMA_DITHERINGBIT(2)
> #define DISP_GAMMA_SIZE0x0030
> @@ -177,6 +178,9 @@ void mtk_gamma_set(struct device *dev, struct
> drm_crtc_state *state)
> /* Enable the gamma table */
> cfg_val |= FIELD_PREP(GAMMA_LUT_EN, 1);
>
> +/* Disable RELAY mode to pass the processed image */
> +cfg_val &= ~GAMMA_RELAY_MODE;
> +
> writel(cfg_val, gamma->regs + DISP_GAMMA_CFG);
> }
>

</pre><!--type:text--><!--{--><pre>************* MEDIATEK Confidentiality Notice
 ********************
The information contained in this e-mail message (including any 
attachments) may be confidential, proprietary, privileged, or otherwise
exempt from disclosure under applicable laws. It is intended to be 
conveyed only to the designated recipient(s). Any use, dissemination, 
distribution, printing, retaining or copying of this e-mail (including its 
attachments) by unintended recipient(s) is strictly prohibited and may 
be unlawful. If you are not an intended recipient of this e-mail, or believe
 
that you have received this e-mail in error, please notify the sender 
immediately (by replying to this e-mail), delete any and all copies of 
this e-mail (including any attachments) from your system, and do not
disclose the content of this e-mail to any other person. Thank you!
</pre><!--}-->