All of lore.kernel.org
 help / color / mirror / Atom feed
From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
To: Jacopo Mondi <jacopo.mondi@ideasonboard.com>
Cc: linux-media@vger.kernel.org, linux-renesas-soc@vger.kernel.org,
	Sakari Ailus <sakari.ailus@iki.fi>,
	Hans Verkuil <hverkuil-cisco@xs4all.nl>,
	Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>,
	Kieran Bingham <kieran.bingham@ideasonboard.com>
Subject: Re: [RFC PATCH v1 09/19] media: renesas: vsp1: Pass partition pointer to .configure_partition()
Date: Tue, 18 Jun 2024 19:13:30 +0300	[thread overview]
Message-ID: <20240618161330.GE32669@pendragon.ideasonboard.com> (raw)
In-Reply-To: <apdbfvn5umgmep2kgujggy7ziasmziepbjofl2brkgqndxdc6v@vi5nxd5ikbd4>

Hi Jacopo,

On Tue, Jun 18, 2024 at 12:45:42PM +0200, Jacopo Mondi wrote:
> On Wed, Nov 22, 2023 at 06:29:59AM GMT, Laurent Pinchart wrote:
> > The entity .configure_partition() function operates on a partition, and
> > has to retrieve that partition from the pipeline's current partition
> > field. Pass the partition pointer to the function to make it clearer
> > what partition it operates on, and remove the vsp1_pipeline.partition
> > field.
> >
> > This change clearly shows that the DRM pipeline doesn't use partitions,
> > which makes entity implementation more complex and error-prone. This
> > will be addressed in a further cleanup.
> >
> > Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
> > ---
> >  drivers/media/platform/renesas/vsp1/vsp1_drm.c    | 2 +-
> >  drivers/media/platform/renesas/vsp1/vsp1_entity.c | 4 +++-
> >  drivers/media/platform/renesas/vsp1/vsp1_entity.h | 2 ++
> >  drivers/media/platform/renesas/vsp1/vsp1_pipe.h   | 2 --
> >  drivers/media/platform/renesas/vsp1/vsp1_rpf.c    | 5 +++--
> >  drivers/media/platform/renesas/vsp1/vsp1_uds.c    | 2 +-
> >  drivers/media/platform/renesas/vsp1/vsp1_video.c  | 5 ++---
> >  drivers/media/platform/renesas/vsp1/vsp1_wpf.c    | 5 +++--
> >  8 files changed, 15 insertions(+), 12 deletions(-)
> >
> > diff --git a/drivers/media/platform/renesas/vsp1/vsp1_drm.c b/drivers/media/platform/renesas/vsp1/vsp1_drm.c
> > index 9b087bd8df7d..3954c138fa7b 100644
> > --- a/drivers/media/platform/renesas/vsp1/vsp1_drm.c
> > +++ b/drivers/media/platform/renesas/vsp1/vsp1_drm.c
> > @@ -569,7 +569,7 @@ static void vsp1_du_pipeline_configure(struct vsp1_pipeline *pipe)
> >  		vsp1_entity_route_setup(entity, pipe, dlb);
> >  		vsp1_entity_configure_stream(entity, pipe, dl, dlb);
> >  		vsp1_entity_configure_frame(entity, pipe, dl, dlb);
> > -		vsp1_entity_configure_partition(entity, pipe, dl, dlb);
> > +		vsp1_entity_configure_partition(entity, pipe, NULL, dl, dlb);
> 
> Are was passing a NULL pointer to rpf_configure_partition() and
> wpf_configure_partition() now ? Will this commit break bisection ?

I don't think it will, becase pipe->partition is set in
vsp1_video_pipeline_run_partition() only, which is not called for DRM
pipelines. Entities already get a NULL pipe->partition in DRM pipelines,
so this patch doesn't change the behaviour.

