drm/rockchip: dw_hdmi: Fix crash caused by hotplug in uboot

Signed-off-by: Algea Cao <algea.cao@rock-chips.com>
Change-Id: Id22025a2b464e68ac3683587eb808975439096df
This commit is contained in:
Algea Cao
2023-07-28 14:45:36 +08:00
parent bf9c5670ae
commit 6926979cb0

View File

@@ -1666,10 +1666,14 @@ static void dw_hdmi_rockchip_encoder_disable(struct drm_encoder *encoder)
{
struct rockchip_hdmi *hdmi = to_rockchip_hdmi(encoder);
struct drm_crtc *crtc = encoder->crtc;
struct rockchip_crtc_state *s = to_rockchip_crtc_state(crtc->state);
struct rockchip_crtc_state *s;
if (WARN_ON(!crtc || !crtc->state))
if (!crtc || !crtc->state) {
dev_info(hdmi->dev, "%s old crtc state is null\n", __func__);
return;
}
s = to_rockchip_crtc_state(crtc->state);
if (crtc->state->active_changed) {
if (hdmi->plat_data->split_mode) {
@@ -1697,8 +1701,10 @@ static void dw_hdmi_rockchip_encoder_enable(struct drm_encoder *encoder)
int mux;
int ret;
if (WARN_ON(!crtc || !crtc->state))
if (!crtc || !crtc->state) {
dev_info(hdmi->dev, "%s old crtc state is null\n", __func__);
return;
}
if (hdmi->phy)
phy_set_bus_width(hdmi->phy, hdmi->phy_bus_width);