Commit 41ca9caa authored by Neil Armstrong's avatar Neil Armstrong Committed by Chun-Kuang Hu
Browse files

drm/mediatek: hdmi: Add check for CEA modes only



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: default avatarFabien Parent <fparent@baylibre.com>
Signed-off-by: default avatarNeil Armstrong <narmstrong@baylibre.com>
Signed-off-by: default avatarChun-Kuang Hu <chunkuang.hu@kernel.org>
parent 15870b97
Loading
Loading
Loading
Loading
+4 −0
Original line number Original line Diff line number Diff line
@@ -148,6 +148,7 @@ struct hdmi_audio_param {


struct mtk_hdmi_conf {
struct mtk_hdmi_conf {
	bool tz_disabled;
	bool tz_disabled;
	bool cea_modes_only;
};
};


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


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

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