Commit Graph

64 Commits (451d43ad44b00bd6d518254086378464ffef96ef)

Author SHA1 Message Date
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
Sylwester Nawrocki c3aac8be4f [media] coda: 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.

Signed-off-by: Sylwester Nawrocki <sylvester.nawrocki@gmail.com>
Acked-by: Javier Martin <javier.martin@vista-silicon.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-09-26 16:21:55 -03:00
Hans Verkuil 954f340fc7 [media] Set vfl_dir for all display or m2m drivers
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Acked-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Acked-by: Sakari Ailus <sakari.ailus@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-09-26 11:57:06 -03:00
Hans Verkuil 4f996594ce [media] v4l2: make vidioc_s_crop const
Write-only ioctls should have a const argument in the ioctl op.
Do this conversion for vidioc_s_crop.
Adding const for write-only ioctls was decided during the 2012 Media Workshop.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-09-26 11:02:25 -03:00
Hans Verkuil 85f5fe3962 [media] v4l2: make vidioc_(un)subscribe_event const
Write-only ioctls should have a const argument in the ioctl op.
Do this conversion for vidioc_(un)subscribe_event.
Adding const for write-only ioctls was decided during the 2012 Media Workshop.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-09-26 10:48:52 -03:00
Hans Verkuil e6eb28c220 [media] v4l2: make vidioc_s_fbuf const
Write-only ioctls should have a const argument in the ioctl op.
Do this conversion for vidioc_s_fbuf.
Adding const for write-only ioctls was decided during the 2012 Media Workshop.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-09-26 10:42:36 -03:00
Hans Verkuil 72c2af6ec1 [media] vivi/mem2mem_testdev: update to latest bus_info specification
Prefix bus_info with "platform:".

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Acked-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Acked-by: Sakari Ailus <sakari.ailus@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-09-26 09:32:41 -03:00
Peter Senna Tschudin 150a136368 [media] drivers/media/platform/blackfin/bfin_capture.c: fix error return code
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>
Cc: Scott Jiang <scott.jiang.linux@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-09-23 16:52:10 -03:00
Peter Senna Tschudin 9a888ba273 [media] drivers/media/platform/davinci/vpfe_capture.c: fix error return code
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>
Cc: Prabhakar Lad <prabhakar.lad@ti.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-09-23 13:46:08 -03:00
Mauro Carvalho Chehab 2e59d4d143 Revert "[media] gscaler: mark it as BROKEN"
This reverts commit aa740e0a6f.

Now that the Makefile got added, we can remove this one.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-09-15 15:09:57 -03:00
Sylwester Nawrocki ebf6b78ebb [media] exynos-gsc: Add missing Makefile
Add missing Makefile that got lost while rebasing commit 655ceff16b
"[media] gscaler: Add Makefile for G-Scaler Driver" onto latest source tree.

Signed-off-by: Sylwester Nawrocki <sylvester.nawrocki@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-09-15 15:09:34 -03:00
Julia Lawall 9f9831a8b6 [media] drivers/media/platform/mx2_emmaprp.c: adjust inconsistent IS_ERR and PTR_ERR
Change the call to IS_ERR to test the value that was just initialized and
is returned using PTR_ERR.

