Re: [PATCH v15 3/5] drm: renesas: Add RZ/G2L DU Support

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Dec 14, 2023 at 08:50:14PM +0000, Biju Das wrote:
> Hi Maxime Ripard,
> 
> 
> > -----Original Message-----
> > From: Biju Das
> > Sent: Thursday, December 14, 2023 3:24 PM
> > Subject: RE: [PATCH v15 3/5] drm: renesas: Add RZ/G2L DU Support
> > 
> > >
> > > > +
> > > > +	for (i = 0; i < num_planes; ++i) {
> > > > +		enum drm_plane_type type = i < num_crtcs
> > > > +					 ? DRM_PLANE_TYPE_PRIMARY
> > > > +					 : DRM_PLANE_TYPE_OVERLAY;
> > > > +		struct rzg2l_du_vsp_plane *plane = &vsp->planes[i];
> > > > +
> > > > +		plane->vsp = vsp;
> > > > +		plane->index = i;
> > > > +		ret = drm_universal_plane_init(&rcdu->ddev, &plane->plane,
> > > > +					       crtcs, &rzg2l_du_vsp_plane_funcs,
> > > > +					       rzg2l_du_vsp_formats,
> > > > +					       ARRAY_SIZE(rzg2l_du_vsp_formats),
> > > > +					       NULL, type, NULL);
> > > > +		if (ret < 0)
> > > > +			return ret;
> > >
> > > you need to use drmm variant here too.
> > 
> > I did rebased to latest drm_misc_next and I don't find the
> > drmm_universal_plane_init()
> > 
> > Can you please point me to the API?
> 
> We cannot use drmm_universal_plane_alloc() in this architecture.
> 
> rzg2l_du_vsps_init() stores the VSP pointer and pipe index from DT first.
> 
> Then all the planes are created using rzg2l_du_vsp_init()
> 
> CRTC uses VSP pointer and pipe_index to set the plane(rzg2l_du_crtc_create()).
> 
> CRTC->vsp->planes[rcrtc->vsp_pipe].plane

Actually, I don't think you need vsp->planes at all. The only real use
you have for it is to find the primary plane in rzg2l_du_crtc_create()
and you could just pass it as an argument to the function, and make
rzg2l_du_vsps_init return it for example (or fill a pointer on success,
or something).

And I also don't think you need to store the crtcs either, you can
probably just get away with storing the vsp pointer in the crtc when you
allocate it.

Maxime

Attachment: signature.asc
Description: PGP signature


[Index of Archives]     [Linux DRI Users]     [Linux Intel Graphics]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux