From aa3e5d4088047e98636ce68ed887b986f52dde04 Mon Sep 17 00:00:00 2001 From: Algea Cao Date: Sat, 14 Jul 2018 15:02:54 +0800 Subject: [PATCH] drm/bridge: synopsys: dw-hdmi: Clear color depth mask and format if get edid failed If edid can't be got when hdmi plug in, hdmi color depth mask and format won't be updated. The color list in the setting are those of the previous TV. This commit fix the error. Change-Id: I5ed4be5efa2a69be0b58489f58a3af5de9912292 Signed-off-by: Algea Cao --- drivers/gpu/drm/bridge/synopsys/dw-hdmi.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c b/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c index 54de21bae71d..d57d999c50a5 100644 --- a/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c +++ b/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c @@ -2498,6 +2498,7 @@ static int dw_hdmi_connector_get_modes(struct drm_connector *connector) struct edid *edid; struct drm_display_mode *mode; const u8 def_modes[6] = {4, 16, 31, 19, 17, 2}; + struct drm_display_info *info = &connector->display_info; struct hdr_static_metadata *metedata = &connector->display_info.hdmi.hdr_panel_metadata; int i, ret = 0; @@ -2533,6 +2534,10 @@ static int dw_hdmi_connector_get_modes(struct drm_connector *connector) ret++; } } + info->edid_hdmi_dc_modes = 0; + info->hdmi.y420_dc_modes = 0; + info->color_formats = 0; + dev_info(hdmi->dev, "failed to get edid\n"); }