The semantic match that finds this problem is as follows:
(http://coccinelle.lip6.fr/)

// <smpl>
@@
expression e,e1;
@@

(
if (IS_ERR(e)) { ... PTR_ERR(e) ... }
|
if (IS_ERR(e=e1)) { ... PTR_ERR(e) ... }
|
*if (IS_ERR(e))
 { ...
*  PTR_ERR(e1)
   ... }
)
// </smpl>

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
Cc: Javier Martin <javier.martin@vista-silicon.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-09-15 13:09:21 -03:00
Mauro Carvalho Chehab aa740e0a6f [media] gscaler: mark it as BROKEN
-EMISSINGMAKEFILE

Without a Makefile, the driver will not compile, causing
breakages for arm exynos5 sub-architecture.

Cc: Shaik Ameer Basha <shaik.ameer@samsung.com>
Cc: Sungchun Kang <sungchun.kang@samsung.com>
Cc: "Seung-Woo Kim/Mobile S/W Platform Lab(DMC)/E4"  <sw0312.kim@samsung.com>
Cc: Kyungmin Park <kyungmin.park@samsung.com>
Cc: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-09-15 12:36:35 -03:00
Sachin Kamat 3287283121 [media] mem2mem_testdev: Make m2mtest_dev_release function static
Fixes the following warning:
drivers/media/platform/mem2mem_testdev.c:73:6: warning:
symbol 'm2mtest_dev_release' was not declared. Should it be static?

Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-09-15 11:59:53 -03:00
Ezequiel García ef925e5211 [media] s5p-g2d: Remove unneeded struct vb2_queue clear on queue_init()
queue_init() is always called by v4l2_m2m_ctx_init(), which allocates
a context struct v4l2_m2m_ctx with kzalloc.
Therefore, there is no need to clear vb2_queue src/dst structs.

Cc: Kamil Debski <k.debski@samsung.com>
Signed-off-by: Ezequiel Garcia <elezegarcia@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-09-15 11:48:40 -03:00
Ezequiel García dc6341c4a4 [media] s5p-jpeg: Remove unneeded struct vb2_queue clear on queue_init()
queue_init() is always called by v4l2_m2m_ctx_init(), which allocates
a context struct v4l2_m2m_ctx with kzalloc.
Therefore, there is no need to clear vb2_queue src/dst structs.

Cc: Andrzej Pietrasiewicz <andrzej.p@samsung.com>
Signed-off-by: Ezequiel Garcia <elezegarcia@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-09-15 11:48:23 -03:00
Ezequiel García 73dad42e68 [media] s5p-fimc: Remove unneeded struct vb2_queue clear on queue_init()
queue_init() is always called by v4l2_m2m_ctx_init(), which allocates
a context struct v4l2_m2m_ctx with kzalloc.
Therefore, there is no need to clear vb2_queue src/dst structs.

Cc: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Ezequiel Garcia <elezegarcia@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-09-15 11:47:56 -03:00
Ezequiel García 8c6f59f979 [media] mem2mem-emmaprp: Remove unneeded struct vb2_queue clear on queue_init()
queue_init() is always called by v4l2_m2m_ctx_init(), which allocates
a context struct v4l2_m2m_ctx with kzalloc.
Therefore, there is no need to clear vb2_queue src/dst structs.

Signed-off-by: Ezequiel Garcia <elezegarcia@gmail.com>
Acked-by: Javier Martin <javier.martin@vista-silicon.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-09-15 11:47:24 -03:00
Ezequiel García 55d594211a [media] mem2mem-deinterlace: Remove unneeded struct vb2_queue clear on queue_init()
queue_init() is always called by v4l2_m2m_ctx_init(), which allocates
a context struct v4l2_m2m_ctx with kzalloc.
Therefore, there is no need to clear vb2_queue src/dst structs.

Cc: Javier Martin <javier.martin@vista-silicon.com>
Signed-off-by: Ezequiel Garcia <elezegarcia@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-09-15 11:47:11 -03:00
Ezequiel García 4fb857424f [media] coda: Remove unneeded struct vb2_queue clear on queue_init()
queue_init() is always called by v4l2_m2m_ctx_init(), which allocates
a context struct v4l2_m2m_ctx with kzalloc.
Therefore, there is no need to clear vb2_queue src/dst structs.

Signed-off-by: Ezequiel Garcia <elezegarcia@gmail.com>
Acked-by: Javier Martin <javier.martin@vista-silicon.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-09-15 11:46:26 -03:00
Ezequiel García 23f53e37aa [media] mem2mem_testdev: Remove unneeded struct vb2_queue clear on queue_init()
queue_init() is always called by v4l2_m2m_ctx_init(), which allocates
a context struct v4l2_m2m_ctx with kzalloc.
Therefore, there is no need to clear vb2_queue src/dst structs.

Signed-off-by: Ezequiel Garcia <elezegarcia@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-09-15 11:46:09 -03:00
Ezequiel García e923477427 [media] vivi: Remove unneeded struct vb2_queue clearing
struct vb2_queue is allocated through kzalloc as part of a larger struct,
there's no need to clear it.

Signed-off-by: Ezequiel Garcia <elezegarcia@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-09-15 11:41:44 -03:00
Shaik Ameer Basha 655ceff16b [media] gscaler: Add Makefile for G-Scaler Driver
This patch adds the Makefile for G-Scaler driver.

Signed-off-by: Shaik Ameer Basha <shaik.ameer@samsung.com>
Reviewed-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-09-15 11:09:08 -03:00
Sungchun Kang 5d71833804 [media] gscaler: Add m2m functionality for the G-Scaler driver
This patch adds the memory to memory (m2m) interface functionality
for the G-Scaler driver.

[mchehab@redhat.com: Fixed a small coding style issue:
 sizeof *ctx should be sizeof(*ctx)]
Signed-off-by: Hynwoong Kim <khw0178.kim@samsung.com>
Signed-off-by: Sungchun Kang <sungchun.kang@samsung.com>
Signed-off-by: Shaik Ameer Basha <shaik.ameer@samsung.com>
Reviewed-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-09-15 11:08:51 -03:00
Sungchun Kang 8906969976 [media] gscaler: Add core functionality for the G-Scaler driver
This patch adds the core functionality for the G-Scaler driver.

Signed-off-by: Hynwoong Kim <khw0178.kim@samsung.com>
Signed-off-by: Sungchun Kang <sungchun.kang@samsung.com>
Signed-off-by: Shaik Ameer Basha <shaik.ameer@samsung.com>
Reviewed-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-09-15 11:06:00 -03:00
Sungchun Kang 199854a3a8 [media] gscaler: Add new driver for generic scaler
This patch adds support for G-Scaler (Generic Scaler) device which is a
new device for scaling and color space conversion on EXYNOS5 SoCs. This
patch adds the code for register definitions and register operations.

This device supports the followings as key feature.
 1) Input image format
   - RGB888/565, YUV422 1P/2P, YUV420 2P/3P, TILE
 2) Output image format
   - RGB888/565, YUV422 1P/2P, YUV420 2P/3P, YUV444
 3) Input rotation
   - 0/90/180/270 degree, X/Y Flip
 4) Scale ratio
   - 1/16 scale down to 8 scale up
 5) CSC
   - RGB to YUV / YUV to RGB
 6) Size
   - 2048 x 2048 for tile or rotation
   - 4800 x 3344 other case

