Commit graph

104 commits

Author SHA1 Message Date
Lad, Prabhakar
fabc4e948b [media] media: davinci: vpbe: fix build warning
recent patch with commit id 4f996594ce
which makes vidioc_s_crop const, was causing a following build warning,
vpbe_display.c: In function 'vpbe_display_s_crop':
vpbe_display.c:640: warning: initialization discards qualifiers from pointer target type
This patch fixes the above build warning.

Signed-off-by: Lad, Prabhakar <prabhakar.lad@ti.com>
Signed-off-by: Manjunath Hadli <manjunath.hadli@ti.com>
Acked-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-10-05 14:28:46 -03:00
Hans Verkuil
368640827c [media] dm644x: replace the obsolete preset API by the timings API
This patch replaces the preset API by the timings API, and
appropriate changes in board file.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Lad, Prabhakar <prabhakar.lad@ti.com>
Signed-off-by: Manjunath Hadli <manjunath.hadli@ti.com>
Acked-by: Sekhar Nori <nsekhar@ti.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-10-05 14:27:18 -03:00
Lad, Prabhakar
8b6faacd75 [media] media: davinci: vpfe: fix build error
recent patch with commit id 4f996594ce
which makes vidioc_s_crop const, was causing a following build error.
vpfe_capture.c: In function 'vpfe_s_crop':
vpfe_capture.c:1695: error: assignment of read-only location '*crop'
vpfe_capture.c:1706: warning: passing argument 1 of
'ccdc_dev->hw_ops.set_image_window' discards qualifiers from pointer target type
vpfe_capture.c:1706: note: expected 'struct v4l2_rect *' but argument is of
type 'const struct v4l2_rect *'
make[4]: *** [drivers/media/platform/davinci/vpfe_capture.o] Error 1

Signed-off-by: Lad, Prabhakar <prabhakar.lad@ti.com>
Signed-off-by: Manjunath Hadli <manjunath.hadli@ti.com>
Acked-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-10-05 13:50:53 -03:00
Sylwester Nawrocki
7208507ed9 [media] s5p-tv: Report only multi-plane capabilities in vidioc_querycap
The mixer video node supports only multi-planar API so the driver
should not be setting V4L2_CAP_VIDEO_OUTPUT flags. Fix this and
also switch to device_caps. Additionally fix the VIDIOC_ENUM_FMT
ioctl handler which now works for V4L2_BUF_TYPE_CAPTURE, rather
than expected V4L2_BUF_TYPE_CAPTURE_MPLANE.

Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-10-02 14:04:19 -03:00
Sachin Kamat
81c9bcfbef [media] s5p-mfc: Fix misplaced return statement in s5p_mfc_suspend()
return statement was wrongly placed before a code that needs to be
executed. Moved the return statement to the end of the function.
Tested suspend/resume on SMDK4412 board using 3.5-rc6 kernel.

Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
Acked-by: Kamil Debski <k.debski@samsung.com>
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-10-02 14:03:47 -03:00
Sachin Kamat
d2331c9913 [media] exynos-gsc: Add missing static storage class specifiers
Fixes the following warnings:
drivers/media/platform/exynos-gsc/gsc-core.c:313:5: warning:
symbol 'get_plane_info' was not declared. Should it be static?
drivers/media/platform/exynos-gsc/gsc-core.c:746:28: warning:
symbol 'gsc_ctrl_ops' was not declared. Should it be static?
drivers/media/platform/exynos-gsc/gsc-m2m.c:102:5: warning:
symbol 'gsc_fill_addr' was not declared. Should it be static?
drivers/media/platform/exynos-gsc/gsc-m2m.c:252:16: warning:
symbol 'gsc_m2m_qops' was not declared. Should it be static?

Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-10-02 14:03:17 -03:00
Sachin Kamat
9b2e0e70ac [media] exynos-gsc: Remove <linux/version.h> header file inclusion
version.h is not needed for these files.

Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-10-02 14:02:50 -03:00
Sachin Kamat
f68247fcdc [media] s5p-fimc: Fix incorrect condition in fimc_lite_reqbufs()
Fixes a typo in a conditional evaluation.

Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-10-02 14:02:24 -03:00
Sachin Kamat
970e85f870 [media] s5p-tv: Fix potential NULL pointer dereference error
When mdev is NULL, the error print statement will try to dereference
the NULL pointer.

Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
Acked-by: Tomasz Stanislawski <t.stanislaws@samsung.com>
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-10-02 14:02:03 -03:00
Andrzej Hajda
7fb89eca0f [media] s5p-mfc: optimized code related to working contextes
All code setting/clearing working context bits has been moved
to separate functions. set_bit/clear_bit have been replaced by
non-atomic variants - variable is already guarded by spin_lock.

