cascardo/linux.git
10 years ago[media] media: davinci: vpif_capture: improve start/stop_streaming callbacks
Lad, Prabhakar [Fri, 16 May 2014 13:33:39 +0000 (10:33 -0300)]
[media] media: davinci: vpif_capture: improve start/stop_streaming callbacks

this patch drops unnecessary check from start_streaming() callback
as this is already done in try/s_fmt and some minor code cleanups,
drops check for vb2_is_streaming() as this check is done by vb2
itself before calling this callback.

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: improve vpif_buffer_queue_setup() function
Lad, Prabhakar [Fri, 16 May 2014 13:33:38 +0000 (10:33 -0300)]
[media] media: davinci: vpif_capture: improve vpif_buffer_queue_setup() function

this patch sets the sizes[0] of plane according to the fmt passed
or which is being set in the channel, in both MMAP and USERPTR buffer
type.

This patch also move the calculation of offests(vpif_calculate_offsets())
to queue_setup() callback as after queue_setup() callback the
application is no longer allowed to change format, and prepares to
removal of config_params.

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: improve vpif_buffer_prepare() callback
Lad, Prabhakar [Fri, 16 May 2014 13:33:37 +0000 (10:33 -0300)]
[media] media: davinci: vpif_capture: improve vpif_buffer_prepare() callback

this patch improve vpif_buffer_prepare() callback, as buf_prepare()
callback is never called with invalid state and check for
vb2_plane_vaddr(vb, 0) is dropped as payload check should
be done unconditionally.

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: drop buf_cleanup() callback
Lad, Prabhakar [Fri, 16 May 2014 13:33:36 +0000 (10:33 -0300)]
[media] media: davinci: vpif_capture: drop buf_cleanup() callback

this patch drops buf_cleanup() callback as this callback
is never called with buffer state active.

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: release buffers in case start_streaming() call...
Lad, Prabhakar [Fri, 16 May 2014 13:33:35 +0000 (10:33 -0300)]
[media] media: davinci: vpif_capture: release buffers in case start_streaming() call back fails

this patch adds support to release 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] media: davinci: vpif_capture: use vb2_ops_wait_prepare/finish helper functions
Lad, Prabhakar [Fri, 16 May 2014 13:33:33 +0000 (10:33 -0300)]
[media] media: davinci: vpif_capture: use vb2_ops_wait_prepare/finish helper functions

this patch makes use of vb2_ops_wait_prepare/finish helper functions.

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: drop buf_init() callback
Lad, Prabhakar [Fri, 16 May 2014 13:33:32 +0000 (10:33 -0300)]
[media] media: davinci: vpif_capture: drop buf_init() callback

this patch drops the buf_init() callback as init
of buf list is not required.

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: initalize vb2 queue and DMA context during...
Lad, Prabhakar [Fri, 16 May 2014 13:33:31 +0000 (10:33 -0300)]
[media] media: davinci: vpif_capture: initalize vb2 queue and DMA context during probe

this patch moves the initalization of vb2 queue and
the DMA context to probe() and clean up in remove()
callback respectively.

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 v4l-compliance issues
Lad, Prabhakar [Fri, 16 May 2014 13:33:30 +0000 (10:33 -0300)]
[media] media: davinci: vpif_display: fix v4l-compliance issues

this patch does following,
1: sets initial default format during probe.
2: removes spurious messages.
3: optimize vpif_s/try_fmt_vid_out code.

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 checkpatch error
Lad, Prabhakar [Fri, 16 May 2014 13:33:29 +0000 (10:33 -0300)]
[media] media: davinci; vpif_display: fix checkpatch error

this patch fixes following checkpatch warning, and alongside
renames the DAVINCIHD_DISPLAY_H to VPIF_DISPLAY_H.

WARNING: Unnecessary space before function pointer arguments

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: return -ENODATA for *std calls
Lad, Prabhakar [Fri, 16 May 2014 13:33:28 +0000 (10:33 -0300)]
[media] media: davinci: vpif_display: return -ENODATA for *std calls

this patch adds supports to return -ENODATA to *std calls
if the selected output does not support it.

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: return -ENODATA for *dv_timings calls
Lad, Prabhakar [Fri, 16 May 2014 13:33:27 +0000 (10:33 -0300)]
[media] media: davinci: vpif_display: return -ENODATA for *dv_timings calls

this patch adds suppport to return -ENODATA for *dv_timings calls
if the current output does not support it.

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: use SIMPLE_DEV_PM_OPS
Lad, Prabhakar [Fri, 16 May 2014 13:33:26 +0000 (10:33 -0300)]
[media] media: davinci: vpif_display: use SIMPLE_DEV_PM_OPS

this patch uses SIMPLE_DEV_PM_OPS, and drops unneeded members
from io_usrs, usrs and makes use of vb2 helepers instead.

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: group v4l2_ioctl_ops
Lad, Prabhakar [Fri, 16 May 2014 13:33:25 +0000 (10:33 -0300)]
[media] media: davinci: vpif_display: group v4l2_ioctl_ops

this patch gorups the v4l2_ioctl_ops and align them appropriately.

No functional changes.

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: drop cropcap
Lad, Prabhakar [Fri, 16 May 2014 13:33:24 +0000 (10:33 -0300)]
[media] media: davinci: vpif_display: drop cropcap

this patch drops cropcap as this driver doesnt support cropping.

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: drop unneeded module params
Lad, Prabhakar [Fri, 16 May 2014 13:33:23 +0000 (10:33 -0300)]
[media] media: davinci: vpif_display: drop unneeded module params

this pacth drops unneeded module params and vpif_config_params.

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: initialize the video device in single place
Lad, Prabhakar [Fri, 16 May 2014 13:33:22 +0000 (10:33 -0300)]
[media] media: davinci: vpif_display: initialize the video device in single place

this patch moves the initalization of video device to a
single place and uses macro to define the driver name and
use it appropraitely in required places.

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: davinic: vpif_display: drop started member from struct common_obj
Lad, Prabhakar [Fri, 16 May 2014 13:33:21 +0000 (10:33 -0300)]
[media] media: davinic: vpif_display: drop started member from struct common_obj

the started member was indicating whether streaming was started
or not, this can be determined by vb2 offering, this patch replaces
the started member from struct common_obj with appropriate vb2 calls.

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: drop numbuffers field from common_obj
Lad, Prabhakar [Fri, 16 May 2014 13:33:20 +0000 (10:33 -0300)]
[media] media: davinci: vpif_display: drop numbuffers field from common_obj

This patch drops numbuffers member from struct common_obj
as this was not required.

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: drop unnecessary field memory
Lad, Prabhakar [Fri, 16 May 2014 13:33:19 +0000 (10:33 -0300)]
[media] media: davinci: vpif_display: drop unnecessary field memory

The common->memory field is set but not used anywhere. Drop it.

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: drop reserving memory for device
Lad, Prabhakar [Fri, 16 May 2014 13:33:18 +0000 (10:33 -0300)]
[media] media: davinci: vpif_display: drop reserving memory for device

this patch drops reserving contigiuos memory for the device,
as now with CMA support there is no need of this.
This patch also prepares to removal of config_params.

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: drop unused member fbuffers
Lad, Prabhakar [Fri, 16 May 2014 13:33:17 +0000 (10:33 -0300)]
[media] media: davinci: vpif_display: drop unused member fbuffers

