From: Mauro Carvalho Chehab <mchehab@redhat.com>
To: Devin Heitmueller <dheitmueller@kernellabs.com>
Cc: Hans Verkuil <hverkuil@xs4all.nl>,
Linux Media Mailing List <linux-media@vger.kernel.org>
Subject: Re: ABI breakage due to "Unsupported formats in TRY_FMT/S_FMT" recommendation
Date: Sat, 29 Dec 2012 18:00:00 -0200 [thread overview]
Message-ID: <20121229180000.31db58e3@redhat.com> (raw)
In-Reply-To: <CAGoCfix-3AgrkBUtFwLYTQf3YYL9t-8D7Qrge1fvJg-Fd+aBLA@mail.gmail.com>
Em Sat, 29 Dec 2012 12:39:11 -0500
Devin Heitmueller <dheitmueller@kernellabs.com> escreveu:
> > I suspect that the behavior of returning an error if a pixelformat is not
> > supported is a leftover from the V4L1 API (VIDIOCSPICT). When drivers were
> > converted to S/TRY_FMT this method of handling unsupported pixelformats was
> > probably never changed. And quite a few newer drivers copy-and-pasted that
> > method. Drivers like cx18/ivtv that didn't copy-and-paste code looked at the
> > API and followed what the API said.
> >
> > At the moment most TV drivers seem to return an error, whereas for webcams
> > it is hit and miss: uvc returned an error (until it was fixed recently),
> > gspca didn't. So webcam applications probably do the right thing given the
> > behavior of gspca.
>
> What if we returned an error but still changed the struct to specify
> the supported format? That's not what the spec says, but it seems
> like that's what is implemented in many drivers today and what many
> applications expect to happen.
That sounds a very bad idea: when an error rises, applications should
not trust on any returned value, except for the returned error code
itself. All the other values can be on some random state.
This is perhaps the only behavior that are consistent on all ioctls of the
media subsystem (and likely on the other ioctl's of the Kernel).
> No doubt, this is a mess, and if we had tighter enforcement and better
> specs before this stuff went upstream years ago, we wouldn't be in
> this situation. But that's not the world we live in, and we have to
> deal with where we stand today.
Well, something needs to be done at Kernel level, in order to make this ioctl
consistent among all drivers. I'm open to proposals.
In any case, applications aren't implementing the same logic to handle
this ioctl. This should be fixed there, in order to avoid unexpected
troubles with different hardware.
Cheers,
Mauro
prev parent reply other threads:[~2012-12-29 20:26 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-12-28 19:52 ABI breakage due to "Unsupported formats in TRY_FMT/S_FMT" recommendation Devin Heitmueller
2012-12-29 0:27 ` Mauro Carvalho Chehab
2012-12-29 11:53 ` Hans Verkuil
2012-12-29 14:23 ` Mauro Carvalho Chehab
2012-12-29 14:58 ` Mauro Carvalho Chehab
2012-12-29 19:52 ` Devin Heitmueller
2012-12-29 20:32 ` Mauro Carvalho Chehab
2012-12-30 9:27 ` Hans de Goede
2012-12-29 17:39 ` Devin Heitmueller
2012-12-29 20:00 ` Mauro Carvalho Chehab [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=20121229180000.31db58e3@redhat.com \
--to=mchehab@redhat.com \
--cc=dheitmueller@kernellabs.com \
--cc=hverkuil@xs4all.nl \
--cc=linux-media@vger.kernel.org \
/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).