Commit Graph

40 Commits

Author SHA1 Message Date
Peter Hutterer
b3244827d9 Fix ioctl return value handling
Found by coverity

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Dave Airlie <airlied@redhat.com>
2018-10-08 13:16:35 +10:00
Peter Hutterer
3370b6b6a4 Fix handling of realloc failure
Coverity complaint and whatnot

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Dave Airlie <airlied@redhat.com>
2018-10-08 13:16:28 +10:00
Peter Hutterer
a020fda02f Ensure the device name is null-terminated
And expand the size to 18, because the stack array we copied this into is 18
bytes long. This covers us for up to 999 (kernel) v4l devices and that is
definitely not a reason to use the "640k ought to be enough" meme.

Found by - you guessed it - coverity!

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Dave Airlie <airlied@redhat.com>
2018-10-08 13:10:14 +10:00
Peter Hutterer
3f9022bdfe Remove unused variable osname
Coverity is unhappy and there's enough unhappiness in this world already, so
let's go for the low-hanging fruit.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Dave Airlie <airlied@redhat.com>
2018-10-08 13:07:25 +10:00
Adam Jackson
33c2170e89 Fix distcheck
Signed-off-by: Adam Jackson <ajax@redhat.com>
2018-08-14 14:58:18 -04:00
Hans de Goede
bbf9462a4e Fix build post xserver 1.17
Signed-off-by: Adam Jackson <ajax@redhat.com>
2018-08-14 14:58:03 -04:00
Adam Jackson
b45bef53fc Remove a bogus memset
We get this warning:

    v4l.c:1154:39: warning: argument to 'sizeof' in 'memset' call is the same expression as the destination; did you mean to remove the addressof? [-Wsizeof-pointer-memaccess]

It's correct enough, but ->cap is already zeroed by the previous memset.
Just remove the bogus one.

Fixes: xorg/driver/xf86-video-v4l#1
Signed-off-by: Adam Jackson <ajax@redhat.com>
2018-08-14 14:43:26 -04:00
Adam Jackson
74d39213b4 Remove call to LoaderGetOS
If you're not using Linux, this isn't likely to build let alone run. And
if it _does_ build on non-Linux, it's probably because someone went out
of their way to try to make it work.

Signed-off-by: Adam Jackson <ajax@redhat.com>
2017-01-24 09:43:43 -05:00
Mauro Carvalho Chehab
ca09693ba2 Fix standard video size detection
video width/height size can vary not only as a function of the
video standard but also in function of device capabilities. Due
to that, the code were trying to get those info from the hardware.
However, due to a driver bug, the info is not properly filled when
the video standard is changed.

While I intend to fix this inside the drivers, the current logic
doesn't work with the current stable kernels. So, use an alternative
way of getting this info, just using video standards information.

Let's keep the not working code there, in order to make easy to
return, after fixing the drivers. We'll probably need to check for
driver versions after reenabling the correct (not working) code,
or to use the new VIDIOC ioctl's to enumberate the supported
formats.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-02-11 09:24:53 -02:00
Mauro Carvalho Chehab
f7e6dcee73 Fix arguments for v4l_check_yuv
The device name and the file descriptors are wrong at the cal for
v4l_check_yuv(). Due to that, the driver were falling back to work
with RGB formats.

While here, add a code to prevent V4L driver to work if no video
adapter provide Xv overlay method.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-02-11 09:24:53 -02:00
Mauro Carvalho Chehab
6167b289f1 Provide a more consistent message if FBUF fails
Instead of providing an useless info that FBUF fails, print an
error indicating what's the Fourcc format that fails.

Also, on debug mode, prints a message indicating the selection of a
given fourcc. This helps to verify if both the video adapter and the
video capture board were set to the same video format.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-02-11 09:24:53 -02:00
Mauro Carvalho Chehab
362a97d43c Return BadMatch if a Port Attribute is not found
Fix a small non-compliance issue: if a port attribute is not known,
according with Xv specs, it should return BadMatch, and not BadValue.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-02-11 09:24:53 -02:00
Mauro Carvalho Chehab
2cca68d701 Fix Get/Set Port Attribute logic
There are several issues at GPA/SPA logic:
  - driver tries to limit minimum/maximum values to -1000/1000;
  - If yuv_format is available, all GPA/SPA are sent to the
    overlay encoder at the video adapter;
  - The most used return condition is an error.

Rework the entire logic to fix the above bugs and clean the
code.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-02-11 09:24:53 -02:00
Mauro Carvalho Chehab
f344cb78ef Use the fourcc header instead of redefining it inside the code
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-02-11 09:24:53 -02:00
Mauro Carvalho Chehab
436829a9d6 Coding style Cleanup
It is hard to work on a file that has multiple coding styles. As
we're rewriting the entire file, the better is to remove trailing
spaces and fix all the alignment issues, using 4 spaces for alignment
and not using tab.

