All of lore.kernel.org
 help / color / mirror / Atom feed
From: Gregor Jasny <jasny@vidsoft.de>
To: Jiri Slaby <jirislaby@gmail.com>
Cc: video4linux-list@redhat.com,
	SPCA50x Linux Device Driver Development
	<spca50x-devs@lists.sourceforge.net>,
	v4l2 library <v4l2-library@linuxtv.org>,
	Brandon Philips <bphilips@suse.de>
Subject: Re: [V4l2-library] Messed up syscall return value
Date: Tue, 29 Jul 2008 00:16:28 +0200	[thread overview]
Message-ID: <20080728221628.GB21280@vidsoft.de> (raw)
In-Reply-To: <488E4090.5020600@gmail.com>

On Mon, Jul 28, 2008 at 11:56:32PM +0200, Jiri Slaby wrote:
> On 07/28/2008 11:49 PM, Gregor Jasny wrote:
> >I've observed strange behavior in the REQBUFS ioctl for the non-emulated
> >case.
> >
> >I've debugged the problem to the line:
> >result = syscall(SYS_ioctl, devices[index].fd, VIDIOC_REQBUFS, req);
> >
> >Here the value 2 get stored into result, although the kernel driver
> >returned success (at least it does not complain loudly in the logs).
> >
> strace and ltrace will help in this case I guess. Could you provide them for
> your testcases?

Sure:

ioctl(3, VIDIOC_QUERYCAP or VT_OPENQRY, 0x7fffbfd9fdd0) = 0
ioctl(3, VIDIOC_G_FMT or VT_SENDSIG, 0x7fffbfd9fd00) = 0
ioctl(3, VIDIOC_ENUM_FMT or VT_SETMODE, 0x7fffbfd9fc40) = 0
ioctl(3, VIDIOC_ENUM_FMT or VT_SETMODE, 0x7fffbfd9fc40) = -1 EINVAL (Invalid argument)
ioctl(3, VIDIOC_TRY_FMT, 0x7fffbfda0080) = 0
ioctl(3, VIDIOC_S_FMT or VT_RELDISP, 0x7fffbfd9fd40) = 0
ioctl(3, VIDIOC_REQBUFS or VT_DISALLOCATE, 0x7fffbfda0060) = 2

Huh? Something evils seems to be going on in V4L2 land.
I've spotted the following lines in videobuf-core.c:videobuf_reqbufs

        req->count = retval;

 done:
        mutex_unlock(&q->vb_lock);
        return retval;

That would explain the retval '2'. It seems a retval = 0; statement is missing here for the success case.

Gregor

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

  parent reply	other threads:[~2008-07-28 22:16 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-07-23 12:20 Announcing libv4l 0.3.7 Hans de Goede
2008-07-28 21:49 ` Messed up syscall return value Gregor Jasny
     [not found]   ` <488E4090.5020600@gmail.com>
2008-07-28 22:16     ` Gregor Jasny [this message]
     [not found]       ` <488E46BC.10104@gmail.com>
2008-07-28 22:34         ` [V4l2-library] " Gregor Jasny
2008-07-28 22:35         ` H. Willstrand
2008-07-29 10:00         ` Hans de Goede
2008-07-29 11:52           ` Gregor Jasny
2008-07-29 19:49             ` Hans de Goede
2008-07-29 16:00         ` Mauro Carvalho Chehab
2008-07-29 19:05           ` Laurent Pinchart
2008-07-29 20:51             ` Mauro Carvalho Chehab
2008-07-29 20:57               ` 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=20080728221628.GB21280@vidsoft.de \
    --to=jasny@vidsoft.de \
    --cc=bphilips@suse.de \
    --cc=jirislaby@gmail.com \
    --cc=spca50x-devs@lists.sourceforge.net \
    --cc=v4l2-library@linuxtv.org \
    --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.