diff options
author | Neil Armstrong <narmstrong@baylibre.com> | 2021-04-19 10:32:43 +0300 |
---|---|---|
committer | Chun-Kuang Hu <chunkuang.hu@kernel.org> | 2021-05-13 02:52:32 +0300 |
commit | c91026a938c261c2241c391a12b7f99647cb8a06 (patch) | |
tree | cbb32eef537e1403e43c273dbdae11ed2f5b6d78 /drivers/gpu/drm/mediatek | |
parent | 41ca9caaae0bfc959b22dbcd59d88a7107707e17 (diff) | |
download | linux-c91026a938c261c2241c391a12b7f99647cb8a06.tar.xz |
drm/mediatek: hdmi: Add optional limit on maximal HDMI mode clock
Some SoCs like the MT8167 have a hard limit on the maximal
supported HDMI TMDS clock, so add a configuration value to
filter out those modes.
Signed-off-by: Fabien Parent <fparent@baylibre.com>
Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
Signed-off-by: Chun-Kuang Hu <chunkuang.hu@kernel.org>
Diffstat (limited to 'drivers/gpu/drm/mediatek')
-rw-r--r-- | drivers/gpu/drm/mediatek/mtk_hdmi.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/gpu/drm/mediatek/mtk_hdmi.c b/drivers/gpu/drm/mediatek/mtk_hdmi.c index 0539262e69d3..bc50d97f2553 100644 --- a/drivers/gpu/drm/mediatek/mtk_hdmi.c +++ b/drivers/gpu/drm/mediatek/mtk_hdmi.c @@ -149,6 +149,7 @@ struct hdmi_audio_param { struct mtk_hdmi_conf { bool tz_disabled; bool cea_modes_only; + unsigned long max_mode_clock; }; struct mtk_hdmi { @@ -1226,6 +1227,10 @@ static int mtk_hdmi_bridge_mode_valid(struct drm_bridge *bridge, if (hdmi->conf->cea_modes_only && !drm_match_cea_mode(mode)) return MODE_BAD; + if (hdmi->conf->max_mode_clock && + mode->clock > hdmi->conf->max_mode_clock) + return MODE_CLOCK_HIGH; + if (mode->clock < 27000) return MODE_CLOCK_LOW; if (mode->clock > 297000) |