From: Sakari Ailus <sakari.ailus@maxwell.research.nokia.com>
To: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Cc: "Aguirre Rodriguez, Sergio Alberto" <saaguirre@ti.com>,
Linux Media Mailing List <linux-media@vger.kernel.org>
Subject: Re: dqbuf in blocking mode
Date: Fri, 02 Oct 2009 15:37:11 +0300 [thread overview]
Message-ID: <4AC5F3F7.4010404@maxwell.research.nokia.com> (raw)
In-Reply-To: <200910011534.28019.laurent.pinchart@ideasonboard.com>
Laurent Pinchart wrote:
[clip]
> If I'm not mistaken videobuf_dqbuf() only returns -EIO if the buffer state is
> VIDEOBUF_ERROR. This is the direct result of either
>
> - videobuf_queue_cancel() being called, or
> - the device driver marking the buffer as erroneous because of a (possibly
> transient) device error
>
> In the first case VIDIOC_DQBUF should in my opinion return with an error. In
> the second case things are not that clear. A transient error could be hidden
> from the application, or, if returned to the application through -EIO,
> shouldn't be treated as a fatal error. Non-transient errors should result in
> the application stopping video streaming.
>
> Unfortunately there V4L2 API doesn't offer a way to find out if the error is
> transient or fatal:
>
> "EIO VIDIOC_DQBUF failed due to an internal error. Can also indicate
> temporary problems like signal loss. Note the driver might dequeue an (empty)
> buffer despite returning an error, or even stop capturing."
>
> -EIO can mean many different things that need to be handled differently by
> applications. I especially hate the "the driver might dequeue an (empty)
> buffer despite returning an error".
>
> Drivers should always or never dequeue a buffer when an error occurs, not
> sometimes. The problem is for the application to recognize the difference
> between a transient and a fatal error in a backward-compatible way.
The errors in this case are transient and for blocking mode IMO the
safest way is to return the buffer only when there's one available.
Which is what the driver is doing now.
What I'd probably change, however, is to move the handling to the ISP
driver instead.
Regards,
--
Sakari Ailus
sakari.ailus@maxwell.research.nokia.com
prev parent reply other threads:[~2009-10-02 12:37 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-10-01 11:56 dqbuf in blocking mode Aguirre Rodriguez, Sergio Alberto
2009-10-01 13:34 ` Laurent Pinchart
2009-10-01 16:58 ` Aguirre Rodriguez, Sergio Alberto
2009-10-02 12:37 ` Sakari Ailus [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=4AC5F3F7.4010404@maxwell.research.nokia.com \
--to=sakari.ailus@maxwell.research.nokia.com \
--cc=laurent.pinchart@ideasonboard.com \
--cc=linux-media@vger.kernel.org \
--cc=saaguirre@ti.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.