Skip to content

Commit 572c465

Browse files
Zheng Yangjayxurockchip
authored andcommitted
drm: rockchip: hdmi: check sink max_tmds_clock in mode_valid
If sink max TMDS clock < 340MHz, we think the mode pixel clock greater than 340MHz should support YCbCr420, or it is a bad mode. Change-Id: I9f53fa4f9875977ae0355b65d9ccd8a304558c5d Signed-off-by: Zheng Yang <zhengyang@rock-chips.com>
1 parent e68ba0f commit 572c465

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

drivers/gpu/drm/rockchip/dw_hdmi-rockchip.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -888,6 +888,14 @@ dw_hdmi_rockchip_mode_valid(struct drm_connector *connector,
888888
*/
889889
if (mode->clock > INT_MAX / 1000)
890890
return MODE_BAD;
891+
/*
892+
* If sink max TMDS clock < 340MHz, we should check the mode pixel
893+
* clock > 340MHz is YCbCr420 or not.
894+
*/
895+
if (mode->clock > 340000 &&
896+
connector->display_info.max_tmds_clock < 340000 &&
897+
!(mode->flags & DRM_MODE_FLAG_420_MASK))
898+
return MODE_BAD;
891899

892900
if (!encoder) {
893901
const struct drm_connector_helper_funcs *funcs;

0 commit comments

Comments
 (0)