Signed-off-by: Hynwoong Kim <khw0178.kim@samsung.com>
Signed-off-by: Sungchun Kang <sungchun.kang@samsung.com>
Signed-off-by: Shaik Ameer Basha <shaik.ameer@samsung.com>
Reviewed-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-09-15 11:03:09 -03:00
Richard Zhao 8d6214724b [media] media: coda: remove duplicated call of fh_to_ctx in vidioc_s_fmt_vid_out
Signed-off-by: Richard Zhao <richard.zhao@freescale.com>
Acked-by: Javier Martin <javier.martin@vista-silicon.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-09-15 09:16:33 -03:00
Mauro Carvalho Chehab 79e8c7bebb Linux 3.6-rc3
-----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1.4.12 (GNU/Linux)
 
 iQEcBAABAgAGBQJQNUEyAAoJEHm+PkMAQRiGs+sH/iLtdAVcfBfUwdmGV0qDXbVE
 L3gCg3IERPCSaQo8qsT3zujdLAQ2HsiMs73jbqJaBWSV16ZMqkglRKbn+QMGpqJV
 bi/pf5Akrm9IL/u+427ycB8QxzyjGal8uJ6btuwXa03VROSfOsEiQbtsByFNaDv/
 8oq0/DaE8mWRedlcAaeN+l8nD4Enb2jSKp0UADkBMnUr4KCbwSVQ+ITXAggqVq23
 htA3Yt0oGf1JYq+k99D5k92h0I/4VwiorUgwPKhmS5DM9gVtJ4L+SigbekS/MFq+
 huyzOHRWlO++OxBlgSTMuJAE1k/G2B7tGeoERY0tEL/hAWcKYTfGIXSc7X6JvM0=
 =Dmsv
 -----END PGP SIGNATURE-----

