Re: [PATCH RFC v3 2/6] drm/sprd: add Unisoc's drm kms master

Sam Ravnborg
2020-02-22T21:27:51Z

Hi Kevin/tang.

Thanks for the quick and detailed feedback.
Your questions are addressed below.

Sam

> > > +static int sprd_drm_bind(struct device *dev)
> > > +{
> > > + struct drm_device *drm;
> > > + struct sprd_drm *sprd;
> > > + int err;
> > > +
> > > + drm = drm_dev_alloc(&sprd_drm_drv, dev);
> > > + if (IS_ERR(drm))
> > > + return PTR_ERR(drm);
> > You should embed drm_device in struct sprd_drm.
> > See example code in drm/drm_drv.c
> >
> > This is what modern drm drivers do.
> >
> > I *think* you can drop the component framework if you do this.
> >
> I have read it(drm/drm_drv.c) carefully, if drop the component framework,
> the whole our drm driver maybe need to redesign, so i still want to keep
> current design.
OK, fine.

> > > + sprd_drm_mode_config_init(drm);
> > > +
> > > + /* bind and init sub drivers */
> > > + err = component_bind_all(drm->dev, drm);
> > > + if (err) {
> > > + DRM_ERROR("failed to bind all component.\n");
> > > + goto err_dc_cleanup;
> > > + }
> > When you have a drm_device - which you do here.
> > Then please use drm_err() and friends for error messages.
> > Please verify all uses of DRM_XXX
> >
> modern drm drivers need drm_xxx to replace DRM_XXX?
Yes, use of DRM_XXX is deprecated - when you have a drm_device.

> >
> > > + /* with irq_enabled = true, we can use the vblank feature. */
> > > + drm->irq_enabled = true;
> > I cannot see any irq being installed. This looks wrong.
> >
> Our display controller isr is been register on crtc driver(sprd_dpu.c), not
> here.

I think you just need to move this to next patch and then it is fine.

Sam