drm: bridge: dw-hdmi: fix wrong color if get edid error at bootup

if get edid error at bootup the input bus format will be set as
rgb and hdmi is no reinit, so hdmi color will be wrong if set yuv
in uboot, now reinit hdmi in this case.

Change-Id: I8d117b6e241079ceab44793f6566adf91e9d84c6
Signed-off-by: Huicong Xu <xhc@rock-chips.com>
This commit is contained in:
Huicong Xu
2018-01-23 16:45:34 +08:00
committed by Tao Huang
parent 752d7732ad
commit d7f22ab4c1

View File

@@ -2598,6 +2598,9 @@ dw_hdmi_connector_atomic_flush(struct drm_connector *connector,
connector);
struct drm_display_mode *mode = NULL;
void *data = hdmi->plat_data->phy_data;
unsigned int in_bus_format = hdmi->hdmi_data.enc_in_bus_format;
unsigned int out_bus_format = hdmi->hdmi_data.enc_out_bus_format;
if (!hdmi->hpd_state || !conn_state->crtc)
return;
@@ -2629,7 +2632,11 @@ dw_hdmi_connector_atomic_flush(struct drm_connector *connector,
hdmi->hdmi_data.video_mode.previous_tmdsclock = mode->clock;
hdmi->mc_clkdis = hdmi_readb(hdmi, HDMI_MC_CLKDIS);
hdmi->phy.enabled = true;
return;
if (in_bus_format != hdmi->hdmi_data.enc_in_bus_format ||
out_bus_format != hdmi->hdmi_data.enc_out_bus_format)
hdmi->hdmi_data.update = true;
else
return;
}
if (hdmi->hdmi_data.update) {
@@ -3019,6 +3026,20 @@ static void dw_hdmi_attatch_properties(struct dw_hdmi *hdmi)
dev_err(hdmi->dev, "unexpected mapping: 0x%x\n",
video_mapping);
}
hdmi->hdmi_data.enc_in_bus_format = color;
hdmi->hdmi_data.enc_out_bus_format = color;
/*
* input format will be set as yuv444 when output
* format is yuv420
*/
if (color == MEDIA_BUS_FMT_UYVY10_1X20)
hdmi->hdmi_data.enc_in_bus_format =
MEDIA_BUS_FMT_YUV10_1X30;
else if (color == MEDIA_BUS_FMT_UYVY8_1X16)
hdmi->hdmi_data.enc_in_bus_format =
MEDIA_BUS_FMT_YUV8_1X24;
}
if (ops && ops->attatch_properties)