As fbuffers is not used anymore, remove it.
No functional changes.

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: use vb2_ioctl_* helpers
Lad, Prabhakar [Fri, 16 May 2014 13:33:16 +0000 (10:33 -0300)]
[media] media: davinci: vpif_display: use vb2_ioctl_* helpers

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: use v4l2_fh_open and vb2_fop_release
Lad, Prabhakar [Fri, 16 May 2014 13:33:15 +0000 (10:33 -0300)]
[media] media: davinci: vpif_display: use v4l2_fh_open and vb2_fop_release

this patch adds support to use v4l2_fh_open() and vb2_fop_release,
which allows to drop driver specific struct vpif_fh, as this is handeled
by core. This patch also drops vpif_g/s_priority as this handeled
by core.

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: use vb2_fop_mmap/poll
Lad, Prabhakar [Fri, 16 May 2014 13:33:14 +0000 (10:33 -0300)]
[media] media: davinci: vpif_display: use vb2_fop_mmap/poll

No need to reinvent the wheel. Just use the already existing
functions for that.

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: improve start/stop_streaming callbacks
Lad, Prabhakar [Fri, 16 May 2014 13:33:13 +0000 (10:33 -0300)]
[media] media: davinci: vpif_display: improve start/stop_streaming callbacks

this patch drops unnecessary check from start_streaming() callback
as this is already done in try/s_fmt and some minor code cleanups,
drops check for vb2_is_streaming() as this check is done by vb2
itself before calling this callback.

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: improve vpif_buffer_queue_setup() function
Lad, Prabhakar [Fri, 16 May 2014 13:33:12 +0000 (10:33 -0300)]
[media] media: davinci: vpif_display: improve vpif_buffer_queue_setup() function

this patch sets the sizes[0] of plane according to the fmt passed
or which is being set in the channel, in both MMAP and USERPTR buffer
type.

This patch also move the calculation of offests(vpif_calculate_offsets())
to queue_setup() callback as after queue_setup() callback the
application is no longer allowed to change format, and prepares to
removal of config_params.

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: improve vpif_buffer_prepare() callback
Lad, Prabhakar [Fri, 16 May 2014 13:33:11 +0000 (10:33 -0300)]
[media] media: davinci: vpif_display: improve vpif_buffer_prepare() callback

this patch improve vpif_buffer_prepare() callback, as buf_prepare()
callback is never called with invalid state and check for
vb2_plane_vaddr(vb, 0) is dropped as payload check should
be done unconditionally.

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: drop buf_cleanup() callback
Lad, Prabhakar [Fri, 16 May 2014 13:33:10 +0000 (10:33 -0300)]
[media] media: davinci: vpif_display: drop buf_cleanup() callback

this patch drops buf_cleanup() callback as this callback
is never called with buffer state active.

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: release buffers in case start_streaming() call...
Lad, Prabhakar [Fri, 16 May 2014 13:33:09 +0000 (10:33 -0300)]
[media] media: davinci: vpif_display: release buffers in case start_streaming() call back fails

this patch adds support to release 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] media: davinci: vpif_display: use vb2_ops_wait_prepare/finish helper functions
Lad, Prabhakar [Fri, 16 May 2014 13:33:08 +0000 (10:33 -0300)]
[media] media: davinci: vpif_display: use vb2_ops_wait_prepare/finish helper functions

this patch makes use of vb2_ops_wait_prepare/finish helper functions.

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: drop buf_init() callback
Lad, Prabhakar [Fri, 16 May 2014 13:33:07 +0000 (10:33 -0300)]
[media] media: davinci: vpif_display: drop buf_init() callback

this patch drops the buf_init() callback as init
of buf list is not required.

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: initialize vb2 queue and DMA context during...
Lad, Prabhakar [Fri, 16 May 2014 13:33:06 +0000 (10:33 -0300)]
[media] media: davinci: vpif_display: initialize vb2 queue and DMA context during probe

this patch moves the initalization of vb2 queue and
the DMA context to probe() and clean up in remove()
callback respectively.

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] exynos4-is: Remove support for non-dt platforms
Sylwester Nawrocki [Tue, 15 Apr 2014 11:35:25 +0000 (08:35 -0300)]
[media] exynos4-is: Remove support for non-dt platforms

All platforms supported by this driver are going to get device tree
support in this kernel release so remove code that would have been
actually not used any more.

Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Acked-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years ago[media] ARM: S5PV210: Remove camera support from mach-goni.c
Sylwester Nawrocki [Tue, 15 Apr 2014 10:31:21 +0000 (07:31 -0300)]
[media] ARM: S5PV210: Remove camera support from mach-goni.c

S5PV210 is going to get DT support, so we can remove the camera
bits from the only board using camera on S5PV210. This allows to
clean the exynos4-is driver by dropping code for non-dt platforms.
This patch can be dropped if a patch removing the whole board
file is applied first.

Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Acked-by: Kyungmin Park <kyungmin.park@samsung.com>
Acked-by: Kukjin Kim <kgene.kim@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years ago[media] exynos4-is: Free FIMC-IS CPU memory only when allocated
Sylwester Nawrocki [Thu, 8 May 2014 17:35:15 +0000 (14:35 -0300)]
[media] exynos4-is: Free FIMC-IS CPU memory only when allocated

Ensure dma_free_coherent() is not called with incorrect arguments
and only when the memory was actually allocated. This will prevent
possible crashes on error paths of the top level media device driver,
when fimc-is device gets unregistered and its driver detached.

Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Acked-by: Kyungmin Park <kyungmin.park@samsung.com>
Cc: stable@vger.kernel.org # for v3.15
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years ago[media] exynos4-is: Fix compilation for !CONFIG_COMMON_CLK
Sylwester Nawrocki [Tue, 15 Apr 2014 17:34:29 +0000 (14:34 -0300)]
[media] exynos4-is: Fix compilation for !CONFIG_COMMON_CLK

CONFIG_COMMON_CLK is not enabled on S5PV210 platform, so include
some clk API data structures conditionally to avoid compilation
errors. These #ifdefs will be removed for next kernel release,
when the S5PV210 platform moves to DT and the common clk API.

Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Acked-by: Kyungmin Park <kyungmin.park@samsung.com>
Cc: stable@vger.kernel.org # for 3.15
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years ago[media] s5p-mfc: Core support for v8 encoder
Kiran AVND [Mon, 19 May 2014 12:50:02 +0000 (09:50 -0300)]
[media] s5p-mfc: Core support for v8 encoder

This patch adds core support for v8 encoder. This
patch also adds register definitions and buffer size
requirements for H264 & VP8 encoding, needed for new
firmware version v8 for MFC

Signed-off-by: Kiran AVND <avnd.kiran@samsung.com>
Signed-off-by: Pawel Osciak <posciak@chromium.org>
Signed-off-by: Arun Kumar K <arun.kk@samsung.com>
[k.debski@samsung.com: Change MFC version macro name to MFC_V8_BIT]
Signed-off-by: Kamil Debski <k.debski@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years ago[media] s5p-mfc: Core support to add v8 decoder
Kiran AVND [Mon, 19 May 2014 12:50:01 +0000 (09:50 -0300)]
[media] s5p-mfc: Core support to add v8 decoder

This patch adds variant data and core support for
V8 decoder. This patch also adds the register definition
file for new firmware version v8 for MFC.

