All of lore.kernel.org
 help / color / mirror / Atom feed
From: Biju Das <biju.das.jz@bp.renesas.com>
To: Maxime Ripard <mripard@kernel.org>
Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>,
	Thomas Zimmermann <tzimmermann@suse.de>,
	David Airlie <airlied@gmail.com>, Daniel Vetter <daniel@ffwll.ch>,
	Philipp Zabel <p.zabel@pengutronix.de>,
	Laurent Pinchart <laurent.pinchart@ideasonboard.com>,
	Kieran Bingham <kieran.bingham+renesas@ideasonboard.com>,
	Jacopo Mondi <jacopo.mondi@ideasonboard.com>,
	Geert Uytterhoeven <geert+renesas@glider.be>,
	Magnus Damm <magnus.damm@gmail.com>,
	"dri-devel@lists.freedesktop.org"
	<dri-devel@lists.freedesktop.org>,
	"linux-renesas-soc@vger.kernel.org"
	<linux-renesas-soc@vger.kernel.org>,
	Fabrizio Castro <fabrizio.castro.jz@renesas.com>,
	Prabhakar Mahadev Lad <prabhakar.mahadev-lad.rj@bp.renesas.com>,
	biju.das.au <biju.das.au@gmail.com>
Subject: RE: [PATCH v15 3/5] drm: renesas: Add RZ/G2L DU Support
Date: Fri, 15 Dec 2023 11:19:16 +0000	[thread overview]
Message-ID: <TYCPR01MB11269E63B4CBB97576DBF03F68693A@TYCPR01MB11269.jpnprd01.prod.outlook.com> (raw)
In-Reply-To: <jxjqwytay24p5g7rl23asjucbwswpjyw3znrbu6z7eigrvl7jy@5vxwqtgpg35g>

Hi Maxime Ripard,


> -----Original Message-----
> From: Maxime Ripard <mripard@kernel.org>
> Sent: Friday, December 15, 2023 9:25 AM
> Subject: Re: [PATCH v15 3/5] drm: renesas: Add RZ/G2L DU Support
> 
> On Fri, Dec 15, 2023 at 07:47:07AM +0000, Biju Das wrote:
> > Hi Maxime Ripard,
> >
> > > -----Original Message-----
> > > From: Biju Das
> > > Sent: Thursday, December 14, 2023 8:50 PM
> > > Subject: RE: [PATCH v15 3/5] drm: renesas: Add RZ/G2L DU Support
> > >
> > > 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
> > >
> >
> > Thinking again, it is possible to use drmm_universal_plane_alloc()
> > here
> >
> > Introduce a linked list [1] and use an API [2] to retrieve plane by
> > matching vsp_pipe index against plane->index.
> >
> > With this we don't need drmm_kcalloc() any more.
> >
> > I will implement and test this and send v16, if there are no comments.
> >
> >
> > [1]
> > struct rzg2l_du_vsp_plane {
> > 	struct drm_plane plane;
> > 	struct rzg2l_du_vsp *vsp;
> > 	unsigned int index;
> > 	struct rzg2l_du_vsp_plane *next;
> > };
> >
> > [2]
> > struct drm_plane *rzg2l_du_vsp_get_drm_plane(struct rzg2l_du_crtc *crtc,
> > 					 unsigned int pipe_index);
> 
> Why do you need a linked list for? There's one already: the DRM device
> will store all the planes registered in the DRM device, and you can
> already iterate over all the planes with drm_for_each_plane, or
> drm_for_each_plane_mask if you want to reduce the scope of the iterator.


Thanks for the pointer, it is simple now.

Vsp->planes[] aswell as linked list is not required using drm_for_each_plane()

Cheers,
Biju


WARNING: multiple messages have this Message-ID (diff)
From: Biju Das <biju.das.jz@bp.renesas.com>
To: Maxime Ripard <mripard@kernel.org>
Cc: Fabrizio Castro <fabrizio.castro.jz@renesas.com>,
	"biju.das.au" <biju.das.au@gmail.com>,
	Magnus Damm <magnus.damm@gmail.com>,
	Geert Uytterhoeven <geert+renesas@glider.be>,
	Thomas Zimmermann <tzimmermann@suse.de>,
	Prabhakar Mahadev Lad <prabhakar.mahadev-lad.rj@bp.renesas.com>,
	"dri-devel@lists.freedesktop.org"
	<dri-devel@lists.freedesktop.org>,
	"linux-renesas-soc@vger.kernel.org"
	<linux-renesas-soc@vger.kernel.org>,
	Kieran Bingham <kieran.bingham+renesas@ideasonboard.com>,
	Laurent Pinchart <laurent.pinchart@ideasonboard.com>,
	Jacopo Mondi <jacopo.mondi@ideasonboard.com>