Merge tag 'v3.6-rc3' into staging/for_v3.7

Linux 3.6-rc3

* tag 'v3.6-rc3': (764 commits)
  Linux 3.6-rc3
  task_work: add a scheduling point in task_work_run()
  fs: fix fs/namei.c kernel-doc warnings
  eventpoll: use-after-possible-free in epoll_create1()
  vfio: grab vfio_device reference *before* exposing the sucker via fd_install()
  vfio: get rid of vfio_device_put()/vfio_group_get_device* races
  vfio: get rid of open-coding kref_put_mutex
  introduce kref_put_mutex()
  vfio: don't dereference after kfree...
  fbcon: fix race condition between console lock and cursor timer (v1.1)
  mm: compaction: Abort async compaction if locks are contended or taking too long
  mm: have order > 0 compaction start near a pageblock with free pages
  rapidio/tsi721: fix unused variable compiler warning
  rapidio/tsi721: fix inbound doorbell interrupt handling
  drivers/rtc/rtc-rs5c348.c: fix hour decoding in 12-hour mode
  mm: correct page->pfmemalloc to fix deactivate_slab regression
  drivers/rtc/rtc-pcf2123.c: initialize dynamic sysfs attributes
  mm/compaction.c: fix deferring compaction mistake
  drivers/misc/sgi-xp/xpc_uv.c: SGI XPC fails to load when cpu 0 is out of IRQ resources
  string: do not export memweight() to userspace
  ...
2012-08-24 11:25:10 -03:00
Mauro Carvalho Chehab a47b6118e1 Makefile: Add missing soc_camera/ directory
drivers/built-in.o: In function `imx074_s_power':
imx074.c:(.text+0x1de93d0): undefined reference to `soc_camera_power_on'
imx074.c:(.text+0x1de93f3): undefined reference to `soc_camera_power_off'
drivers/built-in.o: In function `mt9m001_s_mbus_config':

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-08-21 19:49:50 -03:00
Hans Verkuil 090836dd81 [media] Fix vino compilation
A trivial fix so that vino can find the saa7191.h header.

[mchehab@redhat.com: Fix merge conflict]
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-08-21 08:33:39 -03:00
Mauro Carvalho Chehab fccea74ff8 [media] Kconfig: merge all customise options into just one
Instead of having 3 options to allow customizing the media
sub-drivers (tuners, I2C drivers, frontends), merge all of
them into just one.

That simplifies the life for users, as they can just keep
this untouched.

Life for developers is also simpler, as there's now just
one Kconfig item to remember, for the ancillary sub-drivers
providing supports for chips that could change from one
board design to another.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-08-21 08:05:06 -03:00
Mauro Carvalho Chehab b6334460f2 [media] Cleanup media Kconfig files
- get rid of ridden V4L2_COMMON symbol

  This symbol is not needed anymore; it can be folded with V4L2
  one, simplifying the Kconfig a little bit;

- Comment why some Kconfig items are needed;

- Remove if test for MEDIA_CAMERA_SUPPORT, replacing it by
  depends on.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-08-21 07:55:47 -03:00
Mauro Carvalho Chehab 7a46e188bf [media] Put the test devices together
Vivi is not that important to appear at the main menu, so move it
to its own submenu. Also, the mem2mem test device driver is
similar to vivi. So, put both at the same menu.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-08-21 07:51:49 -03:00
Mauro Carvalho Chehab b47ff4a3ed [media] move soc_camera to its own directory
That helps to better organize the soc_camera items.

While here, cleanup Makefiles, removing uneeded include dirs.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-08-21 07:49:12 -03:00
Mauro Carvalho Chehab 7ba2f84159 sh_mobile_csi2: move it to the right place
make[4]: *** No rule to make target `drivers/media/platform/sh_mobile_csi2.c',
	needed by `drivers/media/platform/sh_mobile_csi2.o'.  Stop.