Signed-off-by: Kiran AVND <avnd.kiran@samsung.com>
Signed-off-by: Pawel Osciak <posciak@chromium.org>
Signed-off-by: Arun Kumar K <arun.kk@samsung.com>
[k.debski@samsung.com: Change MFC version macro name to MFC_V8_BIT]
Signed-off-by: Kamil Debski <k.debski@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years ago[media] v4l: s5p-mfc: Limit enum_fmt to output formats of current version
Kamil Debski [Tue, 20 May 2014 13:15:13 +0000 (10:15 -0300)]
[media] v4l: s5p-mfc: Limit enum_fmt to output formats of current version

MFC versions support a different set of formats, this specially applies
to the raw YUV formats. This patch changes enum_fmt, so that it only
reports formats that are supported by the used MFC version.

Signed-off-by: Kamil Debski <k.debski@samsung.com>
Acked-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years ago[media] v4l: s5p-mfc: Fix default pixel format selection for decoder
Kamil Debski [Fri, 16 May 2014 12:03:43 +0000 (09:03 -0300)]
[media] v4l: s5p-mfc: Fix default pixel format selection for decoder

The patch adding the v6 version of MFC changed the default format for
the CAPTURE queue, but this also affects the v5 version. This patch
solves this problem by checking the MFC version before assigning the
default format.

Signed-off-by: Kamil Debski <k.debski@samsung.com>
Acked-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years ago[media] s5p-mfc: Rename IS_MFCV7 macro
Arun Kumar K [Mon, 19 May 2014 12:33:06 +0000 (09:33 -0300)]
[media] s5p-mfc: Rename IS_MFCV7 macro

Renaming the IS_MFCV7 macro to IS_MFCV7_PLUS for the
addition of MFCv8 support which reuses the v7 code.

Signed-off-by: Arun Kumar K <arun.kk@samsung.com>
Signed-off-by: Kamil Debski <k.debski@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years ago[media] s5p-mfc: Add variants to access mfc registers
Kiran AVND [Mon, 19 May 2014 12:33:05 +0000 (09:33 -0300)]
[media] s5p-mfc: Add variants to access mfc registers

This patch is needed in preparation to add MFC V8
where the register offsets are changed w.r.t MFC V6/V7.

This patch adds variants of MFC V6 and V7 while
accessing MFC registers. Registers are kept in mfc context
and are initialized to a particular MFC variant during probe,
which is used instead of macros.

This avoids duplication of the code for MFC variants
V6 & V7, and reduces the if_else checks while accessing
registers of different MFC variants.

Signed-off-by: Kiran AVND <avnd.kiran@samsung.com>
Signed-off-by: Pawel Osciak <posciak@chromium.org>
Signed-off-by: Arun Kumar K <arun.kk@samsung.com>
Signed-off-by: Kamil Debski <k.debski@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years ago[media] s5p-mfc: Move INIT_BUFFER_OPTIONS from v7 to v6
Arun Kumar K [Mon, 19 May 2014 12:33:04 +0000 (09:33 -0300)]
[media] s5p-mfc: Move INIT_BUFFER_OPTIONS from v7 to v6

The register S5P_FIMV_D_INIT_BUFFER_OPTIONS holds good for v6
firmware too. So moving the definition from v7 regs to v6.

Signed-off-by: Arun Kumar K <arun.kk@samsung.com>
Signed-off-by: Kamil Debski <k.debski@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years ago[media] s5p-mfc: Update scratch buffer size for MPEG4
Arun Kumar K [Mon, 19 May 2014 12:33:03 +0000 (09:33 -0300)]
[media] s5p-mfc: Update scratch buffer size for MPEG4

Update the MPEG4 decoder scratch buffer size as per the
new v6 firmware. This updation is increasing the size and so
is backward compatible with older v6 firmwares.

Signed-off-by: Arun Kumar K <arun.kk@samsung.com>
Signed-off-by: Kamil Debski <k.debski@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years ago[media] s5p-mfc: Don't try to resubmit VP8 bitstream buffer for decode
Pawel Osciak [Mon, 19 May 2014 12:33:02 +0000 (09:33 -0300)]
[media] s5p-mfc: Don't try to resubmit VP8 bitstream buffer for decode

Currently, for formats that are not H264, MFC driver will check
the consumed stream size returned by the firmware and, based on that,
will try to decide whether the bitstream buffer contained more than
one frame. If the size of the buffer is larger than the consumed
stream, it assumes that there are more frames in the buffer and that the
buffer should be resubmitted for decode. This rarely works though and
actually introduces problems, because:

- v7 firmware will always return consumed stream size equal to whatever
the driver passed to it when running decode (which is the size of the whole
buffer), which means we will never try to resubmit, because the firmware
will always tell us that it consumed all the data we passed to it;

- v6 firmware will return the number of consumed bytes, but will not
include the padding ("stuffing") bytes that are allowed after the frame
in VP8. Since there is no way of figuring out how many of those bytes
follow the frame without getting the frame size from IVF headers (or
somewhere else, but not from the stream itself), the driver tries to guess that
padding size is not larger than 4 bytes, which is not always true;

The only way to make it work is to queue only one frame per buffer from
userspace and the check in the kernel is useless and wrong for VP8.
So adding VP8 also along with H264 to disallow re-submitting of buffer
back to hardware for decode.

Signed-off-by: Pawel Osciak <posciak@chromium.org>
Signed-off-by: Arun Kumar K <arun.kk@samsung.com>
Signed-off-by: Kamil Debski <k.debski@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years ago[media] s5p-mfc: Update scratch buffer size for VP8 encoder
Kiran AVND [Mon, 19 May 2014 12:33:01 +0000 (09:33 -0300)]
[media] s5p-mfc: Update scratch buffer size for VP8 encoder

Scratch buffer size updated for vp8 encoding as per
the latest v7 firmware. As the new macro increases the
scratch buffer size, it is backward compatible with the older
firmware too.

Signed-off-by: Kiran AVND <avnd.kiran@samsung.com>
Signed-off-by: Arun Kumar K <arun.kk@samsung.com>
Signed-off-by: Kamil Debski <k.debski@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years ago[media] s5p-mfc: Don't allocate codec buffers on STREAMON
Pawel Osciak [Mon, 19 May 2014 12:33:00 +0000 (09:33 -0300)]
[media] s5p-mfc: Don't allocate codec buffers on STREAMON

Currently, we allocate private codec buffers on STREAMON, which may fail
if we are out of memory. We don't check for failure though, which will
make us crash with the codec accessing random memory.

We shouldn't be failing STREAMON with out of memory errors though. So move
the allocation of private codec buffers to REQBUFS for OUTPUT queue. Also,
move MFC instance opening and closing to REQBUFS as well, as it's tied to
allocation and deallocation of private codec buffers.

Signed-off-by: Pawel Osciak <posciak@chromium.org>
Signed-off-by: Arun Kumar K <arun.kk@samsung.com>
Signed-off-by: Kamil Debski <k.debski@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years ago[media] s5p-mfc: Extract open/close MFC instance commands
Pawel Osciak [Mon, 19 May 2014 12:32:59 +0000 (09:32 -0300)]
[media] s5p-mfc: Extract open/close MFC instance commands

This is in preparation for a new flow to fix issues with streamon, which
should not be allocating buffer memory.

