linux-renesas-soc.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Sakari Ailus <sakari.ailus@linux.intel.com>
To: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Cc: "Niklas Söderlund" <niklas.soderlund+renesas@ragnatech.se>,
	"Benoit Parrot" <bparrot@ti.com>,
	linux-media@vger.kernel.org, linux-renesas-soc@vger.kernel.org
Subject: Re: [PATCH v2 06/30] media: entity: Use pad as the starting point for a pipeline
Date: Tue, 22 Jan 2019 18:16:43 +0200	[thread overview]
Message-ID: <20190122161642.ocpuuqp4cwq46wf2@paasikivi.fi.intel.com> (raw)
In-Reply-To: <20190122153715.GC11461@pendragon.ideasonboard.com>

On Tue, Jan 22, 2019 at 05:37:15PM +0200, Laurent Pinchart wrote:
> Hi Sakari,
> 
> On Tue, Jan 22, 2019 at 05:31:34PM +0200, Sakari Ailus wrote:
> > On Wed, Jan 16, 2019 at 12:54:20AM +0200, Laurent Pinchart wrote:
> > > On Fri, Nov 02, 2018 at 12:31:20AM +0100, Niklas Söderlund wrote:
> > >> From: Sakari Ailus <sakari.ailus@linux.intel.com>
> > >> 
> > >> The pipeline will be moved from the entity to the pads; reflect this in
> > >> the media pipeline function API.
> > > 
> > > Will be moved, or has been moved ?
> > 
> > Will be, as it's not yet in this patch.
> 
> [PATCH v2 05/30] media: entity: Move the pipeline from entity to pads

Oh, I thought it was the other way. Well, "has been" then? :-)

> 
> > >> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
> > >> Reviewed-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se>
> > >> ---
> > >>  Documentation/media/kapi/mc-core.rst          |  6 ++--
> > >>  drivers/media/media-entity.c                  | 25 +++++++-------
> > >>  drivers/media/pci/intel/ipu3/ipu3-cio2.c      |  6 ++--
> > >>  .../media/platform/exynos4-is/fimc-capture.c  |  8 ++---
> > >>  .../platform/exynos4-is/fimc-isp-video.c      |  8 ++---
> > >>  drivers/media/platform/exynos4-is/fimc-lite.c |  8 ++---
> > >>  drivers/media/platform/omap3isp/ispvideo.c    |  6 ++--
> > >>  .../media/platform/qcom/camss/camss-video.c   |  6 ++--
> > >>  drivers/media/platform/rcar-vin/rcar-dma.c    |  6 ++--
> > >>  .../media/platform/s3c-camif/camif-capture.c  |  6 ++--
> > >>  drivers/media/platform/vimc/vimc-capture.c    |  6 ++--
> > >>  drivers/media/platform/vsp1/vsp1_video.c      |  6 ++--
> > >>  drivers/media/platform/xilinx/xilinx-dma.c    |  6 ++--
> > >>  drivers/media/usb/au0828/au0828-core.c        |  4 +--
> > >>  drivers/staging/media/imx/imx-media-utils.c   |  6 ++--
> > >>  drivers/staging/media/omap4iss/iss_video.c    |  6 ++--
> > >>  include/media/media-entity.h                  | 33 ++++++++++---------
> > >>  17 files changed, 76 insertions(+), 76 deletions(-)
> > >> 
> > >> diff --git a/Documentation/media/kapi/mc-core.rst b/Documentation/media/kapi/mc-core.rst
> > >> index 849b87439b7a9772..ede7e946f6a82ac0 100644
> > >> --- a/Documentation/media/kapi/mc-core.rst
> > >> +++ b/Documentation/media/kapi/mc-core.rst
> > >> @@ -211,11 +211,11 @@ When starting streaming, drivers must notify all entities in the pipeline to
> > >>  prevent link states from being modified during streaming by calling
> > >>  :c:func:`media_pipeline_start()`.
> > >>  
> > >> -The function will mark all entities connected to the given entity through
> > >> -enabled links, either directly or indirectly, as streaming.
> > >> +The function will mark all entities connected to the given pad through
> > >> +enabled routes and links, either directly or indirectly, as streaming.
> > > 
> > > That's not really correct, it doesn't mark entities, but pads. I think
> > > this section of the documentation needs to be rewritten based on the new
> > > model of an entity being part of multiple pipelines. s/entity/pad/ isn't
> > > enough, there's a whole new semantics.
> > 
> > I'd say it's correct. Note that this function just beings the walk from a
> > given pad, it doesn't make other changes --- there are further patches
> > thought that do.
> 
> OK, it might be a change in progress, but the documentation still has to
> be rewritten to explain the new model. We need at least one or two new
> paragraphs in addition to the s/entity/pad/.

