]> git.karo-electronics.de Git - linux-beck.git/log
linux-beck.git
10 years ago[media] s5p-fimc: Changed RGB32 to BGR32
Nicolas Dufresne [Tue, 25 Mar 2014 20:55:23 +0000 (17:55 -0300)]
[media] s5p-fimc: Changed RGB32 to BGR32

Testing showed that HW produces BGR32 rather then RGB32 as exposed
in the driver. The documentation seems to state the pixels are stored
in little endian order.

Signed-off-by: Nicolas Dufresne <nicolas.dufresne@collabora.com>
[s.nawrocki@samsung.com] replaced "BGRB888, 32 bpp" with "BGRA8888, 32 bpp"
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years ago[media] s5p-fimc: Iterate for each memory plane
Nicolas Dufresne [Tue, 25 Mar 2014 20:52:31 +0000 (17:52 -0300)]
[media] s5p-fimc: Iterate for each memory plane

Depth and payload is defined per memory plane. It's better to iterate using
number of memory planes. This was not causing much issue since the rest
of the arrays involved where intialized to zero.

Signed-off-by: Nicolas Dufresne <nicolas.dufresne@collabora.com>
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years ago[media] V4L2: fix VIDIOC_CREATE_BUFS in 64- / 32-bit compatibility mode
Guennadi Liakhovetski [Sat, 26 Apr 2014 15:51:31 +0000 (12:51 -0300)]
[media] V4L2: fix VIDIOC_CREATE_BUFS in 64- / 32-bit compatibility mode

If a struct contains 64-bit fields, it is aligned on 64-bit boundaries
within containing structs in 64-bit compilations. This is the case with
struct v4l2_window, which contains pointers and is embedded into struct
v4l2_format, and that one is embedded into struct v4l2_create_buffers.
Unlike some other structs, used as a part of the kernel ABI as ioctl()
arguments, that are packed, these structs aren't packed. This isn't a
problem per se, but the ioctl-compat code for VIDIOC_CREATE_BUFS contains
a bug, that triggers in such 64-bit builds. That code wrongly assumes,
that in struct v4l2_create_buffers, struct v4l2_format immediately follows
the __u32 memory field, which in fact isn't the case. This bug wasn't
visible until now, because until recently hardly any applications used
this ioctl() and mostly embedded 32-bit only drivers implemented it. This
is changing now with addition of this ioctl() to some USB drivers, e.g.
UVC. This patch fixes the bug by copying parts of struct
v4l2_create_buffers separately.

Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years ago[media] V4L2: ov7670: fix a wrong index, potentially Oopsing the kernel from user...
Guennadi Liakhovetski [Mon, 14 Apr 2014 13:49:34 +0000 (10:49 -0300)]
[media] V4L2: ov7670: fix a wrong index, potentially Oopsing the kernel from user-space

Commit 75e2bdad8901a0b599e01a96229be922eef1e488 "ov7670: allow
configuration of image size, clock speed, and I/O method" uses a wrong
index to iterate an array. Apart from being wrong, it also uses an
unchecked value from user-space, which can cause access to unmapped
memory in the kernel, triggered by a normal desktop user with rights to
use V4L2 devices.

Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Acked-by: Jonathan Corbet <corbet@lwn.net>
Cc: stable@vger.kernel.org
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years ago[media] soc_camera: disable STD ioctls if no tvnorms are set
Hans Verkuil [Mon, 17 Feb 2014 11:44:14 +0000 (08:44 -0300)]
[media] soc_camera: disable STD ioctls if no tvnorms are set

If the sub-device did not report any tvnorms, then disable the STD
ioctls.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Tested-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Guennadi Liakhovetski <g.liakhovetski+renesas@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years ago[media] tw9910: add g_tvnorms video op
Hans Verkuil [Mon, 17 Feb 2014 11:44:13 +0000 (08:44 -0300)]
[media] tw9910: add g_tvnorms video op

Report to soc_camera which standards are supported by tw9910.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Tested-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Guennadi Liakhovetski <g.liakhovetski+renesas@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years ago[media] v4l2-subdev.h: add g_tvnorms video op
Hans Verkuil [Mon, 17 Feb 2014 11:44:12 +0000 (08:44 -0300)]
[media] v4l2-subdev.h: add g_tvnorms video op

While there was already a g_tvnorms_output video op, it's counterpart for
video capture was missing. Add it.

This is necessary for generic bridge drivers like soc-camera to set the
video_device tvnorms field correctly. Otherwise ENUMSTD cannot work.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Tested-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Guennadi Liakhovetski <g.liakhovetski+renesas@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years ago[media] v4l: Add 12-bit YUV 4:2:2 media bus pixel codes
Laurent Pinchart [Fri, 17 May 2013 15:32:46 +0000 (12:32 -0300)]
[media] v4l: Add 12-bit YUV 4:2:2 media bus pixel codes

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years ago[media] v4l: Add 12-bit YUV 4:2:0 media bus pixel codes
Laurent Pinchart [Fri, 17 May 2013 15:32:46 +0000 (12:32 -0300)]
[media] v4l: Add 12-bit YUV 4:2:0 media bus pixel codes

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years ago[media] v4l: Add UYVY10_1X20 and VYUY10_1X20 media bus pixel codes
Laurent Pinchart [Fri, 17 May 2013 15:32:46 +0000 (12:32 -0300)]
[media] v4l: Add UYVY10_1X20 and VYUY10_1X20 media bus pixel codes

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years ago[media] v4l: Add UYVY10_2X10 and VYUY10_2X10 media bus pixel codes
Laurent Pinchart [Fri, 17 May 2013 15:32:46 +0000 (12:32 -0300)]
[media] v4l: Add UYVY10_2X10 and VYUY10_2X10 media bus pixel codes

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years ago[media] v4l: Remove documentation for nonexistend input field in v4l2_buffer
Sakari Ailus [Fri, 20 Dec 2013 13:20:26 +0000 (10:20 -0300)]
[media] v4l: Remove documentation for nonexistend input field in v4l2_buffer

The input field in struct v4l2_buffer no longer exists but has been replaced
by a reserved field. Remove the field documentation.

Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years ago[media] v4l: V4L2_MBUS_FRAME_DESC_FL_BLOB is about 1D DMA
Sakari Ailus [Wed, 18 Dec 2013 11:40:28 +0000 (08:40 -0300)]
[media] v4l: V4L2_MBUS_FRAME_DESC_FL_BLOB is about 1D DMA

V4L2_MBUS_FRAME_DESC_FL_BLOB intends to say the receiver must use 1D DMA to
receive the image, as the format does not have line offsets. This typically
includes all compressed formats.

Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Cc: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years ago[media] v4l: Only get module if it's different than the driver for v4l2_dev
Sakari Ailus [Thu, 12 Dec 2013 12:36:46 +0000 (09:36 -0300)]
[media] v4l: Only get module if it's different than the driver for v4l2_dev

When the sub-device is registered, increment the use count of the sub-device
owner only if it's different from the owner of the driver for the media
device. This avoids increasing the use count by the module itself and thus
making it possible to unload it when it's not in use.

Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years ago[media] media: Use a better owner for the media device
Sakari Ailus [Thu, 12 Dec 2013 15:38:17 +0000 (12:38 -0300)]
[media] media: Use a better owner for the media device

mdev->fops->owner is actually the owner of the very same module which
implements media_device_register(), so it can't be unloaded anyway. Instead,
use THIS_MODULE through a macro as does video_register_device().

Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years ago[media] v4l: Check pad arguments for [gs]_frame_interval
Sakari Ailus [Mon, 22 Apr 2013 13:24:51 +0000 (10:24 -0300)]
[media] v4l: Check pad arguments for [gs]_frame_interval

VIDIOC_SUBDEV_[GS]_FRAME_INTERVAL IOCTLs argument structs contain the pad
field but the validity check was missing. There should be no implications
security-wise from this since no driver currently uses the pad field in the
struct.

Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years ago[media] saa7134: rename empress_tsq to empress_vbq
Hans Verkuil [Thu, 17 Apr 2014 08:56:42 +0000 (05:56 -0300)]
[media] saa7134: rename empress_tsq to empress_vbq

Create consistent _vbq suffix for videobuf_queue fields.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years ago[media] saa7134: remove fmt from saa7134_buf
Hans Verkuil [Thu, 17 Apr 2014 08:00:39 +0000 (05:00 -0300)]
[media] saa7134: remove fmt from saa7134_buf

This is already available from saa7134_dev.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years ago[media] saa7134: store VBI hlen/vlen globally
Hans Verkuil [Thu, 17 Apr 2014 07:55:43 +0000 (04:55 -0300)]
[media] saa7134: store VBI hlen/vlen globally

Don't calculate this for every buffer, store it globally instead.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years ago[media] saa7134: swap ts_init_encoder and ts_reset_encoder
Hans Verkuil [Thu, 17 Apr 2014 07:23:07 +0000 (04:23 -0300)]
[media] saa7134: swap ts_init_encoder and ts_reset_encoder

This will make the next patch a bit easier to read.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years ago[media] saa7134: drop abuse of low-level videobuf functions
Hans Verkuil [Thu, 17 Apr 2014 06:57:14 +0000 (03:57 -0300)]
[media] saa7134: drop abuse of low-level videobuf functions

saa7134-alsa used low-level videobuf functions to allocate and sync
DMA buffers. Replace this with saa7134-specific code. These functions
will not be available when we convert to vb2.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years ago[media] saa7134: coding style cleanups
Hans Verkuil [Thu, 17 Apr 2014 06:48:50 +0000 (03:48 -0300)]
[media] saa7134: coding style cleanups

Just white space and coding style changes to reduce the noise in the
following patches.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years ago[media] saa7134: fix regression with tvtime
Hans Verkuil [Thu, 17 Apr 2014 10:24:31 +0000 (07:24 -0300)]
[media] saa7134: fix regression with tvtime