Signed-off-by: Pawel Osciak <posciak@chromium.org>
Signed-off-by: Arun Kumar K <arun.kk@samsung.com>
Signed-off-by: Kamil Debski <k.debski@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years ago[media] s5p-mfc: Fixes for decode REQBUFS
Pawel Osciak [Mon, 19 May 2014 12:32:58 +0000 (09:32 -0300)]
[media] s5p-mfc: Fixes for decode REQBUFS

- Honor return values from vb2_reqbufs on REQBUFS(0).

- Do not set the number of allocated buffers to 0 if userspace tries
  to request buffers again without freeing them.

- There is no need to verify correct instance state on reqbufs, as we will
  verify this in queue_setup().

- There is also no need to verify that vb2_reqbufs() was able to allocate enough
  buffers (pb_count) and call buf_init on that many buffers (i.e. dst_buf_count
  is at least pb_count), because this will be verified by second queue_setup()
  call as well and vb2_reqbufs() will fail otherwise.

- Only verify state is MFCINST_INIT when allocating, not when freeing.

- Refactor and simplify code.

Signed-off-by: Pawel Osciak <posciak@chromium.org>
Signed-off-by: Arun Kumar K <arun.kk@samsung.com>
Signed-off-by: Kamil Debski <k.debski@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years ago[media] s5p-mfc: Copy timestamps only when a frame is produced
Pawel Osciak [Mon, 19 May 2014 12:32:57 +0000 (09:32 -0300)]
[media] s5p-mfc: Copy timestamps only when a frame is produced

Timestamps for destination buffers are assigned by copying them from
corresponding source buffers when the decode operation results in a frame
being outputted to a destination buffer. But the decision when to do this, i.e.
whether the decode operation on current source buffer produced a destination
frame, is wrongly based on "display status". Display status reflects the status
of the destination buffer, not source.

