mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-09 04:10:18 +09:00
drm: rockchip: dw-hdmi: Don't clean output_if when mode set
If hdmi mode is changed but not plug out, encoder disabled is after encoder atomic check, hdmi output_if won't be set when crtc atomic enable, sync polarity won't be set correctly. Signed-off-by: Algea Cao <algea.cao@rock-chips.com> Change-Id: I2e3244c4f8f9f9fd565170d50f39710749085b98
This commit is contained in:
@@ -115,6 +115,7 @@ struct rockchip_hdmi {
|
||||
int max_tmdsclk;
|
||||
bool unsupported_yuv_input;
|
||||
bool unsupported_deep_color;
|
||||
bool mode_changed;
|
||||
|
||||
unsigned long bus_format;
|
||||
unsigned long output_bus_format;
|
||||
@@ -557,7 +558,8 @@ static void dw_hdmi_rockchip_encoder_disable(struct drm_encoder *encoder)
|
||||
struct drm_crtc *crtc = encoder->crtc;
|
||||
struct rockchip_crtc_state *s = to_rockchip_crtc_state(crtc->state);
|
||||
|
||||
s->output_if &= ~VOP_OUTPUT_IF_HDMI0;
|
||||
if (!hdmi->mode_changed)
|
||||
s->output_if &= ~VOP_OUTPUT_IF_HDMI0;
|
||||
/*
|
||||
* when plug out hdmi it will be switch cvbs and then phy bus width
|
||||
* must be set as 8
|
||||
@@ -577,6 +579,8 @@ static void dw_hdmi_rockchip_encoder_enable(struct drm_encoder *encoder)
|
||||
if (WARN_ON(!crtc || !crtc->state))
|
||||
return;
|
||||
|
||||
hdmi->mode_changed = false;
|
||||
|
||||
if (hdmi->phy)
|
||||
phy_set_bus_width(hdmi->phy, hdmi->phy_bus_width);
|
||||
|
||||
@@ -856,6 +860,9 @@ dw_hdmi_rockchip_encoder_atomic_check(struct drm_encoder *encoder,
|
||||
s->bus_format = bus_format;
|
||||
hdmi->bus_format = s->bus_format;
|
||||
|
||||
if (crtc_state->mode_changed == true)
|
||||
hdmi->mode_changed = true;
|
||||
|
||||
if (hdmi->enc_out_encoding == V4L2_YCBCR_ENC_BT2020)
|
||||
s->color_space = V4L2_COLORSPACE_BT2020;
|
||||
else if (colorformat == DRM_HDMI_OUTPUT_DEFAULT_RGB)
|
||||
|
||||
Reference in New Issue
Block a user