Skip to content

Commit 9bc78d6

Browse files
Laurent Pinchartsravnborg
authored andcommitted
drm: meson: dw-hdmi: Use dw_hdmi context to replace hack
The meson-dw-hdmi driver needs to access its own context from the .mode_valid() operation. It currently gets it from the dev_private field of the drm_device retrieved from the connector, which is a hack. Use the private data passed to the .mode_valid() operation instead. Signed-off-by: Laurent Pinchart <[email protected]> Reviewed-by: Neil Armstrong <[email protected]> Signed-off-by: Sam Ravnborg <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/20200526011505.31884-15-laurent.pinchart+renesas@ideasonboard.com
1 parent 29fc897 commit 9bc78d6

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

drivers/gpu/drm/meson/meson_dw_hdmi.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -634,7 +634,8 @@ dw_hdmi_mode_valid(struct dw_hdmi *hdmi, void *data,
634634
struct drm_connector *connector,
635635
const struct drm_display_mode *mode)
636636
{
637-
struct meson_drm *priv = connector->dev->dev_private;
637+
struct meson_dw_hdmi *dw_hdmi = data;
638+
struct meson_drm *priv = dw_hdmi->priv;
638639
bool is_hdmi2_sink = connector->display_info.hdmi.scdc.supported;
639640
unsigned int phy_freq;
640641
unsigned int vclk_freq;
@@ -693,7 +694,7 @@ dw_hdmi_mode_valid(struct dw_hdmi *hdmi, void *data,
693694
if (mode->flags & DRM_MODE_FLAG_DBLCLK)
694695
venc_freq /= 2;
695696

696-
dev_dbg(connector->dev->dev, "%s: vclk:%d phy=%d venc=%d hdmi=%d\n",
697+
dev_dbg(dw_hdmi->dev, "%s: vclk:%d phy=%d venc=%d hdmi=%d\n",
697698
__func__, phy_freq, vclk_freq, venc_freq, hdmi_freq);
698699

699700
return meson_vclk_vic_supported_freq(priv, phy_freq, vclk_freq);
@@ -1068,6 +1069,7 @@ static int meson_dw_hdmi_bind(struct device *dev, struct device *master,
10681069

10691070
/* Bridge / Connector */
10701071

1072+
dw_plat_data->priv_data = meson_dw_hdmi;
10711073
dw_plat_data->mode_valid = dw_hdmi_mode_valid;
10721074
dw_plat_data->phy_ops = &meson_dw_hdmi_phy_ops;
10731075
dw_plat_data->phy_name = "meson_dw_hdmi_phy";

0 commit comments

Comments
 (0)