Reported-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-08-21 07:39:30 -03:00
Mauro Carvalho Chehab 88f8472c9f [media] Fix some Makefile rules
On a few places, := were using instead of +=, causing drivers to
not compile.

While here, standardize the usage of += on all cases where multiple
lines are needed, and for obj-y/obj-m targets, and := when just one
line is needed, on <module>-obj rules.

Reported-by: Hans Verkuil <hverkuil@xs4all.nl>
Identified-by: Antti Polosaari <crope@iki.fi>
Tested-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-08-16 19:55:03 -03:00
Albert Wang a70a6c4330 [media] media: soc_camera: don't clear pix->sizeimage in JPEG mode
In JPEG mode, the size of image is variable due to different JPEG compression
rate. We only can get the pix->sizeimage from the user.

If we clear pix->sizeimage in soc_camera_try_fmt() then we will get it from:
	ret = soc_mbus_image_size(xlate->host_fmt, pix->bytesperline,
				pix->height);
	if (ret < 0)
		return ret;

	pix->sizeimage = max_t(u32, pix->sizeimage, ret);

In general, this sizeimage will be larger than the actul JPEG image size.

But vb2 will check the buffer and size of image in __qbuf_userptr():
	/* Check if the provided plane buffer is large enough */
	if (planes[plane].length < q->plane_sizes[plane])

So we shouldn't clear the pix->sizeimage and also shouldn't re-calculate
the pix->sizeimage in soc_mbus_image_size() in JPEG mode

We also shouldn't re-calculate pix->bytesperline:
	ret = soc_mbus_bytes_per_line(pix->width, xlate->host_fmt);
	if (ret < 0)
		return ret;

	pix->bytesperline = max_t(u32, pix->bytesperline, ret);

pix->bytesperline also should be set by the user or by the driver's
try_fmt() implementation.

Change-Id: I700690a2287346127a624b5260922eaa5427a596

Signed-off-by: Albert Wang <twang13@marvell.com>
Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-08-15 20:05:40 -03:00
Liu Ying c4ede4ceda [media] media: mx3_camera: Improve data bus width check code for probe
This patch contains code change only to use the present macro-
MX3_CAMERA_DATAWIDTH_MASK to check valid camera platform data
bus width instead of enumerating every possible data bus width.

Signed-off-by: Liu Ying <Ying.Liu@freescale.com>
Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-08-15 20:05:25 -03:00
Javier Martin eb68faaf66 [media] media: mx2_camera: Fix clock handling for i.MX27
On i.MX27 two clocks are required: emma-ipg and emma-ahb. The ahb clock
has to be requested using both a device and a connection ID.

Signed-off-by: Javier Martin <javier.martin@vista-silicon.com>
[g.liakhovetski@gmx.de: rebase to the current media tree]
Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-08-15 20:00:02 -03:00
Alex Gershgorin c72f429f66 [media] media: mx3_camera: buf_init() add buffer state check
This patch checks the state of the buffer when calling .buf_init() method.
This is needed for the USERPTR buffer type, because in that case
.buf_init() is called every time a buffer is queued, and not only once
during the preparation stage, like in the MMAP case. Without this check
buffers get initialised repeatedly, which also leads to the allocation
of new DMA descriptors, of which there is only a final relatively small
number available. Both MMAP and USERPTR methods were successfully tested.

Signed-off-by: Alex Gershgorin <alexg@meprolight.com>
[g.liakhovetski@gmx.de: remove mx3_camera_buffer::state completely]
Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-08-15 19:59:03 -03:00
Emil Goode c06d8752e7 [media] media: coda: add const qualifiers
The commit 98d7bbb9 changed *of_device_id.data to const
which introduced warnings in various places that have mostly
been fixed. This patch fixes one such warning by introducing
two const qualifiers.

GCC warning:
drivers/media/platform/coda.c:1785:16: warning:
        assignment discards ‘const’ qualifier
        from pointer target type [enabled by default]

Signed-off-by: Emil Goode <emilgoode@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-08-15 19:15:02 -03:00