This used to work for firmwares version <= 6, because in addition to the above,
we'd check the decoded frame type register, which was set to "skipped" if
a destination frame was not produced, exiting early from
s5p_mfc_handle_frame_new().
Firmware >=7 does not set the frame type register for frames that were not
decoded anymore though, which results in us wrongly overwriting timestamps of
previously decoded buffers (firmware reports the same destination buffer address
as previously decoded one if a frame wasn't decoded during current operation).

To do it properly, we should be basing our decision to copy the timestamp on the
status of the source buffer, i.e. "decode status". The decode status register
values are confusing, because in its case "display" means "a frame has been
outputted to a destination buffer". We should copy if "decode and display"
is returned in it. This also works on <= v6 firmware, which behaves in the same
way with regards to decode status register.

Signed-off-by: Pawel Osciak <posciak@chromium.org>
Signed-off-by: Arun Kumar K <arun.kk@samsung.com>
Signed-off-by: Kamil Debski <k.debski@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years ago[media] media: mx2-emmaprp: Add missing mutex_destroy()
Alexander Shiyan [Fri, 2 May 2014 07:18:01 +0000 (04:18 -0300)]
[media] media: mx2-emmaprp: Add missing mutex_destroy()

This patch adds the missing mutex_destroy(), when the driver is removed.

Signed-off-by: Alexander Shiyan <shc_work@mail.ru>
Signed-off-by: Kamil Debski <k.debski@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years ago[media] media: mx2-emmaprp: Cleanup internal structure
Alexander Shiyan [Fri, 2 May 2014 07:18:00 +0000 (04:18 -0300)]
[media] media: mx2-emmaprp: Cleanup internal structure

There are no need to store resource struct and IRQ in the driver
internal structure.
This patch remove these fields and improve error handling by using
proper return codes from devm_ioremap_resource() and devm_request_irq().

Signed-off-by: Alexander Shiyan <shc_work@mail.ru>
Signed-off-by: Kamil Debski <k.debski@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years ago[media] s5p-mfc: fix encoder crash after VIDIOC_STREAMOFF
John Sheu [Tue, 11 Mar 2014 22:52:02 +0000 (19:52 -0300)]
[media] s5p-mfc: fix encoder crash after VIDIOC_STREAMOFF

VIDIOC_STREAMOFF clears the encoder's destination queue -- routines run
from the interrupt handler cannot assume that the queue is non-empty.

Signed-off-by: John Sheu <sheu@google.com>
Signed-off-by: Kamil Debski <k.debski@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years ago[media] mt9p031: Fix BLC configuration restore when disabling test pattern
Laurent Pinchart [Thu, 8 May 2014 13:03:37 +0000 (10:03 -0300)]
[media] mt9p031: Fix BLC configuration restore when disabling test pattern

Auto BLC and BLC digital offset are disabled when enabling the test
pattern and must be restored when disabling it. The driver does so by
calling the set control handler on the auto BLC and BLC offset controls,
but this programs the hardware with the new value of those controls, not
the current value. Fix this by writing to the registers directly.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years ago[media] mt9p031: Really disable Black Level Calibration in test pattern mode
Laurent Pinchart [Wed, 7 May 2014 15:34:34 +0000 (12:34 -0300)]
[media] mt9p031: Really disable Black Level Calibration in test pattern mode

The digital side of the Black Level Calibration (BLC) function must be
disabled when generating a test pattern to avoid artifacts in the image.
The driver disables BLC correctly at the hardware level, but the feature
gets reenabled by v4l2_ctrl_handler_setup() the next time the device is
powered on.

Fix this by marking the BLC controls as inactive when generating a test
pattern, and ignoring control set requests on inactive controls.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years ago[media] v4l: ti-vpe: Rename csc memory resource name
Archit Taneja [Thu, 13 Mar 2014 11:44:10 +0000 (08:44 -0300)]
[media] v4l: ti-vpe: Rename csc memory resource name

Rename the memory block resource "vpe_csc" to "csc" since it also exists within
the VIP IP block. This would make the name more generic, and both VPE and VIP DT
nodes in the future can use it.

Signed-off-by: Archit Taneja <archit@ti.com>
Signed-off-by: Kamil Debski <k.debski@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years ago[media] v4l: ti-vpe: Add selection API in VPE driver
Archit Taneja [Thu, 13 Mar 2014 11:44:09 +0000 (08:44 -0300)]
[media] v4l: ti-vpe: Add selection API in VPE driver

Add selection ioctl ops. For VPE, cropping makes sense only for the input to
VPE(or V4L2_BUF_TYPE_VIDEO_OUTPUT/MPLANE buffers) and composing makes sense
only for the output of VPE(or V4L2_BUF_TYPE_VIDEO_CAPTURE/MPLANE buffers).

For the CAPTURE type, V4L2_SEL_TGT_COMPOSE results in VPE writing the output
in a rectangle within the capture buffer. For the OUTPUT type, V4L2_SEL_TGT_CROP
results in selecting a rectangle region within the source buffer.

Setting the crop/compose rectangles should successfully result in
re-configuration of registers which are affected when either source or
destination dimensions change, set_srcdst_params() is called for this purpose.

Signed-off-by: Archit Taneja <archit@ti.com>
Signed-off-by: Kamil Debski <k.debski@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years ago[media] v4l: ti-vpe: Fix some params in VPE data descriptors
Archit Taneja [Thu, 13 Mar 2014 11:44:08 +0000 (08:44 -0300)]
[media] v4l: ti-vpe: Fix some params in VPE data descriptors

Some parameters of the VPE descriptors were understood incorrectly. They are now
fixed. The fixes are explained as follows:

- When adding an inbound data descriptor to the VPDMA descriptor list, we intend
  to use c_rect as the cropped region fetched by VPDMA. Therefore, c_rect->width
  shouldn't be used to calculate the line stride, the original image width
  should be used for that. We add a 'width' argument which gives the buffer
  width in memory.

- frame_width and frame_height describe the complete width and height of the
  client to which the channel is connected. If there are multiple channels
  fetching data and providing to the same client, the above 2 arguments should
  be the width and height of the region covered by all the channels. In the case
  where there is only one channel providing pixel data to the client
  (like in VPE), frame_width and frame_height should be the cropped width and
  cropped height respectively. The calculation of these params is done in the
  vpe driver now.

- start_h and start_v is also used in the case of multiple channels to describe
  where each channel should start filling pixel data. We don't use this in VPE,
  and pass 0s to the vpdma_add_in_dtd() helper.

- Some minor changes are made to the vpdma_add_out_dtd() helper. The c_rect
  param is used for specifying the 'composition' target, and 'width'  is added
  to calculate the line stride.

Signed-off-by: Archit Taneja <archit@ti.com>
Acked-by: Kamil Debski <k.debski@samsung.com>
Signed-off-by: Kamil Debski <k.debski@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years ago[media] em28xx: make em28xx_free_v4l2 static()
Mauro Carvalho Chehab [Fri, 23 May 2014 17:29:44 +0000 (14:29 -0300)]
[media] em28xx: make em28xx_free_v4l2 static()

Changeset 95d2608b88 created this function, but declared it as
global, by mistake.

Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years ago[media] v4l: ti-vpe: Allow DMABUF buffer type support
Archit Taneja [Thu, 13 Mar 2014 11:44:06 +0000 (08:44 -0300)]
[media] v4l: ti-vpe: Allow DMABUF buffer type support

For OMAP and DRA7x, we generally allocate video and graphics buffers through
omapdrm since the corresponding omap-gem driver provides DMM-Tiler backed
contiguous buffers. omapdrm is a dma-buf exporter. These buffers are used by
other drivers in the video pipeline.

Add VB2_DMABUF flag to the io_modes of the vb2 output and capture queues. This
allows the driver to import dma shared buffers.

Reviewed-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Archit Taneja <archit@ti.com>
Signed-off-by: Kamil Debski <k.debski@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years ago[media] v4l: ti-vpe: register video device only when firmware is loaded
Archit Taneja [Thu, 13 Mar 2014 11:44:04 +0000 (08:44 -0300)]
[media] v4l: ti-vpe: register video device only when firmware is loaded

vpe fops(vpe_open in particular) should be called only when VPDMA firmware
is loaded. File operations on the video device are possible the moment it is
registered.

Currently, we register the video device for VPE at driver probe, after calling
a vpdma helper to initialize VPDMA and load firmware. This function is
non-blocking(it calls request_firmware_nowait()), and doesn't ensure that the
firmware is actually loaded when it returns.

We remove the device registration from vpe probe, and move it to a callback
provided by the vpe driver to the vpdma library, through vpdma_create().

The ready field in vpdma_data is no longer needed since we always have firmware
loaded before the device is registered.

A minor problem with this approach is that if the video_register_device
fails(which doesn't really happen), the vpe platform device would be registered.
however, there won't be any v4l2 device corresponding to it.

Signed-off-by: Archit Taneja <archit@ti.com>
Signed-off-by: Kamil Debski <k.debski@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years ago[media] saa7134: add saa7134_userptr module option to enable USERPTR
Hans Verkuil [Thu, 17 Apr 2014 09:44:31 +0000 (06:44 -0300)]
[media] saa7134: add saa7134_userptr module option to enable USERPTR

If the saa7134 module is loaded with the saa7134_userptr set to 1,
then USERPTR support is enabled. A check in buffer_prepare
verifies that the pointer is page-aligned.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years ago[media] saa7134: convert to vb2
Hans Verkuil [Thu, 17 Apr 2014 10:30:53 +0000 (07:30 -0300)]
[media] saa7134: convert to vb2

Convert the saa7134 driver to vb2.

Note that while this uses the vb2-dma-sg version, the VB2_USERPTR mode is
disabled. The DMA hardware only supports DMAing full pages, and in the
USERPTR memory model the first and last scatter-gather buffer is almost
never a full page.

In practice this means that we can't use the VB2_USERPTR mode.

This has been tested with raw video, compressed video, VBI, radio, DVB and
video overlays.

Unfortunately, a vb2 conversion is one of those things you cannot split
up in smaller patches, it's all or nothing. This patch switches the whole
driver over to vb2, using the vb2 ioctl and fop helper functions.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years ago[media] saa7134: move saa7134_pgtable to saa7134_dmaqueue
Hans Verkuil [Thu, 17 Apr 2014 09:06:06 +0000 (06:06 -0300)]
[media] saa7134: move saa7134_pgtable to saa7134_dmaqueue

All dmaqueue's use saa7134_pgtable, so move it into struct saa7134_dmaqueue.
The videobuf_queue priv_data field now points to the dmaqueue struct.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years ago[media] saa7134: rename vbi/cap to vbi_vbq/cap_vbq
Hans Verkuil [Tue, 13 May 2014 17:24:44 +0000 (14:24 -0300)]
[media] saa7134: rename vbi/cap to vbi_vbq/cap_vbq

Use 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] vb2: fix num_buffers calculation if req->count > VIDEO_MAX_FRAMES
Philipp Zabel [Fri, 9 May 2014 15:32:10 +0000 (12:32 -0300)]
[media] vb2: fix num_buffers calculation if req->count > VIDEO_MAX_FRAMES

num_buffers can't be bigger than VIDEO_MAX_FRAME. This is assured by:
  num_buffers = min_t(unsigned int, req->count, VIDEO_MAX_FRAME);

However, this value is overriden by:
  num_buffers = max_t(unsigned int, req->count, q->min_buffers_needed);

It should, instead, use the previously calculated value as an input
to max_t:
  num_buffers = max_t(unsigned int, num_buffers, q->min_buffers_needed);

Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
Reviewed-by: Hans Verkuil <hans.verkuil@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] v4l: vb2: Avoid double WARN_ON when stopping streaming
Laurent Pinchart [Sun, 20 Apr 2014 23:55:41 +0000 (20:55 -0300)]
[media] v4l: vb2: Avoid double WARN_ON when stopping streaming

The __vb2_queue_cancel function marks the queue as not streaming and
then WARNs when buffers are still owned by the driver. It proceeds to
complete all active buffers by calling vb2_buffer_done with the new
buffer state set to VB2_BUF_STATE_ERROR in that case. This triggers
another WARN_ON due to as new state not being VB2_BUF_STATE_QUEUED while
the queue is not streaming.

Check buffer ownership and complete all active buffers before marking
the queue as not streaming to avoid the double WARN_on.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Hans Verkuil <hans.verkuil@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] em28xx: move fields wq_trigger and streaming_started from struct em28xx to...
Frank Schaefer [Mon, 24 Mar 2014 19:33:25 +0000 (16:33 -0300)]
[media] em28xx: move fields wq_trigger and streaming_started from struct em28xx to struct em28xx_audio

Both wq_trigger and stream_started are used only to control the em28xx
alsa streaming. They don't belong to em28xx common struct.

Signed-off-by: Frank Schäfer <fschaefer.oss@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] em28xx: remove field tuner_addr from struct em28xx
Frank Schaefer [Mon, 24 Mar 2014 19:33:24 +0000 (16:33 -0300)]
[media] em28xx: remove field tuner_addr from struct em28xx

