From: Sakari Ailus <sakari.ailus@maxwell.research.nokia.com>
To: Hans Verkuil <hverkuil@xs4all.nl>
Cc: Laurent Pinchart <laurent.pinchart@ideasonboard.com>,
Guennadi Liakhovetski <g.liakhovetski@gmx.de>,
Hans Verkuil <hansverk@cisco.com>,
Linux Media Mailing List <linux-media@vger.kernel.org>,
Mauro Carvalho Chehab <mchehab@infradead.org>
Subject: Re: [PATCH/RFC 1/4] V4L: add three new ioctl()s for multi-size videobuffer management
Date: Mon, 11 Apr 2011 14:27:23 +0300 [thread overview]
Message-ID: <4DA2E59B.3050108@maxwell.research.nokia.com> (raw)
In-Reply-To: <67d14bc84cde1153c035ddff7efdcb8f.squirrel@webmail.xs4all.nl>
Hi Hans,
Hans Verkuil wrote:
>> Hi Hans,
>>
>> On Thursday 07 April 2011 09:50:13 Hans Verkuil wrote:
>>>> On Thu, 7 Apr 2011, Hans Verkuil wrote:
>>
>> [snip]
>>
>>>>> Regarding DESTROY_BUFS: perhaps we should just skip this for now and
>>> wait
>>>>> for the first use-case. That way we don't need to care about holes. I
>>>>> don't like artificial restrictions like 'no holes'. If someone has a
>>> good
>>>>> use-case for selectively destroying buffers, then we need to look at
>>> this
>>>>> again.
>>>>
>>>> Sorry, skip what? skip the ioctl completely and rely on REQBUFS(0) /
>>>> close()?
>>>
>>> Yes.
>>
>> I don't really like that as it would mix CREATE and REQBUFS calls.
>> Applications should either use the old API (REQBUFS) or the new one, but
>> not
>> mix both.
>
> That's a completely unnecessary limitation. And from the point of view of
> vb2 it shouldn't even matter.
If calls to {CREATE,DESTROY}_BUF and REQBUFS are allowed to be mixed, it
would be nice to define the API so that one could implement REQBUFS
using CREATE_BUFS and DESTROY_BUFS. Then, drivers would not need to
implement REQBUFS separately which would still be used by majority of
applications. And Videobuf2 wouldn't need to implement REQBUFS at all.
Would this require more than to require buffer indices starting from
zero and be contiguous when there are no existing allocations?
The spec says under VIDIOC_QBUF that "Valid index numbers range from
zero to the number of buffers allocated with VIDIOC_REQBUFS (struct
v4l2_requestbuffers count) minus one."
>> The fact that freeing arbitrary spans of buffers gives us uneasy feelings
>> might be a sign that the CREATE/DESTROY API is not mature enough. I'd
>> rather
>> try to solve the issue now instead of postponing it for later and discover
>> that our CREATE API should have been different.
>
> What gives me an uneasy feeling is prohibiting freeing arbitrary spans of
> buffers. I rather choose not to implement the DESTROY ioctl instead of
> implementing a limited version of it, also because we do not have proper
> use cases yet. But I have no problems with the CREATE/DESTROY API as such.
What would you think about using an array of index numbers rather than a
range for both? One must manage index number allocation even when using
a range and it might not be easier than to allocate all buffers from a
relatively small range (e.g. index numbers from 0 to 63), whose
implementation could be a bit field.
Cheers,
--
Sakari Ailus
sakari.ailus@maxwell.research.nokia.com
next prev parent reply other threads:[~2011-04-11 11:27 UTC|newest]
Thread overview: 59+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-04-01 8:12 [PATCH/RFC 0/4] V4L: new ioctl()s to support multi-sized video-buffers Guennadi Liakhovetski
2011-04-01 8:13 ` [PATCH/RFC 1/4] V4L: add three new ioctl()s for multi-size videobuffer management Guennadi Liakhovetski
2011-04-04 7:05 ` Hans Verkuil
2011-04-04 7:38 ` Guennadi Liakhovetski
2011-04-04 8:06 ` Hans Verkuil
2011-04-04 8:23 ` Guennadi Liakhovetski
2011-04-05 12:02 ` Laurent Pinchart
2011-04-05 12:40 ` Guennadi Liakhovetski
2011-04-05 12:40 ` Hans Verkuil
2011-04-05 12:53 ` Laurent Pinchart
2011-04-05 11:59 ` Laurent Pinchart
2011-04-05 12:39 ` Guennadi Liakhovetski
2011-04-05 12:56 ` Laurent Pinchart
2011-04-05 14:53 ` Sakari Ailus
2011-04-05 12:21 ` Laurent Pinchart
2011-04-05 12:34 ` Hans Verkuil
2011-04-05 12:50 ` Laurent Pinchart
2011-04-05 12:52 ` Guennadi Liakhovetski
2011-04-05 12:58 ` Laurent Pinchart
2011-04-06 16:19 ` Guennadi Liakhovetski
2011-04-07 7:06 ` Hans Verkuil
2011-04-07 7:15 ` Guennadi Liakhovetski
2011-04-07 7:50 ` Hans Verkuil
2011-04-07 8:53 ` Guennadi Liakhovetski
2011-04-07 9:13 ` Hans Verkuil
2011-04-07 9:17 ` Laurent Pinchart
2011-04-07 9:28 ` Hans Verkuil
2011-04-11 11:27 ` Sakari Ailus [this message]
2011-04-11 8:54 ` Sakari Ailus
2011-05-13 7:45 ` Guennadi Liakhovetski
2011-05-14 11:12 ` Hans Verkuil
2011-05-16 13:32 ` Sakari Ailus
2011-05-16 20:34 ` Guennadi Liakhovetski
2011-05-17 5:52 ` Sakari Ailus
2011-05-18 14:01 ` Laurent Pinchart
2011-05-18 14:48 ` Guennadi Liakhovetski
2011-05-18 19:58 ` Sakari Ailus
2011-06-06 13:10 ` Guennadi Liakhovetski
2011-06-06 17:28 ` Sakari Ailus
2011-06-07 12:14 ` Guennadi Liakhovetski
2011-06-08 9:04 ` Sakari Ailus
2011-05-22 10:18 ` Guennadi Liakhovetski
2011-05-22 12:17 ` Sakari Ailus
2011-05-18 13:59 ` Laurent Pinchart
2011-05-18 15:15 ` Guennadi Liakhovetski
2011-05-18 18:02 ` Sakari Ailus
2011-04-01 8:13 ` [PATCH/RFC 2/4] V4L: add videobuf2 helper functions to support multi-size video-buffers Guennadi Liakhovetski
2011-04-01 14:06 ` [PATCH/RFC 2/4 v2] " Guennadi Liakhovetski
2011-04-03 17:34 ` Pawel Osciak
2011-04-04 7:55 ` Guennadi Liakhovetski
2011-04-05 12:42 ` Laurent Pinchart
2011-04-05 12:38 ` Laurent Pinchart
2011-04-05 13:01 ` Guennadi Liakhovetski
2011-04-01 8:13 ` [PATCH/RFC 3/4] V4L: soc-camera: add support for new multi-size video-buffer ioctl()s Guennadi Liakhovetski
2011-04-01 8:13 ` [PATCH/RFC 4/4] V4L: sh_mobile_ceu_camera: support multi-size video-buffers Guennadi Liakhovetski
2011-04-03 17:34 ` [PATCH/RFC 0/4] V4L: new ioctl()s to support multi-sized video-buffers Pawel Osciak
2011-04-04 7:15 ` Guennadi Liakhovetski
2011-04-05 12:19 ` Laurent Pinchart
2011-04-05 12:48 ` Guennadi Liakhovetski
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=4DA2E59B.3050108@maxwell.research.nokia.com \
--to=sakari.ailus@maxwell.research.nokia.com \
--cc=g.liakhovetski@gmx.de \
--cc=hansverk@cisco.com \
--cc=hverkuil@xs4all.nl \
--cc=laurent.pinchart@ideasonboard.com \
--cc=linux-media@vger.kernel.org \
--cc=mchehab@infradead.org \
/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