No functional changes are made on this patch.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-02-11 09:24:48 -02:00
Mauro Carvalho Chehab
f4ccca1dec Port xf86-video-v4l driver to V4L2
V4L1 API was dropped on kernel 2.6.38. Even the emulation layer
inside kernel was dropped. While it might still be possible to use
X with libv4l and a LD_PRELOADER setup, the proper way is to port
the driver to use the V4L2 API.

This change brings some improvements to the code, as now all
integer/boolean/menu controls are visible, and all video standards.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-02-11 07:55:25 -02:00
Gaetan Nadon
45a5eb8cab config: header files are part of the source not in EXTRA_DIST
Only files that are not part of the source used to build
the driver are listed in EXTRA_DIST

Signed-off-by: Gaetan Nadon <memsize@videotron.ca>
2010-05-26 16:25:25 -04:00
Gaetan Nadon
19811b8245 .gitignore: use common defaults with custom section # 24239
Using common defaults will reduce errors and maintenance.
Only the very small or inexistent custom section need periodic maintenance
when the structure of the component changes. Do not edit defaults.
2009-10-22 13:05:12 -04:00
Julien Cristau
610a340050 Add missing includes.
Fixes missing declaration of close() and ioctl().
2008-06-09 20:38:12 +02:00
Adam Jackson
b0dad860b9 Fix ioctl() outparameter on LP64 systems. 2008-03-19 16:42:18 -04:00
Adam Jackson
edfeb249a8 Death to RCS tags. 2008-03-19 16:14:52 -04:00
James Cloos
68ef5a3537 Rename .cvsignore to .gitignore 2007-08-23 19:26:00 -04:00
Adam Jackson
0fb67e3f76 Bump to 0.1.1 for Xv changes. 2006-04-08 01:52:08 +00:00
Aaron Plattner
3288506bb3 Add a DrawablePtr argument to the XV functions to pave the way for
redirected video.
2006-04-07 23:17:04 +00:00
Adam Jackson
0ae947b760 Unlibcwrap. Bump server version requirement. Bump to 0.1.0. 2006-04-07 21:45:55 +00:00
Eric Anholt
9e9e26cbfc Add .cvsignores for drivers. 2005-11-21 10:49:21 +00:00
Adam Jackson
083adf6032 Bug #4328: Add build skeleton for the poor forgotten v4l driver. 2005-09-21 00:30:22 +00:00
Adam Jackson
1f05cde42c Prep for modular builds by adding guarded #include "config.h" everywhere. 2005-07-11 02:30:06 +00:00
Adam Jackson
1fa8d2f701 Bug #3626: _X_EXPORT tags for video and input drivers. 2005-06-25 21:16:59 +00:00
Daniel Stone
7123df70e0 Fix includes right throughout the Xserver tree:
change "foo.h" to <X11/foo.h> for core headers, e.g. X.h, Xpoll.h;
change "foo.h", "extensions/foo.h" and "X11/foo.h" to
    <X11/extensions/foo.h> for extension headers, e.g. Xv.h;
change "foo.[ch]" to <X11/Xtrans/foo.[ch]> for Xtrans files.
2005-04-20 12:25:32 +00:00
Eric Anholt
b299863dd2 DRI XFree86-4_3_99_12-merge import 2004-06-16 09:24:09 +00:00
Egbert Eich
1f8ceb0991 Merging XORG-CURRENT into trunk 2004-04-23 19:52:24 +00:00
Egbert Eich
fb4a148b6e Importing vendor version xf86-4_4_99_1 on Sun Mar 14 00:26:39 PST 2004 2004-03-14 08:33:41 +00:00
Egbert Eich
abaaf69833 Importing vendor version xf86-4_4_0 on Wed Mar 3 04:09:24 PST 2004 2004-03-03 12:12:28 +00:00
Egbert Eich
bd8c0455c2 readding XFree86's cvs IDs 2004-02-26 13:35:55 +00:00
Egbert Eich
9c34b95344 Importing vendor version xf86-4_3_99_903 on Wed Feb 26 01:21:00 PST 2004 2004-02-26 09:23:28 +00:00
Egbert Eich
871d6d6aef Importing vendor version xf86-012804-2330 on Thu Jan 29 00:06:33 PST 2004 2004-01-29 08:08:41 +00:00
Kaleb Keithley
e8bf6a26c8 XFree86 4.3.99.902 (RC 2) 2003-12-19 20:55:19 +00:00
Kaleb Keithley
0fc7fdb71a XFree86 4.3.99.16 Bring the tree up to date for the Cygwin folks 2003-11-25 19:28:43 +00:00
Kaleb Keithley
5c72acfc65 Initial revision 2003-11-14 16:48:55 +00:00