[PATCH v15 3/5] drm: renesas: Add RZ/G2L DU Support
Maxime Ripard
mripard at kernel.org
Fri Dec 15 09:22:31 UTC 2023
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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 228 bytes
Desc: not available
URL: <https://lists.freedesktop.org/archives/dri-devel/attachments/20231215/48f7626b/attachment.sig>
More information about the dri-devel
mailing list