linux-media.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
To: Pawel Osciak <pawel@osciak.com>
Cc: LMML <linux-media@vger.kernel.org>,
	Hans Verkuil <hverkuil@xs4all.nl>,
	Nicolas Dufresne <nicolas.dufresne@collabora.com>,
	Marek Szyprowski <m.szyprowski@samsung.com>,
	Kyungmin Park <kyungmin.park@samsung.com>
Subject: Re: [PATCH/RFC v2 2/2] v4l: vb2: Add fatal error condition flag
Date: Fri, 06 Jun 2014 11:19:36 +0200	[thread overview]
Message-ID: <2013428.7yG2aMynBj@avalon> (raw)
In-Reply-To: <CAMm-=zCQsPP4k1RDtVfHxk4AWhLESUMDT=+aHnM3nReBtpa8qA@mail.gmail.com>

Hi Pawel,

On Friday 06 June 2014 14:31:15 Pawel Osciak wrote:
> Hi Laurent,
> Thanks for the patch. Did you test this to work in fileio mode? Looks
> like it should, but would like to make sure.

No, I haven't tested it. The OMAP4 ISS driver, which is my test target for 
this patch, doesn't support fileio mode. Adding VB2_READ would be easy, but 
the driver requires configuring the format on the file handle used for 
streaming, so I can't just run cat /dev/video*.

> On Thu, Jun 5, 2014 at 9:23 PM, Laurent Pinchart wrote:
> > When a fatal error occurs that render the device unusable, the only
> > options for a driver to signal the error condition to userspace is to
> > set the V4L2_BUF_FLAG_ERROR flag when dequeuing buffers and to return an
> > error from the buffer prepare handler when queuing buffers.
> > 
> > The buffer error flag indicates a transient error and can't be used by
> > applications to detect fatal errors. Returning an error from vb2_qbuf()
> > is thus the only real indication that a fatal error occurred. However,
> > this is difficult to handle for multithreaded applications that requeue
> > buffers from a thread other than the control thread. In particular the
> > poll() call in the control thread will not notify userspace of the
> > error.
> > 
> > This patch adds an explicit mechanism to report fatal errors to
> > userspace. Applications can call the vb2_queue_error() function to
> > signal a fatal error. From this moment on, buffer preparation will
> > return -EIO to userspace, and vb2_poll() will set the POLLERR flag and
> > return immediately. The error flag is cleared when cancelling the queue,
> > either at stream off time (through vb2_streamoff) or when releasing the
> > queue with vb2_queue_release().
> > 
> > Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>

-- 
Regards,

Laurent Pinchart


  reply	other threads:[~2014-06-06  9:19 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-06-05 12:23 [PATCH/RFC v2 0/2] vb2: Report POLLERR for fatal errors only Laurent Pinchart
2014-06-05 12:23 ` [PATCH/RFC v2 1/2] v4l: vb2: Don't return POLLERR during transient buffer underruns Laurent Pinchart
2014-06-06  5:15   ` Pawel Osciak
2014-06-06  9:50   ` Hans de Goede
2014-06-06  9:58     ` Hans Verkuil
2014-06-06 13:42       ` Laurent Pinchart
2014-09-15 11:14         ` Hans Verkuil
2014-09-15 12:02           ` Mauro Carvalho Chehab
2014-09-15 12:49             ` Laurent Pinchart
2014-09-15 12:56               ` Nicolas Dufresne
2014-09-15 13:55                 ` Mauro Carvalho Chehab
2014-09-15 14:33                   ` Nicolas Dufresne
2014-09-15 15:51                     ` Mauro Carvalho Chehab
2014-09-16 10:29           ` Laurent Pinchart
2014-09-16 11:18             ` Hans Verkuil
2014-09-16 12:19               ` Laurent Pinchart
2014-06-05 12:23 ` [PATCH/RFC v2 2/2] v4l: vb2: Add fatal error condition flag Laurent Pinchart
2014-06-06  5:31   ` Pawel Osciak
2014-06-06  9:19     ` Laurent Pinchart [this message]
2014-06-06  9:31       ` Hans Verkuil
2014-06-06  9:46         ` Laurent Pinchart
2014-06-06  9:55           ` Hans Verkuil
2014-06-06 13:42             ` Laurent Pinchart
2014-06-06 13:45               ` 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=2013428.7yG2aMynBj@avalon \
    --to=laurent.pinchart@ideasonboard.com \
    --cc=hverkuil@xs4all.nl \
    --cc=kyungmin.park@samsung.com \
    --cc=linux-media@vger.kernel.org \
    --cc=m.szyprowski@samsung.com \
    --cc=nicolas.dufresne@collabora.com \
    --cc=pawel@osciak.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;
as well as URLs for NNTP newsgroup(s).