[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[RFC v2 0/2] V4L2 IOCTL enum compat wrapper



Hi all,

This is my first intended-to-be-complete RFC patch to get rid of the enums
in V4L2 IOCTL structs. The approach is the one outlined first by Mauro
(AFAIR):

<URL:http://www.spinics.net/lists/linux-media/msg46504.html>

A set of compat structs (and compat IOCTLs) are created and there are a few
functions to convert between the in-kernel representation and the old
representation with enums the user space may well be using. On many archs
the two IOCTLs are actually the same.

This patchset depends on my earlier patch to remove v4l2_buffer.input:

<URL:http://www.spinics.net/lists/linux-media/msg47144.html>

All three patches are also available here:

<URL:http://git.linuxtv.org/sailus/media_tree.git/shortlog/refs/heads/enum-fix>

Open questions:

- Orring the return values of {get,put}_user etc. is time-consuming on
  modern CPUs with deep pipelines. Would if be better to use | (logical or)
  instead? The regular case where the access is successful would be
  optimised on the expense of the error case. The end result in error cases
  may be different, too, but does that matter?

- Testing this patch completely is difficult. I've only got access to
  capture hardware on 32-bit systems which generally do not easily exhibit
  problems with enums in IOCTLs (since they're 32-bit ints) in first place.
  I've tested this by changing fields from __u32 to __u64 where the old code
  had enums; that works, so at least something is working correctly. Help in
  testing would be very much appreciated.

Questions and comments are welcome.

Kind regards,

-- 
Sakari Ailus
e-mail: sakari.ailus@xxxxxx	jabber/XMPP/Gmail: sailus@xxxxxxxxxxxxxx
--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Linux Input]     [Video for Linux]     [Mplayer Users]     [Linux USB Devel]     [Linux Audio Users]     [Photos]     [Yosemite Photos]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Devices]     [Yosemite Backpacking]

Add to Google Powered by Linux