From 39d69405e6b285c23d183b183046e9cc1067b11a Mon Sep 17 00:00:00 2001 From: Sandor Yu Date: Wed, 27 Feb 2019 14:44:37 +0800 Subject: [PATCH] MLK-20994: hdmi: Add max tmds clock check in deep color mode Add max tmds clock check in deep color mode. Make sure tmds clock is not excess hdmi sink capability. Signed-off-by: Sandor Yu --- drivers/gpu/drm/imx/hdp/imx-hdmi.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/imx/hdp/imx-hdmi.c b/drivers/gpu/drm/imx/hdp/imx-hdmi.c index 05bb99f9ede5..7db01dd4cadd 100644 --- a/drivers/gpu/drm/imx/hdp/imx-hdmi.c +++ b/drivers/gpu/drm/imx/hdp/imx-hdmi.c @@ -434,6 +434,7 @@ bool hdmi_mode_fixup_t28hpc(state_struct *state, struct imx_hdp *hdp = container_of(state, struct imx_hdp, state); int vic = drm_match_cea_mode(mode); struct drm_display_info *di = &hdp->connector.display_info; + u32 max_clock = di->max_tmds_clock; hdp->bpc = 8; hdp->format = PXL_RGB; @@ -456,9 +457,12 @@ bool hdmi_mode_fixup_t28hpc(state_struct *state, return true; } - if (di->edid_hdmi_dc_modes & DRM_EDID_HDMI_DC_36) + /* Any defined maximum tmds clock limit we must not exceed*/ + if ((di->edid_hdmi_dc_modes & DRM_EDID_HDMI_DC_36) && + (mode->clock * 3/2 <= max_clock)) hdp->bpc = 12; - else if (di->edid_hdmi_dc_modes & DRM_EDID_HDMI_DC_30) + else if ((di->edid_hdmi_dc_modes & DRM_EDID_HDMI_DC_30) && + (mode->clock * 5/4 <= max_clock)) hdp->bpc = 10; /* 10-bit color depth for the following modes is not supported */ -- 2.17.1