The tuner address is only used by the v4l submodule and at tuner setup and
can be obtained from the board data directly (if specified).

Signed-off-by: Frank Schäfer <fschaefer.oss@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] em28xx: remove field tda9887_conf from struct em28xx
Frank Schaefer [Mon, 24 Mar 2014 19:33:23 +0000 (16:33 -0300)]
[media] em28xx: remove field tda9887_conf from struct em28xx

The tda9887 chipset is part of the analog tuner. Move it out of
em28xx-cards.

Also, it is used only one time by the v4l2 sub-module at tuner setup.

With that, we can get rid of an additional data inside the em28xx
common structure.

Signed-off-by: Frank Schäfer <fschaefer.oss@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] em28xx: move tuner frequency field from struct em28xx to struct v4l2
Frank Schaefer [Mon, 24 Mar 2014 19:33:22 +0000 (16:33 -0300)]
[media] em28xx: move tuner frequency field from struct em28xx to struct v4l2

Move V4L2-specific frequency cache to struct em28xx_v4l2.

Signed-off-by: Frank Schäfer <fschaefer.oss@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] em28xx: move v4l2 user counting fields from struct em28xx to struct v4l2
Frank Schaefer [Sun, 11 May 2014 20:59:04 +0000 (17:59 -0300)]
[media] em28xx: move v4l2 user counting fields from struct em28xx to struct v4l2

Despite being at the common em28xx struct, those two fields are
actually taking into account only the usage inside em28xx v4l2
submodule. So, move them out of the common struct.

Signed-off-by: Frank Schäfer <fschaefer.oss@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] em28xx: move capture state tracking fields from struct em28xx to struct v4l2
Frank Schaefer [Mon, 24 Mar 2014 19:33:20 +0000 (16:33 -0300)]
[media] em28xx: move capture state tracking fields from struct em28xx to struct v4l2

Move some temporary capture tracking date to the em28xx_v4l2 struct,
as those info are used only by em28xx v4l2 submodule.

Signed-off-by: Frank Schäfer <fschaefer.oss@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] em28xx: move sensor parameter fields from struct em28xx to struct v4l2
Frank Schaefer [Mon, 24 Mar 2014 19:33:19 +0000 (16:33 -0300)]
[media] em28xx: move sensor parameter fields from struct em28xx to struct v4l2

Move camera sensor resolution and xtal out of em28xx common struct,
as thore are used only by the em28xx v4l2 submodule.

Signed-off-by: Frank Schäfer <fschaefer.oss@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] em28xx: move progressive/interlaced fields from struct em28xx to struct v4l2
Frank Schaefer [Mon, 24 Mar 2014 19:33:18 +0000 (16:33 -0300)]
[media] em28xx: move progressive/interlaced fields from struct em28xx to struct v4l2

The video progressive data fields belong to analog TV. Move them out
of the common em28xx struct.

Signed-off-by: Frank Schäfer <fschaefer.oss@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] em28xx: move struct em28xx_fmt *format from struct em28xx to struct v4l2
Frank Schaefer [Mon, 24 Mar 2014 19:33:17 +0000 (16:33 -0300)]
[media] em28xx: move struct em28xx_fmt *format from struct em28xx to struct v4l2

The analog format struct belongs to analog TV. Move it out of the
common em28xx struct.

Signed-off-by: Frank Schäfer <fschaefer.oss@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] em28xx: move TV norm from struct em28xx to struct v4l2
Frank Schaefer [Mon, 24 Mar 2014 19:33:16 +0000 (16:33 -0300)]
[media] em28xx: move TV norm from struct em28xx to struct v4l2

TV norm is specific to analog TV reception. move it out of the common
em28xx struct.

Signed-off-by: Frank Schäfer <fschaefer.oss@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] em28xx: move vinmode and vinctrl data from struct em28xx to struct v4l2
Frank Schaefer [Mon, 24 Mar 2014 19:33:15 +0000 (16:33 -0300)]
[media] em28xx: move vinmode and vinctrl data from struct em28xx to struct v4l2

The video input mode and control data also belong only to the
analog side. move them to struct em28xx_v4l.

Signed-off-by: Frank Schäfer <fschaefer.oss@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] em28xx: move v4l2 frame resolutions and scale data from struct em28xx to...
Frank Schaefer [Mon, 24 Mar 2014 19:33:14 +0000 (16:33 -0300)]
[media] em28xx: move v4l2 frame resolutions and scale data from struct em28xx to struct v4l2

The em28xx scaler data are used only for analog video. Move them to
struct em28xx_v4l2.

Signed-off-by: Frank Schäfer <fschaefer.oss@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] em28xx: move videobuf2 related data from struct em28xx to struct v4l2
Frank Schaefer [Mon, 24 Mar 2014 19:33:13 +0000 (16:33 -0300)]
[media] em28xx: move videobuf2 related data from struct em28xx to struct v4l2

The video and VBI-specific VB2 queue and mutexes are used only by
the v4l2 sub-driver. Move them to the V4L2 struct, preventing
wasting memory if this sub-driver is not used.

Signed-off-by: Frank Schäfer <fschaefer.oss@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] em28xx: move video_device structs from struct em28xx to struct v4l2
Frank Schaefer [Mon, 24 Mar 2014 19:33:12 +0000 (16:33 -0300)]
[media] em28xx: move video_device structs from struct em28xx to struct v4l2

There are 3 struct video_device at the em28xx common struct,
for video, VBI and radio. They all are used only by the V4L2 driver.
So, move them to the v4l2-specific struct.

Signed-off-by: Frank Schäfer <fschaefer.oss@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] em28xx: move struct v4l2_clk *clk from struct em28xx to struct v4l2
Frank Schaefer [Mon, 24 Mar 2014 19:33:11 +0000 (16:33 -0300)]
[media] em28xx: move struct v4l2_clk *clk from struct em28xx to struct v4l2

The current clock definition applies only to the V4L2 side of the
driver. Move its struct pointer to the v4l2_dev, where it belongs.

Signed-off-by: Frank Schäfer <fschaefer.oss@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] em28xx: move struct v4l2_ctrl_handler ctrl_handler from struct em28xx to...
Frank Schaefer [Mon, 24 Mar 2014 19:33:10 +0000 (16:33 -0300)]
[media] em28xx: move struct v4l2_ctrl_handler ctrl_handler from struct em28xx to struct v4l2

Controls are only applicable to V4L2 module. Move the corresponding
data structs to the proper place.

Signed-off-by: Frank Schäfer <fschaefer.oss@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] em28xx: start moving em28xx-v4l specific data to its own struct
Frank Schaefer [Mon, 24 Mar 2014 19:33:09 +0000 (16:33 -0300)]
[media] em28xx: start moving em28xx-v4l specific data to its own struct

That reduces a little bit the memory footprint when em28xx-video
is not loaded.

Signed-off-by: Frank Schäfer <fschaefer.oss@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] em28xx-video: simplify usage of the pointer to struct v4l2_ctrl_handler in...
Frank Schaefer [Mon, 24 Mar 2014 19:33:08 +0000 (16:33 -0300)]
[media] em28xx-video: simplify usage of the pointer to struct v4l2_ctrl_handler in em28xx_v4l2_init()

