From d929366968638f80dcbc227d0d04ac4d6dd7f8f7 Mon Sep 17 00:00:00 2001 From: Algea Cao Date: Sat, 14 Jul 2018 16:22:43 +0800 Subject: [PATCH] drm/rockchip: rk3066_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: Iffe3164af1f1ad32002c26b5bbac14f2ff417c96 Signed-off-by: Algea Cao --- drivers/gpu/drm/rockchip/rk3066_hdmi.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/drivers/gpu/drm/rockchip/rk3066_hdmi.c b/drivers/gpu/drm/rockchip/rk3066_hdmi.c index c7ec75320065..7831430d8122 100644 --- a/drivers/gpu/drm/rockchip/rk3066_hdmi.c +++ b/drivers/gpu/drm/rockchip/rk3066_hdmi.c @@ -498,6 +498,7 @@ static int rk3066_hdmi_connector_get_modes(struct drm_connector *connector) struct edid *edid; const u8 def_modes[6] = {4, 16, 31, 19, 17, 2}; struct drm_display_mode *mode; + struct drm_display_info *info = &connector->display_info; int i, ret = 0; if (!hdmi->ddc) @@ -524,6 +525,11 @@ static int rk3066_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"); }