<pre>
Hi, Angelo:

On Fri, 2023-08-04 at 09:28 +0200, AngeloGioacchino Del Regno wrote:
> Make the code more robust and improve readability by using bitfield
> macros instead of open coding bit operations.

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

>
> Signed-off-by: AngeloGioacchino Del Regno <
> angelogioacchino.delregno@collabora.com>
> ---
> drivers/gpu/drm/mediatek/mtk_disp_aal.c | 10 ++++++++--
> 1 file changed, 8 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/gpu/drm/mediatek/mtk_disp_aal.c
> b/drivers/gpu/drm/mediatek/mtk_disp_aal.c
> index e2e4155faf01..bec035780db0 100644
> --- a/drivers/gpu/drm/mediatek/mtk_disp_aal.c
> +++ b/drivers/gpu/drm/mediatek/mtk_disp_aal.c
> @@ -18,6 +18,8 @@
> #define DISP_AAL_EN0x0000
> #define AAL_ENBIT(0)
> #define DISP_AAL_SIZE0x0030
> +#define DISP_AAL_SIZE_HSIZEGENMASK(28, 16)
> +#define DISP_AAL_SIZE_VSIZEGENMASK(12, 0)
> #define DISP_AAL_OUTPUT_SIZE0x04d8
> #define DISP_AAL_LUT_SIZE512
>
> @@ -56,9 +58,13 @@ void mtk_aal_config(struct device *dev, unsigned
> int w,
> unsigned int bpc, struct cmdq_pkt *cmdq_pkt)
> {
> struct mtk_disp_aal *aal = dev_get_drvdata(dev);
> +u32 sz;
>
> -mtk_ddp_write(cmdq_pkt, w << 16 | h, &aal->cmdq_reg, aal->regs,
> DISP_AAL_SIZE);
> -mtk_ddp_write(cmdq_pkt, w << 16 | h, &aal->cmdq_reg, aal->regs,
> DISP_AAL_OUTPUT_SIZE);
> +sz = FIELD_PREP(DISP_AAL_SIZE_HSIZE, w);
> +sz |= FIELD_PREP(DISP_AAL_SIZE_VSIZE, h);
> +
> +mtk_ddp_write(cmdq_pkt, sz, &aal->cmdq_reg, aal->regs,
> DISP_AAL_SIZE);
> +mtk_ddp_write(cmdq_pkt, sz, &aal->cmdq_reg, aal->regs,
> DISP_AAL_OUTPUT_SIZE);
> }
>
> /**

</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><!--}-->