This solves this bug:

https://bugzilla.kernel.org/show_bug.cgi?id=73361

The problem is that when you quit tvtime it calls STREAMOFF, but then it queues a
bunch of buffers for no good reason before closing the file descriptor.

In the past closing the fd would free the vb queue since that was part of the file
handle struct. Since that was moved to the global struct that no longer happened.

This wouldn't be a problem, but the extra QBUF calls that tvtime does meant that
the buffer list in videobuf (q->stream) contained buffers, so REQBUFS would fail
with -EBUSY.

The solution is to init the list head explicitly when releasing the file
descriptor and to not free the video resource when calling streamoff.

The real fix will hopefully go into kernel 3.16 when the vb2 conversion is
merged. Basically the saa7134 driver with the old videobuf is so full of holes it
ain't funny anymore, so consider this a band-aid for kernels 3.14 and 15.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Cc: stable@vger.kernel.org # for v3.14 and up
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years ago[media] smiapp: Use %u for printing u32 value
Sakari Ailus [Tue, 1 Apr 2014 12:58:19 +0000 (09:58 -0300)]
[media] smiapp: Use %u for printing u32 value

Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years ago[media] smiapp: Define macros for obtaining properties of register definitions
Sakari Ailus [Thu, 10 Apr 2014 13:08:59 +0000 (10:08 -0300)]
[media] smiapp: Define macros for obtaining properties of register definitions

The register address, width and flags are encoded as a 32-bit value. Add
macros for obtaining these separately. Use the macros in register access
functions.

Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years ago[media] smiapp: Add register diversion quirk
Sakari Ailus [Tue, 1 Apr 2014 11:37:38 +0000 (08:37 -0300)]
[media] smiapp: Add register diversion quirk

Add a quirk for diverting registers for on some sensors, even the standard
registers are not where they can be expected to be found. Add a quirk to
to help using such sensors.

smiapp_write_no_quirk() and smiapp_read_no_quirk() functions are provided
for the use of quirk implementations.

Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years ago[media] smiapp: Make PLL (quirk) flags a function
Sakari Ailus [Tue, 8 Apr 2014 21:18:10 +0000 (18:18 -0300)]
[media] smiapp: Make PLL (quirk) flags a function

This is more flexible. Quirk flags may be affected by configuration.

Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years ago[media] smiapp: Make PLL flags unsigned long
Sakari Ailus [Tue, 8 Apr 2014 21:14:42 +0000 (18:14 -0300)]
[media] smiapp: Make PLL flags unsigned long

No reason to keep this u8, really.

Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years ago[media] smiapp: Make PLL flags separate from regular quirk flags
Sakari Ailus [Wed, 12 Feb 2014 13:33:51 +0000 (10:33 -0300)]
[media] smiapp: Make PLL flags separate from regular quirk flags

It doesn't make sense to just copy the information to the PLL flags. Add a
new fields for the quirks to contain the PLL flags.

Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years ago[media] smiapp: Use I2C adapter ID and address in the sub-device name
Sakari Ailus [Wed, 26 Mar 2014 16:34:29 +0000 (13:34 -0300)]
[media] smiapp: Use I2C adapter ID and address in the sub-device name

The sub-device names should be unique. Should two identical sensors be
present in the same media device they would be indistinguishable. The names
will change e.g. from "vs6555 pixel array" to "vs6555 1-0010 pixel array".

Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years ago[media] smiapp: Add a macro for constructing 8-bit quirk registers
Sakari Ailus [Fri, 11 Apr 2014 09:30:18 +0000 (06:30 -0300)]
[media] smiapp: Add a macro for constructing 8-bit quirk registers

Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years ago[media] smiapp: Fix determining the need for 8-bit read access
Sakari Ailus [Sat, 12 Apr 2014 19:41:12 +0000 (16:41 -0300)]
[media] smiapp: Fix determining the need for 8-bit read access

8-bit reads are needed in some cases; however the condition used was wrong.
Regular access (register width) was used if:

len == SMIAPP_REG_8BIT && !only8

This causes 8-bit read access to be used always. The operator should be ||
instead: regular access can be used for 8-bit reads OR if allowed otherwise.

Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years ago[media] smiapp: Rename SMIA_REG to SMIAPP_REG for consistency
Sakari Ailus [Fri, 11 Apr 2014 08:47:21 +0000 (05:47 -0300)]
[media] smiapp: Rename SMIA_REG to SMIAPP_REG for consistency

SMIAPP_REG_ is the common prefix used in the driver for register related
definitions. Use it consistently.

Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years ago[media] smiapp: Remove unused quirk register functionality
Sakari Ailus [Sat, 12 Apr 2014 17:32:01 +0000 (14:32 -0300)]
[media] smiapp: Remove unused quirk register functionality

The quirk registers mechanism which allows register to have a static read
access value from the sensor specific quirks, is not used. Remove it. It is
to be replaced by a more generic register diversion quirk soon.

Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years ago[media] vb2: fix compiler warning
Hans Verkuil [Thu, 17 Apr 2014 06:17:08 +0000 (03:17 -0300)]
[media] vb2: fix compiler warning

When compiling this for older kernels using the compatibility build
the compiler complains about uninitialized variables:

In file included from include/linux/kernel.h:20:0,
                 from include/linux/cache.h:4,
                 from include/linux/time.h:7,
                 from include/linux/input.h:13,
                 from /home/hans/work/build/media_build/v4l/compat.h:9,
                 from <command-line>:0:
