summaryrefslogtreecommitdiffstats
path: root/drivers/media/platform/coda/coda-common.c
Commit message (Collapse)AuthorAgeFilesLines
* [media] coda: fix fill bitstream errors in nonstreaming casePhilipp Zabel2015-04-101-3/+3
| | | | | | | | | | When queueing a buffer into the bitstream fails, it has to be requeued in the videobuf2 queue before streaming starts, but while streaming it should be returned to userspace with an error. Signed-off-by: Philipp Zabel <philipp.zabel@gmail.com> Signed-off-by: Kamil Debski <k.debski@samsung.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
* [media] coda: call SEQ_END when the first queue is stoppedPhilipp Zabel2015-04-101-1/+4
| | | | | | | | | | | This allows to stop and restart the output queue to start a new sequence while keeping the capture queue running. Before, sequence end would only be issued if both output and capture queue were stopped and the sequence start issued when reenabling the output queue would fail. Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de> Signed-off-by: Kamil Debski <k.debski@samsung.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
* [media] coda: fail to start streaming if userspace set invalid formatsPhilipp Zabel2015-04-101-1/+12
| | | | | | Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de> Signed-off-by: Kamil Debski <k.debski@samsung.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
* [media] coda: remove duplicate error messages for buffer allocationsPhilipp Zabel2015-04-101-9/+3
| | | | | | | | | coda_alloc_aux_buf already prints an error, no need to print duplicate error messages all over the place. Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de> Signed-off-by: Kamil Debski <k.debski@samsung.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
* [media] coda: move parameter buffer in together with context buffer allocationPhilipp Zabel2015-04-101-12/+0
| | | | | | | | | | | The parameter buffer is a per-context buffer, so we can allocate and free it together with the other context buffers during REQBUFS. Since this was the last context buffer allocated in coda-common.c, we can now move coda_alloc_context_buf into coda-bit.c. Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de> Signed-off-by: Kamil Debski <k.debski@samsung.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
* [media] coda: allocate bitstream buffer from REQBUFS, size depends on the formatPhilipp Zabel2015-04-101-22/+0
| | | | | | | | | | | | | | | | | | | Allocating the bitstream buffer only when the format is set allows to guarantee that at least two frames fit into the bitstream buffer. For small frame sizes a smaller bitstream buffer can be allocated. Since the bitstream buffer size now depends on the format, replace CODA_MAX_FRAME_SIZE with ctx->bitstream.size where appropriate and remove the now unused constant. Since REQBUFS can be called multiple times, but the format can't be changed unless REQBUFS 0 was called before, we can just keep the allocated context and bitstream buffers if REQBUFS is called multiple times with a non-zero buffer count. [fixed a resource leak preventing repeatedly decoding] Signed-off-by: Peter Seiderer <ps.report@gmx.net> Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de> Signed-off-by: Kamil Debski <k.debski@samsung.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
* [media] coda: allocate per-context buffers from REQBUFSPhilipp Zabel2015-04-101-1/+21
| | | | | | | | | | Allocate the per-context buffers from REQBUFS instead in start_encoding or start_decoding. This allows to stop and start streaming independently of buffer (re)allocation Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de> Signed-off-by: Kamil Debski <k.debski@samsung.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
* [media] coda: use strlcpy instead of snprintfPhilipp Zabel2015-04-101-2/+1
| | | | | | | | | There is no need to take the detour through a "%s" format string to create a copy of a string. Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de> Signed-off-by: Kamil Debski <k.debski@samsung.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
* [media] coda: fix double call to debugfs_removePeter Seiderer2015-04-101-1/+2
| | | | | | | | | | | | | | In coda_free_aux_buf() call debugfs_remove only if buffer entry is valid (and therfore dentry is valid), double protect by invalidating dentry value. Fixes erroneous prematurely dealloc of debugfs caused by incorrect reference count incrementing. Signed-off-by: Peter Seiderer <ps.report@gmx.net> Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de> Signed-off-by: Kamil Debski <k.debski@samsung.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
* [media] coda: check kasprintf return value in coda_openPeter Seiderer2015-04-101-0/+6
| | | | | | | | | kasprintf might fail if free memory is low. Signed-off-by: Peter Seiderer <ps.report@gmx.net> Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de> Signed-off-by: Kamil Debski <k.debski@samsung.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
* [media] coda: bitrate can only be set in kbps stepsPhilipp Zabel2015-04-101-1/+1
| | | | | | | | | We divide the bitrate by 1000 before writing it to the register. Communicate to userspace that the bitrate granularity is kbps. Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de> Signed-off-by: Kamil Debski <k.debski@samsung.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
* [media] coda: set allow_zero_bytesused flag for vb2_queue_initKamil Debski2015-04-101-0/+7
| | | | | | | | | | | The coda driver interprets a buffer with bytesused equal to 0 as a special case indicating end-of-stream. After vb2: fix bytesused == 0 handling (8a75ffb) patch videobuf2 modified the value of bytesused if it was 0. The allow_zero_bytesused flag was added to videobuf2 to keep backward compatibility. Signed-off-by: Kamil Debski <k.debski@samsung.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
* [media] coda: simplify check in coda_buf_queuePhilipp Zabel2015-02-021-2/+2
| | | | | | | | | | Now that the bitstream buffer is only allocated for the BIT decoder case, we can use bitstream.size to check for bitstream ringbuffer operation. Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de> Signed-off-by: Kamil Debski <k.debski@samsung.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
* [media] coda: allocate bitstream ringbuffer only for BIT decoderPhilipp Zabel2015-02-021-1/+2
| | | | | | | | | | The BIT encoder does not use a per-context bitstream ringbuffer as it encodes directly into the videobuf2 capture queue's buffers. Avoid allocation of the bitstream ringbuffer for encoder contexts. Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de> Signed-off-by: Kamil Debski <k.debski@samsung.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
* [media] coda: add support for contexts that do not use the BIT processorPhilipp Zabel2015-02-021-19/+23
| | | | | | | | | In preparation for CODA9 JPEG support, allow contexts that control hardware units directly, without the BIT processor. Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de> Signed-off-by: Kamil Debski <k.debski@samsung.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
* [media] coda: make seq_end_work optionalPhilipp Zabel2015-02-021-3/+5
| | | | | | | | | In preparation for CODA9 JPEG support, which doesn't have to call SEQ_END on the BIT processor. Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de> Signed-off-by: Kamil Debski <k.debski@samsung.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
* [media] coda: switch BIT decoder source queue to vmallocPhilipp Zabel2015-02-021-2/+4
| | | | | | | | | | Since we have to copy from input buffers into the bitstream ringbuffer with the CPU, there is no need for contiguous DMA buffers on the decoder input side. Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de> Signed-off-by: Kamil Debski <k.debski@samsung.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
* [media] coda: add coda_estimate_sizeimage and use it in set_defaultsPhilipp Zabel2015-02-021-15/+23
| | | | | | | | | | | | | Call coda_estimate_sizeimage from both try_fmt and set_defaults to avoid this v4l2-compliance warning on the h.264 decoder video device: G_FMT: 1920x1088, 32315559, 1, 1920, 1048576, 3, 0, 0, feedcafe TRY/S_FMT: 1920x1088, 32315559, 1, 1920, 3133440, 3, 0, 0, feedcafe fail: v4l2-test-formats.cpp(948): Video Capture: S_FMT(G_FMT) != G_FMT Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de> Signed-off-by: Kamil Debski <k.debski@samsung.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
* [media] coda: issue seq_end_work during stop_streamingPhilipp Zabel2015-02-021-0/+5
| | | | | | | | | | This patch queues seq_end_work and flushes the queue during stop_streaming and clears the ctx->initialized flag. This allows to start streaming again after stopping streaming without releasing the context. Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de> Signed-off-by: Kamil Debski <k.debski@samsung.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
* [media] coda: remove unused isequence, reset qsequence in stop_streamingPhilipp Zabel2015-02-021-1/+1
| | | | | | | | | The isequence counter is never used, qsequence counts the buffers queued into the bit decoder bitstream ringbuffer. It needs to be reset in stop_streaming. Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de> Signed-off-by: Kamil Debski <k.debski@samsung.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
* [media] coda: initialize SRAM on probePhilipp Zabel2015-02-021-0/+1
| | | | | | | | Zeroing the SRAM on probe helps with debugging SRAM contents. Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de> Signed-off-by: Kamil Debski <k.debski@samsung.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
* [media] coda: properly clear f_cap in coda_s_fmt_vid_outPhilipp Zabel2015-02-021-0/+1
| | | | | | | | Properly zero the structure on the stack before using it. Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de> Signed-off-by: Kamil Debski <k.debski@samsung.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
* [media] coda: fix try_fmt_vid_out colorspace settingPhilipp Zabel2015-02-021-1/+5
| | | | | | | | | v4l2-compliance complains about invalid colorspace settings being accepted on the output side. This patch only allows REC709 and JPEG. Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de> Signed-off-by: Kamil Debski <k.debski@samsung.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
* [media] coda: fix job_ready debug reporting for bitstream decodingPhilipp Zabel2015-02-021-9/+37
| | | | | | | | | | | Clarify whether job_ready returns false because the context is on hold, waiting for new input buffers, whether there are not enough input buffers to fill two into the bitstream, or whether there is not enough data in the bitstream buffer for the bitstream reader hardware to read a whole frame. Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de> Signed-off-by: Kamil Debski <k.debski@samsung.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
* [media] coda: remove context debugfs entry lastPhilipp Zabel2015-02-021-2/+1
| | | | | | | | | Do not remove the per-context debugfs directory before the per-buffer debugfs entries contained therein. Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de> Signed-off-by: Kamil Debski <k.debski@samsung.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
* [media] coda: improve safety in coda_register_device()Dan Carpenter2015-01-271-2/+3
| | | | | | | | | | | | | | The "i" variable is used as an offset into both the dev->vfd[] and the dev->devtype->vdevs[] arrays. The second array is smaller so we should use that as a limit instead of ARRAY_SIZE(dev->vfd). Also the original check was off by one. We should use a format string as well in case the ->name has any funny characters and also to stop static checkers from complaining. Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
* [media] coda: coda-common: Remove mx53 entry from coda_platform_idsFabio Estevam2015-01-271-1/+0
| | | | | | | | | As mx53 is a dt-only architecture we can safely remove its entry from the coda_platform_ids[] structure. Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
* Merge tag 'driver-core-3.19-rc1' of ↵Linus Torvalds2014-12-141-1/+0
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core Pull driver core update from Greg KH: "Here's the set of driver core patches for 3.19-rc1. They are dominated by the removal of the .owner field in platform drivers. They touch a lot of files, but they are "simple" changes, just removing a line in a structure. Other than that, a few minor driver core and debugfs changes. There are some ath9k patches coming in through this tree that have been acked by the wireless maintainers as they relied on the debugfs changes. Everything has been in linux-next for a while" * tag 'driver-core-3.19-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core: (324 commits) Revert "ath: ath9k: use debugfs_create_devm_seqfile() helper for seq_file entries" fs: debugfs: add forward declaration for struct device type firmware class: Deletion of an unnecessary check before the function call "vunmap" firmware loader: fix hung task warning dump devcoredump: provide a one-way disable function device: Add dev_<level>_once variants ath: ath9k: use debugfs_create_devm_seqfile() helper for seq_file entries ath: use seq_file api for ath9k debugfs files debugfs: add helper function to create device related seq_file drivers/base: cacheinfo: remove noisy error boot message Revert "core: platform: add warning if driver has no owner" drivers: base: support cpu cache information interface to userspace via sysfs drivers: base: add cpu_device_create to support per-cpu devices topology: replace custom attribute macros with standard DEVICE_ATTR* cpumask: factor out show_cpumap into separate helper function driver core: Fix unbalanced device reference in drivers_probe driver core: fix race with userland in device_add() sysfs/kernfs: make read requests on pre-alloc files use the buffer. sysfs/kernfs: allow attributes to request write buffer be pre-allocated. fs: sysfs: return EGBIG on write if offset is larger than file size ...
| * media: platform: coda: drop owner assignment from platform_driversWolfram Sang2014-10-201-1/+0
| | | | | | | | | | | | | | A platform_driver does not need to set an owner, it will be populated by the driver core. Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
* | Merge tag 'media/v3.19-rc1' of ↵Linus Torvalds2014-12-111-210/+397
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-media Pull media updates from Mauro Carvalho Chehab: - Two new dvb frontend drivers: mn88472 and mn88473 - A new driver for some PCIe DVBSky cards - A new remote controller driver: meson-ir - One LIRC staging driver got rewritten and promoted to mainstream: igorplugusb - A new tuner driver (m88rs6000t) - The old omap2 media driver got removed from staging. This driver uses an old DMA API and it is likely broken on recent kernels. Nobody cared enough to fix it - Media bus format moved to a separate header, as DRM will also use the definitions there - mem2mem_testdev were renamed to vim2m, in order to use the same naming convention taken by the other virtual test driver (vivid) - Added a new driver for coda SoC (coda-jpeg) - The cx88 driver got converted to use videobuf2 core - Make DMABUF export buffer to work with DMA Scatter/Gather and Vmalloc cores - Lots of other fixes, improvements and cleanups on the drivers. * tag 'media/v3.19-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-media: (384 commits) [media] mn88473: One function call less in mn88473_init() after error [media] mn88473: Remove uneeded check before release_firmware() [media] lirc_zilog: Deletion of unnecessary checks before vfree() [media] MAINTAINERS: Add myself as img-ir maintainer [media] img-ir: Don't set driver's module owner [media] img-ir: Depend on METAG or MIPS or COMPILE_TEST [media] img-ir/hw: Drop [un]register_decoder declarations [media] img-ir/hw: Fix potential deadlock stopping timer [media] img-ir/hw: Always read data to clear buffer [media] redrat3: ensure dma is setup properly [media] ddbridge: remove unneeded check before dvb_unregister_device() [media] si2157: One function call less in si2157_init() after error [media] tuners: remove uneeded checks before release_firmware() [media] arm: omap2: rx51-peripherals: fix build warning [media] stv090x: add an extra protetion against buffer overflow [media] stv090x: Remove an unreachable code [media] stv090x: Some whitespace cleanups [media] em28xx: checkpatch cleanup: whitespaces/new lines cleanups [media] si2168: add support for firmware files in new format [media] si2168: debug printout for firmware version ...
| * | [media] coda: Unregister v4l2 upon alloc_workqueue() errorFabio Estevam2014-11-031-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | If alloc_workqueue() fails, we should go to the 'err_v4l2_register' label, which will unregister the v4l2 device. Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com> Acked-by: Philipp Zabel <p.zabel@pengutronix.de> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
| * | [media] coda: Call v4l2_device_unregister() from a single locationFabio Estevam2014-11-031-8/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Instead of calling v4l2_device_unregister() in multiple locations within the error paths, let's call it from a single location to make the error handling simpler. Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com> Acked-by: Philipp Zabel <p.zabel@pengutronix.de> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
| * | [media] coda: re-queue buffers if start_streaming failsPhilipp Zabel2014-10-281-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Patch b906352c2338 ([media] coda: dequeue buffers if start_streaming fails) incorrectly marked buffers as DEQUEUED in case of start_streaming failure, when in fact they should be set to QUEUED. The videobuf2 core warns about this. Reported-by: Jean-Michel Hautbois <jean-michel.hautbois@vodalys.com> Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de> Signed-off-by: Kamil Debski <k.debski@samsung.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
| * | [media] coda: set bitstream end flag in coda_releasePhilipp Zabel2014-10-281-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | This should fix CODA crashes due to timeouts when stopping the decoding process with SIGINT. Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de> Signed-off-by: Kamil Debski <k.debski@samsung.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
| * | [media] coda: allow userspace to set compressed buffer size in a certain rangePhilipp Zabel2014-10-281-8/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | For small frame sizes, allocating 1 MiB per compressed buffer is a waste of space. On the other hand, incompressible 1080p data can produce JPEGs larger than 1 MiB at higher quality settings. Allow userspace to set the compressed buffer size and clamp the value to a sensible range. Also set the initial sizeimage to a value inside the range allowed by try_fmt. While at it, reduce the default image size to a maximum of 1920*1088 (otherwise JPEG will default to 8k*8k and 96 MiB buffers). Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de> Signed-off-by: Kamil Debski <k.debski@samsung.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
| * | [media] coda: store bitstream buffer position with buffer metadataPhilipp Zabel2014-10-281-7/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Storing the buffer position in the bitstream with the buffer metadata allows to later use that information to drop metadata for skipped buffers and to determine whether bitstream padding has to be applied. This patch also renames struct coda_timestamp to struct coda_buffer_meta to make clear that it contains more than only the buffer timestamp. Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de> Signed-off-by: Kamil Debski <k.debski@samsung.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
| * | [media] coda: add CODA7541 JPEG supportPhilipp Zabel2014-10-281-18/+94
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch adds JPEG encoding and decoding support for CODA7541, using the BIT processor. Separate JPEG encoder and decoder video devices are created due to different streaming behaviour and different supported pixel formats. The hardware can not change subsampling on the fly, but encode and decode 4:2:2 subsampled JPEG images from and into this format. The CODA7541 JPEG decoder uses the bitstream buffer and thus can run without new buffers queued if there is a buffer in the bitstream. Since there is no standard way to store the colorspace used in JPEGs, and to make v4l2-compliance happy, the JPEG format always reports V4L2_COLORSPACE_JPEG. Signed-off-by: Lucas Stach <l.stach@pengutronix.de> Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de> Signed-off-by: Kamil Debski <k.debski@samsung.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
| * | [media] coda: split out encoder control setup to specify controls per video ↵Philipp Zabel2014-10-281-7/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | device This patch splits the encoder specific controls out of the main control setup function. This way each video device registers only relevant controls. Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de> Signed-off-by: Kamil Debski <k.debski@samsung.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
| * | [media] coda: add coda_video_device descriptorsPhilipp Zabel2014-10-281-152/+198
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Each video device descriptor determines the name, callback ops, and input and output formats on the corresponding video device. This simplifies coda_enum_fmt and coda_try_fmt a bit and will simplify adding separate video devices for JPEG codecs due to the slightly different behavior in the CodaDx6/CODA7542 case and a separate hardware unit on CODA960. Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de> Signed-off-by: Kamil Debski <k.debski@samsung.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
| * | [media] coda: identify platform device earlierPhilipp Zabel2014-10-281-11/+9
| | | | | | | | | | | | | | | | | | | | | | | | We'll use this information to decide whether to request the JPEG IRQ later. Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de> Signed-off-by: Kamil Debski <k.debski@samsung.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
| * | [media] coda: add support for planar YCbCr 4:2:2 (YUV422P) formatPhilipp Zabel2014-10-281-0/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | This patch adds support for the three-plane YUV422P format with one luma plane and two horizontally subsampled chroma planes. Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de> Signed-off-by: Kamil Debski <k.debski@samsung.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
| * | [media] coda: add support for partial interleaved YCbCr 4:2:0 (NV12) formatPhilipp Zabel2014-10-281-0/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | This patch adds support for the two-plane NV12 format with one luma plane and one interleaved chroma plane. Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de> Signed-off-by: Kamil Debski <k.debski@samsung.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
| * | [media] coda: simplify frame memory control register handlingPhilipp Zabel2014-10-281-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Since the firmware newer writes to FRAME_MEM_CTRL, we can initialize it once per context (incidentally, we already do write it in coda_hw_init) and never have to read it back. Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de> Signed-off-by: Kamil Debski <k.debski@samsung.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
| * | [media] coda: add coda_write_base helperPhilipp Zabel2014-10-281-0/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add a helper function that writes a vb2_buffer's Y, Cb, and Cr plane base addresses of into three consecutive registers. This moves common code out of coda-bit.c. Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de> Signed-off-by: Kamil Debski <k.debski@samsung.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
| * | [media] coda: remove superfluous error message on devm_kzalloc failurePhilipp Zabel2014-10-281-4/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | When devm_kzalloc causes an OOM condition, this is already reported by the MM subsystem. Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de> Signed-off-by: Kamil Debski <k.debski@samsung.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
| * | [media] coda: clear aborting flag in stop_streamingPhilipp Zabel2014-10-281-1/+1
| |/ | | | | | | | | | | | | | | | | | | | | Clearing the aborting flag in stop_streaming is necessary if we want to start streaming again without having to closing and reopening the device. Also, do not explicitly set it in default_params; the context is zeroed by kzalloc anyway. Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de> Signed-off-by: Kamil Debski <k.debski@samsung.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
* | media / PM: Replace CONFIG_PM_RUNTIME with CONFIG_PMRafael J. Wysocki2014-12-051-2/+2
|/ | | | | | | | | | | | | | | | | | After commit b2b49ccbdd54 (PM: Kconfig: Set PM_RUNTIME if PM_SLEEP is selected) PM_RUNTIME is always set if PM is set, so #ifdef blocks depending on CONFIG_PM_RUNTIME may now be changed to depend on CONFIG_PM. The alternative of CONFIG_PM_SLEEP and CONFIG_PM_RUNTIME may be replaced with CONFIG_PM too. Make these changes everywhere under drivers/media/. Acked-by: Sylwester Nawrocki <s.nawrocki@samsung.com> Acked-by: Philipp Zabel <p.zabel@pengutronix.de> Acked-by: Kamil Debski <k.debski@samsung.com> Acked-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
* [media] coda: Improve runtime PM supportUlf Hansson2014-09-261-34/+21
| | | | | | | | | | | | | | For several reasons it's good practice to leave devices in runtime PM active state while those have been probed. In this cases we also want to prevent the device from going inactive, until the firmware has been completely installed, especially when using a PM domain. Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org> Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de> Signed-off-by: Kamil Debski <k.debski@samsung.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
* [media] coda: checkpatch cleanupPhilipp Zabel2014-08-211-11/+23
| | | | | | | | | | This patch breaks most long lines, concatenates broken up text strings, and adds or removes parentheses where needed to make checkpatch happy. The long codec list lines and a few 81-wide lines remain. Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de> Signed-off-by: Kamil Debski <k.debski@samsung.com> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
* [media] coda: disable old cropping ioctlsPhilipp Zabel2014-08-211-0/+5
| | | | | | | | | | | Since we neither support composing on the OUTPUT side, nor cropping on the CAPTURE side, disable VIDIOC_CROPCAP and VIDIOC_G/S_CROP altogether. This silences a GStreamer warning when GStreamer tries to obtain the pixel aspect ratio using VIDIOC_CROPCAP. Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de> Signed-off-by: Kamil Debski <k.debski@samsung.com> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
OpenPOWER on IntegriCloud