Skip to content

Commit 618dfbe

Browse files
AngeloGioacchino Del RegnoChun-Kuang Hu
authored andcommitted
drm/mediatek: mtk_dpi: Use switch in mtk_dpi_config_color_format()
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. Signed-off-by: AngeloGioacchino Del Regno <[email protected]> Reviewed-by: CK Hu <[email protected]> Link: https://patchwork.kernel.org/project/dri-devel/patch/[email protected]/ Signed-off-by: Chun-Kuang Hu <[email protected]>
1 parent 26c691a commit 618dfbe

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

drivers/gpu/drm/mediatek/mtk_dpi.c

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -452,7 +452,8 @@ static void mtk_dpi_config_color_format(struct mtk_dpi *dpi,
452452
{
453453
mtk_dpi_config_channel_swap(dpi, MTK_DPI_OUT_CHANNEL_SWAP_RGB);
454454

455-
if (format == MTK_DPI_COLOR_FORMAT_YCBCR_422) {
455+
switch (format) {
456+
case MTK_DPI_COLOR_FORMAT_YCBCR_422:
456457
mtk_dpi_config_yuv422_enable(dpi, true);
457458
mtk_dpi_config_csc_enable(dpi, true);
458459

@@ -463,11 +464,14 @@ static void mtk_dpi_config_color_format(struct mtk_dpi *dpi,
463464
mtk_dpi_mask(dpi, DPI_MATRIX_SET, dpi->mode.hdisplay <= 720 ?
464465
MATRIX_SEL_RGB_TO_BT601 : MATRIX_SEL_RGB_TO_JPEG,
465466
INT_MATRIX_SEL_MASK);
466-
} else {
467+
break;
468+
default:
469+
case MTK_DPI_COLOR_FORMAT_RGB:
467470
mtk_dpi_config_yuv422_enable(dpi, false);
468471
mtk_dpi_config_csc_enable(dpi, false);
469472
if (dpi->conf->swap_input_support)
470473
mtk_dpi_config_swap_input(dpi, false);
474+
break;
471475
}
472476
}
473477

0 commit comments

Comments
 (0)