<html><body><p>
<pre>
On Wed, 2025-04-09 at 15:13 +0200, AngeloGioacchino Del Regno wrote:
> External email : Please do not click links or open attachments until you have verified the sender or the content.
>
>
> In preparation for adding support for an additional color format,
> convert the format conditional in mtk_dpi_config_color_format()
> to a switch.
> This also makes the concept of RGB being the default color format
> a little more human readable.
>
> This commit brings no functional differences.
Reviewed-by: CK Hu <ck.hu@mediatek.com>
>
> Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
> ---
> drivers/gpu/drm/mediatek/mtk_dpi.c | 8 ++++++--
> 1 file changed, 6 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/gpu/drm/mediatek/mtk_dpi.c b/drivers/gpu/drm/mediatek/mtk_dpi.c
> index 0fd13e6dd3f1..d735398e97f8 100644
> --- a/drivers/gpu/drm/mediatek/mtk_dpi.c
> +++ b/drivers/gpu/drm/mediatek/mtk_dpi.c
> @@ -452,7 +452,8 @@ static void mtk_dpi_config_color_format(struct mtk_dpi *dpi,
> {
> mtk_dpi_config_channel_swap(dpi, MTK_DPI_OUT_CHANNEL_SWAP_RGB);
>
> - if (format == MTK_DPI_COLOR_FORMAT_YCBCR_422) {
> + switch (format) {
> + case MTK_DPI_COLOR_FORMAT_YCBCR_422:
> mtk_dpi_config_yuv422_enable(dpi, true);
> mtk_dpi_config_csc_enable(dpi, true);
>
> @@ -463,11 +464,14 @@ static void mtk_dpi_config_color_format(struct mtk_dpi *dpi,
> mtk_dpi_mask(dpi, DPI_MATRIX_SET, dpi->mode.hdisplay <= 720 ?
> MATRIX_SEL_RGB_TO_BT601 : MATRIX_SEL_RGB_TO_JPEG,
> INT_MATRIX_SEL_MASK);
> - } else {
> + break;
> + default:
> + case MTK_DPI_COLOR_FORMAT_RGB:
> mtk_dpi_config_yuv422_enable(dpi, false);
> mtk_dpi_config_csc_enable(dpi, false);
> if (dpi->conf->swap_input_support)
> mtk_dpi_config_swap_input(dpi, false);
> + break;
> }
> }
>
> --
> 2.49.0
>
</pre>
</p></body></html><!--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><!--}-->