There are several patches that would need to change the documentation "a
little". I wonder if it'd be better to just have one patch in the end
updating the documentation.

> 
> > >>  The struct :c:type:`media_pipeline` instance pointed to by
> > >> -the pipe argument will be stored in every entity in the pipeline.
> > >> +the pipe argument will be stored in every pad in the pipeline.
> > >>  Drivers should embed the struct :c:type:`media_pipeline`
> > >>  in higher-level pipeline structures and can then access the
> > >>  pipeline through the struct :c:type:`media_entity`
> > >> diff --git a/drivers/media/media-entity.c b/drivers/media/media-entity.c
> > >> index 13260149c4dfc90c..f2fa0b7826dbc2f3 100644
> > >> --- a/drivers/media/media-entity.c
> > >> +++ b/drivers/media/media-entity.c
> > >> @@ -411,12 +411,11 @@ EXPORT_SYMBOL_GPL(media_entity_get_fwnode_pad);
> > >>   * Pipeline management
> > >>   */
> > >>  
> > >> -__must_check int __media_pipeline_start(struct media_entity *entity,
> > >> +__must_check int __media_pipeline_start(struct media_pad *pad,
> > >>  					struct media_pipeline *pipe)
> > >>  {
> > >> -	struct media_device *mdev = entity->graph_obj.mdev;
> > >> +	struct media_device *mdev = pad->graph_obj.mdev;
> > >>  	struct media_graph *graph = &pipe->graph;
> > >> -	struct media_pad *pad = entity->pads;
> > >>  	struct media_pad *pad_err = pad;
> > >>  	struct media_link *link;
> > >>  	int ret = 0;
> > >> @@ -549,24 +548,23 @@ __must_check int __media_pipeline_start(struct media_entity *entity,
> > >>  }
> > >>  EXPORT_SYMBOL_GPL(__media_pipeline_start);
> > >>  
> > >> -__must_check int media_pipeline_start(struct media_entity *entity,
> > >> +__must_check int media_pipeline_start(struct media_pad *pad,
> > >>  				      struct media_pipeline *pipe)
> > >>  {
> > >> -	struct media_device *mdev = entity->graph_obj.mdev;
> > >> +	struct media_device *mdev = pad->graph_obj.mdev;
> > >>  	int ret;
> > >>  
> > >>  	mutex_lock(&mdev->graph_mutex);
> > >> -	ret = __media_pipeline_start(entity, pipe);
> > >> +	ret = __media_pipeline_start(pad, pipe);
> > >>  	mutex_unlock(&mdev->graph_mutex);
> > >>  	return ret;
> > >>  }
> > >>  EXPORT_SYMBOL_GPL(media_pipeline_start);
> > >>  
> > >> -void __media_pipeline_stop(struct media_entity *entity)
> > >> +void __media_pipeline_stop(struct media_pad *pad)
> > >>  {
> > >> -	struct media_pipeline *pipe = entity->pads->pipe;
> > >> +	struct media_pipeline *pipe = pad->pipe;
> > >>  	struct media_graph *graph = &pipe->graph;
> > >> -	struct media_pad *pad;
> > >>  
> > >>  	/*
> > >>  	 * If the following check fails, the driver has performed an
> > >> @@ -575,9 +573,10 @@ void __media_pipeline_stop(struct media_entity *entity)
> > >>  	if (WARN_ON(!pipe))
> > >>  		return;
> > >>  
> > >> -	media_graph_walk_start(graph, entity->pads);
> > >> +	media_graph_walk_start(graph, pad);
> > >>  
> > >>  	while ((pad = media_graph_walk_next(graph))) {
> > >> +		struct media_entity *entity = pad->entity;
> > > 
> > > It looks like this line is a bug fix for a previous patch in the series.
> > 
> > Yes, so it seems to be. The previous patch appears to remove it.
> > 
> > >>  		unsigned int i;
> > >>  
> > >>  		for (i = 0; i < entity->num_pads; i++) {
> > >> @@ -598,12 +597,12 @@ void __media_pipeline_stop(struct media_entity *entity)
> > >>  }
> > >>  EXPORT_SYMBOL_GPL(__media_pipeline_stop);
> > >>  
> > >> -void media_pipeline_stop(struct media_entity *entity)
> > >> +void media_pipeline_stop(struct media_pad *pad)
> > >>  {
> > >> -	struct media_device *mdev = entity->graph_obj.mdev;
> > >> +	struct media_device *mdev = pad->graph_obj.mdev;
> > >>  
> > >>  	mutex_lock(&mdev->graph_mutex);
> > >> -	__media_pipeline_stop(entity);
> > >> +	__media_pipeline_stop(pad);
> > >>  	mutex_unlock(&mdev->graph_mutex);
> > >>  }
> > >>  EXPORT_SYMBOL_GPL(media_pipeline_stop);
> > > 
> > > [snip]
> > > 
> > >> diff --git a/include/media/media-entity.h b/include/media/media-entity.h
> > >> index ca0b79288ea7fd11..8378f700389635ea 100644
> > >> --- a/include/media/media-entity.h
> > >> +++ b/include/media/media-entity.h
> > >> @@ -965,53 +965,54 @@ struct media_pad *media_graph_walk_next(struct media_graph *graph);
> > >>  
> > >>  /**
> > >>   * media_pipeline_start - Mark a pipeline as streaming
> > >> - * @entity: Starting entity
> > >> - * @pipe: Media pipeline to be assigned to all entities in the pipeline.
> > >> + * @pad: Starting pad
> > >> + * @pipe: Media pipeline to be assigned to all pads in the pipeline.
> > >>   *
> > >> - * Mark all entities connected to a given entity through enabled links, either
> > >> - * directly or indirectly, as streaming. The given pipeline object is assigned
> > >> - * to every entity in the pipeline and stored in the media_entity pipe field.
> > >> + * Mark all pads connected to a given pad through enabled
> > >> + * routes or links, either directly or indirectly, as streaming. The
> > >> + * given pipeline object is assigned to every pad in the pipeline
> > >> + * and stored in the media_pad pipe field.
> > > 
> > > Reflowing text to the 80 columns limit ?
> > 
> > Agreed.
> > 
> > >>   *
> > >>   * Calls to this function can be nested, in which case the same number of
> > >>   * media_pipeline_stop() calls will be required to stop streaming. The
> > >>   * pipeline pointer must be identical for all nested calls to
> > >>   * media_pipeline_start().
> > >>   */
> > >> -__must_check int media_pipeline_start(struct media_entity *entity,
> > >> +__must_check int media_pipeline_start(struct media_pad *pad,
> > >>  				      struct media_pipeline *pipe);
> > >>  /**
> > >>   * __media_pipeline_start - Mark a pipeline as streaming
> > >>   *
> > >> - * @entity: Starting entity
> > >> - * @pipe: Media pipeline to be assigned to all entities in the pipeline.
> > >> + * @pad: Starting pad
> > >> + * @pipe: Media pipeline to be assigned to all pads in the pipeline.
> > >>   *
> > >>   * ..note:: This is the non-locking version of media_pipeline_start()
> > >>   */
> > >> -__must_check int __media_pipeline_start(struct media_entity *entity,
> > >> +__must_check int __media_pipeline_start(struct media_pad *pad,
> > >>  					struct media_pipeline *pipe);
> > >>  
> > >>  /**
> > >>   * media_pipeline_stop - Mark a pipeline as not streaming
> > >> - * @entity: Starting entity
> > >> + * @pad: Starting pad
> > >>   *
> > >> - * Mark all entities connected to a given entity through enabled links, either
> > >> - * directly or indirectly, as not streaming. The media_entity pipe field is
> > >> - * reset to %NULL.
> > >> + * Mark all pads connected to a given pad through enabled routes or
> > >> + * links, either directly or indirectly, as not streaming. The
> > >> + * media_pad pipe field is reset to %NULL.
> > > 
> > > Ditto.
> > > 
> > > With the above fixed,
> > > 
> > > Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> > > 
> > >>   *
> > >>   * If multiple calls to media_pipeline_start() have been made, the same
> > >>   * number of calls to this function are required to mark the pipeline as not
> > >>   * streaming.
> > >>   */
> > >> -void media_pipeline_stop(struct media_entity *entity);
> > >> +void media_pipeline_stop(struct media_pad *pad);
> > >>  
> > >>  /**
> > >>   * __media_pipeline_stop - Mark a pipeline as not streaming
> > >>   *
> > >> - * @entity: Starting entity
> > >> + * @pad: Starting pad
> > >>   *
> > >>   * .. note:: This is the non-locking version of media_pipeline_stop()
> > >>   */
> > >> -void __media_pipeline_stop(struct media_entity *entity);
> > >> +void __media_pipeline_stop(struct media_pad *pad);
> > >>  
> > >>  /**
> > >>   * media_devnode_create() - creates and initializes a device node interface
> 
> -- 
> Regards,
> 
> Laurent Pinchart

-- 
Sakari Ailus
sakari.ailus@linux.intel.com

  reply	other threads:[~2019-01-22 16:16 UTC|newest]

Thread overview: 90+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-11-01 23:31 [PATCH v2 00/30] v4l: add support for multiplexed streams Niklas Söderlund
2018-11-01 23:31 ` [PATCH v2 01/30] media: entity: Use pad as a starting point for graph walk Niklas Söderlund
2019-01-15 21:43   ` Laurent Pinchart
2018-11-01 23:31 ` [PATCH v2 02/30] media: entity: Use pads instead of entities in the media graph walk stack Niklas Söderlund
2019-01-15 22:03   ` Laurent Pinchart
2019-01-15 22:13     ` Sakari Ailus
2019-01-15 22:07   ` Laurent Pinchart
2018-11-01 23:31 ` [PATCH v2 03/30] media: entity: Walk the graph based on pads Niklas Söderlund
2019-01-15 22:21   ` Laurent Pinchart
     [not found]     ` <20190115223406.mxgzl36cp54gb7nv@kekkonen.localdomain>
2019-01-15 23:28       ` Laurent Pinchart
2019-01-22 14:50         ` Sakari Ailus
2019-02-14 15:15   ` Jacopo Mondi
2018-11-01 23:31 ` [PATCH v2 04/30] v4l: mc: Start walk from a specific pad in use count calculation Niklas Söderlund
2019-01-15 22:24   ` Laurent Pinchart
2019-01-15 22:36     ` Sakari Ailus
2018-11-01 23:31 ` [PATCH v2 05/30] media: entity: Move the pipeline from entity to pads Niklas Söderlund
2019-01-15 22:38   ` Laurent Pinchart
2019-01-15 22:48     ` Sakari Ailus
2019-02-14 15:53   ` Jacopo Mondi
2018-11-01 23:31 ` [PATCH v2 06/30] media: entity: Use pad as the starting point for a pipeline Niklas Söderlund
2019-01-15 22:54   ` Laurent Pinchart
2019-01-22 15:31     ` Sakari Ailus
2019-01-22 15:37       ` Laurent Pinchart
2019-01-22 16:16         ` Sakari Ailus [this message]
2018-11-01 23:31 ` [PATCH v2 07/30] media: entity: Add has_route entity operation Niklas Söderlund
2018-11-01 23:31 ` [PATCH v2 08/30] media: entity: Add media_has_route() function Niklas Söderlund
2018-11-01 23:31 ` [PATCH v2 09/30] media: entity: Swap pads if route is checked from source to sink Niklas Söderlund
2019-01-15 22:57   ` Laurent Pinchart
2019-01-22 15:15     ` Sakari Ailus
2019-01-22 15:20       ` Laurent Pinchart
2019-02-18  9:21         ` Jacopo Mondi
2019-02-22 12:18           ` Laurent Pinchart
2019-03-04 12:35             ` Jacopo Mondi
2019-03-05 20:04               ` Laurent Pinchart
2019-03-06  8:29                 ` Jacopo Mondi
2018-11-01 23:31 ` [PATCH v2 10/30] media: entity: Use routing information during graph traversal Niklas Söderlund
2018-11-01 23:31 ` [PATCH v2 11/30] media: entity: Skip link validation for pads to which there is no route to Niklas Söderlund
2019-01-15 23:13   ` Laurent Pinchart
2018-11-01 23:31 ` [PATCH v2 12/30] media: entity: Add an iterator helper for connected pads Niklas Söderlund
2019-01-15 23:24   ` Laurent Pinchart
2019-01-22 15:36     ` Sakari Ailus
2019-01-22 15:38       ` Laurent Pinchart
2019-01-22 16:21         ` Sakari Ailus
2018-11-01 23:31 ` [PATCH v2 13/30] media: entity: Add only connected pads to the pipeline Niklas Söderlund
2019-01-15 23:33   ` Laurent Pinchart
2018-11-01 23:31 ` [PATCH v2 14/30] media: entity: Add debug information in graph walk route check Niklas Söderlund
2019-01-15 23:35   ` Laurent Pinchart
2019-01-22 15:38     ` Sakari Ailus
2018-11-01 23:31 ` [PATCH v2 15/30] media: entity: Look for indirect routes Niklas Söderlund
2019-01-15 23:41   ` Laurent Pinchart
2019-01-22 15:56     ` Sakari Ailus
2018-11-01 23:31 ` [PATCH v2 16/30] v4l: subdev: Add [GS]_ROUTING subdev ioctls and operations Niklas Söderlund
2019-01-15 23:51   ` Laurent Pinchart
2019-01-22 16:14     ` Sakari Ailus
2019-01-22 17:00       ` Laurent Pinchart
2019-02-21 14:59     ` Jacopo Mondi
2019-02-21 23:49       ` Sakari Ailus
2019-02-22  8:46         ` Jacopo Mondi
2019-02-21 14:39   ` Jacopo Mondi
2019-02-21 22:31     ` Sakari Ailus
2019-02-22  8:40       ` Jacopo Mondi
2019-02-22 11:04         ` Sakari Ailus
2019-02-22 11:17           ` Jacopo Mondi
2019-02-22 11:29             ` Sakari Ailus
2019-02-22 13:37               ` Ian Arkver
2019-02-22 13:50               ` Geert Uytterhoeven
2018-11-01 23:31 ` [PATCH v2 17/30] v4l: subdev: compat: Implement handling for VIDIOC_SUBDEV_[GS]_ROUTING Niklas Söderlund
2019-01-08 10:04   ` Geert Uytterhoeven
2019-01-15 23:53   ` Laurent Pinchart
2019-01-22 15:57     ` Sakari Ailus
2019-02-18 11:21     ` Jacopo Mondi
2019-02-21 23:50       ` Sakari Ailus
2018-11-01 23:31 ` [PATCH v2 18/30] v4l: subdev: Take routing information into account in link validation Niklas Söderlund
2018-11-01 23:31 ` [PATCH v2 19/30] v4l: subdev: Improve link format validation debug messages Niklas Söderlund
2018-11-01 23:31 ` [PATCH v2 20/30] v4l: mc: Add an S_ROUTING helper function for power state changes Niklas Söderlund
2018-11-01 23:31 ` [PATCH v2 21/30] v4l: Add bus type to frame descriptors Niklas Söderlund
2018-11-01 23:31 ` [PATCH v2 22/30] v4l: Add CSI-2 bus configuration " Niklas Söderlund
2018-11-01 23:31 ` [PATCH v2 23/30] v4l: Add stream to frame descriptor Niklas Söderlund
2018-11-01 23:31 ` [PATCH v2 24/30] adv748x: csi2: add translation from pixelcode to CSI-2 datatype Niklas Söderlund
2018-11-01 23:31 ` [PATCH v2 25/30] adv748x: csi2: only allow formats on sink pads Niklas Söderlund
2019-02-21 14:18   ` Jacopo Mondi
2018-11-01 23:31 ` [PATCH v2 26/30] adv748x: csi2: describe the multiplexed stream Niklas Söderlund
2018-11-01 23:31 ` [PATCH v2 27/30] adv748x: csi2: add internal routing configuration Niklas Söderlund
2018-11-01 23:31 ` [PATCH v2 28/30] adv748x: afe: add routing support Niklas Söderlund
2018-11-01 23:31 ` [PATCH v2 29/30] rcar-csi2: use frame description information to configure CSI-2 bus Niklas Söderlund
2018-11-01 23:31 ` [PATCH v2 30/30] rcar-csi2: expose the subdevice internal routing Niklas Söderlund
2018-11-14 13:10   ` Nikita Yushchenko
2018-11-14 19:45     ` Niklas Söderlund
2018-12-03 22:16 ` [PATCH v2 00/30] v4l: add support for multiplexed streams Sakari Ailus
2018-12-05 22:09   ` Niklas Söderlund

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=20190122161642.ocpuuqp4cwq46wf2@paasikivi.fi.intel.com \
    --to=sakari.ailus@linux.intel.com \
    --cc=bparrot@ti.com \
    --cc=laurent.pinchart@ideasonboard.com \
    --cc=linux-media@vger.kernel.org \
    --cc=linux-renesas-soc@vger.kernel.org \
    --cc=niklas.soderlund+renesas@ragnatech.se \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).