public inbox for linux-media@vger.kernel.org
 help / color / mirror / Atom feed
From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
To: Sakari Ailus <sakari.ailus@iki.fi>
Cc: linux-media@vger.kernel.org, dacohen@gmail.com, snjw23@gmail.com,
	andriy.shevchenko@linux.intel.com, t.stanislaws@samsung.com,
	tuukkat76@gmail.com, k.debski@samsung.com, riverful@gmail.com,
	hverkuil@xs4all.nl, teturtia@gmail.com
Subject: Re: [PATCH v4 16/34] media: Collect entities that are part of the pipeline before link validation
Date: Mon, 05 Mar 2012 12:13:39 +0100	[thread overview]
Message-ID: <7119876.zcxcmOKuSu@avalon> (raw)
In-Reply-To: <1330709442-16654-16-git-send-email-sakari.ailus@iki.fi>

Hi Sakari,

Thanks for the patch.

On Friday 02 March 2012 19:30:24 Sakari Ailus wrote:
> Make information available which entities are part of the pipeline before
> link_validate() ops are being called.
> 
> Signed-off-by: Sakari Ailus <sakari.ailus@iki.fi>
> ---
>  drivers/media/media-entity.c |   23 ++++++++++++++++++++---
>  include/media/media-entity.h |    1 +
>  2 files changed, 21 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/media/media-entity.c b/drivers/media/media-entity.c
> index d6d0e81..55f66c6 100644
> --- a/drivers/media/media-entity.c
> +++ b/drivers/media/media-entity.c
> @@ -220,12 +220,19 @@ __must_check int media_entity_pipeline_start(struct
> media_entity *entity, struct media_device *mdev = entity->parent;
>  	struct media_entity_graph graph;
>  	struct media_entity *entity_err = entity;
> +	struct {
> +		struct media_entity *entity;
> +		struct media_link *link;
> +	} to_validate[MEDIA_ENTITY_ENUM_MAX_DEPTH];
> +	int nto_validate = 0;
>  	int ret;
> 
>  	mutex_lock(&mdev->graph_mutex);
> 
>  	media_entity_graph_walk_start(&graph, entity);
> 
> +	pipe->entities = 0;
> +
>  	while ((entity = media_entity_graph_walk_next(&graph))) {
>  		unsigned int i;
> 
> @@ -237,6 +244,8 @@ __must_check int media_entity_pipeline_start(struct
> media_entity *entity, if (entity->stream_count > 1)
>  			continue;
> 
> +		pipe->entities |= 1 << entity->id;
> +
>  		if (!entity->ops || !entity->ops->link_validate)
>  			continue;
> 
> @@ -251,12 +260,20 @@ __must_check int media_entity_pipeline_start(struct
> media_entity *entity, if (link->sink->entity != entity)
>  				continue;
> 
> -			ret = entity->ops->link_validate(link);
> -			if (ret < 0 && ret != -ENOIOCTLCMD)
> -				goto error;
> +			BUG_ON(nto_validate >= MEDIA_ENTITY_ENUM_MAX_DEPTH);
> +			to_validate[nto_validate].entity = entity;
> +			to_validate[nto_validate].link = link;
> +			nto_validate++;
>  		}
>  	}
> 
> +	for (nto_validate--; nto_validate >= 0; nto_validate--) {
> +		ret = to_validate[nto_validate].entity->ops->
> +			link_validate(to_validate[nto_validate].link);
> +		if (ret < 0 && ret != -ENOIOCTLCMD)
> +			goto error;
> +	}
> +
>  	mutex_unlock(&mdev->graph_mutex);
> 
>  	return 0;
> diff --git a/include/media/media-entity.h b/include/media/media-entity.h
> index 0c16f51..bbfc8f2 100644
> --- a/include/media/media-entity.h
> +++ b/include/media/media-entity.h
> @@ -27,6 +27,7 @@
>  #include <linux/media.h>
> 
>  struct media_pipeline {
> +	u32 entities;

This assume there will be no more than 32 entities. I don't think that's a 
safe assumption, especially with ALSA devices. I'm not sure I would put this 
in the media controller core just yet.

>  };
> 
>  struct media_link {

-- 
Regards,

Laurent Pinchart


  reply	other threads:[~2012-03-05 11:13 UTC|newest]

Thread overview: 57+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-03-02 17:32 [PATCH v4 0/34] V4L2 subdev and sensor control changes, SMIA++ driver and N9 camera board code Sakari Ailus
2012-03-02 17:30 ` [PATCH v4 01/34] v4l: Introduce integer menu controls Sakari Ailus
2012-03-02 17:30 ` [PATCH v4 02/34] v4l: Document " Sakari Ailus
2012-03-02 17:30 ` [PATCH v4 03/34] vivi: Add an integer menu test control Sakari Ailus
2012-03-02 17:30 ` [PATCH v4 04/34] v4l: VIDIOC_SUBDEV_S_SELECTION and VIDIOC_SUBDEV_G_SELECTION IOCTLs Sakari Ailus
2012-03-05 10:59   ` Laurent Pinchart
2012-03-06 15:50     ` Sakari Ailus
2012-03-06 16:27       ` Laurent Pinchart
2012-03-06 16:40         ` Tomasz Stanislawski
2012-03-06 19:55           ` Sakari Ailus
2012-03-06 19:57             ` Laurent Pinchart
2012-03-06 19:58               ` Sakari Ailus
2012-03-08 16:10                 ` Tomasz Stanislawski
2012-03-02 17:30 ` [PATCH v4 05/34] v4l: vdev_to_v4l2_subdev() should have return type "struct v4l2_subdev *" Sakari Ailus
2012-03-02 17:30 ` [PATCH v4 06/34] v4l: Check pad number in get try pointer functions Sakari Ailus
2012-03-05 11:01   ` Laurent Pinchart
2012-03-02 17:30 ` [PATCH v4 07/34] v4l: Support s_crop and g_crop through s/g_selection Sakari Ailus
2012-03-02 17:30 ` [PATCH v4 08/34] v4l: Add subdev selections documentation: svg and dia files Sakari Ailus
2012-03-05 11:07   ` Laurent Pinchart
2012-03-06 15:09     ` Sakari Ailus
2012-03-02 17:30 ` [PATCH v4 09/34] v4l: Add subdev selections documentation Sakari Ailus
2012-03-05 11:47   ` Laurent Pinchart
2012-03-06 12:08     ` Sakari Ailus
2012-03-02 17:30 ` [PATCH v4 10/34] v4l: Mark VIDIOC_SUBDEV_G_CROP and VIDIOC_SUBDEV_S_CROP obsolete Sakari Ailus
2012-03-02 17:30 ` [PATCH v4 11/34] v4l: Image source control class Sakari Ailus
2012-03-02 17:30 ` [PATCH v4 12/34] v4l: Image processing " Sakari Ailus
2012-03-02 17:30 ` [PATCH v4 13/34] v4l: Document raw bayer 4CC codes Sakari Ailus
2012-03-02 17:30 ` [PATCH v4 14/34] v4l: Add DPCM compressed formats Sakari Ailus
2012-03-02 17:30 ` [PATCH v4 15/34] media: Add link_validate() op to check links to the sink pad Sakari Ailus
2012-03-05 11:10   ` Laurent Pinchart
2012-03-02 17:30 ` [PATCH v4 16/34] media: Collect entities that are part of the pipeline before link validation Sakari Ailus
2012-03-05 11:13   ` Laurent Pinchart [this message]
2012-03-06 12:09     ` Sakari Ailus
2012-03-02 17:30 ` [PATCH v4 17/34] v4l: Improve sub-device documentation for pad ops Sakari Ailus
2012-03-02 17:30 ` [PATCH v4 18/34] v4l: Implement v4l2_subdev_link_validate() Sakari Ailus
2012-03-05 11:16   ` Laurent Pinchart
2012-03-02 17:30 ` [PATCH v4 19/34] v4l: Allow changing control handler lock Sakari Ailus
2012-03-02 17:30 ` [PATCH v4 20/34] omap3isp: Support additional in-memory compressed bayer formats Sakari Ailus
2012-03-02 17:30 ` [PATCH v4 21/34] omap3isp: Move definitions required by board code under include/media Sakari Ailus
2012-03-02 17:30 ` [PATCH v4 22/34] omap3: add definition for CONTROL_CAMERA_PHY_CTRL Sakari Ailus
2012-03-02 17:30 ` [PATCH v4 23/34] omap3isp: Move setting constaints above media_entity_pipeline_start Sakari Ailus
2012-03-02 17:30 ` [PATCH v4 24/34] omap3isp: Assume media_entity_pipeline_start may fail Sakari Ailus
2012-03-05 11:26   ` Laurent Pinchart
2012-03-06 10:22     ` Sakari Ailus
2012-03-02 17:30 ` [PATCH v4 25/34] omap3isp: Add lane configuration to platform data Sakari Ailus
2012-03-02 17:30 ` [PATCH v4 26/34] omap3isp: Add information on external subdev to struct isp_pipeline Sakari Ailus
2012-03-05 11:28   ` Laurent Pinchart
2012-03-02 17:30 ` [PATCH v4 27/34] omap3isp: Introduce isp_video_check_external_subdevs() Sakari Ailus
2012-03-02 17:30 ` [PATCH v4 28/34] omap3isp: Use external rate instead of vpcfg Sakari Ailus
2012-03-02 17:30 ` [PATCH v4 29/34] omap3isp: Default link validation for ccp2, csi2, preview and resizer Sakari Ailus
2012-03-05 11:31   ` Laurent Pinchart
2012-03-02 17:30 ` [PATCH v4 30/34] omap3isp: Move CCDC link validation to ccdc_link_validate() Sakari Ailus
2012-03-02 17:30 ` [PATCH v4 31/34] omap3isp: Configure CSI-2 phy based on platform data Sakari Ailus
2012-03-02 17:30 ` [PATCH v4 32/34] omap3isp: Add resizer data rate configuration to resizer_link_validate Sakari Ailus
2012-03-02 17:30 ` [PATCH v4 33/34] smiapp: Add driver Sakari Ailus
2012-03-02 17:30 ` [PATCH v4 34/34] rm680: Add camera init Sakari Ailus
2012-03-05 11:36   ` Laurent Pinchart

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=7119876.zcxcmOKuSu@avalon \
    --to=laurent.pinchart@ideasonboard.com \
    --cc=andriy.shevchenko@linux.intel.com \
    --cc=dacohen@gmail.com \
    --cc=hverkuil@xs4all.nl \
    --cc=k.debski@samsung.com \
    --cc=linux-media@vger.kernel.org \
    --cc=riverful@gmail.com \
    --cc=sakari.ailus@iki.fi \
    --cc=snjw23@gmail.com \
    --cc=t.stanislaws@samsung.com \
    --cc=teturtia@gmail.com \
    --cc=tuukkat76@gmail.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox