drm/mediatek: dsi: Use mipi_dsi_pixel_format_to_bpp() helper function
authorAngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Thu, 15 Feb 2024 08:53:16 +0000 (09:53 +0100)
committerChun-Kuang Hu <chunkuang.hu@kernel.org>
Mon, 19 Feb 2024 14:49:51 +0000 (14:49 +0000)
commite14cba94bc19ff78545d87a6f85b871cf012df3f
tree52f76f85d3308fe658ff94e3b36131a78a97dda0
parent2aa9514adf4faa07019d2de1ca042954cdd70b42
drm/mediatek: dsi: Use mipi_dsi_pixel_format_to_bpp() helper function

Instead of open coding, use the mipi_dsi_pixel_format_to_bpp() helper
function from drm_mipi_dsi.h in mtk_dsi_poweron() and for validation
in mtk_dsi_bridge_mode_valid().

Note that this function changes the behavior of this driver: previously,
in case of unknown formats, it would (wrongly) assume that it should
account for a 24-bits format - now it will return an error and refuse
to set clocks and/or enable the DSI.

This is done because setting the wrong data rate will only produce a
garbage output that the display will misinterpret both because this
driver doesn't actually provide any extra-spec format support and/or
because the data rate (hence, the HS clock) will be wrong.

Reviewed-by: Alexandre Mergnat <amergnat@baylibre.com>
Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Reviewed-by: CK Hu <ck.hu@mediatek.com>
Link: https://patchwork.kernel.org/project/dri-devel/patch/20240215085316.56835-10-angelogioacchino.delregno@collabora.com/
Signed-off-by: Chun-Kuang Hu <chunkuang.hu@kernel.org>
drivers/gpu/drm/mediatek/mtk_dsi.c