From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
To: Sakari Ailus <sakari.ailus@iki.fi>
Cc: Hans Verkuil <hverkuil@xs4all.nl>,
Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>,
linux-media@vger.kernel.org, linux-renesas-soc@vger.kernel.org,
Mauro Carvalho Chehab <mchehab@kernel.org>,
Hans Verkuil <hans.verkuil@cisco.com>
Subject: Re: [PATCH v2 2/3] v4l: Clearly document interactions between formats, controls and buffers
Date: Sun, 05 Mar 2017 14:52:25 +0200 [thread overview]
Message-ID: <1655091.gPI0LlWvRn@avalon> (raw)
In-Reply-To: <20170304134854.GW3220@valkosipuli.retiisi.org.uk>
Hi Sakari,
On Saturday 04 Mar 2017 15:48:54 Sakari Ailus wrote:
> On Sat, Mar 04, 2017 at 11:57:32AM +0100, Hans Verkuil wrote:
> ...
>
> >>> +To simplify their implementation, drivers may also require buffers to
> >>> be +reallocated in order to change formats or controls that influence
> >>> the buffer +size. In that case, to perform such changes, userspace
> >>> applications shall +first stop the video stream with the
> >>> :c:func:`VIDIOC_STREAMOFF` ioctl if it +is running and free all buffers
> >>> with the :c:func:`VIDIOC_REQBUFS` ioctl if +they are allocated. The
> >>> format or controls can then be modified, and buffers +shall then be
> >>> reallocated and the stream restarted. A typical ioctl sequence +is
> >>> +
> >>> + #. VIDIOC_STREAMOFF
> >>> + #. VIDIOC_REQBUFS(0)
> >>> + #. VIDIOC_S_FMT
> >>> + #. VIDIOC_S_EXT_CTRLS
> >>
> >> Same here.
> >>
> >> Would it be safe to say that controls are changed first? I wonder if
> >> there could be special cases where this wouldn't apply though. It could
> >> ultimately come down to hardware features: rotation might be only
> >> available for certain formats so you'd need to change the format first
> >> to enable rotation.
> >>
> >> What you're documenting above is a typical sequence so it doesn't have to
> >> be applicable to all potential hardware. I might mention there could be
> >> such dependencies. I wonder if one exists at the moment. No?
> >
> > The way V4L2 works is that the last ioctl called gets 'preference'. So the
> > driver should attempt to satisfy the ioctl, even if that means undoing
> > previous ioctls. In other words, V4L2 allows any order, but the
> > end-result might be different depending on the hardware capabilities.
>
> Indeed. But the above sequence suggests that formats are set before
> controls. I suggested to clarify that part.
I agree with both of you. I'll clarify that this is just an example and that
formats and controls can be set in a different order (or even interleaved).
--
Regards,
Laurent Pinchart
next prev parent reply other threads:[~2017-03-05 12:51 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-02-28 15:03 [PATCH v2 0/3] Renesas R-Car VSP1 rotation support Laurent Pinchart
2017-02-28 15:03 ` [PATCH v2 1/3] v4l: vsp1: Fix multi-line comment style Laurent Pinchart
2017-02-28 15:03 ` [PATCH v2 2/3] v4l: Clearly document interactions between formats, controls and buffers Laurent Pinchart
2017-03-02 15:37 ` Sakari Ailus
2017-03-04 10:57 ` Hans Verkuil
2017-03-04 13:48 ` Sakari Ailus
2017-03-05 12:52 ` Laurent Pinchart [this message]
2017-03-04 10:53 ` Hans Verkuil
2017-03-04 14:37 ` Sakari Ailus
2017-03-06 9:27 ` Hans Verkuil
2017-03-05 14:35 ` Laurent Pinchart
2017-03-06 9:41 ` Hans Verkuil
2017-03-05 14:39 ` [PATCH v2.1] " Laurent Pinchart
2017-03-05 21:27 ` Sakari Ailus
2017-03-05 21:36 ` [PATCH v2.2] " Laurent Pinchart
2017-03-06 10:04 ` Hans Verkuil
2017-03-06 10:35 ` Laurent Pinchart
2017-03-06 10:46 ` Hans Verkuil
2017-03-06 13:38 ` Laurent Pinchart
2017-03-06 14:14 ` [PATCH v2.3] " Laurent Pinchart
2017-03-06 14:24 ` Hans Verkuil
2017-04-10 12:05 ` Mauro Carvalho Chehab
2017-02-28 15:03 ` [PATCH v2 3/3] v4l: vsp1: wpf: Implement rotation support Laurent Pinchart
2017-02-28 21:13 ` Sakari Ailus
2017-02-28 22:23 ` Laurent Pinchart
2017-03-06 0:43 ` [PATCH v2.1 " 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=1655091.gPI0LlWvRn@avalon \
--to=laurent.pinchart@ideasonboard.com \
--cc=hans.verkuil@cisco.com \
--cc=hverkuil@xs4all.nl \
--cc=laurent.pinchart+renesas@ideasonboard.com \
--cc=linux-media@vger.kernel.org \
--cc=linux-renesas-soc@vger.kernel.org \
--cc=mchehab@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