The local var hdl is already pointing to &dev->ctrl_handler.
Use it, instead of dereferencing it all the time.

Code cleanup. No functional changes.

Signed-off-by: Frank Schäfer <fschaefer.oss@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] em28xx: move sub-module data structs to a common place in the main struct
Frank Schaefer [Mon, 24 Mar 2014 19:33:07 +0000 (16:33 -0300)]
[media] em28xx: move sub-module data structs to a common place in the main struct

Just a cleanup. No functional changes.

Signed-off-by: Frank Schäfer <fschaefer.oss@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] em28xx: remove the i2c_set_adapdata() call in em28xx_i2c_register()
Frank Schaefer [Sun, 11 May 2014 20:29:07 +0000 (17:29 -0300)]
[media] em28xx: remove the i2c_set_adapdata() call in em28xx_i2c_register()

It is no longer needed since nobody is calling i2c_get_adapdata() anymore.

Signed-off-by: Frank Schäfer <fschaefer.oss@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] saa7134: add vidioc_querystd
Mikhail Domrachev [Tue, 1 Apr 2014 12:28:17 +0000 (09:28 -0300)]
[media] saa7134: add vidioc_querystd

Signed-off-by: Mikhail Domrachev <mihail.domrychev@comexp.ru>
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: drop spurious newline in string
Hans Verkuil [Fri, 9 May 2014 12:26:04 +0000 (09:26 -0300)]
[media] v4l2-ioctl: drop spurious newline in string

The message logged by v4l_print_cropcap should be a single line withouti
linebreaks, just like all the other v4l_print_<ioctl> functions.

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: omap24xx: use pr_info() instead of KERN_INFO
Vitaly Osipov [Thu, 10 Apr 2014 09:02:38 +0000 (06:02 -0300)]
[media] staging: media: omap24xx: use pr_info() instead of KERN_INFO

tcm825x.c:

changed printk to pr_info

Signed-off-by: Vitaly Osipov <vitaly.osipov@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: omap24xx: fix up checkpatch error message
Vitaly Osipov [Thu, 10 Apr 2014 09:01:50 +0000 (06:01 -0300)]
[media] staging: media: omap24xx: fix up checkpatch error message

tcm825x.c:

fixing ERROR: Macros with complex values should be enclosed in parenthesis

Signed-off-by: Vitaly Osipov <vitaly.osipov@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] videobuf-dma-contig: fix incorrect argument to vm_iomap_memory() call
Ma Haijun [Thu, 27 Mar 2014 11:07:06 +0000 (08:07 -0300)]
[media] videobuf-dma-contig: fix incorrect argument to vm_iomap_memory() call

The second argument should be physical address rather than virtual address.

Signed-off-by: Ma Haijun <mahaijuns@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] ivtv: Fix Oops when no firmware is loaded
Takashi Iwai [Mon, 5 May 2014 14:20:05 +0000 (11:20 -0300)]
[media] ivtv: Fix Oops when no firmware is loaded

When ivtv PCM device is accessed at the state where no firmware is
loaded, it oopses like:

  BUG: unable to handle kernel NULL pointer dereference at 0000000000000050
  IP: [<ffffffffa049a881>] try_mailbox.isra.0+0x11/0x50 [ivtv]
  Call Trace:
    [<ffffffffa049aa20>] ivtv_api_call+0x160/0x6b0 [ivtv]
    [<ffffffffa049af86>] ivtv_api+0x16/0x40 [ivtv]
    [<ffffffffa049b10c>] ivtv_vapi+0xac/0xc0 [ivtv]
    [<ffffffffa049d40d>] ivtv_start_v4l2_encode_stream+0x19d/0x630 [ivtv]
    [<ffffffffa0530653>] snd_ivtv_pcm_capture_open+0x173/0x1c0 [ivtv_alsa]
    [<ffffffffa04526f1>] snd_pcm_open_substream+0x51/0x100 [snd_pcm]
    [<ffffffffa0452853>] snd_pcm_open+0xb3/0x260 [snd_pcm]
    [<ffffffffa0452a37>] snd_pcm_capture_open+0x37/0x50 [snd_pcm]
    [<ffffffffa033f557>] snd_open+0xa7/0x1e0 [snd]
    [<ffffffff8118a628>] chrdev_open+0x88/0x1d0
    [<ffffffff811840be>] do_dentry_open+0x1de/0x270
    [<ffffffff81193a73>] do_last+0x1c3/0xec0
    [<ffffffff81194826>] path_openat+0xb6/0x670
    [<ffffffff81195b65>] do_filp_open+0x35/0x80
    [<ffffffff81185449>] do_sys_open+0x129/0x210
    [<ffffffff815b782d>] system_call_fastpath+0x1a/0x1f

This patch adds the check of firmware at PCM open callback like other
open callbacks of this driver.

Bugzilla: https://apibugzilla.novell.com/show_bug.cgi?id=875440

Cc: <stable@vger.kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years ago[media] media: coda: Use full device name for request_irq()
Alexander Shiyan [Sat, 26 Apr 2014 09:14:46 +0000 (06:14 -0300)]
[media] media: coda: Use full device name for request_irq()

This will help to debug driver, allows us to see the full name of
the device through /proc/interrupts.

           CPU0
...
 69:          0  mxc-avic  53  10023000.coda
...

Signed-off-by: Alexander Shiyan <shc_work@mail.ru>
Acked-by: Philipp Zabel <p.zabel@pengutronix.de>
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: release buffers in case start_streaming call back fails
Lad, Prabhakar [Mon, 14 Apr 2014 14:52:31 +0000 (11:52 -0300)]
[media] media: davinci: vpbe: release buffers in case start_streaming call back fails

this patch adds support to release 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] s2255drv: fix memory leak s2255_probe()
Daeseok Youn [Thu, 8 May 2014 22:57:18 +0000 (19:57 -0300)]
[media] s2255drv: fix memory leak s2255_probe()

smatch says:
 drivers/media/usb/s2255/s2255drv.c:2246 s2255_probe() warn:
possible memory leak of 'dev'

Signed-off-by: Daeseok Youn <daeseok.youn@gmail.com>
Acked-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years ago[media] timblogiw: Introduce the use of the managed version of kzalloc
Himangi Saraogi [Wed, 7 May 2014 04:44:18 +0000 (01:44 -0300)]
[media] timblogiw: Introduce the use of the managed version of kzalloc

This patch moves data allocated using kzalloc to managed data allocated
using devm_kzalloc and cleans now unnecessary kfrees in probe and remove
functions.The label err_register is removed as it is no longer required.

The following Coccinelle semantic patch was used for making the change:

@platform@
identifier p, probefn, removefn;
@@
struct platform_driver p = {
  .probe = probefn,
  .remove = removefn,
};

@prb@
identifier platform.probefn, pdev;
expression e, e1, e2;
@@
probefn(struct platform_device *pdev, ...) {
  <+...
- e = kzalloc(e1, e2)
+ e = devm_kzalloc(&pdev->dev, e1, e2)
  ...
?-kfree(e);
  ...+>
}

@rem depends on prb@
identifier platform.removefn;
expression e;
@@
removefn(...) {
  <...
- kfree(e);
  ...>
}

Signed-off-by: Himangi Saraogi <himangi774@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: parport: Fix format string mismatch in bw-qcam.c
Masanari Iida [Wed, 30 Apr 2014 15:57:50 +0000 (12:57 -0300)]
[media] media: parport: Fix format string mismatch in bw-qcam.c