> Can't you temporary keep 'struct vsp1_pipeline.partition' around and
> pass it down here ?
> 
> >  	}
> >
> >  	vsp1_dl_list_commit(dl, dl_flags);
> > diff --git a/drivers/media/platform/renesas/vsp1/vsp1_entity.c b/drivers/media/platform/renesas/vsp1/vsp1_entity.c
> > index 8d39f1ee00ab..e9de75de8bde 100644
> > --- a/drivers/media/platform/renesas/vsp1/vsp1_entity.c
> > +++ b/drivers/media/platform/renesas/vsp1/vsp1_entity.c
> > @@ -89,11 +89,13 @@ void vsp1_entity_configure_frame(struct vsp1_entity *entity,
> >
> >  void vsp1_entity_configure_partition(struct vsp1_entity *entity,
> >  				     struct vsp1_pipeline *pipe,
> > +				     const struct vsp1_partition *partition,
> >  				     struct vsp1_dl_list *dl,
> >  				     struct vsp1_dl_body *dlb)
> >  {
> >  	if (entity->ops->configure_partition)
> > -		entity->ops->configure_partition(entity, pipe, dl, dlb);
> > +		entity->ops->configure_partition(entity, pipe, partition,
> > +						 dl, dlb);
> >  }
> >
> >  /* -----------------------------------------------------------------------------
> > diff --git a/drivers/media/platform/renesas/vsp1/vsp1_entity.h b/drivers/media/platform/renesas/vsp1/vsp1_entity.h
> > index 802c0c2acab0..7b86b2fef3e5 100644
> > --- a/drivers/media/platform/renesas/vsp1/vsp1_entity.h
> > +++ b/drivers/media/platform/renesas/vsp1/vsp1_entity.h
> > @@ -85,6 +85,7 @@ struct vsp1_entity_operations {
> >  				struct vsp1_dl_list *, struct vsp1_dl_body *);
> >  	void (*configure_partition)(struct vsp1_entity *,
> >  				    struct vsp1_pipeline *,
> > +				    const struct vsp1_partition *,
> >  				    struct vsp1_dl_list *,
> >  				    struct vsp1_dl_body *);
> >  	unsigned int (*max_width)(struct vsp1_entity *, struct vsp1_pipeline *);
> > @@ -155,6 +156,7 @@ void vsp1_entity_configure_frame(struct vsp1_entity *entity,
> >
> >  void vsp1_entity_configure_partition(struct vsp1_entity *entity,
> >  				     struct vsp1_pipeline *pipe,
> > +				     const struct vsp1_partition *partition,
> >  				     struct vsp1_dl_list *dl,
> >  				     struct vsp1_dl_body *dlb);
> >
> > diff --git a/drivers/media/platform/renesas/vsp1/vsp1_pipe.h b/drivers/media/platform/renesas/vsp1/vsp1_pipe.h
> > index 840fd3288efb..3d2e35ac8fa0 100644
> > --- a/drivers/media/platform/renesas/vsp1/vsp1_pipe.h
> > +++ b/drivers/media/platform/renesas/vsp1/vsp1_pipe.h
> > @@ -106,7 +106,6 @@ struct vsp1_partition {
> >   * @configured: when false the @stream_config shall be written to the hardware
> >   * @interlaced: True when the pipeline is configured in interlaced mode
> >   * @partitions: The number of partitions used to process one frame
> > - * @partition: The current partition for configuration to process
> >   * @part_table: The pre-calculated partitions used by the pipeline
> >   */
> >  struct vsp1_pipeline {
> > @@ -146,7 +145,6 @@ struct vsp1_pipeline {
> >  	bool interlaced;
> >
> >  	unsigned int partitions;
> > -	struct vsp1_partition *partition;
> >  	struct vsp1_partition *part_table;
> >
> >  	u32 underrun_count;
> > diff --git a/drivers/media/platform/renesas/vsp1/vsp1_rpf.c b/drivers/media/platform/renesas/vsp1/vsp1_rpf.c
> > index 42b0c5655404..3b8a62299226 100644
> > --- a/drivers/media/platform/renesas/vsp1/vsp1_rpf.c
> > +++ b/drivers/media/platform/renesas/vsp1/vsp1_rpf.c
> > @@ -280,6 +280,7 @@ static void rpf_configure_frame(struct vsp1_entity *entity,
> >
> >  static void rpf_configure_partition(struct vsp1_entity *entity,
> >  				    struct vsp1_pipeline *pipe,
> > +				    const struct vsp1_partition *partition,
> >  				    struct vsp1_dl_list *dl,
> >  				    struct vsp1_dl_body *dlb)
> >  {
> > @@ -311,8 +312,8 @@ static void rpf_configure_partition(struct vsp1_entity *entity,
> >  	 * 'width' need to be adjusted.
> >  	 */
> >  	if (pipe->partitions > 1) {
> > -		crop.width = pipe->partition->rpf[rpf->entity.index].width;
> > -		crop.left += pipe->partition->rpf[rpf->entity.index].left;
> > +		crop.width = partition->rpf[rpf->entity.index].width;
> > +		crop.left += partition->rpf[rpf->entity.index].left;
> >  	}
> >
> >  	if (pipe->interlaced) {
> > diff --git a/drivers/media/platform/renesas/vsp1/vsp1_uds.c b/drivers/media/platform/renesas/vsp1/vsp1_uds.c
> > index 887b1f70611a..737362ca2315 100644
> > --- a/drivers/media/platform/renesas/vsp1/vsp1_uds.c
> > +++ b/drivers/media/platform/renesas/vsp1/vsp1_uds.c
> > @@ -300,11 +300,11 @@ static void uds_configure_stream(struct vsp1_entity *entity,
> >
> >  static void uds_configure_partition(struct vsp1_entity *entity,
> >  				    struct vsp1_pipeline *pipe,
> > +				    const struct vsp1_partition *partition,
> >  				    struct vsp1_dl_list *dl,
> >  				    struct vsp1_dl_body *dlb)
> >  {
> >  	struct vsp1_uds *uds = to_uds(&entity->subdev);
> > -	struct vsp1_partition *partition = pipe->partition;
> >  	const struct v4l2_mbus_framefmt *output;
> >
> >  	output = v4l2_subdev_state_get_format(uds->entity.state,
> > diff --git a/drivers/media/platform/renesas/vsp1/vsp1_video.c b/drivers/media/platform/renesas/vsp1/vsp1_video.c
> > index ea5773af54d6..6a8db541543a 100644
> > --- a/drivers/media/platform/renesas/vsp1/vsp1_video.c
> > +++ b/drivers/media/platform/renesas/vsp1/vsp1_video.c
> > @@ -240,13 +240,12 @@ static void vsp1_video_pipeline_run_partition(struct vsp1_pipeline *pipe,
> >  					      struct vsp1_dl_list *dl,
> >  					      unsigned int partition)
> >  {
> > +	struct vsp1_partition *part = &pipe->part_table[partition];
> >  	struct vsp1_dl_body *dlb = vsp1_dl_list_get_body0(dl);
> >  	struct vsp1_entity *entity;
> >
> > -	pipe->partition = &pipe->part_table[partition];
> > -
> >  	list_for_each_entry(entity, &pipe->entities, list_pipe)
> > -		vsp1_entity_configure_partition(entity, pipe, dl, dlb);
> > +		vsp1_entity_configure_partition(entity, pipe, part, dl, dlb);
> >  }
> >
> >  static void vsp1_video_pipeline_run(struct vsp1_pipeline *pipe)
> > diff --git a/drivers/media/platform/renesas/vsp1/vsp1_wpf.c b/drivers/media/platform/renesas/vsp1/vsp1_wpf.c
> > index 5129181b8217..80fe7571f4ff 100644
> > --- a/drivers/media/platform/renesas/vsp1/vsp1_wpf.c
> > +++ b/drivers/media/platform/renesas/vsp1/vsp1_wpf.c
> > @@ -363,6 +363,7 @@ static void wpf_configure_frame(struct vsp1_entity *entity,
> >
> >  static void wpf_configure_partition(struct vsp1_entity *entity,
> >  				    struct vsp1_pipeline *pipe,
> > +				    const struct vsp1_partition *partition,
> >  				    struct vsp1_dl_list *dl,
> >  				    struct vsp1_dl_body *dlb)
> >  {
> > @@ -390,8 +391,8 @@ static void wpf_configure_partition(struct vsp1_entity *entity,
> >  	 * multiple slices.
> >  	 */
> >  	if (pipe->partitions > 1) {
> > -		width = pipe->partition->wpf.width;
> > -		left = pipe->partition->wpf.left;
> > +		width = partition->wpf.width;
> > +		left = partition->wpf.left;
> >  	}
> >
> >  	vsp1_wpf_write(wpf, dlb, VI6_WPF_HSZCLIP, VI6_WPF_SZCLIP_EN |

-- 
Regards,

Laurent Pinchart

  reply	other threads:[~2024-06-18 16:13 UTC|newest]

Thread overview: 49+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-11-22  4:29 [RFC PATCH v1 00/19] media: renesas: vsp1: Conversion to subdev active state Laurent Pinchart
2023-11-22  4:29 ` [RFC PATCH v1 01/19] media: renesas: vsp1: Drop vsp1_entity_get_pad_format() wrapper Laurent Pinchart
2024-06-18  9:52   ` Jacopo Mondi
2023-11-22  4:29 ` [RFC PATCH v1 02/19] media: renesas: vsp1: Drop vsp1_entity_get_pad_selection() wrapper Laurent Pinchart
2024-06-18  9:56   ` Jacopo Mondi
2023-11-22  4:29 ` [RFC PATCH v1 03/19] media: renesas: vsp1: Drop vsp1_rwpf_get_crop() wrapper Laurent Pinchart
2024-06-18  9:58   ` Jacopo Mondi
2023-11-22  4:29 ` [RFC PATCH v1 04/19] media: renesas: vsp1: Drop brx_get_compose() wrapper Laurent Pinchart
2024-06-18  9:59   ` Jacopo Mondi
2023-11-22  4:29 ` [RFC PATCH v1 05/19] media: renesas: vsp1: Drop custom .get_fmt() handler for histogram Laurent Pinchart
2024-06-18 10:05   ` Jacopo Mondi
2024-06-18 15:57     ` Laurent Pinchart
2023-11-22  4:29 ` [RFC PATCH v1 06/19] media: renesas: vsp1: Move partition calculation to vsp1_pipe.c Laurent Pinchart
2024-06-18 10:26   ` Jacopo Mondi
2023-11-22  4:29 ` [RFC PATCH v1 07/19] media: renesas: vsp1: Simplify partition calculation Laurent Pinchart
2024-06-18 10:29   ` Jacopo Mondi
2023-11-22  4:29 ` [RFC PATCH v1 08/19] media: renesas: vsp1: Store RPF partition configuration per RPF instance Laurent Pinchart
2024-06-18 10:32   ` Jacopo Mondi
2024-06-18 16:09     ` Laurent Pinchart
2023-11-22  4:29 ` [RFC PATCH v1 09/19] media: renesas: vsp1: Pass partition pointer to .configure_partition() Laurent Pinchart
2024-06-18 10:45   ` Jacopo Mondi
2024-06-18 16:13     ` Laurent Pinchart [this message]
2024-06-18 16:28       ` Jacopo Mondi
2023-11-22  4:30 ` [RFC PATCH v1 10/19] media: renesas: vsp1: Replace vsp1_partition_window with v4l2_rect Laurent Pinchart
2024-06-18 11:07   ` Jacopo Mondi
2024-06-18 16:24     ` Laurent Pinchart
2024-06-18 16:29       ` Jacopo Mondi
2023-11-22  4:30 ` [RFC PATCH v1 11/19] media: renesas: vsp1: Add and use function to dump a pipeline to the log Laurent Pinchart
2024-06-18 11:34   ` Jacopo Mondi
2024-06-18 16:25     ` Laurent Pinchart
2024-06-18 16:30       ` Jacopo Mondi
2023-11-22  4:30 ` [RFC PATCH v1 12/19] media: renesas: vsp1: Keep the DRM pipeline entities sorted Laurent Pinchart
2024-06-19 12:02   ` Jacopo Mondi
2023-11-22  4:30 ` [RFC PATCH v1 13/19] media: renesas: vsp1: Compute partitions for DRM pipelines Laurent Pinchart
2024-06-18 11:35   ` Jacopo Mondi
2023-11-22  4:30 ` [RFC PATCH v1 14/19] media: renesas: vsp1: Get configuration from partition instead of state Laurent Pinchart
2024-06-18 11:23   ` Jacopo Mondi
2024-06-18 16:38     ` Laurent Pinchart
2024-06-18 16:46       ` Jacopo Mondi
2023-11-22  4:30 ` [RFC PATCH v1 15/19] media: renesas: vsp1: Name parameters to entity operations Laurent Pinchart
2024-06-18 11:24   ` Jacopo Mondi
2023-11-22  4:30 ` [RFC PATCH v1 16/19] media: renesas: vsp1: Pass subdev state " Laurent Pinchart
2024-06-18 16:52   ` Jacopo Mondi
2024-06-18 17:17     ` Laurent Pinchart
2023-11-22  4:30 ` [RFC PATCH v1 17/19] media: renesas: vsp1: Initialize control handler after subdev Laurent Pinchart
2024-06-18 16:56   ` Jacopo Mondi
2023-11-22  4:30 ` [RFC PATCH v1 18/19] media: renesas: vsp1: Switch to V4L2 subdev active state Laurent Pinchart
2023-11-22  4:30 ` [RFC PATCH v1 19/19] media: renesas: vsp1: Rename all v4l2_subdev_state variables to 'state' Laurent Pinchart
2024-06-18 16:57   ` Jacopo Mondi

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=20240618161330.GE32669@pendragon.ideasonboard.com \
    --to=laurent.pinchart@ideasonboard.com \
    --cc=hverkuil-cisco@xs4all.nl \
    --cc=jacopo.mondi@ideasonboard.com \
    --cc=kieran.bingham@ideasonboard.com \
    --cc=linux-media@vger.kernel.org \
    --cc=linux-renesas-soc@vger.kernel.org \
    --cc=sakari.ailus@iki.fi \
    --cc=tomi.valkeinen@ideasonboard.com \
    /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.