mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-06 02:50:49 +09:00
drm/bridge: synopsys: dw-hdmi: Record hdmi clk previous status
Compare the status before and after to determine whether to enable hdmi phy. Signed-off-by: Algea Cao <algea.cao@rock-chips.com> Change-Id: Ided938ab83d786d0003afad25a9a191d105d199e
This commit is contained in:
@@ -164,9 +164,11 @@ static const u16 csc_coeff_rgb_full_to_rgb_limited[3][4] = {
|
||||
struct hdmi_vmode {
|
||||
bool mdataenablepolarity;
|
||||
|
||||
unsigned int previous_pixelclock;
|
||||
unsigned int mpixelclock;
|
||||
unsigned int mpixelrepetitioninput;
|
||||
unsigned int mpixelrepetitionoutput;
|
||||
unsigned int previous_tmdsclock;
|
||||
unsigned int mtmdsclock;
|
||||
};
|
||||
|
||||
@@ -2068,7 +2070,7 @@ static void hdmi_av_composer(struct dw_hdmi *hdmi,
|
||||
int hblank, vblank, h_de_hs, v_de_vs, hsync_len, vsync_len;
|
||||
unsigned int vdisplay, hdisplay;
|
||||
|
||||
|
||||
vmode->previous_pixelclock = vmode->mpixelclock;
|
||||
vmode->mpixelclock = mode->crtc_clock * 1000;
|
||||
if (hdmi_bus_fmt_is_yuv420(hdmi->hdmi_data.enc_out_bus_format))
|
||||
vmode->mpixelclock /= 2;
|
||||
@@ -2095,6 +2097,7 @@ static void hdmi_av_composer(struct dw_hdmi *hdmi,
|
||||
vmode->mtmdsclock /= 2;
|
||||
|
||||
dev_dbg(hdmi->dev, "final tmdsclock = %d\n", vmode->mtmdsclock);
|
||||
vmode->previous_tmdsclock = vmode->mtmdsclock;
|
||||
|
||||
/* Set up HDMI_FC_INVIDCONF */
|
||||
inv_val = (hdmi->hdmi_data.hdcp_enable ||
|
||||
@@ -2423,12 +2426,18 @@ static int dw_hdmi_setup(struct dw_hdmi *hdmi,
|
||||
hdmi_av_composer(hdmi, &connector->display_info, mode);
|
||||
|
||||
/* HDMI Initializateion Step B.2 */
|
||||
ret = hdmi->phy.ops->init(hdmi, hdmi->phy.data,
|
||||
&connector->display_info,
|
||||
&hdmi->previous_mode);
|
||||
if (ret)
|
||||
return ret;
|
||||
hdmi->phy.enabled = true;
|
||||
if (!hdmi->phy.enabled ||
|
||||
hdmi->hdmi_data.video_mode.previous_pixelclock !=
|
||||
hdmi->hdmi_data.video_mode.mpixelclock ||
|
||||
hdmi->hdmi_data.video_mode.previous_tmdsclock !=
|
||||
hdmi->hdmi_data.video_mode.mtmdsclock) {
|
||||
ret = hdmi->phy.ops->init(hdmi, hdmi->phy.data,
|
||||
&connector->display_info,
|
||||
&hdmi->previous_mode);
|
||||
if (ret)
|
||||
return ret;
|
||||
hdmi->phy.enabled = true;
|
||||
}
|
||||
|
||||
/* HDMI Initialization Step B.3 */
|
||||
dw_hdmi_enable_video_path(hdmi);
|
||||
|
||||
Reference in New Issue
Block a user