From: Hans Verkuil <hverkuil@xs4all.nl>
To: Sakari Ailus <sakari.ailus@iki.fi>
Cc: linux-media@vger.kernel.org, jh1009.sung@samsung.com,
Hans Verkuil <hans.verkuil@cisco.com>
Subject: Re: [PATCH 1/2] vb2: drop v4l2_format argument from queue_setup
Date: Sun, 8 Nov 2015 14:43:09 +0100 [thread overview]
Message-ID: <563F516D.5060304@xs4all.nl> (raw)
In-Reply-To: <20151107204045.GR17128@valkosipuli.retiisi.org.uk>
On 11/07/2015 09:40 PM, Sakari Ailus wrote:
> Hi Hans,
>
> On Thu, Oct 29, 2015 at 05:24:25AM +0100, Hans Verkuil wrote:
>> From: Hans Verkuil <hans.verkuil@cisco.com>
>>
>> The queue_setup callback has a void pointer that is just for V4L2
>> and is the pointer to the v4l2_format struct that was passed to
>> VIDIOC_CREATE_BUFS. The idea was that drivers would use the information
>> from that struct to buffers suitable for the requested format.
>>
>> After the vb2 split series this pointer is now a void pointer,
>> which is ugly, and the reality is that all existing drivers will
>> effectively just look at the sizeimage field of v4l2_format.
>>
>> To make this more generic the queue_setup callback is changed:
>> the void pointer is dropped, instead if the *num_planes argument
>> is 0, then use the current format size, if it is non-zero, then
>> it contains the number of requested planes and the sizes array
>> contains the requested sizes. If either is unsupported, then return
>> -EINVAL, otherwise use the requested size(s).
>
> Please don't.
>
> This effectively prevents allocating new buffers while streaming if they're
> for a different format than that used by the stream.
Why would this prevent that feature? It's perfectly fine to do that. The only
limitation is that you may need to verify the format beforehand (using TRY_FMT).
Even if drivers really need to do something special, then they can still do
that by providing their own vidioc_create_bufs() callback that does the validation.
Regards,
Hans
> That was the very point
> in struct v4l2_format being part of the argument to the IOCTL.
>
> If this is not used right now I could well imagine someone to need it sooner
> or later.
>
next prev parent reply other threads:[~2015-11-08 13:43 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-10-29 4:24 [PATCH 0/2] vb2: modify VIDIOC_CREATE_BUFS format handling Hans Verkuil
2015-10-29 4:24 ` [PATCH 1/2] vb2: drop v4l2_format argument from queue_setup Hans Verkuil
2015-11-06 5:36 ` Junghak Sung
2015-11-07 20:40 ` Sakari Ailus
2015-11-08 13:43 ` Hans Verkuil [this message]
2015-10-29 4:24 ` [PATCH 2/2] DocBook media: update VIDIOC_CREATE_BUFS documentation Hans Verkuil
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=563F516D.5060304@xs4all.nl \
--to=hverkuil@xs4all.nl \
--cc=hans.verkuil@cisco.com \
--cc=jh1009.sung@samsung.com \
--cc=linux-media@vger.kernel.org \
--cc=sakari.ailus@iki.fi \
/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