[PATCH v16 3/8] drm/mediatek: Add DRM Driver for Mediatek SoC MT8173.

Philipp Zabel p.zabel at pengutronix.de
Fri May 6 07:40:00 PDT 2016


Hi Daniel,

Am Freitag, den 06.05.2016, 15:16 +0200 schrieb Daniel Vetter:
> On Fri, May 06, 2016 at 03:05:49PM +0200, Philipp Zabel wrote:
> > From: CK Hu <ck.hu at mediatek.com>
> > 
> > This patch adds an initial DRM driver for the Mediatek MT8173 DISP
> > subsystem. It currently supports two fixed output streams from the
> > OVL0/OVL1 sources to the DSI0/DPI0 sinks, respectively.
> > 
> > Signed-off-by: CK Hu <ck.hu at mediatek.com>
> > Signed-off-by: YT Shen <yt.shen at mediatek.com>
> > Signed-off-by: Daniel Kurtz <djkurtz at chromium.org>
> > Signed-off-by: Bibby Hsieh <bibby.hsieh at mediatek.com>
> > Signed-off-by: Mao Huang <littlecvr at chromium.org>
> > Signed-off-by: Philipp Zabel <p.zabel at pengutronix.de>
> 
> Spotted two tiny things below.
[...]
> > +static int mtk_drm_bind(struct device *dev)
> > +{
> > +	struct mtk_drm_private *private = dev_get_drvdata(dev);
> > +	struct drm_device *drm;
> > +	int ret;
> > +
> > +	drm = drm_dev_alloc(&mtk_drm_driver, dev);
> > +	if (!drm)
> > +		return -ENOMEM;
> > +
> > +	drm_dev_set_unique(drm, dev_name(dev));
> > +
> > +	ret = drm_dev_register(drm, 0);
> > +	if (ret < 0)
> > +		goto err_free;
> > +
> > +	drm->dev_private = private;
> > +	private->drm = drm;
> > +
> > +	ret = mtk_drm_kms_init(drm);
> > +	if (ret < 0)
> > +		goto err_unregister;
> 
> Wrong way round, drm_dev_register should be last. And you're missing
> drm_connector_register_all here.
> -Daniel

Thanks, that also means the mtk_dsi and mtk_hdmi drivers must not call
drm_connector_(un)register anymore.
What about the connectors registered by external bridge drivers? Should
those check for (dev->driver->load) before calling
drm_connector_unregister?

regards
Philipp




More information about the Linux-mediatek mailing list