Fix format string mismatch in bw-qcam.c

Signed-off-by: Masanari Iida <standby24x7@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] videobuf2-dma-sg: Fix NULL pointer dereference BUG
Ricardo Ribalda [Fri, 25 Apr 2014 16:11:29 +0000 (13:11 -0300)]
[media] videobuf2-dma-sg: Fix NULL pointer dereference BUG

vb2_get_vma() copy the content of the vma to a new structure but set
some of its pointers to NULL.

One of this pointer is used by follow_pte() called by follow_pfn()
on io memory.

This can lead to a NULL pointer derreference.

The version of vma that has not been cleared must be used.

[  406.143320] BUG: unable to handle kernel NULL pointer dereference at 0000000000000040
[  406.143427] IP: [<ffffffff8115204c>] follow_pfn+0x2c/0x70
[  406.143491] PGD 6c3f0067 PUD 6c3ef067 PMD 0
[  406.143546] Oops: 0000 [#1] SMP
[  406.143587] Modules linked in: qtec_mem qt5023_video qtec_testgen qtec_xform videobuf2_core gpio_xilinx videobuf2_vmalloc videobuf2_dma_sg qtec_cmosis videobuf2_memops qtec_pcie qtec_white fglrx(PO) qt5023 spi_xilinx spi_bitbang
[  406.143852] CPU: 0 PID: 299 Comm: tracker Tainted: P           O 3.13.0-qtec-standard #10
[  406.143927] Hardware name: QTechnology QT5022/QT5022, BIOS PM_2.1.0.309 X64 04/04/2013
[  406.144000] task: ffff880085c82d60 ti: ffff880085abe000 task.ti: ffff880085abe000
[  406.144067] RIP: 0010:[<ffffffff8115204c>]  [<ffffffff8115204c>] follow_pfn+0x2c/0x70
[  406.144145] RSP: 0018:ffff880085abf888  EFLAGS: 00010296
[  406.144195] RAX: 0000000000000000 RBX: ffff880085abf8e0 RCX: ffff880085abf888
[  406.144260] RDX: ffff880085abf890 RSI: 00007fc52e173000 RDI: ffff8800863cbe40
[  406.144325] RBP: ffff880085abf8a8 R08: 0000000000000018 R09: ffff8800863cbf00
[  406.144388] R10: ffff880086703b80 R11: 00000000000001e0 R12: 0000000000018000
[  406.144452] R13: 0000000000000000 R14: ffffea0000000000 R15: ffff88015922fea0
[  406.144517] FS:  00007fc536e7c740(0000) GS:ffff88015ec00000(0000) knlGS:0000000000000000
[  406.144591] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[  406.144644] CR2: 0000000000000040 CR3: 0000000066c9d000 CR4: 00000000000007f0
[  406.144708] Stack:
[  406.144731]  0000000000018000 00007fc52e18b000 0000000000000000 00007fc52e173000
[  406.144813]  ffff880085abf918 ffffffffa083b2fd ffff880085ab1ba8 0000000000000000
[  406.144894]  0000000000000000 0000000100000000 ffff880085abf928 ffff880159a20800
[  406.144976] Call Trace:
[  406.145011]  [<ffffffffa083b2fd>] vb2_dma_sg_get_userptr+0x14d/0x310 [videobuf2_dma_sg]
[  406.145089]  [<ffffffffa08507df>] __qbuf_userptr+0xbf/0x3e0 [videobuf2_core]
[  406.147229]  [<ffffffffa0041454>] ? mc_heap_lock_memory+0x1f4/0x490 [fglrx]
[  406.149234]  [<ffffffff813428f3>] ? cpumask_next_and+0x23/0x50
[  406.151223]  [<ffffffff810b2e38>] ? enqueue_task_fair+0x658/0xde0
[  406.153199]  [<ffffffff81061888>] ? native_smp_send_reschedule+0x48/0x60
[  406.155184]  [<ffffffff815836b9>] ? get_ctrl+0xa9/0xd0
[  406.157161]  [<ffffffff8116f4e4>] ? __kmalloc+0x1a4/0x1b0
[  406.159135]  [<ffffffffa0850b9c>] ? __vb2_queue_alloc+0x9c/0x4a0 [videobuf2_core]
[  406.161130]  [<ffffffffa0852d08>] __buf_prepare+0x1a8/0x210 [videobuf2_core]
[  406.163171]  [<ffffffffa0854c57>] __vb2_qbuf+0x27/0xcc [videobuf2_core]
[  406.165229]  [<ffffffffa0851dfd>] vb2_queue_or_prepare_buf+0x1ed/0x270 [videobuf2_core]
[  406.167325]  [<ffffffffa0854c30>] ? vb2_ioctl_querybuf+0x30/0x30 [videobuf2_core]
[  406.169419]  [<ffffffffa0851e9c>] vb2_qbuf+0x1c/0x20 [videobuf2_core]
[  406.171508]  [<ffffffffa0851ef8>] vb2_ioctl_qbuf+0x58/0x70 [videobuf2_core]
[  406.173604]  [<ffffffff8157d3a8>] v4l_qbuf+0x48/0x60
[  406.175681]  [<ffffffff8157b29c>] __video_do_ioctl+0x2bc/0x340
[  406.177779]  [<ffffffff8116f43c>] ? __kmalloc+0xfc/0x1b0
[  406.179883]  [<ffffffff8157cd0e>] ? video_usercopy+0x7e/0x470
[  406.181961]  [<ffffffff8157ce81>] video_usercopy+0x1f1/0x470
[  406.184021]  [<ffffffff8157afe0>] ? v4l_printk_ioctl+0xb0/0xb0
[  406.186085]  [<ffffffff810ae1ed>] ? account_system_time+0x8d/0x190
[  406.188149]  [<ffffffff8157d115>] video_ioctl2+0x15/0x20
[  406.190216]  [<ffffffff815781b3>] v4l2_ioctl+0x123/0x160
[  406.192251]  [<ffffffff810ce415>] ? rcu_eqs_enter+0x65/0xa0
[  406.194256]  [<ffffffff81186b28>] do_vfs_ioctl+0x88/0x560
[  406.196258]  [<ffffffff810ae145>] ? account_user_time+0x95/0xb0
[  406.198262]  [<ffffffff810ae6a4>] ? vtime_account_user+0x44/0x70
[  406.200215]  [<ffffffff81187091>] SyS_ioctl+0x91/0xb0
[  406.202107]  [<ffffffff817be109>] tracesys+0xd0/0xd5
[  406.203946] Code: 66 66 66 90 48 f7 47 50 00 44 00 00 b8 ea ff ff ff 74 52 55 48 89 e5 53 48 89 d3 48 8d 4d e0 48 8d 55 e8 48 83 ec 18 48 8b 47 40 <48> 8b 78 40 e8 8b fe ff ff 85 c0 75 27 48 8b 55 e8 48 b9 00 f0
[  406.208011] RIP  [<ffffffff8115204c>] follow_pfn+0x2c/0x70
[  406.209908]  RSP <ffff880085abf888>
[  406.211760] CR2: 0000000000000040
[  406.213676] ---[ end trace 996d9f64e6739a04 ]---

Signed-off-by: Ricardo Ribalda Delgado <ricardo.ribalda@gmail.com>
Acked-by: Marek Szyprowski <m.szyprowski@samsung.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>