Laurent Pinchart [Wed, 29 Jan 2014 13:07:13 +0000 (10:07 -0300)]
[media] v4l: Validate fields in the core code for subdev EDID ioctls
The subdev EDID ioctls receive a pad field that must reference an
existing pad and an EDID field that must point to a buffer. Validate
both fields in the core code instead of duplicating validation in all
drivers.
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Acked-by: Sakari Ailus <sakari.ailus@linux.intel.com> Reviewed-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
Laurent Pinchart [Fri, 31 Jan 2014 12:04:19 +0000 (09:04 -0300)]
[media] s5p-tv: mixer: Switch to pad-level DV operations
The video-level enum_dv_timings and dv_timings_cap operations are
deprecated in favor of the pad-level versions. All subdev drivers
implement the pad-level versions, switch to them.
Laurent Pinchart [Fri, 31 Jan 2014 12:04:19 +0000 (09:04 -0300)]
[media] media: staging: davinci: vpfe: Switch to pad-level DV operations
The video-level enum_dv_timings and dv_timings_cap operations are
deprecated in favor of the pad-level versions. All subdev drivers
implement the pad-level versions, switch to them.
Laurent Pinchart [Fri, 31 Jan 2014 12:04:19 +0000 (09:04 -0300)]
[media] media: davinci: vpif: Switch to pad-level DV operations
The video-level enum_dv_timings and dv_timings_cap operations are
deprecated in favor of the pad-level versions. All subdev drivers
implement the pad-level versions, switch to them.
Laurent Pinchart [Fri, 31 Jan 2014 12:04:19 +0000 (09:04 -0300)]
[media] media: bfin_capture: Switch to pad-level DV operations
The video-level enum_dv_timings and dv_timings_cap operations are
deprecated in favor of the pad-level versions. All subdev drivers
implement the pad-level versions, switch to them.
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Hans Verkuil <hans.verkuil@cisco.com> Acked-by: Scott Jiang <scott.jiang.linux@gmail.com> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
Laurent Pinchart [Fri, 31 Jan 2014 11:51:18 +0000 (08:51 -0300)]
[media] ths8200: Add pad-level DV timings operations
The video enum_dv_timings and dv_timings_cap operations are deprecated.
Implement the pad-level version of those operations to prepare for the
removal of the video version.
Laurent Pinchart [Fri, 31 Jan 2014 11:51:18 +0000 (08:51 -0300)]
[media] s5p-tv: hdmi: Add pad-level DV timings operations
The video enum_dv_timings and dv_timings_cap operations are deprecated.
Implement the pad-level version of those operations to prepare for the
removal of the video version.
Laurent Pinchart [Fri, 31 Jan 2014 11:51:18 +0000 (08:51 -0300)]
[media] adv7842: Add pad-level DV timings operations
The video enum_dv_timings and dv_timings_cap operations are deprecated.
Implement the pad-level version of those operations to prepare for the
removal of the video version.
Laurent Pinchart [Fri, 31 Jan 2014 11:51:18 +0000 (08:51 -0300)]
[media] adv7511: Add pad-level DV timings operations
The video enum_dv_timings and dv_timings_cap operations are deprecated.
Implement the pad-level version of those operations to prepare for the
removal of the video version.
Laurent Pinchart [Fri, 31 Jan 2014 11:51:18 +0000 (08:51 -0300)]
[media] ad9389b: Add pad-level DV timings operations
The video enum_dv_timings and dv_timings_cap operations are deprecated.
Implement the pad-level version of those operations to prepare for the
removal of the video version.
Laurent Pinchart [Wed, 29 Jan 2014 13:05:10 +0000 (10:05 -0300)]
[media] v4l: Add pad-level DV timings subdev operations
The dv_timings_cap and enum_dv_timings subdev operations are implemented
at the device level, but apply to pads. Create new variants of those
operations at the pad level. The device level variants will be removed
once all drivers are ported to the pad level DT timings operations.
Ismael Luceno [Sun, 18 May 2014 19:44:11 +0000 (16:44 -0300)]
[media] solo6x10: Reduce OSD writes to the minimum necessary
Instead of unconditionally writing SOLO_EOSD_EXT_SIZE() bytes to the OSD
area (which is 64 or 128 kB depending on the PCI board) we only
write the actual amount of data needed which is 16 * OSD_TEXT_MAX (= 16 * 44).
[media] media: stk1160: Avoid stack-allocated buffer for control URBs
Currently stk1160_read_reg() uses a stack-allocated char to get the
read control value. This is wrong because usb_control_msg() requires
a kmalloc-ed buffer.
This commit fixes such issue by kmalloc'ating a 1-byte buffer to receive
the read value.
While here, let's remove the urb_buf array which was meant for a similar
purpose, but never really used.
Cc: Alan Stern <stern@rowland.harvard.edu> Reported-by: Sander Eikelenboom <linux@eikelenboom.it> Signed-off-by: Ezequiel Garcia <ezequiel.garcia@free-electrons.com> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Cc: stable@vger.kernel.org # for v3.7 and up Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
Arun Kumar K [Wed, 14 May 2014 06:59:42 +0000 (03:59 -0300)]
[media] v4l: Add source change event
This event indicates that the video device has encountered
a source parameter change during runtime. This can typically be a
resolution change detected by a video decoder OR a format change
detected by an input connector.
This needs to be nofified to the userspace and the application may
be expected to reallocate buffers before proceeding. The application
can subscribe to events on a specific pad or input port which
it is interested in.
Signed-off-by: Arun Kumar K <arun.kk@samsung.com> Acked-by: Sylwester Nawrocki <s.nawrocki@samsung.com> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
[media] bt8xx: make driver routines fit into its own namespcae
There is a few conflicts with older symbols on older kernels so we
have to patch this driver when backporting. Instead just make these
routines specific to the driver.
Signed-off-by: Luis R. Rodriguez <mcgrof@suse.com> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
[media] technisat-usb2: rename led enums to be specific to driver
The current names clash with include/linux/leds.h namespace,
although there is no compile issue currently this does affect
backports. Drivers should also try to avoid generic namespaces
for things like this.
Cc: Felipe Pena <felipensp@gmail.com> Cc: Michael Krufky <mkrufky@linuxtv.org> Signed-off-by: Luis R. Rodriguez <mcgrof@suse.com> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
Lad, Prabhakar [Fri, 16 May 2014 13:33:46 +0000 (10:33 -0300)]
[media] media: davinci: vpif_capture: 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 appropriately on the required places.
Lad, Prabhakar [Fri, 16 May 2014 13:33:45 +0000 (10:33 -0300)]
[media] media: davinic: vpif_capture: 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.
Lad, Prabhakar [Fri, 16 May 2014 13:33:43 +0000 (10:33 -0300)]
[media] media: davinci: vpif_capture: 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.
Lad, Prabhakar [Fri, 16 May 2014 13:33:41 +0000 (10:33 -0300)]
[media] media: davinci: vpif_capture: 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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
[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.
[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>
[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>
[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>
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>
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.
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.
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.
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.
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.
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.
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.