Signed-off-by: Andrzej Hajda <a.hajda@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-10-02 13:58:40 -03:00
Andrzej Hajda
f9f715a95d [media] s5p-mfc: added support for end of stream handling in MFC encoder
s5p-mfc encoder after receiving V4L2_ENC_CMD_STOP command
will instruct MFC device to release all encoded frames.
After dequeuing last encoded frame driver will generate
V4L2_EVENT_EOS event.

Signed-off-by: Andrzej Hajda <a.hajda@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-10-02 13:58:04 -03:00
Sylwester Nawrocki
6612a08268 [media] s5p-fimc: Keep local copy of sensors platform data
Use a copy of sensor platform data structure, rather than referencing
external platform data from the driver. This allows to fill the local
copy with values parsed from device tree when needed.

Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-10-01 20:27:52 -03:00
Sylwester Nawrocki
99c6902cdd [media] s5p-csis: Add transmission errors logging
Add hardware event/error counters which can be dumped into the kernel
log through VIDIOC_LOG_STATUS ioctl. The counters are reset  in each
s_stream(1) call. Any errors are logged after streaming is turned off.

Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-10-01 20:27:23 -03:00
Sachin Kamat
bae061b46e [media] s5p-mfc: Add missing braces around sizeof
Silences the following warnings:
WARNING: sizeof *ctx should be sizeof(*ctx)
WARNING: sizeof *dev should be sizeof(*dev)

Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-10-01 20:26:33 -03:00
Sachin Kamat
26ee7f4702 [media] s5p-fimc: Add missing braces around sizeof
Silences the following warning:
WARNING: sizeof *ctx should be sizeof(*ctx)

Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-10-01 20:26:19 -03:00
Sachin Kamat
254227817f [media] s5p-fimc: Replace asm/* headers with linux/*
Silences the following warning:
WARNING: Use #include <linux/sizes.h> instead of <asm/sizes.h>

Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-10-01 20:25:58 -03:00
Sylwester Nawrocki
b9ee31e621 [media] s5p-fimc: Add pipeline ops to separate FIMC-LITE module
In order to reuse the FIMC-LITE module on Exynos4 and Exynos5
SoC introduce a set of callbacks for the media pipeline control
from within FIMC/FIMC-LITE video node. It lets us avoid symbol
dependencies between FIMC-LITE and the whole media device driver,
which simplifies the initialization sequences and doesn't
introduce issues preventing common kernel image for exynos4 and
exynos5 SoCs.
This patch also corrects following build errors:
drivers/built-in.o: In function `buffer_queue':
drivers/media/video/s5p-fimc/fimc-lite.c:414: undefined reference
to `fimc_pipeline_s_stream'
drivers/built-in.o: In function `fimc_lite_resume':
drivers/media/video/s5p-fimc/fimc-lite.c:1518: undefined reference
to `fimc_pipeline_initialize'
drivers/built-in.o: In function `fimc_lite_suspend':
drivers/media/video/s5p-fimc/fimc-lite.c:1544: undefined reference
to `fimc_pipeline_shutdown'
when only CONFIG_VIDEO_EXYNOS_FIMC_LITE is selected, without
CONFIG_VIDEO_S5P_FIMC.

Reported-by: Sachin Kamat <sachin.kamat@linaro.org>
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-10-01 20:25:32 -03:00
Sachin Kamat
b5146c96d1 [media] s5p-jpeg: Add missing braces around sizeof
Silences the following warning:
WARNING: sizeof *ctx should be sizeof(*ctx)

Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-10-01 20:23:23 -03:00
Sylwester Nawrocki
9356ac762f [media] s5p-fimc: fimc-lite: Propagate frame format on the subdev
When setting image format on subdev's sink pad there was no
propagation to the source pad. This resulted in wrong reported
format on the source pad and wrong device configuration when
used from subdev interace level only. Correct this by propagating
format from the sink to the source pad.

Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-10-01 19:25:34 -03:00
Sylwester Nawrocki
b98192cb8e [media] s5p-fimc: fimc-lite: Correct Bayer pixel format definitions
Replace erroneous V4L2_PIX_FMT_* entries with their V4L2_MBUS_FMT_*
counterparts. This enables use of raw Bayer formats on FIMC-LITE.?
subdevs.

Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-10-01 19:20:36 -03:00
Hans Verkuil
34a6b7d093 [media] v4l2-ctrls: add a filter function to v4l2_ctrl_add_handler
With a filter function you can control more precisely which controls
are added. This is useful in particular for radio device nodes for
combined TV/Radio cards where you want to show just the radio-specific
controls and not controls like brightness.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-10-01 17:07:07 -03:00
Kamil Debski
3f14513d0a [media] s5p-mfc: Fix second memory bank alignment
Signed-off-by: Kamil Debski <k.debski@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-10-01 14:56:36 -03:00
Sylwester Nawrocki
5d33ee92ac [media] s5p-fimc: Fix setup of initial links to FIMC entities
This patch fixes regression introduced in commit
4af813108b. Missing pointers
to the sensor subdevs are restored along with subdev callback
notifications to a corresponding FIMC instance driver.

Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Andrzej Hajda <a.hajda@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-10-01 14:56:33 -03:00
Sylwester Nawrocki
bbc5296f20 [media] s5p-fimc: Don't allocate fimc-m2m video device dynamically
There is no need to to dynamically allocate struct video_device
for the M2M devices, so embed it instead in driver's private
data structure as it is done in case of fimc-capture and fimc-lite,
where it solves some bugs on cleanup paths.

Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-10-01 14:56:12 -03:00
Sylwester Nawrocki
31d34d9bb3 [media] s5p-fimc: Don't allocate fimc-capture video device dynamically
This fixes potential invalid pointer de-reference, when
media_entity_cleanup() is called before video device
is unregistered.

Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-10-01 14:56:08 -03:00
Sylwester Nawrocki
1bcd704194 [media] s5p-fimc: Don't allocate fimc-lite video device structure dynamically
This fixes potential invalid pointer de-reference, when
media_entity_cleanup() is called after video_unregister_device,
and video device structure memory is already freed.

Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-10-01 14:55:46 -03:00
Sylwester Nawrocki
8cf5e2a976 [media] s5p-fimc: Enable FIMC-LITE driver only for SOC_EXYNOS4x12
Allow to compile-in the FIMC-LITE driver only on Exynos4212,
Exynos4412 and Exynos5250 SoC where the device is available.

Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-10-01 14:55:06 -03:00
Shawn Guo
8928b6d156 [media] media: mx2_camera: use managed functions to clean up code
Use managed functions to clean up the error handling code and function
mx2_camera_remove().  Along with the change, a few variables get removed
from struct mx2_camera_dev.

Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
Acked-by: Sascha Hauer <s.hauer@pengutronix.de>
Acked-by: Arnd Bergmann <arnd@arndb.de>
Acked-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Tested-by: Javier Martin <javier.martin@vista-silicon.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-09-27 15:56:47 -03:00
Shawn Guo
4df6e868d4 [media] media: mx2_camera: remove dead code in mx2_camera_add_device
This is a piece of code becoming dead since commit 2c9ba37 ([media]
V4L: mx2_camera: remove unsupported i.MX27 DMA mode, make EMMA
mandatory).  It should have been removed together with the commit.
Remove it now.

Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
Acked-by: Sascha Hauer <s.hauer@pengutronix.de>
Acked-by: Arnd Bergmann <arnd@arndb.de>
Acked-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Acked-by: Javier Martin <javier.martin@vista-silicon.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-09-27 15:56:01 -03:00
Peter Senna Tschudin
0bd0dbee3f [media] omap3isp: Fix error return code in probe function
Convert a nonnegative error return code to a negative one, as returned
elsewhere in the function.
A simplified version of the semantic match that finds this problem is as
follows: (http://coccinelle.lip6.fr/)
// <smpl>
(
if@p1 (\(ret < 0\|ret != 0\))
 { ... return ret; }
|
ret@p1 = 0
)
... when != ret = e1
    when != &ret
*if(...)
{
  ... when != ret = e2
      when forall
 return ret;
}
// </smpl>

Signed-off-by: Peter Senna Tschudin <peter.senna@gmail.com>
[laurent.pinchart@ideasonboard.com Replaced EBUSY with ENODEV]
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-09-27 14:18:54 -03:00
Wanlong Gao
a694f1b2af [media] omap3isp: Fix up ENOIOCTLCMD error handling
At commit 07d106d0, Linus pointed out that ENOIOCTLCMD should be
translated as ENOTTY to user mode.

Signed-off-by: Wanlong Gao <gaowanlong@cn.fujitsu.com>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-09-27 13:47:55 -03:00
Ezequiel Garcia
4195ec7a8f [media] vivi: Add return code check at vb2_queue_init()
This function returns an integer and it's mandatory
to check the return code.

Signed-off-by: Ezequiel Garcia <elezegarcia@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-09-27 04:47:48 -03:00
Guennadi Liakhovetski
b6ba418ef4 [media] media: sh-vou: fix compilation breakage
A recent commit
commit f135a8a224
Author: Hans Verkuil <hans.verkuil@cisco.com>
    [media] sh_vou: remove V4L2_FL_LOCK_ALL_FOPS
broke compilation of sh_vou.c:
drivers/media/platform/sh_vou.c: In function 'sh_vou_mmap':
drivers/media/platform/sh_vou.c:1227: error: 'vdev' undeclared (first use in this function)
drivers/media/platform/sh_vou.c:1227: error: (Each undeclared identifier is reported only once
drivers/media/platform/sh_vou.c:1227: error: for each function it appears in.)
drivers/media/platform/sh_vou.c: In function 'sh_vou_poll':
drivers/media/platform/sh_vou.c:1242: error: 'vdev' undeclared (first use in this function)
make[2]: *** [drivers/media/platform/sh_vou.o] Error 1
Add missing variable definitions.

Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Acked-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-09-27 04:24:42 -03:00
Sylwester Nawrocki
4703d356e7 [media] m2m-deinterlace: Add V4L2_CAP_VIDEO_M2M capability flag
New mem-to-mem video drivers should use V4L2_CAP_VIDEO_M2M capability, rather
than ORed V4L2_CAP_VIDEO_CAPTURE and V4L2_CAP_VIDEO_OUTPUT flags, as outlined
in commit a1367f1b26.

Acked-by: Javier Martin <javier.martin@vista-silicon.com>
Signed-off-by: Sylwester Nawrocki <sylvester.nawrocki@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-09-26 17:24:31 -03:00
Lad, Prabhakar
9e18404ada [media] davinci: vpif: capture/display: fix race condition
channel_first_int[][] variable is used as a flag for the ISR,
This flag was being set after enabling the interrupts, There
where situations when the isr occurred even before the flag was set
dues to which it was causing the application hang.
This patch sets  channel_first_int[][] flag just before enabling the
interrupt.

Reported-by: David Oleszkiewicz <doleszki@adsyscontrols.com>
Signed-off-by: Lad, Prabhakar <prabhakar.lad@ti.com>
Signed-off-by: Manjunath Hadli <manjunath.hadli@ti.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-09-26 17:22:02 -03:00
Hans Verkuil
080fb42b2b [media] davinci: vpif: remove unwanted header file inclusion
Remove old videobuf-core.h includes.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Lad, Prabhakar <prabhakar.lad@ti.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-09-26 17:21:23 -03:00
Hans Verkuil
0598c17b78 [media] vpif: replace preset with the timings API
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Lad, Prabhakar <prabhakar.lad@ti.com>
Signed-off-by: Manjunath Hadli <manjunath.hadli@ti.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-09-26 17:00:02 -03:00
Philipp Zabel
e34db0661d [media] media: coda: set up buffers to be sized as negotiated with s_fmt
This fixes a failure in vb2_qbuf in user pointer mode where
__qbuf_userptr checks if the buffer queued by userspace is large
enough. The failure would happen if coda_queue_setup was called
with empty fmt (and thus set the expected buffer size to the maximum
resolution), and userspace queues buffers of smaller size -
corresponding to the negotiated dimensions - were queued.
Explicitly setting sizeimage to the value negotiated via s_fmt
fixes the issue.

Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
Acked-by: Javier Martin <javier.martin@vista-silicon.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-09-26 16:56:56 -03:00
Philipp Zabel
c566c78900 [media] media: coda: add byte size slice limit control
Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
Tested-by: Javier Martin <javier.martin@vista-silicon.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-09-26 16:56:07 -03:00
Philipp Zabel
8f35c7bc26 [media] media: coda: add horizontal / vertical flipping support
The hardware can also rotate in 90° steps, but there is no
corresponding V4L2_CID defined yet.

Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
Tested-by: Javier Martin <javier.martin@vista-silicon.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-09-26 16:55:22 -03:00
Philipp Zabel
451d43ad44 [media] media: coda: fix sizeimage setting in try_fmt
VIDIOC_TRY_FMT would incorrectly return bytesperline * height,
instead of width * height * 3 / 2.

Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
Tested-by: Javier Martin <javier.martin@vista-silicon.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-09-26 16:54:44 -03:00
Philipp Zabel
62bed14c4f [media] media: coda: wait for picture run completion in start/stop_streaming
While the CODA is running a PIC_RUN command, its registers are
not to be touched.

Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
Tested-by: Javier Martin <javier.martin@vista-silicon.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-09-26 16:54:13 -03:00
Philipp Zabel
09ae956f93 [media] media: coda: enable user pointer support
USERPTR buffer support is provided by the videobuf2 framework.

Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
Acked-by: Javier Martin <javier.martin@vista-silicon.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-09-26 16:53:22 -03:00
Philipp Zabel
2fb57f0631 [media] media: coda: stop all queues in case of lockup
Add a 1 second timeout for each PIC_RUN command to the CODA. In
case it locks up, stop all queues and dequeue remaining buffers.

Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
Tested-by: Javier Martin <javier.martin@vista-silicon.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-09-26 16:51:19 -03:00
Philipp Zabel
e11f3e6ef6 [media] media: coda: keep track of active instances
Determining the next free instance just by incrementing and decrementing
an instance counter does not work: if there are two instances opened,
0 and 1, and instance 0 is released, the next call to coda_open will
create a new instance with index 1, but instance 1 is already in use.
Instead, scan a bitfield of active instances to determine the first
free instance index.

Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
Tested-by: Javier Martin <javier.martin@vista-silicon.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-09-26 16:36:57 -03:00
Philipp Zabel
bcedb4c242 [media] media: coda: ignore coda busy status in coda_job_ready
job_ready is supposed to signal whether a context is ready to be
added to the job queue, not whether the CODA is ready to run it
immediately.
Calling v4l2_m2m_job_finish at the end of coda_irq_handler already
guarantees that the coda is ready when v4l2-mem2mem eventually tries
to run the next queued job.

Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
Tested-by: Javier Martin <javier.martin@vista-silicon.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-09-26 16:35:54 -03:00
Philipp Zabel
ec25f68d53 [media] media: coda: allocate internal framebuffers separately from v4l2 buffers
Some codecs running on CODA need internal framebuffers for reference and
reconstructed frames. Allocate them separately, and do not use the input
vb2_buffers: those will be handed off to userspace regularly, and there
is no way to signal to the CODA which of the registered framebuffers are
off limits. As a consequence, userspace is now free to choose the number
of v4l2 buffers.
This patch also includes the code to set up the parameter buffer for
CODA7 and above with 64-bit AXI bus width.

Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
Reviewed-by: Javier Martin <javier.martin@vista-silicon.com>
Tested-by: Javier Martin <javier.martin@vista-silicon.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-09-26 16:34:48 -03:00
Philipp Zabel
1043667b17 [media] media: coda: fix IRAM/AXI handling for i.MX53
This uses the ARCH_MXC specific iram_alloc API to allocate a work
buffer in the SoC's on-chip SRAM and sets up the AXI_SRAM_USE
register. In the future, the allocation will be converted to use
the genalloc API.

Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
Tested-by: Javier Martin <javier.martin@vista-silicon.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-09-26 16:29:37 -03:00
Philipp Zabel
df1e74cc04 [media] media: coda: add i.MX53 / CODA7541 platform support
Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
Tested-by: Javier Martin <javier.martin@vista-silicon.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-09-26 16:27:16 -03:00
Philipp Zabel
87048bb465 [media] media: coda: firmware loading for 64-bit AXI bus width
Add support for loading a raw firmware with 16-bit chars ordered in
little-endian 64-bit words, corresponding to the memory access pattern
of CODA7 and above: When writing the boot code into the code download
register, the chars have to be reordered back.

Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
Tested-by: Javier Martin <javier.martin@vista-silicon.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-09-26 16:24:53 -03:00