/home/hans/work/build/media_build/v4l/videobuf2-core.c: In function 'vb2_mmap':
include/linux/dynamic_debug.h:60:9: warning: 'plane' may be used uninitialized in this function [-Wmaybe-uninitialized]
   printk(KERN_DEBUG pr_fmt(fmt), ##__VA_ARGS__);  \
         ^
/home/hans/work/build/media_build/v4l/videobuf2-core.c:2381:23: note: 'plane' was declared here
  unsigned int buffer, plane;
                       ^
In file included from include/linux/kernel.h:20:0,
                 from include/linux/cache.h:4,
                 from include/linux/time.h:7,
                 from include/linux/input.h:13,
                 from /home/hans/work/build/media_build/v4l/compat.h:9,
                 from <command-line>:0:
include/linux/dynamic_debug.h:60:9: warning: 'buffer' may be used uninitialized in this function [-Wmaybe-uninitialized]
   printk(KERN_DEBUG pr_fmt(fmt), ##__VA_ARGS__);  \
         ^
/home/hans/work/build/media_build/v4l/videobuf2-core.c:2381:15: note: 'buffer' was declared here
  unsigned int buffer, plane;
               ^

While these warnings are bogus (the call to __find_plane_by_offset will
set buffer and plane), it doesn't hurt to initialize these variables.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years ago[media] bfin_capture: drop unnecessary vb2_is_streaming check
Hans Verkuil [Thu, 17 Apr 2014 05:52:16 +0000 (02:52 -0300)]
[media] bfin_capture: drop unnecessary vb2_is_streaming check

The stop_streaming op is only called if streaming is in progress,
so drop the unnecessary 'if (!vb2_is_streaming(vq))' check.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Acked-by: Pawel Osciak <pawel@osciak.com>
Acked-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years ago[media] vb2: stop_streaming should return void
Hans Verkuil [Thu, 17 Apr 2014 05:47:21 +0000 (02:47 -0300)]
[media] vb2: stop_streaming should return void

The vb2 core ignores any return code from the stop_streaming op.
And there really isn't anything it can do anyway in case of an error.
So change the return type to void and update any drivers that implement it.

The int return gave drivers the idea that this operation could actually
fail, but that's really not the case.

The pwc amd sdr-msi3101 drivers both had this construction:

        if (mutex_lock_interruptible(&s->v4l2_lock))
                return -ERESTARTSYS;

This has been updated to just call mutex_lock(). The stop_streaming op
expects this to really stop streaming and I very much doubt this will
work reliably if stop_streaming just returns without really stopping the
DMA.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Acked-by: Pawel Osciak <pawel@osciak.com>
Acked-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years ago[media] media:gspca:dtcs033 Clean sparse check warnings on endianess
Robert Butora [Wed, 16 Apr 2014 18:46:49 +0000 (15:46 -0300)]
[media] media:gspca:dtcs033 Clean sparse check warnings on endianess

Warnings due to __le16 / u16 conversions.
Replace offending struct and so stay on cpu domain.

Signed-off-by: Robert Butora <robert.butora.fi@gmail.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years agoDocumentation: Update cardlists
Mauro Carvalho Chehab [Wed, 23 Apr 2014 12:58:16 +0000 (09:58 -0300)]
Documentation: Update cardlists

Two new devices were added, but the cardlists weren't updated.

Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years ago[media] em28xx: PCTV tripleStick (292e) LNA support
Antti Palosaari [Wed, 23 Apr 2014 01:56:54 +0000 (22:56 -0300)]
[media] em28xx: PCTV tripleStick (292e) LNA support

External LNA between antenna connector and RF tuner is controlled
by EM28178 GPIO 0. GPIO value 1 is LNA active and value 0 is LNA
disabled.

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years ago[media] si2168: relax demod lock checks a little
Antti Palosaari [Wed, 23 Apr 2014 00:36:32 +0000 (21:36 -0300)]
[media] si2168: relax demod lock checks a little

bit3 was not cleared always leaving driver reporting demod is not
fully locked. Do not check bit0 as it seems to be always 0.

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years ago[media] MAINTAINERS: add si2157 driver
Antti Palosaari [Tue, 15 Apr 2014 09:21:03 +0000 (06:21 -0300)]
[media] MAINTAINERS: add si2157 driver

Silicon Labs Si2157 silicon tuner driver.

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years ago[media] MAINTAINERS: add si2168 driver
Antti Palosaari [Tue, 15 Apr 2014 09:17:53 +0000 (06:17 -0300)]
[media] MAINTAINERS: add si2168 driver

Silicon Labs Si2168 DVB-T/T2/C demod driver

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years ago[media] si2168: add copyright and license
Antti Palosaari [Tue, 15 Apr 2014 00:55:12 +0000 (21:55 -0300)]
[media] si2168: add copyright and license

Add copyright and license for each file.

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years ago[media] si2157: add copyright and license
Antti Palosaari [Tue, 15 Apr 2014 00:51:32 +0000 (21:51 -0300)]
[media] si2157: add copyright and license

Add copyright and license for each file.

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years ago[media] si2168: add support for DVB-C (annex A version)
Antti Palosaari [Sat, 12 Apr 2014 04:58:32 +0000 (01:58 -0300)]
[media] si2168: add support for DVB-C (annex A version)

Add support for DVB-C (annex A version).

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years ago[media] si2157: extend frequency range for DVB-C
Antti Palosaari [Sat, 12 Apr 2014 04:53:51 +0000 (01:53 -0300)]
[media] si2157: extend frequency range for DVB-C

DVB-C uses lower frequencies than DVB-T. Extend frequency range down to
110 MHz in order to support DVB-C. 110 - 862 MHz range is defined by
NorDig Unified 2.2 specification.

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years ago[media] si2168: add support for DVB-T2
Antti Palosaari [Fri, 11 Apr 2014 23:35:27 +0000 (20:35 -0300)]
[media] si2168: add support for DVB-T2

Add support for DVB-T2.

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years ago[media] em28xx: add [2013:025f] PCTV tripleStick (292e)
Antti Palosaari [Fri, 11 Apr 2014 01:11:27 +0000 (22:11 -0300)]
[media] em28xx: add [2013:025f] PCTV tripleStick (292e)

Empia EM28178, Silicon Labs Si2168, Silicon Labs Si2157.

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years ago[media] si2168: Silicon Labs Si2168 DVB-T/T2/C demod driver
Antti Palosaari [Fri, 11 Apr 2014 01:00:50 +0000 (22:00 -0300)]
[media] si2168: Silicon Labs Si2168 DVB-T/T2/C demod driver

Silicon Labs Si2168 DVB-T/T2/C demod driver.
That driver version supports only DVB-T.

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years ago[media] si2157: Silicon Labs Si2157 silicon tuner driver
Antti Palosaari [Fri, 11 Apr 2014 00:58:10 +0000 (21:58 -0300)]
[media] si2157: Silicon Labs Si2157 silicon tuner driver

Silicon Labs Si2157 silicon tuner driver.
Currently it supports only DVB-T.

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years ago[media] vb2: Add videobuf2-dvb support
Hans Verkuil [Wed, 9 Oct 2013 11:01:05 +0000 (08:01 -0300)]
[media] vb2: Add videobuf2-dvb support

With the new vb2_thread_start/stop core code it is very easy to implement
videobuf2-dvb. This should simplify converting existing videobuf drivers to
vb2.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years ago[media] vb2: add thread support
Hans Verkuil [Mon, 14 Apr 2014 10:33:00 +0000 (07:33 -0300)]
[media] vb2: add thread support

In order to implement vb2 DVB support you need to be able to start
a kernel thread that queues and dequeues buffers, calling a callback
function for every buffer. This patch adds support for that.

It's based on drivers/media/v4l2-core/videobuf-dvb.c, but with all the DVB
specific stuff stripped out, thus making it much more generic.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years ago[media] v4l2-pci-skeleton.c: fix alternate field handling
Hans Verkuil [Fri, 11 Apr 2014 08:02:29 +0000 (05:02 -0300)]
[media] v4l2-pci-skeleton.c: fix alternate field handling

For interlaced HDTV timings the correct field setting is FIELD_ALTERNATE,
not INTERLACED. Update this template driver accordingly:

- add check for the invalid combination of read() and FIELD_ALTERNATE.
- in the interrupt handler set v4l2_buffer field to alternating TOP and
  BOTTOM.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Acked-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years ago[media] DocBook media: update bytesused field description
Hans Verkuil [Mon, 7 Apr 2014 13:01:28 +0000 (10:01 -0300)]
[media] DocBook media: update bytesused field description

For output buffers the application has to set the bytesused field.
In reality applications often do not set this since drivers that
deal with fix image sizes just override it anyway.

The vb2 framework will replace this field with the length field if
bytesused was set to 0 by the application, which is what happens
in practice. Document this behavior.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Acked-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years ago[media] vb2: start messages with a lower-case for consistency
Hans Verkuil [Mon, 7 Apr 2014 12:13:22 +0000 (09:13 -0300)]
[media] vb2: start messages with a lower-case for consistency

The kernel debug messages produced by vb2 started either with a
lower or an upper case character. Switched all to use lower-case
which seemed to be what was used in the majority of the messages.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Acked-by: Pawel Osciak <pawel@osciak.com>
Acked-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years ago[media] vb2: allow read/write as long as the format is single planar
Hans Verkuil [Fri, 11 Apr 2014 07:40:03 +0000 (04:40 -0300)]
[media] vb2: allow read/write as long as the format is single planar

It was impossible to read() or write() a frame if the queue type was multiplanar.
Even if the current format is single planar. Change this to just check whether
the number of planes is 1 or more.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Acked-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years ago[media] vb2: add vb2_fileio_is_active and check it more often
Hans Verkuil [Mon, 7 Apr 2014 12:23:50 +0000 (09:23 -0300)]
[media] vb2: add vb2_fileio_is_active and check it more often

Added a vb2_fileio_is_active inline function that returns true if fileio
is in progress. Check for this too in mmap() (you don't want apps mmap()ing
buffers used by fileio) and expbuf() (same reason).

In addition drivers should be able to check for this in queue_setup() to
return an error if an attempt is made to read() or write() with
V4L2_FIELD_ALTERNATE being configured. This is illegal (there is no way
to pass the TOP/BOTTOM information around using file I/O).

However, in order to be able to check for this the init_fileio function
needs to set q->fileio early on, before the buffers are allocated. So switch
to using internal functions (__reqbufs, vb2_internal_qbuf and
vb2_internal_streamon) to skip the fileio check. Well, that's why the internal
functions were created...

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Acked-by: Pawel Osciak <pawel@osciak.com>
Acked-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years ago[media] vb2: simplify a confusing condition
Hans Verkuil [Mon, 24 Feb 2014 18:52:04 +0000 (15:52 -0300)]
[media] vb2: simplify a confusing condition

q->start_streaming_called is always true, so the WARN_ON check against
it being false can be dropped.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Acked-by: Pawel Osciak <pawel@osciak.com>
Acked-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years ago[media] vb2: reject output buffers with V4L2_FIELD_ALTERNATE
Hans Verkuil [Mon, 7 Apr 2014 12:20:39 +0000 (09:20 -0300)]
[media] vb2: reject output buffers with V4L2_FIELD_ALTERNATE

This is not allowed by the spec and does in fact not make any sense.
Return -EINVAL if this is the case.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Acked-by: Pawel Osciak <pawel@osciak.com>
Acked-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years ago[media] vb2: set timestamp when using write()
Hans Verkuil [Fri, 11 Apr 2014 07:36:57 +0000 (04:36 -0300)]
[media] vb2: set timestamp when using write()

When using write() to write data to an output video node the vb2 core
should set timestamps if V4L2_BUF_FLAG_TIMESTAMP_COPY is set. Nobody
else is able to provide this information with the write() operation.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Acked-by: Pawel Osciak <pawel@osciak.com>
Acked-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years ago[media] vb2: move __qbuf_mmap before __qbuf_userptr
Hans Verkuil [Mon, 10 Mar 2014 15:23:13 +0000 (12:23 -0300)]
[media] vb2: move __qbuf_mmap before __qbuf_userptr

__qbuf_mmap was sort of hidden in between the much larger __qbuf_userptr
and __qbuf_dmabuf functions. Move it before __qbuf_userptr which is
also conform the usual order these memory models are implemented: first
mmap, then userptr, then dmabuf.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Acked-by: Pawel Osciak <pawel@osciak.com>
Acked-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years ago[media] vb2: use correct prefix
Hans Verkuil [Mon, 7 Apr 2014 12:08:47 +0000 (09:08 -0300)]
[media] vb2: use correct prefix

Many dprintk's in vb2 use a hardcoded prefix with the function name. In
many cases that is now outdated. To keep things consistent the dprintk
macro has been changed to print the function name in addition to the "vb2:"
prefix. Superfluous prefixes elsewhere in the code have been removed.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Acked-by: Pawel Osciak <pawel@osciak.com>
Acked-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years ago[media] vb2: if bytesused is 0, then fill with output buffer length
Hans Verkuil [Mon, 7 Apr 2014 11:57:48 +0000 (08:57 -0300)]
[media] vb2: if bytesused is 0, then fill with output buffer length

The application should really always fill in bytesused for output
buffers, unfortunately the vb2 framework never checked for that.

So for single planar formats replace a bytesused of 0 by the length
of the buffer, and for multiplanar format do the same if bytesused is
0 for ALL planes.

This seems to be what the user really intended if v4l2_buffer was
just memset to 0.

I'm afraid that just checking for this and returning an error would
break too many applications. Quite a few drivers never check for bytesused
at all and just use the buffer length instead.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Acked-by: Pawel Osciak <pawel@osciak.com>
Acked-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years ago[media] vb2: fix handling of data_offset and v4l2_plane.reserved[]
Hans Verkuil [Mon, 7 Apr 2014 11:44:56 +0000 (08:44 -0300)]
[media] vb2: fix handling of data_offset and v4l2_plane.reserved[]

The videobuf2-core did not zero the 'planes' array in __qbuf_userptr()
and __qbuf_dmabuf(). That's now memset to 0. Without this the reserved
array in struct v4l2_plane would be non-zero, causing v4l2-compliance
errors.

More serious is the fact that data_offset was not handled correctly:

- for capture devices it was never zeroed, which meant that it was
  uninitialized. Unless the driver sets it it was a completely random
  number. With the memset above this is now fixed.

- __qbuf_dmabuf had a completely incorrect length check that included
  data_offset.

- in __fill_vb2_buffer in the DMABUF case the data_offset field was
  unconditionally copied from v4l2_buffer to v4l2_plane when this
  should only happen in the output case.

- in the single-planar case data_offset was never correctly set to 0.
  The single-planar API doesn't support data_offset, so setting it
  to 0 is the right thing to do. This too is now solved by the memset.

All these issues were found with v4l2-compliance.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Acked-by: Pawel Osciak <pawel@osciak.com>
Acked-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years ago[media] v4l2-dv-timings.c: add the new 4K timings to the list
Hans Verkuil [Tue, 8 Apr 2014 08:01:52 +0000 (05:01 -0300)]
[media] v4l2-dv-timings.c: add the new 4K timings to the list

Add the new CEA-861-F and DMT 4K timings to the list of predefined
timings.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years ago[media] v4l2-dv-timings.h: add CEA-861-F 4K timings
Hans Verkuil [Tue, 8 Apr 2014 08:00:39 +0000 (05:00 -0300)]
[media] v4l2-dv-timings.h: add CEA-861-F 4K timings

Add the CEA-861-F timings for 3840x2160p24/25/30/50/60 and
4096x2160p24/25/30/50/60.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years ago[media] staging: media: davinci: vpfe: release buffers in case start_streaming call...
Lad, Prabhakar [Sun, 23 Mar 2014 06:37:25 +0000 (03:37 -0300)]
[media] staging: media: davinci: vpfe: release buffers in case start_streaming call back fails

this patch releases the buffer by calling vb2_buffer_done(),
with state marked as VB2_BUF_STATE_QUEUED if start_streaming()
call back fails.

Signed-off-by: Lad, Prabhakar <prabhakar.csengg@gmail.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years ago[media] staging: media: davinci: vpfe: use v4l2_fh for priority handling
Lad, Prabhakar [Sun, 23 Mar 2014 06:37:24 +0000 (03:37 -0300)]
[media] staging: media: davinci: vpfe: use v4l2_fh for priority handling

Signed-off-by: Lad, Prabhakar <prabhakar.csengg@gmail.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years ago[media] sn9c102_hv7131r: fix style warnings flagged by checkpatch.pl
Mike Sampson [Mon, 24 Mar 2014 09:04:49 +0000 (06:04 -0300)]
[media] sn9c102_hv7131r: fix style warnings flagged by checkpatch.pl

Signed-off-by: Mike Sampson <mike@sambodata.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years ago[media] media: davinci: vpfe: use v4l2_fh for priority handling
Lad, Prabhakar [Sat, 22 Mar 2014 11:39:24 +0000 (08:39 -0300)]
[media] media: davinci: vpfe: use v4l2_fh for priority handling

This patch migrates the vpfe driver to use v4l2_fh for
priority handling.

Signed-off-by: Lad, Prabhakar <prabhakar.csengg@gmail.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years ago[media] media: davinci: vpbe: use v4l2_fh for priority handling
Lad, Prabhakar [Sat, 22 Mar 2014 10:57:59 +0000 (07:57 -0300)]
[media] media: davinci: vpbe: use v4l2_fh for priority handling

This patch migrates the vpbe driver to use v4l2_fh for
priority handling. This also fixes v4l2-compliance test.

Signed-off-by: Lad, Prabhakar <prabhakar.csengg@gmail.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years ago[media] bttv: Add support for PCI-8604PW
Daniel Glöckner [Wed, 19 Mar 2014 09:50:41 +0000 (06:50 -0300)]
[media] bttv: Add support for PCI-8604PW

This patch adds support for the PCI-8604PW card equipped with four 878A.
It is unknown who the manufacturer of this card is and no drivers were
available during development of the patch. According to images found
online, the card is originally sold with Linux DVR software.

A CPLD on the card prevents the 878A from requesting access to the
bus until an initialization sequence has been issued via GPIOs. The
implemented sequence uses the minimum number of GPIOs needed to
successfully unlock bus access. As there are many more GPIOs connected
to the CPLD, it is very likely that some of the others have an influence
on the bus arbitration scheduling. This should be investigated further
in case of performance issues.

The tested card contains an EEPROM on one of the 878A, but it is
completely empty (i.e. contains only 0xff), so it is not possible
to detect the card.

Signed-off-by: Daniel Glöckner <daniel-gl@gmx.net>
Tested-by: Robert Longbottom <rongblor@googlemail.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years ago[media] adv7842: Disable access to EDID DDC lines before chip power up
Martin Bugge [Wed, 19 Mar 2014 09:43:45 +0000 (06:43 -0300)]
[media] adv7842: Disable access to EDID DDC lines before chip power up

In core_init make sure access to EDID DDC lines are disabled
before chip is powered up. Also DISABLE_AUTO_EDID before power up.
The correct setting is applied later when setting the EDID.
Some sources (MAC) kept on reading EDID even when Hotplug was low
and in the short period in core_init before the DDC lines was enabled
read a corrupt EDID.

Signed-off-by: Martin Bugge <marbugge@cisco.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years ago[media] adv7842: update RGB quantization range on HDMI/DVI-D mode irq
Martin Bugge [Wed, 19 Mar 2014 09:43:43 +0000 (06:43 -0300)]
[media] adv7842: update RGB quantization range on HDMI/DVI-D mode irq

This was the reason for enabling the HDMI/DVI-D mode irq in the first place.

Signed-off-by: Martin Bugge <marbugge@cisco.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years ago[media] staging: omap24xx: fix coding style
ileana@telecom-paristech.fr [Tue, 18 Mar 2014 13:31:03 +0000 (10:31 -0300)]
[media] staging: omap24xx: fix coding style

Fix missing parentheses in macros
Errors found by checkpatch.pl

Signed-off-by: Ioana Ileana <ileana@enst.fr>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years ago[media] v4l2-ioctl.c: fix sparse __user-related warnings
Hans Verkuil [Mon, 17 Mar 2014 12:54:23 +0000 (09:54 -0300)]
[media] v4l2-ioctl.c: fix sparse __user-related warnings

Fix the use of __user in the check_array_args() prototype: instead of
using 'void * __user *' you should use 'void __user **' for sparse to
understand this correctly.

This also required the use of __force in the '*kernel_ptr = user_ptr'
assignment.

Also replace a wrong cast (void *) with the correct one (void **)
in check_array_args().

This fixes these sparse warnings:

drivers/media/v4l2-core/v4l2-ioctl.c:2284:35: warning: incorrect type in assignment (different address spaces)
drivers/media/v4l2-core/v4l2-ioctl.c:2301:35: warning: incorrect type in assignment (different address spaces)
drivers/media/v4l2-core/v4l2-ioctl.c:2319:35: warning: incorrect type in assignment (different address spaces)
drivers/media/v4l2-core/v4l2-ioctl.c:2386:57: warning: incorrect type in argument 4 (different address spaces)
drivers/media/v4l2-core/v4l2-ioctl.c:2420:29: warning: incorrect type in assignment (different address spaces)

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years ago[media] v4l2-common.h: remove __user annotation in struct v4l2_edid
Hans Verkuil [Mon, 17 Mar 2014 12:54:22 +0000 (09:54 -0300)]
[media] v4l2-common.h: remove __user annotation in struct v4l2_edid

The edid array is copied to kernelspace by the v4l2 core, so drivers
shouldn't see the __user annotation. This conforms to other structs like
v4l2_ext_controls where the data pointed to is copied to from user to
kernelspace.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years ago[media] videobuf2-core: fix sparse errors
Hans Verkuil [Mon, 17 Mar 2014 12:54:21 +0000 (09:54 -0300)]
[media] videobuf2-core: fix sparse errors

Sparse generated a bunch of errors like this:

drivers/media/v4l2-core/videobuf2-core.c:2045:25: error: incompatible types in conditional expression (different base types)
drivers/media/v4l2-core/videobuf2-core.c:136:17: error: incompatible types in conditional expression (different base types)
drivers/media/v4l2-core/videobuf2-core.c:151:17: error: incompatible types in conditional expression (different base types)
drivers/media/v4l2-core/videobuf2-core.c:168:25: error: incompatible types in conditional expression (different base types)
drivers/media/v4l2-core/videobuf2-core.c:183:17: error: incompatible types in conditional expression (different base types)
drivers/media/v4l2-core/videobuf2-core.c:185:9: error: incompatible types in conditional expression (different base types)
drivers/media/v4l2-core/videobuf2-core.c:385:25: error: incompatible types in conditional expression (different base types)
drivers/media/v4l2-core/videobuf2-core.c:1115:17: error: incompatible types in conditional expression (different base types)
drivers/media/v4l2-core/videobuf2-core.c:1268:33: error: incompatible types in conditional expression (different base types)
drivers/media/v4l2-core/videobuf2-core.c:1270:25: error: incompatible types in conditional expression (different base types)
drivers/media/v4l2-core/videobuf2-core.c:1315:17: error: incompatible types in conditional expression (different base types)
drivers/media/v4l2-core/videobuf2-core.c:1324:25: error: incompatible types in conditional expression (different base types)
drivers/media/v4l2-core/videobuf2-core.c:1396:25: error: incompatible types in conditional expression (different base types)
drivers/media/v4l2-core/videobuf2-core.c:1457:17: error: incompatible types in conditional expression (different base types)
drivers/media/v4l2-core/videobuf2-core.c:1482:17: error: incompatible types in conditional expression (different base types)
drivers/media/v4l2-core/videobuf2-core.c:1484:9: error: incompatible types in conditional expression (different base types)
drivers/media/v4l2-core/videobuf2-core.c:1523:17: error: incompatible types in conditional expression (different base types)
drivers/media/v4l2-core/videobuf2-core.c:1525:17: error: incompatible types in conditional expression (different base types)
drivers/media/v4l2-core/videobuf2-core.c:1815:17: error: incompatible types in conditional expression (different base types)
drivers/media/v4l2-core/videobuf2-core.c:1828:17: error: incompatible types in conditional expression (different base types)
drivers/media/v4l2-core/videobuf2-core.c:1914:25: error: incompatible types in conditional expression (different base types)
drivers/media/v4l2-core/videobuf2-core.c:1944:9: error: incompatible types in conditional expression (different base types)

These are caused by the call*op defines which do something like this:

        (ops->op) ? ops->op(args) : 0

which is OK as long as op is not a void function, because in that case one part
of the conditional expression returns void, the other an integer. Hence the sparse
errors.

I've replaced this by introducing three variants of the call_ macros:
call_*op for int returns, call_void_*op for void returns and call_ptr_*op for
pointer returns.

That's the bad news. The good news is that the fail_*op macros could be removed
since the call_*op macros now have enough information to determine if the op
succeeded or not and can increment the op counter only on success. This at least
makes it more robust w.r.t. future changes.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Acked-by: Pawel Osciak <pawel@osciak.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years ago[media] v4l2-subdev.h: fix sparse error with v4l2_subdev_notify
Hans Verkuil [Mon, 17 Mar 2014 12:54:19 +0000 (09:54 -0300)]
[media] v4l2-subdev.h: fix sparse error with v4l2_subdev_notify

The notify function is a void function, yet the v4l2_subdev_notify
define uses it in a ? : construction, which causes sparse warnings.

Replace the define by a static inline function and move it to
v4l2-device.h, which is where it belongs since it needs to know the
v4l2_device struct. This wasn't a problem when it was a define, but
as a static inline function this no longer compiles in v4l2-subdev.h.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years ago[media] gspca_gl860: Clean up idxdata structs
Ismael Luceno [Fri, 14 Mar 2014 19:43:23 +0000 (16:43 -0300)]
[media] gspca_gl860: Clean up idxdata structs

Signed-off-by: Ismael Luceno <ismael.luceno@gmail.com>
Acked-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years ago[media] media/usb/gspca: Add support for Scopium astro webcam (0547:7303)
Robert Butora [Mon, 24 Mar 2014 22:41:38 +0000 (19:41 -0300)]
[media] media/usb/gspca: Add support for Scopium astro webcam (0547:7303)

This patch does not modify existing drivers. It adds subdriver
to gspca for DTCS033 (Scopium) webcam for astrophotography.
The patch adds dtcs033.c and modifies Kconfig and Makefile.

Signed-off-by: Robert Butora <robert.butora.fi@gmail.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years ago[media] Prefer gspca_sonixb over sn9c102 for all devices
Jean Delvare [Fri, 11 Apr 2014 07:15:32 +0000 (04:15 -0300)]
[media] Prefer gspca_sonixb over sn9c102 for all devices

The sn9c102 driver is deprecated. It was moved to staging in
anticipation of its removal in a future kernel version. However, USB
devices 0C45:6024 and 0C45:6025 are still handled by sn9c102 when
both sn9c102 and gspca_sonixb are enabled.

We must migrate all the users of these devices to the gspca_sonixb
driver now, so that it gets sufficient testing before the sn9c102
driver is finally phased out.

Signed-off-by: Jean Delvare <jdelvare@suse.de>
Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Acked-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years ago[media] media: davinci: vpfe: make sure all the buffers unmapped and released
Lad, Prabhakar [Sun, 23 Mar 2014 05:44:11 +0000 (02:44 -0300)]
[media] media: davinci: vpfe: make sure all the buffers unmapped and released

this patch makes sure that it terminates if any IO in
progress and also makes sure that all the buffers are unmapped.
It was observed that with several runs of application the application
sometimes failed to allocate memory, This patch makes sure it
all the buffers are released.

Using kmemleak it was found that buffer were not released, this patch
fixes following issue,

 echo scan > /sys/kernel/debug/kmemleak
  Kernel message reads:
      memleak: 3 new suspected memory leaks (see /sys/kernel/debug/kmemleak)

Then,
     cat /sys/kernel/debug/kmemleak

  unreferenced object 0xc564a480 (size 192):
  comm "mttest", pid 764, jiffies 4294945878 (age 487.160s)
  hex dump (first 32 bytes):
    00 00 00 00 28 07 07 20 d0 02 00 00 e0 01 00 00  ....(.. ........
    00 00 00 00 00 64 05 00 01 00 00 00 01 00 00 00  .....d..........
  backtrace:
    [<c00a98dc>] create_object+0x10c/0x28c
    [<c03ba8ec>] kmemleak_alloc+0x3c/0x70
    [<c00a67c0>] __kmalloc+0x11c/0x1d4
    [<c02b6f48>] __videobuf_alloc+0x1c/0x3c
    [<c02b6194>] videobuf_alloc_vb+0x38/0x80
    [<c02b6638>] __videobuf_mmap_setup+0x9c/0x108
    [<c02b6da0>] videobuf_reqbufs.part.10+0x12c/0x1bc
    [<c02b6e9c>] videobuf_reqbufs+0x6c/0x8c
    [<c02be2c4>] vpfe_reqbufs+0xcc/0x130
    [<c02aae90>] v4l_reqbufs+0x50/0x54
    [<c02aab54>] __video_do_ioctl+0x260/0x2c4
    [<c02a9dd4>] video_usercopy+0xf0/0x310
    [<c02aa008>] video_ioctl2+0x14/0x1c
    [<c02a562c>] v4l2_ioctl+0x104/0x14c
    [<c00bd320>] do_vfs_ioctl+0x80/0x2d0
    [<c00bd5b4>] SyS_ioctl+0x44/0x64
unreferenced object 0xc564ac00 (size 192):
  comm "mttest", pid 764, jiffies 4294945878 (age 487.160s)
  hex dump (first 32 bytes):
    01 00 00 00 28 07 07 20 d0 02 00 00 e0 01 00 00  ....(.. ........
    00 00 00 00 00 64 05 00 01 00 00 00 01 00 00 00  .....d..........
  backtrace:
    [<c00a98dc>] create_object+0x10c/0x28c
    [<c03ba8ec>] kmemleak_alloc+0x3c/0x70
    [<c00a67c0>] __kmalloc+0x11c/0x1d4
    [<c02b6f48>] __videobuf_alloc+0x1c/0x3c
    [<c02b6194>] videobuf_alloc_vb+0x38/0x80
    [<c02b6638>] __videobuf_mmap_setup+0x9c/0x108
    [<c02b6da0>] videobuf_reqbufs.part.10+0x12c/0x1bc
    [<c02b6e9c>] videobuf_reqbufs+0x6c/0x8c
    [<c02be2c4>] vpfe_reqbufs+0xcc/0x130
    [<c02aae90>] v4l_reqbufs+0x50/0x54
    [<c02aab54>] __video_do_ioctl+0x260/0x2c4
    [<c02a9dd4>] video_usercopy+0xf0/0x310
    [<c02aa008>] video_ioctl2+0x14/0x1c
    [<c02a562c>] v4l2_ioctl+0x104/0x14c
    [<c00bd320>] do_vfs_ioctl+0x80/0x2d0
    [<c00bd5b4>] SyS_ioctl+0x44/0x64
unreferenced object 0xc564a180 (size 192):
  comm "mttest", pid 764, jiffies 4294945880 (age 487.140s)
  hex dump (first 32 bytes):
    02 00 00 00 28 07 07 20 d0 02 00 00 e0 01 00 00  ....(.. ........
    00 00 00 00 00 64 05 00 01 00 00 00 01 00 00 00  .....d..........
  backtrace:
    [<c00a98dc>] create_object+0x10c/0x28c
    [<c03ba8ec>] kmemleak_alloc+0x3c/0x70
    [<c00a67c0>] __kmalloc+0x11c/0x1d4
    [<c02b6f48>] __videobuf_alloc+0x1c/0x3c
    [<c02b6194>] videobuf_alloc_vb+0x38/0x80
    [<c02b6638>] __videobuf_mmap_setup+0x9c/0x108
    [<c02b6da0>] videobuf_reqbufs.part.10+0x12c/0x1bc
    [<c02b6e9c>] videobuf_reqbufs+0x6c/0x8c
    [<c02be2c4>] vpfe_reqbufs+0xcc/0x130
    [<c02aae90>] v4l_reqbufs+0x50/0x54
    [<c02aab54>] __video_do_ioctl+0x260/0x2c4
    [<c02a9dd4>] video_usercopy+0xf0/0x310
    [<c02aa008>] video_ioctl2+0x14/0x1c
    [<c02a562c>] v4l2_ioctl+0x104/0x14c
    [<c00bd320>] do_vfs_ioctl+0x80/0x2d0
    [<c00bd5b4>] SyS_ioctl+0x44/0x64

Reported-by: Jimmy Ho <jimmygge@gmail.com>
Signed-off-by: Lad, Prabhakar <prabhakar.csengg@gmail.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years ago[media] staging: media: davinci: vpfe: make sure all the buffers are released
Lad, Prabhakar [Sun, 23 Mar 2014 05:16:46 +0000 (02:16 -0300)]
[media] staging: media: davinci: vpfe: make sure all the buffers are released

from commit-id: b3379c6201bb3555298cdbf0aa004af260f2a6a4
"vb2: only call start_streaming if sufficient buffers are queued"
the vb2 framework warns on (WARN_ON()) if all the active buffers
are not released when streaming is stopped, initially the vb2 silently
released the buffer internally if the buffer was not released by
the driver.

This patch fixes following issue:

WARNING: CPU: 0 PID: 2049 at drivers/media/v4l2-core/videobuf2-core.c:2011 __vb2_queue_cancel+0x1a0/0x218()
Modules linked in:
CPU: 0 PID: 2049 Comm: vpfe_video Tainted: G        W    3.14.0-rc5-00414-ged97a6f #89
[<c000e3f0>] (unwind_backtrace) from [<c000c618>] (show_stack+0x10/0x14)
[<c000c618>] (show_stack) from [<c001adb0>] (warn_slowpath_common+0x68/0x88)
[<c001adb0>] (warn_slowpath_common) from [<c001adec>] (warn_slowpath_null+0x1c/0x24)
[<c001adec>] (warn_slowpath_null) from [<c0252e0c>] (__vb2_queue_cancel+0x1a0/0x218)
[<c0252e0c>] (__vb2_queue_cancel) from [<c02533a4>] (vb2_queue_release+0x14/0x24)
[<c02533a4>] (vb2_queue_release) from [<c025a65c>] (vpfe_release+0x60/0x230)
[<c025a65c>] (vpfe_release) from [<c023fe5c>] (v4l2_release+0x34/0x74)
[<c023fe5c>] (v4l2_release) from [<c00b4a00>] (__fput+0x80/0x224)
[<c00b4a00>] (__fput) from [<c00341e8>] (task_work_run+0xa0/0xd0)
[<c00341e8>] (task_work_run) from [<c001cc28>] (do_exit+0x244/0x918)
[<c001cc28>] (do_exit) from [<c001d344>] (do_group_exit+0x48/0xdc)
[<c001d344>] (do_group_exit) from [<c0029894>] (get_signal_to_deliver+0x2a0/0x5bc)
[<c0029894>] (get_signal_to_deliver) from [<c000b888>] (do_signal+0x78/0x3a0)
[<c000b888>] (do_signal) from [<c000bc54>] (do_work_pending+0xa4/0xb4)
[<c000bc54>] (do_work_pending) from [<c00096dc>] (work_pending+0xc/0x20)
---[ end trace 5faa75e8c2f8a6a1 ]---
------------[ cut here ]------------
WARNING: CPU: 0 PID: 2049 at drivers/media/v4l2-core/videobuf2-core.c:1095 vb2_buffer_done+0x1e0/0x224()
Modules linked in:
CPU: 0 PID: 2049 Comm: vpfe_video Tainted: G        W    3.14.0-rc5-00414-ged97a6f #89
[<c000e3f0>] (unwind_backtrace) from [<c000c618>] (show_stack+0x10/0x14)
[<c000c618>] (show_stack) from [<c001adb0>] (warn_slowpath_common+0x68/0x88)
[<c001adb0>] (warn_slowpath_common) from [<c001adec>] (warn_slowpath_null+0x1c/0x24)
[<c001adec>] (warn_slowpath_null) from [<c0252c28>] (vb2_buffer_done+0x1e0/0x224)
[<c0252c28>] (vb2_buffer_done) from [<c0252e3c>] (__vb2_queue_cancel+0x1d0/0x218)
[<c0252e3c>] (__vb2_queue_cancel) from [<c02533a4>] (vb2_queue_release+0x14/0x24)
[<c02533a4>] (vb2_queue_release) from [<c025a65c>] (vpfe_release+0x60/0x230)
[<c025a65c>] (vpfe_release) from [<c023fe5c>] (v4l2_release+0x34/0x74)
[<c023fe5c>] (v4l2_release) from [<c00b4a00>] (__fput+0x80/0x224)
[<c00b4a00>] (__fput) from [<c00341e8>] (task_work_run+0xa0/0xd0)
[<c00341e8>] (task_work_run) from [<c001cc28>] (do_exit+0x244/0x918)
[<c001cc28>] (do_exit) from [<c001d344>] (do_group_exit+0x48/0xdc)
[<c001d344>] (do_group_exit) from [<c0029894>] (get_signal_to_deliver+0x2a0/0x5bc)
[<c0029894>] (get_signal_to_deliver) from [<c000b888>] (do_signal+0x78/0x3a0)
[<c000b888>] (do_signal) from [<c000bc54>] (do_work_pending+0xa4/0xb4)
[<c000bc54>] (do_work_pending) from [<c00096dc>] (work_pending+0xc/0x20)
---[ end trace 5faa75e8c2f8a6a2 ]---

Signed-off-by: Lad, Prabhakar <prabhakar.csengg@gmail.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years ago[media] media: davinci: vpbe_display: fix releasing of active buffers
Lad, Prabhakar [Sat, 22 Mar 2014 11:03:09 +0000 (08:03 -0300)]
[media] media: davinci: vpbe_display: fix releasing of active buffers

from commit-id: b3379c6201bb3555298cdbf0aa004af260f2a6a4
"vb2: only call start_streaming if sufficient buffers are queued"
the vb2 framework warns on (WARN_ON()) if all the active buffers
are not released when streaming is stopped, initially the vb2 silently
released the buffer internally if the buffer was not released by
the driver.
This patch fixes following issue:

WARNING: CPU: 0 PID: 2049 at drivers/media/v4l2-core/videobuf2-core.c:2011 __vb2_queue_cancel+0x1a0/0x218()
Modules linked in:
CPU: 0 PID: 2049 Comm: vpbe_display Tainted: G        W    3.14.0-rc5-00414-ged97a6f #89
[<c000e3f0>] (unwind_backtrace) from [<c000c618>] (show_stack+0x10/0x14)
[<c000c618>] (show_stack) from [<c001adb0>] (warn_slowpath_common+0x68/0x88)
[<c001adb0>] (warn_slowpath_common) from [<c001adec>] (warn_slowpath_null+0x1c/0x24)
[<c001adec>] (warn_slowpath_null) from [<c0252e0c>] (__vb2_queue_cancel+0x1a0/0x218)
[<c0252e0c>] (__vb2_queue_cancel) from [<c02533a4>] (vb2_queue_release+0x14/0x24)
[<c02533a4>] (vb2_queue_release) from [<c025a65c>] (vpbe_display_release+0x60/0x230)
[<c025a65c>] (vpbe_display_release) from [<c023fe5c>] (v4l2_release+0x34/0x74)
[<c023fe5c>] (v4l2_release) from [<c00b4a00>] (__fput+0x80/0x224)
[<c00b4a00>] (__fput) from [<c00341e8>] (task_work_run+0xa0/0xd0)
[<c00341e8>] (task_work_run) from [<c001cc28>] (do_exit+0x244/0x918)
[<c001cc28>] (do_exit) from [<c001d344>] (do_group_exit+0x48/0xdc)
[<c001d344>] (do_group_exit) from [<c0029894>] (get_signal_to_deliver+0x2a0/0x5bc)
[<c0029894>] (get_signal_to_deliver) from [<c000b888>] (do_signal+0x78/0x3a0)
[<c000b888>] (do_signal) from [<c000bc54>] (do_work_pending+0xa4/0xb4)
[<c000bc54>] (do_work_pending) from [<c00096dc>] (work_pending+0xc/0x20)
---[ end trace 5faa75e8c2f8a6a1 ]---
------------[ cut here ]------------
WARNING: CPU: 0 PID: 2049 at drivers/media/v4l2-core/videobuf2-core.c:1095 vb2_buffer_done+0x1e0/0x224()
Modules linked in:
CPU: 0 PID: 2049 Comm: vpbe_display Tainted: G        W    3.14.0-rc5-00414-ged97a6f #89
[<c000e3f0>] (unwind_backtrace) from [<c000c618>] (show_stack+0x10/0x14)
[<c000c618>] (show_stack) from [<c001adb0>] (warn_slowpath_common+0x68/0x88)
[<c001adb0>] (warn_slowpath_common) from [<c001adec>] (warn_slowpath_null+0x1c/0x24)
[<c001adec>] (warn_slowpath_null) from [<c0252c28>] (vb2_buffer_done+0x1e0/0x224)
[<c0252c28>] (vb2_buffer_done) from [<c0252e3c>] (__vb2_queue_cancel+0x1d0/0x218)
[<c0252e3c>] (__vb2_queue_cancel) from [<c02533a4>] (vb2_queue_release+0x14/0x24)
[<c02533a4>] (vb2_queue_release) from [<c025a65c>] (vpbe_display_release+0x60/0x230)
[<c025a65c>] (vpbe_display_release) from [<c023fe5c>] (v4l2_release+0x34/0x74)
[<c023fe5c>] (v4l2_release) from [<c00b4a00>] (__fput+0x80/0x224)
[<c00b4a00>] (__fput) from [<c00341e8>] (task_work_run+0xa0/0xd0)
[<c00341e8>] (task_work_run) from [<c001cc28>] (do_exit+0x244/0x918)
[<c001cc28>] (do_exit) from [<c001d344>] (do_group_exit+0x48/0xdc)
[<c001d344>] (do_group_exit) from [<c0029894>] (get_signal_to_deliver+0x2a0/0x5bc)
[<c0029894>] (get_signal_to_deliver) from [<c000b888>] (do_signal+0x78/0x3a0)
[<c000b888>] (do_signal) from [<c000bc54>] (do_work_pending+0xa4/0xb4)
[<c000bc54>] (do_work_pending) from [<c00096dc>] (work_pending+0xc/0x20)
---[ end trace 5faa75e8c2f8a6a2 ]---

Signed-off-by: Lad, Prabhakar <prabhakar.csengg@gmail.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years ago[media] media: davinci: vpif_display: fix releasing of active buffers
Lad, Prabhakar [Sat, 22 Mar 2014 11:03:08 +0000 (08:03 -0300)]
[media] media: davinci: vpif_display: fix releasing of active buffers

from commit-id: b3379c6201bb3555298cdbf0aa004af260f2a6a4
"vb2: only call start_streaming if sufficient buffers are queued"
the vb2 framework warns on (WARN_ON()) if all the active buffers
are not released when streaming is stopped, initially the vb2 silently
released the buffer internally if the buffer was not released by
the driver.
Also this patch moves the disabling of interrupts from relase() callback
to stop_streaming() callback as which needs to be done ideally.

This patch fixes following issue:

WARNING: CPU: 0 PID: 2049 at drivers/media/v4l2-core/videobuf2-core.c:2011 __vb2_queue_cancel+0x1a0/0x218()
Modules linked in:
CPU: 0 PID: 2049 Comm: vpif_display Tainted: G        W    3.14.0-rc5-00414-ged97a6f #89
[<c000e3f0>] (unwind_backtrace) from [<c000c618>] (show_stack+0x10/0x14)
[<c000c618>] (show_stack) from [<c001adb0>] (warn_slowpath_common+0x68/0x88)
[<c001adb0>] (warn_slowpath_common) from [<c001adec>] (warn_slowpath_null+0x1c/0x24)
[<c001adec>] (warn_slowpath_null) from [<c0252e0c>] (__vb2_queue_cancel+0x1a0/0x218)
[<c0252e0c>] (__vb2_queue_cancel) from [<c02533a4>] (vb2_queue_release+0x14/0x24)
[<c02533a4>] (vb2_queue_release) from [<c025a65c>] (vpif_release+0x60/0x230)
[<c025a65c>] (vpif_release) from [<c023fe5c>] (v4l2_release+0x34/0x74)
[<c023fe5c>] (v4l2_release) from [<c00b4a00>] (__fput+0x80/0x224)
[<c00b4a00>] (__fput) from [<c00341e8>] (task_work_run+0xa0/0xd0)
[<c00341e8>] (task_work_run) from [<c001cc28>] (do_exit+0x244/0x918)
[<c001cc28>] (do_exit) from [<c001d344>] (do_group_exit+0x48/0xdc)
[<c001d344>] (do_group_exit) from [<c0029894>] (get_signal_to_deliver+0x2a0/0x5bc)
[<c0029894>] (get_signal_to_deliver) from [<c000b888>] (do_signal+0x78/0x3a0)
[<c000b888>] (do_signal) from [<c000bc54>] (do_work_pending+0xa4/0xb4)
[<c000bc54>] (do_work_pending) from [<c00096dc>] (work_pending+0xc/0x20)
---[ end trace 5faa75e8c2f8a6a1 ]---
------------[ cut here ]------------
WARNING: CPU: 0 PID: 2049 at drivers/media/v4l2-core/videobuf2-core.c:1095 vb2_buffer_done+0x1e0/0x224()
Modules linked in:
CPU: 0 PID: 2049 Comm: vpif_display Tainted: G        W    3.14.0-rc5-00414-ged97a6f #89
[<c000e3f0>] (unwind_backtrace) from [<c000c618>] (show_stack+0x10/0x14)
[<c000c618>] (show_stack) from [<c001adb0>] (warn_slowpath_common+0x68/0x88)
[<c001adb0>] (warn_slowpath_common) from [<c001adec>] (warn_slowpath_null+0x1c/0x24)
[<c001adec>] (warn_slowpath_null) from [<c0252c28>] (vb2_buffer_done+0x1e0/0x224)
[<c0252c28>] (vb2_buffer_done) from [<c0252e3c>] (__vb2_queue_cancel+0x1d0/0x218)
[<c0252e3c>] (__vb2_queue_cancel) from [<c02533a4>] (vb2_queue_release+0x14/0x24)
[<c02533a4>] (vb2_queue_release) from [<c025a65c>] (vpif_release+0x60/0x230)
[<c025a65c>] (vpif_release) from [<c023fe5c>] (v4l2_release+0x34/0x74)
[<c023fe5c>] (v4l2_release) from [<c00b4a00>] (__fput+0x80/0x224)
[<c00b4a00>] (__fput) from [<c00341e8>] (task_work_run+0xa0/0xd0)
[<c00341e8>] (task_work_run) from [<c001cc28>] (do_exit+0x244/0x918)
[<c001cc28>] (do_exit) from [<c001d344>] (do_group_exit+0x48/0xdc)
[<c001d344>] (do_group_exit) from [<c0029894>] (get_signal_to_deliver+0x2a0/0x5bc)
[<c0029894>] (get_signal_to_deliver) from [<c000b888>] (do_signal+0x78/0x3a0)
[<c000b888>] (do_signal) from [<c000bc54>] (do_work_pending+0xa4/0xb4)
[<c000bc54>] (do_work_pending) from [<c00096dc>] (work_pending+0xc/0x20)
---[ end trace 5faa75e8c2f8a6a2 ]---

Signed-off-by: Lad, Prabhakar <prabhakar.csengg@gmail.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years ago[media] media: davinci: vpif_capture: fix releasing of active buffers
Lad, Prabhakar [Sat, 22 Mar 2014 11:03:07 +0000 (08:03 -0300)]
[media] media: davinci: vpif_capture: fix releasing of active buffers

from commit-id: b3379c6201bb3555298cdbf0aa004af260f2a6a4
"vb2: only call start_streaming if sufficient buffers are queued"
the vb2 framework warns on (WARN_ON()) if all the active buffers
are not released when streaming is stopped, initially the vb2 silently
released the buffer internally if the buffer was not released by
the driver.
Also this patch moves the disabling of interrupts from relase() callback
to stop_streaming() callback as which needs to be done ideally.

This patch fixes following issue:

WARNING: CPU: 0 PID: 2049 at drivers/media/v4l2-core/videobuf2-core.c:2011 __vb2_queue_cancel+0x1a0/0x218()
Modules linked in:
CPU: 0 PID: 2049 Comm: vpif_capture Tainted: G        W    3.14.0-rc5-00414-ged97a6f #89
[<c000e3f0>] (unwind_backtrace) from [<c000c618>] (show_stack+0x10/0x14)
[<c000c618>] (show_stack) from [<c001adb0>] (warn_slowpath_common+0x68/0x88)
[<c001adb0>] (warn_slowpath_common) from [<c001adec>] (warn_slowpath_null+0x1c/0x24)
[<c001adec>] (warn_slowpath_null) from [<c0252e0c>] (__vb2_queue_cancel+0x1a0/0x218)
[<c0252e0c>] (__vb2_queue_cancel) from [<c02533a4>] (vb2_queue_release+0x14/0x24)
[<c02533a4>] (vb2_queue_release) from [<c025a65c>] (vpif_release+0x60/0x230)
[<c025a65c>] (vpif_release) from [<c023fe5c>] (v4l2_release+0x34/0x74)
[<c023fe5c>] (v4l2_release) from [<c00b4a00>] (__fput+0x80/0x224)
[<c00b4a00>] (__fput) from [<c00341e8>] (task_work_run+0xa0/0xd0)
[<c00341e8>] (task_work_run) from [<c001cc28>] (do_exit+0x244/0x918)
[<c001cc28>] (do_exit) from [<c001d344>] (do_group_exit+0x48/0xdc)
[<c001d344>] (do_group_exit) from [<c0029894>] (get_signal_to_deliver+0x2a0/0x5bc)
[<c0029894>] (get_signal_to_deliver) from [<c000b888>] (do_signal+0x78/0x3a0)
[<c000b888>] (do_signal) from [<c000bc54>] (do_work_pending+0xa4/0xb4)
[<c000bc54>] (do_work_pending) from [<c00096dc>] (work_pending+0xc/0x20)
---[ end trace 5faa75e8c2f8a6a1 ]---
------------[ cut here ]------------
WARNING: CPU: 0 PID: 2049 at drivers/media/v4l2-core/videobuf2-core.c:1095 vb2_buffer_done+0x1e0/0x224()
Modules linked in:
CPU: 0 PID: 2049 Comm: vpif_capture Tainted: G        W    3.14.0-rc5-00414-ged97a6f #89
[<c000e3f0>] (unwind_backtrace) from [<c000c618>] (show_stack+0x10/0x14)
[<c000c618>] (show_stack) from [<c001adb0>] (warn_slowpath_common+0x68/0x88)
[<c001adb0>] (warn_slowpath_common) from [<c001adec>] (warn_slowpath_null+0x1c/0x24)
[<c001adec>] (warn_slowpath_null) from [<c0252c28>] (vb2_buffer_done+0x1e0/0x224)
[<c0252c28>] (vb2_buffer_done) from [<c0252e3c>] (__vb2_queue_cancel+0x1d0/0x218)
[<c0252e3c>] (__vb2_queue_cancel) from [<c02533a4>] (vb2_queue_release+0x14/0x24)
[<c02533a4>] (vb2_queue_release) from [<c025a65c>] (vpif_release+0x60/0x230)
[<c025a65c>] (vpif_release) from [<c023fe5c>] (v4l2_release+0x34/0x74)
[<c023fe5c>] (v4l2_release) from [<c00b4a00>] (__fput+0x80/0x224)
[<c00b4a00>] (__fput) from [<c00341e8>] (task_work_run+0xa0/0xd0)
[<c00341e8>] (task_work_run) from [<c001cc28>] (do_exit+0x244/0x918)
[<c001cc28>] (do_exit) from [<c001d344>] (do_group_exit+0x48/0xdc)
[<c001d344>] (do_group_exit) from [<c0029894>] (get_signal_to_deliver+0x2a0/0x5bc)
[<c0029894>] (get_signal_to_deliver) from [<c000b888>] (do_signal+0x78/0x3a0)
[<c000b888>] (do_signal) from [<c000bc54>] (do_work_pending+0xa4/0xb4)
[<c000bc54>] (do_work_pending) from [<c00096dc>] (work_pending+0xc/0x20)
---[ end trace 5faa75e8c2f8a6a2 ]---

Signed-off-by: Lad, Prabhakar <prabhakar.csengg@gmail.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years ago[media] s5p-fimc: Fix YUV422P depth
Nicolas Dufresne [Tue, 25 Mar 2014 20:50:11 +0000 (17:50 -0300)]
[media] s5p-fimc: Fix YUV422P depth

All YUV 422 has 16bit per pixels.

Signed-off-by: Nicolas Dufresne <nicolas.dufresne@collabora.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years ago[media] s5c73m3: Add missing rename of v4l2_of_get_next_endpoint() function
Sylwester Nawrocki [Tue, 8 Apr 2014 13:05:03 +0000 (10:05 -0300)]
[media] s5c73m3: Add missing rename of v4l2_of_get_next_endpoint() function

This fixes following build error:

  CC      drivers/media/i2c/s5c73m3/s5c73m3-core.o
  CC      drivers/md/dm-ioctl.o
  CC      net/ipv4/inet_lro.o
drivers/media/i2c/s5c73m3/s5c73m3-core.c: In function ‘s5c73m3_get_platform_data’:
drivers/media/i2c/s5c73m3/s5c73m3-core.c:1619:2: error: implicit declaration of function ‘v4l2_of_get_next_endpoint’ [-Werror=implicit-function-declaration]
drivers/media/i2c/s5c73m3/s5c73m3-core.c:1619:10: warning: assignment makes pointer from integer without a cast [enabled by default]

Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years ago[media] rtl28xxu: silence error log about disabled rtl2832_sdr module
Antti Palosaari [Wed, 9 Apr 2014 21:08:37 +0000 (18:08 -0300)]
[media] rtl28xxu: silence error log about disabled rtl2832_sdr module

It printed a little bit too heavy looking error log "DVB: Unable to
find symbol rtl2832_sdr_attach()" when staging module was disabled.
Silence that error by introducing own version of dvb_attach() macro
without the error logging.

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years ago[media] rtl28xxu: do not hard depend on staging SDR module
Antti Palosaari [Wed, 9 Apr 2014 15:42:35 +0000 (12:42 -0300)]
[media] rtl28xxu: do not hard depend on staging SDR module

RTL2832 SDR extension module is currently on staging. SDR module
headers were included from staging causing direct dependency staging
directory. As a solution, add needed headers to main driver.
Motivation of that change comes from Luis / driver backports project.

Reported-by: Luis R. Rodriguez <mcgrof@do-not-panic.com>
Cc: backports@vger.kernel.org
Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years agoMerge tag 'v3.15-rc1' into patchwork
Mauro Carvalho Chehab [Mon, 14 Apr 2014 15:00:36 +0000 (12:00 -0300)]
Merge tag 'v3.15-rc1' into patchwork

Linux 3.15-rc1

* tag 'v3.15-rc1': (12180 commits)
  Linux 3.15-rc1
  mm: Initialize error in shmem_file_aio_read()
  cifs: Use min_t() when comparing "size_t" and "unsigned long"
  sym53c8xx_2: Set DID_REQUEUE return code when aborting squeue
  powerpc: Don't try to set LPCR unless we're in hypervisor mode
  futex: update documentation for ordering guarantees
  ceph: fix pr_fmt() redefinition
  vti: don't allow to add the same tunnel twice
  gre: don't allow to add the same tunnel twice
  drivers: net: xen-netfront: fix array initialization bug
  missing bits of "splice: fix racy pipe->buffers uses"
  cifs: fix the race in cifs_writev()
  ceph_sync_{,direct_}write: fix an oops on ceph_osdc_new_request() failure
  pktgen: be friendly to LLTX devices
  r8152: check RTL8152_UNPLUG
  net: sun4i-emac: add promiscuous support
  net/apne: replace IS_ERR and PTR_ERR with PTR_ERR_OR_ZERO
  blackfin: cleanup board files
  bf609: clock: drop unused clock bit set/clear functions
  Blackfin: bf537: rename "CONFIG_ADT75"
  ...

10 years agoLinux 3.15-rc1
Linus Torvalds [Sun, 13 Apr 2014 21:18:35 +0000 (14:18 -0700)]
Linux 3.15-rc1

10 years agomm: Initialize error in shmem_file_aio_read()
Geert Uytterhoeven [Sun, 13 Apr 2014 18:46:22 +0000 (20:46 +0200)]
mm: Initialize error in shmem_file_aio_read()

Some versions of gcc even warn about it:

  mm/shmem.c: In function ‘shmem_file_aio_read’:
  mm/shmem.c:1414: warning: ‘error’ may be used uninitialized in this function

If the loop is aborted during the first iteration by one of the two
first break statements, error will be uninitialized.

Introduced by commit 6e58e79db8a1 ("introduce copy_page_to_iter, kill
loop over iovec in generic_file_aio_read()").

Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
Acked-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
10 years agocifs: Use min_t() when comparing "size_t" and "unsigned long"
Geert Uytterhoeven [Sun, 13 Apr 2014 18:46:21 +0000 (20:46 +0200)]
cifs: Use min_t() when comparing "size_t" and "unsigned long"

On 32 bit, size_t is "unsigned int", not "unsigned long", causing the
following warning when comparing with PAGE_SIZE, which is always "unsigned
long":

  fs/cifs/file.c: In function ‘cifs_readdata_to_iov’:
  fs/cifs/file.c:2757: warning: comparison of distinct pointer types lacks a cast

Introduced by commit 7f25bba819a3 ("cifs_iovec_read: keep iov_iter
between the calls of cifs_readdata_to_iov()"), which changed the
signedness of "remaining" and the code from min_t() to min().

Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
10 years agoMerge branch 'slab/next' of git://git.kernel.org/pub/scm/linux/kernel/git/penberg...
Linus Torvalds [Sun, 13 Apr 2014 20:28:13 +0000 (13:28 -0700)]
Merge branch 'slab/next' of git://git.kernel.org/pub/scm/linux/kernel/git/penberg/linux

Pull slab changes from Pekka Enberg:
 "The biggest change is byte-sized freelist indices which reduces slab
  freelist memory usage:

    https://lkml.org/lkml/2013/12/2/64"

* 'slab/next' of git://git.kernel.org/pub/scm/linux/kernel/git/penberg/linux:
  mm: slab/slub: use page->list consistently instead of page->lru
  mm/slab.c: cleanup outdated comments and unify variables naming
  slab: fix wrongly used macro
  slub: fix high order page allocation problem with __GFP_NOFAIL
  slab: Make allocations with GFP_ZERO slightly more efficient
  slab: make more slab management structure off the slab
  slab: introduce byte sized index for the freelist of a slab
  slab: restrict the number of objects in a slab
  slab: introduce helper functions to get/set free object
  slab: factor out calculate nr objects in cache_estimate

10 years agoMerge branch 'misc' of git://git.kernel.org/pub/scm/linux/kernel/git/mmarek/kbuild
Linus Torvalds [Sun, 13 Apr 2014 01:22:27 +0000 (18:22 -0700)]
Merge branch 'misc' of git://git.kernel.org/pub/scm/linux/kernel/git/mmarek/kbuild

Pull misc kbuild changes from Michal Marek:
 "Here is the non-critical part of kbuild:
   - One bogus coccinelle check removed, one check fixed not to suggest
     the obsolete PTR_RET macro
   - scripts/tags.sh does not index the generated *.mod.c files
   - new objdiff tool to list differences between two versions of an
     object file
   - A fix for scripts/bootgraph.pl"

* 'misc' of git://git.kernel.org/pub/scm/linux/kernel/git/mmarek/kbuild:
  scripts/coccinelle: Use PTR_ERR_OR_ZERO
  scripts/bootgraph.pl: Add graphic header
  scripts: objdiff: detect object code changes between two commits
  Coccicheck: Remove memcpy to struct assignment test
  scripts/tags.sh: Ignore *.mod.c

10 years agosym53c8xx_2: Set DID_REQUEUE return code when aborting squeue
Mikulas Patocka [Wed, 9 Apr 2014 01:52:05 +0000 (21:52 -0400)]
sym53c8xx_2: Set DID_REQUEUE return code when aborting squeue

This patch fixes I/O errors with the sym53c8xx_2 driver when the disk
returns QUEUE FULL status.

When the controller encounters an error (including QUEUE FULL or BUSY
status), it aborts all not yet submitted requests in the function
sym_dequeue_from_squeue.

This function aborts them with DID_SOFT_ERROR.

If the disk has full tag queue, the request that caused the overflow is
aborted with QUEUE FULL status (and the scsi midlayer properly retries
it until it is accepted by the disk), but the sym53c8xx_2 driver aborts
the following requests with DID_SOFT_ERROR --- for them, the midlayer
does just a few retries and then signals the error up to sd.

The result is that disk returning QUEUE FULL causes request failures.

The error was reproduced on 53c895 with COMPAQ BD03685A24 disk
(rebranded ST336607LC) with command queue 48 or 64 tags.  The disk has
64 tags, but under some access patterns it return QUEUE FULL when there
are less than 64 pending tags.  The SCSI specification allows returning
QUEUE FULL anytime and it is up to the host to retry.

Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
Cc: Matthew Wilcox <matthew@wil.cx>
Cc: James Bottomley <JBottomley@Parallels.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
10 years agopowerpc: Don't try to set LPCR unless we're in hypervisor mode
Paul Mackerras [Fri, 11 Apr 2014 06:43:35 +0000 (16:43 +1000)]
powerpc: Don't try to set LPCR unless we're in hypervisor mode

Commit 8f619b5429d9 ("powerpc/ppc64: Do not turn AIL (reloc-on
interrupts) too early") added code to set the AIL bit in the LPCR
without checking whether the kernel is running in hypervisor mode.  The
result is that when the kernel is running as a guest (i.e., under
PowerKVM or PowerVM), the processor takes a privileged instruction
interrupt at that point, causing a panic.  The visible result is that
the kernel hangs after printing "returning from prom_init".

This fixes it by checking for hypervisor mode being available before
setting LPCR.  If we are not in hypervisor mode, we enable relocation-on
interrupts later in pSeries_setup_arch using the H_SET_MODE hcall.

Signed-off-by: Paul Mackerras <paulus@samba.org>
Acked-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>