Re: [PATCH RFC 3/3] s5p-fimc: improved pipeline try format routine

Sakari Ailus
2012-12-04T23:22:14Z

Hi Andrzej,

On Fri, Nov 23, 2012 at 04:22:30PM +0100, Andrzej Hajda wrote:
> Function support variable number of subdevs in pipe-line.
>
> Signed-off-by: Andrzej Hajda <a.hajda@samsung.com>
> Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
> ---
> drivers/media/platform/s5p-fimc/fimc-capture.c | 100 +++++++++++++++---------
> 1 file changed, 64 insertions(+), 36 deletions(-)
>
> diff --git a/drivers/media/platform/s5p-fimc/fimc-capture.c b/drivers/media/platform/s5p-fimc/fimc-capture.c
> index 3acbea3..39c4555 100644
> --- a/drivers/media/platform/s5p-fimc/fimc-capture.c
> +++ b/drivers/media/platform/s5p-fimc/fimc-capture.c
> @@ -794,6 +794,21 @@ static int fimc_cap_enum_fmt_mplane(struct file *file, void *priv,
> return 0;
> }
>
> +static struct media_entity *fimc_pipeline_get_head(struct media_entity *me)
> +{
> + struct media_pad *pad = &me->pads[0];
> +
> + while (!(pad->flags & MEDIA_PAD_FL_SOURCE)) {
> + pad = media_entity_remote_source(pad);
> + if (!pad)
> + break;

Isn't it an error if a sink pad of the entity isn't connected?
media_entity_remote_source(pad) returns NULL if the link is disabled. I'm
just wondering if this is possible.

> + me = pad->entity;
> + pad = &me->pads[0];
> + }
> +
> + return me;
> +}
> +

--
Kind regards,

Sakari Ailus
e-mail: sakari.ailus@iki.fi XMPP: sailus@retiisi.org.uk