Subject: RE: [PATCH v15 3/5] drm: renesas: Add RZ/G2L DU Support
Date: Fri, 15 Dec 2023 11:19:16 +0000	[thread overview]
Message-ID: <TYCPR01MB11269E63B4CBB97576DBF03F68693A@TYCPR01MB11269.jpnprd01.prod.outlook.com> (raw)
In-Reply-To: <jxjqwytay24p5g7rl23asjucbwswpjyw3znrbu6z7eigrvl7jy@5vxwqtgpg35g>

Hi Maxime Ripard,


> -----Original Message-----
> From: Maxime Ripard <mripard@kernel.org>
> Sent: Friday, December 15, 2023 9:25 AM
> Subject: Re: [PATCH v15 3/5] drm: renesas: Add RZ/G2L DU Support
> 
> On Fri, Dec 15, 2023 at 07:47:07AM +0000, Biju Das wrote:
> > Hi Maxime Ripard,
> >
> > > -----Original Message-----
> > > From: Biju Das
> > > Sent: Thursday, December 14, 2023 8:50 PM
> > > Subject: RE: [PATCH v15 3/5] drm: renesas: Add RZ/G2L DU Support
> > >
> > > 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
> > >
> >
> > Thinking again, it is possible to use drmm_universal_plane_alloc()
> > here
> >
> > Introduce a linked list [1] and use an API [2] to retrieve plane by
> > matching vsp_pipe index against plane->index.
> >
> > With this we don't need drmm_kcalloc() any more.
> >
> > I will implement and test this and send v16, if there are no comments.
> >
> >
> > [1]
> > struct rzg2l_du_vsp_plane {
> > 	struct drm_plane plane;
> > 	struct rzg2l_du_vsp *vsp;
> > 	unsigned int index;
> > 	struct rzg2l_du_vsp_plane *next;
> > };
> >
> > [2]
> > struct drm_plane *rzg2l_du_vsp_get_drm_plane(struct rzg2l_du_crtc *crtc,
> > 					 unsigned int pipe_index);
> 
> Why do you need a linked list for? There's one already: the DRM device
> will store all the planes registered in the DRM device, and you can
> already iterate over all the planes with drm_for_each_plane, or
> drm_for_each_plane_mask if you want to reduce the scope of the iterator.


Thanks for the pointer, it is simple now.

Vsp->planes[] aswell as linked list is not required using drm_for_each_plane()

Cheers,
Biju


  reply	other threads:[~2023-12-15 11:19 UTC|newest]

Thread overview: 77+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-11-28 10:51 [PATCH v15 0/5] Add RZ/{G2L,G2LC} and RZ/V2L Display Unit support Biju Das
2023-11-28 10:51 ` Biju Das
2023-11-28 10:51 ` [PATCH v15 1/5] dt-bindings: display: Document Renesas RZ/G2L DU bindings Biju Das
2023-11-28 10:51   ` Biju Das
2023-11-28 10:51 ` [PATCH v15 2/5] dt-bindings: display: renesas, rzg2l-du: Document RZ/V2L " Biju Das
2023-11-28 10:51   ` [PATCH v15 2/5] dt-bindings: display: renesas,rzg2l-du: " Biju Das
2023-11-28 10:51 ` [PATCH v15 3/5] drm: renesas: Add RZ/G2L DU Support Biju Das
2023-11-28 10:51   ` Biju Das
2023-12-13 15:47   ` Maxime Ripard
2023-12-13 15:47     ` Maxime Ripard
2023-12-13 15:48     ` Maxime Ripard
2023-12-13 15:48       ` Maxime Ripard
2023-12-13 15:50     ` Laurent Pinchart
2023-12-13 15:50       ` Laurent Pinchart
2023-12-13 16:11       ` Geert Uytterhoeven
2023-12-13 16:11         ` Geert Uytterhoeven
2023-12-13 16:46       ` Biju Das
2023-12-13 16:46         ` Biju Das
2023-12-14 15:24     ` Biju Das
2023-12-14 15:24       ` Biju Das
2023-12-14 18:35       ` Biju Das
2023-12-14 18:35         ` Biju Das
2023-12-14 20:50       ` Biju Das
2023-12-14 20:50         ` Biju Das
2023-12-15  7:47         ` Biju Das
2023-12-15  7:47           ` Biju Das
2023-12-15  9:24           ` Maxime Ripard
2023-12-15  9:24             ` Maxime Ripard
2023-12-15 11:19             ` Biju Das [this message]
2023-12-15 11:19               ` Biju Das
2023-12-15  9:22         ` Maxime Ripard
2023-12-15  9:22           ` Maxime Ripard
2023-12-15 10:23       ` Maxime Ripard
2023-12-15 10:23         ` Maxime Ripard
2023-12-15 11:37         ` Biju Das
2023-12-15 11:37           ` Biju Das
2023-12-15 12:58           ` Maxime Ripard
2023-12-15 12:58             ` Maxime Ripard
2023-12-15 13:52             ` Biju Das
2023-12-15 13:52               ` Biju Das
2023-12-15 14:18               ` Maxime Ripard
2023-12-15 14:18                 ` Maxime Ripard
2023-12-15 14:55                 ` Biju Das
2023-12-15 14:55                   ` Biju Das
2023-12-15 14:58                   ` Biju Das
2023-12-15 14:58                     ` Biju Das
2024-01-04 14:17                   ` Biju Das
2024-01-04 14:17                     ` Biju Das
2024-01-10 19:38                     ` Laurent Pinchart
2024-01-10 19:38                       ` Laurent Pinchart
2024-01-11  9:31                       ` Biju Das
2024-01-11  9:31                         ` Biju Das
2023-12-15 14:19               ` Biju Das
2023-12-15 14:19                 ` Biju Das
2023-12-15 14:23                 ` Maxime Ripard
2023-12-15 14:23                   ` Maxime Ripard
2023-12-15 14:42                   ` Biju Das
2023-12-15 14:42                     ` Biju Das
2023-12-15 13:25         ` Biju Das
2023-12-15 13:25           ` Biju Das
2023-12-15 14:24           ` Maxime Ripard
2023-12-15 14:24             ` Maxime Ripard
2024-01-04 14:34             ` Biju Das
2024-01-04 14:34               ` Biju Das
2024-01-10 16:14               ` Maxime Ripard
2024-01-10 16:14                 ` Maxime Ripard
2024-01-10 17:58                 ` Laurent Pinchart
2024-01-10 17:58                   ` Laurent Pinchart
2023-11-28 10:51 ` [PATCH v15 4/5] MAINTAINERS: Update entries for Renesas DRM drivers Biju Das
2023-11-28 10:51   ` Biju Das
2023-11-28 11:05   ` Geert Uytterhoeven
2023-11-28 11:05     ` Geert Uytterhoeven
2023-11-28 10:51 ` [PATCH v15 5/5] MAINTAINERS: Create entry for Renesas RZ " Biju Das
2023-11-28 10:51   ` Biju Das
2023-12-11 12:10 ` [PATCH v15 0/5] Add RZ/{G2L, G2LC} and RZ/V2L Display Unit support Biju Das
2023-12-11 12:10   ` [PATCH v15 0/5] Add RZ/{G2L,G2LC} " Biju Das
2024-02-21 16:24 ` Maxime Ripard

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=TYCPR01MB11269E63B4CBB97576DBF03F68693A@TYCPR01MB11269.jpnprd01.prod.outlook.com \
    --to=biju.das.jz@bp.renesas.com \
    --cc=airlied@gmail.com \
    --cc=biju.das.au@gmail.com \
    --cc=daniel@ffwll.ch \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=fabrizio.castro.jz@renesas.com \
    --cc=geert+renesas@glider.be \
    --cc=jacopo.mondi@ideasonboard.com \
    --cc=kieran.bingham+renesas@ideasonboard.com \
    --cc=laurent.pinchart@ideasonboard.com \
    --cc=linux-renesas-soc@vger.kernel.org \
    --cc=maarten.lankhorst@linux.intel.com \
    --cc=magnus.damm@gmail.com \
    --cc=mripard@kernel.org \
    --cc=p.zabel@pengutronix.de \
    --cc=prabhakar.mahadev-lad.rj@bp.renesas.com \
    --cc=tzimmermann@suse.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.