summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* [media] MAINTAINERS: V4L2: PLATFORM: Add entry for Renesas JPEG Processing ↵Mikhail Ulyanov2015-08-111-0/+6
| | | | | | | | | | Unit driver Update RENESAS JPU driver maintainer in MAINTAINERS file. Signed-off-by: Mikhail Ulyanov <mikhail.ulyanov@cogentembedded.com> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
* [media] V4L2: platform: Add Renesas R-Car JPEG codec driverMikhail Ulyanov2015-08-113-0/+1807
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Here's the driver for the Renesas R-Car JPEG processing unit. The driver is implemented within the V4L2 framework as a memory-to-memory device. It presents two video nodes to userspace, one for the encoding part, and one for the decoding part. It was found that the only working mode for encoding is no markers output, so we generate markers with software. In the current version of driver we also use software JPEG header parsing because with hardware parsing performance is lower than desired. >From a userspace point of view the process is typical (S_FMT, REQBUF, optionally QUERYBUF, QBUF, STREAMON, DQBUF) for both the source and destination queues. STREAMON can return -EINVAL in case of mismatch of output and capture queues format. Also during decoding driver can return buffers if queued buffer with JPEG image contains image with inappropriate subsampling (e.g. 4:2:0 in JPEG and 4:2:2 in capture). If JPEG image and queue format dimensions differ driver will return buffer on QBUF with VB2_BUF_STATE_ERROR flag. During encoding the available formats are: V4L2_PIX_FMT_NV12M, V4L2_PIX_FMT_NV12, V4L2_PIX_FMT_NV16, V4L2_PIX_FMT_NV16M for source and V4L2_PIX_FMT_JPEG for destination. During decoding the available formats are: V4L2_PIX_FMT_JPEG for source and V4L2_PIX_FMT_NV12M, V4L2_PIX_FMT_NV16M, V4L2_PIX_FMT_NV12, V4L2_PIX_FMT_NV16 for destination. Performance of current version: 1280x800 NV12 image encoding/decoding decoding ~122 FPS encoding ~191 FPS Signed-off-by: Mikhail Ulyanov <mikhail.ulyanov@cogentembedded.com> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
* [media] devicetree: bindings: Document Renesas R-Car JPEG Processing UnitMikhail Ulyanov2015-08-111-0/+24
| | | | | | | | | Add Renesas R-Car JPEG processing unit driver device tree bindings documentation. Signed-off-by: Mikhail Ulyanov <mikhail.ulyanov@cogentembedded.com> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
* [media] v4l2-ioctl: Give more information when device_caps are missingLaura Abbott2015-08-111-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently, the warning for missing device_caps gives a backtrace like so: [<ffffffff8175c199>] dump_stack+0x45/0x57 [<ffffffff8109ad5a>] warn_slowpath_common+0x8a/0xc0 [<ffffffff8109ae8a>] warn_slowpath_null+0x1a/0x20 [<ffffffffa0237453>] v4l_querycap+0x43/0x80 [videodev] [<ffffffffa0237734>] __video_do_ioctl+0x2a4/0x320 [videodev] [<ffffffff812207e5>] ? do_last+0x195/0x1210 [<ffffffffa023a11e>] video_usercopy+0x22e/0x5b0 [videodev] [<ffffffffa0237490>] ? v4l_querycap+0x80/0x80 [videodev] [<ffffffffa023a4b5>] video_ioctl2+0x15/0x20 [videodev] [<ffffffffa0233733>] v4l2_ioctl+0x113/0x150 [videodev] [<ffffffff81225798>] do_vfs_ioctl+0x2f8/0x4f0 [<ffffffff8113b2d4>] ? __audit_syscall_entry+0xb4/0x110 [<ffffffff81022d7c>] ? do_audit_syscall_entry+0x6c/0x70 [<ffffffff81225a11>] SyS_ioctl+0x81/0xa0 [<ffffffff8113b526>] ? __audit_syscall_exit+0x1f6/0x2a0 [<ffffffff81763549>] system_call_fastpath+0x12/0x17 This indicates that device_caps are missing but doesn't give much of a clue which driver is actually at fault. Improve the warning output by showing the capabilities and the responsible driver. Signed-off-by: Laura Abbott <labbott@fedoraproject.org> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
* [media] tc358743: remove unused variableHans Verkuil2015-08-111-3/+0Star
| | | | | | | The bt pointer was never used, remove it. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
* [media] v4l2-mem2mem: drop lock in v4l2_m2m_fop_mmapHans Verkuil2015-08-111-11/+1Star
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The v4l2_m2m_fop_mmap function takes the core mutex, but this will result in a potential circular locking dependency: [ 262.517164] ====================================================== [ 262.517166] [ INFO: possible circular locking dependency detected ] [ 262.517169] 4.2.0-rc2-koryphon #844 Not tainted [ 262.517171] ------------------------------------------------------- [ 262.517173] v4l2-compliance/1379 is trying to acquire lock: [ 262.517175] (&dev->dev_mutex){+.+.+.}, at: [<ffffffffa000ddab>] v4l2_m2m_fop_mmap+0x2b/0x90 [v4l2_mem2mem] [ 262.517187] but task is already holding lock: [ 262.517189] (&mm->mmap_sem){++++++}, at: [<ffffffff81159309>] vm_mmap_pgoff+0x69/0xc0 [ 262.517199] which lock already depends on the new lock. [ 262.517202] the existing dependency chain (in reverse order) is: [ 262.517204] -> #1 (&mm->mmap_sem){++++++}: [ 262.517209] [<ffffffff810d0e6b>] __lock_acquire+0x62b/0xe80 [ 262.517215] [<ffffffff810d2095>] lock_acquire+0x65/0x90 [ 262.517218] [<ffffffff811612e5>] __might_fault+0x75/0xa0 [ 262.517222] [<ffffffffa06dead9>] video_usercopy+0x3e9/0x4e0 [videodev] [ 262.517231] [<ffffffffa06debe0>] video_ioctl2+0x10/0x20 [videodev] [ 262.517238] [<ffffffffa06d8663>] v4l2_ioctl+0xc3/0xe0 [videodev] [ 262.517243] [<ffffffff811a8cac>] do_vfs_ioctl+0x2fc/0x550 [ 262.517248] [<ffffffff811a8f74>] SyS_ioctl+0x74/0x80 [ 262.517252] [<ffffffff81a4d2ee>] entry_SYSCALL_64_fastpath+0x12/0x76 [ 262.517258] -> #0 (&dev->dev_mutex){+.+.+.}: [ 262.517262] [<ffffffff810cf464>] validate_chain.isra.38+0xd04/0x1170 [ 262.517266] [<ffffffff810d0e6b>] __lock_acquire+0x62b/0xe80 [ 262.517270] [<ffffffff810d2095>] lock_acquire+0x65/0x90 [ 262.517273] [<ffffffff81a48e3c>] mutex_lock_interruptible_nested+0x6c/0x4b0 [ 262.517279] [<ffffffffa000ddab>] v4l2_m2m_fop_mmap+0x2b/0x90 [v4l2_mem2mem] [ 262.517284] [<ffffffffa06d80ff>] v4l2_mmap+0x4f/0x90 [videodev] [ 262.517288] [<ffffffff8116b06c>] mmap_region+0x38c/0x5b0 [ 262.517293] [<ffffffff8116b585>] do_mmap_pgoff+0x2f5/0x3e0 [ 262.517297] [<ffffffff8115932a>] vm_mmap_pgoff+0x8a/0xc0 [ 262.517300] [<ffffffff81169bab>] SyS_mmap_pgoff+0x1cb/0x270 [ 262.517304] [<ffffffff8100876d>] SyS_mmap+0x1d/0x20 [ 262.517309] [<ffffffff81a4d2ee>] entry_SYSCALL_64_fastpath+0x12/0x76 [ 262.517313] other info that might help us debug this: [ 262.517315] Possible unsafe locking scenario: [ 262.517318] CPU0 CPU1 [ 262.517319] ---- ---- [ 262.517321] lock(&mm->mmap_sem); [ 262.517324] lock(&dev->dev_mutex); [ 262.517327] lock(&mm->mmap_sem); [ 262.517329] lock(&dev->dev_mutex); [ 262.517332] *** DEADLOCK *** Since vb2_fop_mmap doesn't take the lock, neither should v4l2_m2m_fop_mmap. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Tested-by: Mikhail Ulyanov <mikhail.ulyanov@cogentembedded.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
* [media] s5p-jpeg: Eliminate double kfree()Andrzej Pietrasiewicz2015-08-111-10/+4Star
| | | | | | | | | | | | | | | | | | | | video_unregister_device() calls device_unregister(), which calls put_device(), which calls kobject_put(), and if this is the last reference then kobject_release() is called, which calls kobject_cleanup(), which calls ktype's release method which happens to be device_release() in this case, which calls dev->release(), which happens to be v4l2_device_release() in this case, which calls vdev->release(), which happens to be video_device_release(). But video_device_release() is called explicitly both in error recovery path of s5p_jpeg_probe() and in s5p_jpeg_remove(). The pointers in question are not nullified between the two calls, so this is harmful. This patch fixes the driver so that video_device_release() is not called twice for the same object. Signed-off-by: Andrzej Pietrasiewicz <andrzej.p@samsung.com> Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
* [media] s5p-mfc: add additional check for incorrect memory configurationMarek Szyprowski2015-08-114-11/+22
| | | | | | | | | | | | | | MFC hardware is known to trash random memory if one tries to use a buffer which has lower DMA addresses than the configured DMA base address. This patch adds a check for this case and proper error handling. Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com> Acked-by: Kamil Debski <kamil@wypas.org> [s.nawrocki@samsung.com: fixed typo (addres -> address] Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
* [media] s5p-mfc: add return value check in mfc_sys_init_cmdMarek Szyprowski2015-08-111-1/+5
| | | | | | | | | | alloc_dev_context_buffer method might fail, so add proper return value check. Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com> Acked-by: Kamil Debski <kamil@wypas.org> Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
* [media] s5p-mfc: fix state check from encoder queue_setupSeung-Woo Kim2015-08-111-4/+5
| | | | | | | | | | | | MFCINST_GOT_INST state is set to encoder context with set_format only for capture buffer. In queue_setup of encoder called during reqbufs, it is checked MFCINST_GOT_INST state for both capture and output buffer. So this patch fixes encoder to check MFCINST_GOT_INST state only for capture buffer from queue_setup. Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com> Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
* [media] s5p-tv: fix wait_event_timeout return handlingNicholas Mc Guire2015-08-111-7/+5Star
| | | | | | | | | | | | | | | | event API conformance testing with coccinelle spatches are being used to locate API usage inconsistencies this triggert with: ./drivers/media/platform/s5p-tv/mixer_reg.c:364 incorrect check for negative return Return type of wait_event_timeout is signed long not int and the return type is >=0 always thus the negative check is unnecessary. An appropriately named variable of type long is inserted and the call fixed up aswell as the negative return check dropped. Signed-off-by: Nicholas Mc Guire <hofrat@osadl.org> Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
* [media] s5p-tv: Drop owner assignment from i2c_driverKrzysztof Kozlowski2015-08-112-2/+0Star
| | | | | | | | | i2c_driver does not need to set an owner because i2c_register_driver() will set it. Signed-off-by: Krzysztof Kozlowski <k.kozlowski@samsung.com> Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
* [media] dvb_core: Replace memset with eth_zero_addrVaishali Thakkar2015-07-221-1/+1
| | | | | | | | | | | | | | | | | | | Use eth_zero_addr to assign the zero address to the given address array instead of memset when second argument is address of zero. The Coccinelle semantic patch that makes this change is as follows: // <smpl> @eth_zero_addr@ expression e; @@ -memset(e,0x00,ETH_ALEN); +eth_zero_addr(e); // </smpl> Signed-off-by: Vaishali Thakkar <vthakkar1994@gmail.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
* [media] staging: media: lirc: fix coding style errorSunil Shahu2015-07-221-1/+1
| | | | | | | Fix code indentation error by replacing tab in place of spaces. Signed-off-by: Sunil Shahu <shshahu@gmail.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
* [media] sh-veu: don't use COLORSPACE_JPEGHans Verkuil2015-07-221-1/+1
| | | | | | | | | COLORSPACE_JPEG should only be used for JPEGs. Use SMPTE170M instead, which is how YCbCr images are usually encoded. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Acked-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
* [media] media: ttpci: Use vsprintf %pM extensionJoe Perches2015-07-221-3/+1Star
| | | | | | | Format mac addresses with the normal kernel extension. Signed-off-by: Joe Perches <joe@perches.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
* [media] tc358743: allow event subscriptionPhilipp Zabel2015-07-221-2/+17
| | | | | | | | | This is useful to subscribe to HDMI hotplug events via the V4L2_CID_DV_RX_POWER_PRESENT control. Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
* [media] tc358743: add direct interrupt handlingPhilipp Zabel2015-07-221-0/+22
| | | | | | | | | When probed from device tree, the i2c client driver can handle the interrupt on its own. Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
* [media] tc358743: support probe from device treePhilipp Zabel2015-07-222-6/+197
| | | | | | | | | | | Add support for probing the TC358743 subdevice from device tree. The reference clock must be supplied using the common clock bindings. MIPI CSI-2 specific properties are parsed from the OF graph endpoint node and support for a non-continuous MIPI CSI-2 clock is added. Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
* [media] tc358743: enable v4l2 subdevice devnodePhilipp Zabel2015-07-221-1/+1
| | | | | | | | | Add V4L2_SUBDEV_FL_HAS_DEVNODE to subdev flags, in order to enable a subdev device node. Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
* [media] tc358743: register v4l2 asynchronous subdevicePhilipp Zabel2015-07-221-0/+13
| | | | | | | | Add support for registering the sensor subdevice using the v4l2-async API. Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
* [media] cobalt: allow fewer than 8 PCIe lanesHans Verkuil2015-07-221-5/+6
| | | | | | | | | | | Currently the cobalt driver refuses to load if fewer than 8 PCIe lanes are assigned. This patch changes this and just issues a warning. The only time it will refuse to load is if the number of assigned lanes is less than what the PCIe host is capable of since this suggests that the card isn't seated correctly in the slot. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
* [media] cobalt: accept unchanged timings when vb2_is_busy()Hans Verkuil2015-07-221-3/+8
| | | | | | | | | | | | | When vb2_is_busy() it should still be possible to call S_DV_TIMINGS provided the new timings are the same as the current timings. For input 1 (test generator) the size is always 1080p, so just return that. Fixes a v4l2-compliance issue. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
* [media] media: am437x-vpfe: Fix a race condition during releaseBenoit Parrot2015-07-221-2/+12
| | | | | | | | | | | | | There was a race condition where during cleanup/release operation on-going streaming would cause a kernel panic because the hardware module was disabled prematurely with IRQ still pending. Fixes: 417d2e507edc ("[media] media: platform: add VPFE capture driver support for AM437X") Cc: <stable@vger.kernel.org> # v4.0+ Signed-off-by: Benoit Parrot <bparrot@ti.com> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
* [media] videobuf2: add trace eventsPhilipp Zabel2015-07-172-0/+108
| | | | | | | | | | | | | | | | Add videobuf2 specific vb2_qbuf and vb2_dqbuf trace events that mirror the v4l2_qbuf and v4l2_dqbuf trace events, only they include additional information about queue fill state and are emitted right before the buffer is enqueued in the driver or userspace is woken up. This allows to make sense of the timeline of trace events in combination with others that might be triggered by __enqueue_in_driver. Also two new trace events vb2_buf_queue and vb2_buf_done are added, allowing to trace the handover between videobuf2 framework and driver. Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
* [media] v4l2-mem2mem: set the queue owner field just as vb2_ioctl_reqbufs doesPhilipp Zabel2015-07-171-1/+8
| | | | | | | | | | | The queue owner will be used by videobuf2 trace events to determine and record the device minor number. It is set in v4l2_m2m_reqbufs instead of v4l2_m2m_ioctl_reqbufs because several drivers implement their own vidioc_reqbufs handlers that still call v4l2_m2m_reqbufs directly. Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
* [media] v4l2-dev: use event class to deduplicate v4l2 trace eventsPhilipp Zabel2015-07-171-82/+78Star
| | | | | | | | | | | | Trace events with exactly the same parameters and trace output, such as v4l2_qbuf and v4l2_dqbuf, are supposed to use the DECLARE_EVENT_CLASS and DEFINE_EVENT macros instead of duplicated TRACE_EVENT macro calls. Suggested-by: Steven Rostedt <rostedt@goodmis.org> Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
* [media] coda: make NV12 format defaultPhilipp Zabel2015-07-171-14/+14
| | | | | | | | | | The chroma interleaved NV12 format has higher memory bandwidth efficiency because the chroma planes can be read/written with longer burst lengths. Use NV12 as default format if available and consistently sort it first. Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
* [media] coda: add macroblock tiling supportPhilipp Zabel2015-07-176-70/+221
| | | | | | | | | | | | | | | | Storing internal frames in macroblock tiled order improves memory access patterns by allowing increased burst sizes when transferring the uncompressed macroblocks to or from main memory. The translation logic only supports a single chroma base address, so this is only supported for the chroma interleaved NV12 format. Since the rotator used to copy the decoder output into the v4l2 capture buffers does not seem to support the tiled format correctly, only enable it in the encoder for now. Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
* [media] coda: move cache setup into coda9_set_frame_cache, also use it in ↵Philipp Zabel2015-07-171-20/+25
| | | | | | | | | | | | | start_encoding The frame cache should be set up correctly to encode NV12 source frames. This was not done before, so move the cache setup out of start_decoding into its own function and call it from both start_encoding and start_decoding. Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
* [media] coda: Use S_PARM to set nominal framerate for h.264 encoderPhilipp Zabel2015-07-172-0/+106
| | | | | | | | | | The encoder needs to know the nominal framerate for the constant bitrate control mechanism to work. Currently the only way to set the framerate is by using VIDIOC_S_PARM on the output queue. Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
* [media] coda: implement VBV delay and buffer size controlsPhilipp Zabel2015-07-173-1/+20
| | | | | | | | | The encoder allows to specify the VBV model reference decoder's initial delay and buffer size. Export the corresponding V4L2 controls. Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
* [media] coda: reset CODA960 hardware after sequence endPhilipp Zabel2015-07-171-0/+8
| | | | | | | | | | On i.MX6, sometimes after decoding a stream, encoding will produce macroblock errors caused by missing 8-byte sequences in the output stream. Until the cause for this is found, reset the hardware after sequence end, which seems to help. Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
* [media] coda: rework meta counting and add separate lockPhilipp Zabel2015-07-173-14/+25
| | | | | | | | | | | Keep count of number of buffer meta structures in the list and use a separate spinlock for operations on this counted list instead of reusing the bitstream mutex in some places and none at all in others. Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
* [media] coda: reuse src_bufs in coda_job_readyPhilipp Zabel2015-07-171-8/+5Star
| | | | | | | | | | The v4l2_m2m_num_src_bufs_ready() function is called in multiple places in coda_cob_ready, and there already is a variable src_bufs that is assigned to its result. Move it to the beginning and use it everywhere. Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
* [media] coda: use event class to deduplicate v4l2 trace eventsPhilipp Zabel2015-07-172-65/+26Star
| | | | | | | | | | | | | Trace events with exactly the same parameters and trace output, such as coda_enc_pic_run and coda_enc_pic_done, are supposed to use the DECLARE_EVENT_CLASS and DEFINE_EVENT macros instead of duplicated TRACE_EVENT macro calls. This patch changes the order of parameters to coda_dec_rot_done and adds a timestamp so it can share an event class with coda_bit_queue. Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
* [media] coda: drop custom list of pixel format descriptionsPhilipp Zabel2015-07-171-68/+7Star
| | | | | | | | | | Since commit ba3002045f80 ("[media] v4l2-ioctl: fill in the description for VIDIOC_ENUM_FMT"), all pixel formats are assigned their description in a central place. We can now drop the custom list. Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
* [media] coda: reset stream end in stop_streamingPhilipp Zabel2015-07-171-0/+3
| | | | | | | | Otherwise a restarted stream won't queue buffers. Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
* [media] coda: avoid calling SEQ_END twicePhilipp Zabel2015-07-172-3/+9
| | | | | | | | | | | | Allow coda_seq_end_work to be called multiple times, move the setting of ctx->initialized from coda_start/stop_streaming() into coda_start_encoding/decoding and coda_seq_end_work, respectively, and skip the SEQ_END command in coda_seq_end_work if the context is already deinitialized before. Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
* [media] coda: keep buffers on the queue in bitstream end modePhilipp Zabel2015-07-171-0/+3
| | | | | | | | | | In stream end mode the hardware will read the bitstream to its end, overshooting the write pointer. Do not write additional data into the bitstream in this mode. Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
* [media] coda: fix bitstream preloading for MPEG4 decodingPhilipp Zabel2015-07-171-3/+1Star
| | | | | | | | | | | All decoder instances using the BIT processor should preload buffers into the bitstream ring buffer, including MPEG4 decoding. Fix this by explicitly stating the above condition instead of listing all relevant input formats. Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
* [media] coda: fix mvcol buffer for MPEG4 decodingPhilipp Zabel2015-07-171-1/+1
| | | | | | | | | The mvcol buffer is allocated at the end of the first internal buffer. This patch fixes an out of bounds array access. Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
* [media] coda: clamp frame sequence counters to 16 bitLucas Stach2015-07-171-1/+8
| | | | | | | | | | | | | | This is already done for one side of the comparison with the expectation that the HW counter rolls over at the 16 bit boundary. This is true when decoding a h.264 stream, but doesn't hold for at least MJPEG. As we don't know the exact wrap-around point for this format just clamp the HW counter to the same 16 bits. This should be enough to detect most of the errors and saves us from doing different comparisons based on the decoded format. Signed-off-by: Lucas Stach <l.stach@pengutronix.de> Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
* [media] v4l: vsp1: Don't sleep in atomic contextLaurent Pinchart2015-07-172-11/+11
| | | | | | | | | | The vsp1_entity_is_streaming() function is called in atomic context when queuing buffers, and sleeps due to a mutex. As the mutex just protects access to one structure field, fix this by replace the mutex with a spinlock. Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
* [media] v4l: vsp1: Fix plane stride and size checksLaurent Pinchart2015-07-171-1/+1
| | | | | | | | | | | The checks need to be performed on up to two planes, as the third plane, if present, must have the same stride and size as the second plane. The code incorrectly performs the checks on at least two planes instead of at most two planes, fix it. Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
* [media] v4l: xilinx: missing error codeDan Carpenter2015-07-171-1/+3
| | | | | | | | | | | We should set "ret" on this error path instead of returning success. Fixes: df3305156f98 ('[media] v4l: xilinx: Add Xilinx Video IP core') Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Acked-by: Hyun Kwon <hyun.kwon@xilinx.com> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
* [media] Driver for Toshiba TC358743 HDMI to CSI-2 bridgeMats Randgaard2015-07-177-0/+2611
| | | | | | | | | | | | | | | | | The driver is tested on our hardware and all the implemented features works as expected. Missing features: - CEC support - HDCP repeater support - IR support Signed-off-by: Mats Randgaard <matrandg@cisco.com> [hans.verkuil@cisco.com: updated copyright year to 2015] [hans.verkuil@cisco.com: update confusing confctl_mutex comment] Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
* [media] bdisp: fix debug info memory accessFabien Dessenne2015-07-171-2/+2
| | | | | | | | | bdisp_dev->dbg.copy_node shall be a copy of (and not point to) bdisp_ctx->node, since this resource is freed upon driver release. Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
* [media] bdisp: add debug info for RGB24 formatFabien Dessenne2015-07-171-0/+8
| | | | | | | | Add this missing debug information Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
* [media] bdisp: composing supportFabien Dessenne2015-07-172-29/+55
| | | | | | | | | Support the composing (at VIDEO_CAPTURE) with the _selection API. v4l2-compliance successfully run ("test Composing: OK") Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>