Skip to content

Commit 98703e4

Browse files
larunbesuperna9999
authored andcommitted
drm: bridge: dw_hdmi: fix connector access for scdc
Commit 5d84409 ("drm/scdc-helper: Pimp SCDC debugs") changed the scdc interface to pick up an i2c adapter from a connector instead. However, in the case of dw-hdmi, the wrong connector was being used to pass i2c adapter information, since dw-hdmi's embedded connector structure is only populated when the bridge attachment callback explicitly asks for it. drm-meson is handling connector creation, so this won't happen, leading to a NULL pointer dereference. Fix it by having scdc functions access dw-hdmi's current connector pointer instead, which is assigned during the bridge enablement stage. Fixes: 5d84409 ("drm/scdc-helper: Pimp SCDC debugs") Signed-off-by: Adrián Larumbe <[email protected]> Reported-by: Lukas F. Hartmann <[email protected]> Acked-by: Neil Armstrong <[email protected]> [narmstrong: moved Fixes tag before first S-o-b and added Reported-by tag] Signed-off-by: Neil Armstrong <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
1 parent e30cb05 commit 98703e4

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

drivers/gpu/drm/bridge/synopsys/dw-hdmi.c

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1426,9 +1426,9 @@ void dw_hdmi_set_high_tmds_clock_ratio(struct dw_hdmi *hdmi,
14261426
/* Control for TMDS Bit Period/TMDS Clock-Period Ratio */
14271427
if (dw_hdmi_support_scdc(hdmi, display)) {
14281428
if (mtmdsclock > HDMI14_MAX_TMDSCLK)
1429-
drm_scdc_set_high_tmds_clock_ratio(&hdmi->connector, 1);
1429+
drm_scdc_set_high_tmds_clock_ratio(hdmi->curr_conn, 1);
14301430
else
1431-
drm_scdc_set_high_tmds_clock_ratio(&hdmi->connector, 0);
1431+
drm_scdc_set_high_tmds_clock_ratio(hdmi->curr_conn, 0);
14321432
}
14331433
}
14341434
EXPORT_SYMBOL_GPL(dw_hdmi_set_high_tmds_clock_ratio);
@@ -2116,7 +2116,7 @@ static void hdmi_av_composer(struct dw_hdmi *hdmi,
21162116
min_t(u8, bytes, SCDC_MIN_SOURCE_VERSION));
21172117

21182118
/* Enabled Scrambling in the Sink */
2119-
drm_scdc_set_scrambling(&hdmi->connector, 1);
2119+
drm_scdc_set_scrambling(hdmi->curr_conn, 1);
21202120

21212121
/*
21222122
* To activate the scrambler feature, you must ensure
@@ -2132,7 +2132,7 @@ static void hdmi_av_composer(struct dw_hdmi *hdmi,
21322132
hdmi_writeb(hdmi, 0, HDMI_FC_SCRAMBLER_CTRL);
21332133
hdmi_writeb(hdmi, (u8)~HDMI_MC_SWRSTZ_TMDSSWRST_REQ,
21342134
HDMI_MC_SWRSTZ);
2135-
drm_scdc_set_scrambling(&hdmi->connector, 0);
2135+
drm_scdc_set_scrambling(hdmi->curr_conn, 0);
21362136
}
21372137
}
21382138

@@ -3553,6 +3553,7 @@ struct dw_hdmi *dw_hdmi_probe(struct platform_device *pdev,
35533553
hdmi->bridge.ops = DRM_BRIDGE_OP_DETECT | DRM_BRIDGE_OP_EDID
35543554
| DRM_BRIDGE_OP_HPD;
35553555
hdmi->bridge.interlace_allowed = true;
3556+
hdmi->bridge.ddc = hdmi->ddc;
35563557
#ifdef CONFIG_OF
35573558
hdmi->bridge.of_node = pdev->dev.of_node;
35583559
#endif

0 commit comments

Comments
 (0)