All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andrea <audetto@tiscali.it>
To: video4linux-list@redhat.com
Subject: Re: [PATCH] pwc: do not block in VIDIOC_DQBUF
Date: Mon, 07 Jul 2008 21:21:17 +0100	[thread overview]
Message-ID: <48727ABD.40608@tiscali.it> (raw)
In-Reply-To: <25500277.1215264222465.JavaMail.root@ps10>

audetto@tiscali.it wrote:
> I think the ioctl VIDIOC_DQBUF in pwc does not follow the API spec.
> It should not block if there are no buffers and the device has been 
> opened with O_NONBLOCK.
> 
> I am not sure the patch is 100% correct, since I do not understand it 
> completely.
> 
> Andrea

Anybody to review this patch?

The documentation of VIDIOC_DQBUF is at

http://www.linuxtv.org/downloads/video4linux/API/V4L2_API/spec/r8849.htm

diff -r 87aa6048e718 linux/drivers/media/video/pwc/pwc-v4l.c
--- a/linux/drivers/media/video/pwc/pwc-v4l.c   Wed Jul 02 08:59:38 2008 -0300
+++ b/linux/drivers/media/video/pwc/pwc-v4l.c   Mon Jul 07 21:17:49 2008 +0100
@@ -1134,6 +1136,13 @@
                                      frameq is safe now.
                          */
                         add_wait_queue(&pdev->frameq, &wait);
+
+                       if ((pdev->full_frames == NULL) && (file->f_flags & O_NONBLOCK)) {
+                               remove_wait_queue(&pdev->frameq, &wait);
+                               set_current_state(TASK_RUNNING);
+                               return -EAGAIN;
+                       }
+
                         while (pdev->full_frames == NULL) {
                                 if (pdev->error_status) {
                                         remove_wait_queue(&pdev->frameq, &wait);


--
video4linux-list mailing list
Unsubscribe mailto:video4linux-list-request@redhat.com?subject=unsubscribe
https://www.redhat.com/mailman/listinfo/video4linux-list

      reply	other threads:[~2008-07-07 20:23 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-07-05 13:23 [PATCH] pwc: do not block in VIDIOC_DQBUF audetto
2008-07-07 20:21 ` Andrea [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=48727ABD.40608@tiscali.it \
    --to=audetto@tiscali.it \
    --cc=video4linux-list@redhat.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.