public inbox for linux-media@vger.kernel.org
 help / color / mirror / Atom feed
From: Sylwester Nawrocki <s.nawrocki@samsung.com>
To: Sakari Ailus <sakari.ailus@iki.fi>
Cc: Andrzej Hajda <a.hajda@samsung.com>,
	linux-media@vger.kernel.org,
	Kyungmin Park <kyungmin.park@samsung.com>,
	Seung-Woo Kim <sw0312.kim@samsung.com>,
	Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Subject: Re: [PATCH RFC 3/3] s5p-fimc: improved pipeline try format routine
Date: Wed, 05 Dec 2012 10:57:04 +0100	[thread overview]
Message-ID: <50BF1A70.8070502@samsung.com> (raw)
In-Reply-To: <20121204232208.GP31879@valkosipuli.retiisi.org.uk>

Hi Sakari,

Thank you for the comments.

On 12/05/2012 12:22 AM, Sakari Ailus wrote:
>> 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.

It is not possible to not have all links connected, from video device to
the sensor subdev entity, at the point when this function is called
(from within VIDIOC_TRY_FMT or VIDIOC_S_FMT ioctls). fimc_pipeline_prepare()
walks the graph in direction from video node to the sensor, also using
media_entity_remote_source(). If it doesn't reach the sensor entity and
save a pointer to it for further reference the video node open() will fail.
And there won't be even a chance to invoke VIDIOC_TRY_FMT/VIDIOC_S_FMT 
ioctls. It's true the above function takes some assumptions that could be
explained with a relevant comment.

It's worth to note that all this in-driver setting of format at the 
pipeline is for static default links created by the driver. If userspace 
reconfigures links it should not rely on it in first place. When we finally 
prepare a libv4l support for this driver it should just go away. Regular 
V4L2 applications must use libv4l2 anyway since the driver supports only 
multi-planar API.

--

Regards,
Sylwester


      parent reply	other threads:[~2012-12-05  9:57 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-11-23 15:22 [PATCH RFC 0/3] s5c73m3 camera sensor driver Andrzej Hajda
2012-11-23 15:22 ` [PATCH RFC 1/3] [media] s5c73m3: Add driver Andrzej Hajda
2012-12-31 11:15   ` Sylwester Nawrocki
2012-11-23 15:22 ` [PATCH RFC 2/3] s5p-fimc: add support for sensors with multiple pads Andrzej Hajda
2012-11-23 15:22 ` [PATCH RFC 3/3] s5p-fimc: improved pipeline try format routine Andrzej Hajda
2012-12-04 15:55   ` Sylwester Nawrocki
2012-12-05  8:36     ` Andrzej Hajda
2012-12-04 23:22   ` Sakari Ailus
2012-12-05  8:12     ` Andrzej Hajda
2012-12-05  9:57     ` Sylwester Nawrocki [this message]

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=50BF1A70.8070502@samsung.com \
    --to=s.nawrocki@samsung.com \
    --cc=a.hajda@samsung.com \
    --cc=kyungmin.park@samsung.com \
    --cc=laurent.pinchart@ideasonboard.com \
    --cc=linux-media@vger.kernel.org \
    --cc=sakari.ailus@iki.fi \
    --cc=sw0312.kim@samsung.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