Skip to content

Commit

Permalink
drm/mediatek: hdmi: Add check for CEA modes only
Browse files Browse the repository at this point in the history
Some SoCs like the MT8167 are not validated and supported for
HDMI modes out of HDMI CEA modes, so add a configuration boolean
to filter out non-CEA 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>
  • Loading branch information
superna9999 authored and Chun-Kuang Hu committed May 12, 2021
1 parent 15870b9 commit 41ca9ca
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions drivers/gpu/drm/mediatek/mtk_hdmi.c
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,7 @@ struct hdmi_audio_param {

struct mtk_hdmi_conf {
bool tz_disabled;
bool cea_modes_only;
};

struct mtk_hdmi {
Expand Down Expand Up @@ -1222,6 +1223,9 @@ static int mtk_hdmi_bridge_mode_valid(struct drm_bridge *bridge,
return MODE_BAD;
}

if (hdmi->conf->cea_modes_only && !drm_match_cea_mode(mode))
return MODE_BAD;

if (mode->clock < 27000)
return MODE_CLOCK_LOW;
if (mode->clock > 297000)
Expand Down

0 comments on commit 41ca9ca

Please sign in to comment.