summaryrefslogtreecommitdiffstats
path: root/drivers/media/platform
Commit message (Collapse)AuthorAgeFilesLines
* media: platform: fix several typosMauro Carvalho Chehab2019-03-0146-70/+70
| | | | | | | | | | | | | | | | Use codespell to fix lots of typos over frontends. Manually verified to avoid false-positives. Reviewed-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se> Acked-by: Andrzej Pietrasiewicz <andrzejtp2010@gmail.com> Reviewed-by: Benoit Parrot <bparrot@ti.com> Reviewed-by: Kieran Bingham <kieran.bingham+renesas@ideasonboard.com> Reviewed-by: Lad, Prabhakar <prabhakar.csengg@gmail.com> Acked-by: Philipp Zabel <p.zabel@pengutronix.de> Reviewed-by: Houlong Wei <houlong.wei@mediatek.com> Reviewed-by: Yong Deng <yong.deng@magewell.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
* media: video-mux: add bayer formatsRui Miguel Silva2019-02-181-0/+20
| | | | | | | | | | Add non vendor bayer formats to the allowed format array. Signed-off-by: Rui Miguel Silva <rui.silva@linaro.org> Reviewed-by: Philipp Zabel <p.zabel@pengutronix.de> Acked-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
* media: vicodec: Add a flag for I-frames in fwht headerDafna Hirschfeld2019-02-183-4/+7
| | | | | | | | | | | | | | | Add a flag 'FWHT_FL_I_FRAME' that indicates that this is an I-frame. This requires incrementing to version 3 This flag is needed for the upcoming stateless FWHT decoder since it has to know if an encoded frame is an I or a P frame. Signed-off-by: Dafna Hirschfeld <dafna3@gmail.com> [hverkuil-cisco@xs4all.nl: added the last paragraph of the commit msg] Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
* media: exynos4-is: remove redundant check on typeColin Ian King2019-02-181-3/+1Star
| | | | | | | | | | | | | The check to see if type is V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE is redundant as this has been already checked at the start of the function and if it's not that value then -ENOSYS is returned. Hence the sprintf can be replaced by a simpler string copy. Detected by CoverityScan, CID#1309450 ("Logically dead code") Signed-off-by: Colin Ian King <colin.king@canonical.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
* media: sh_veu: Correct return type for mem2mem buffer helpersEzequiel Garcia2019-02-181-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | Fix the assigned type of mem2mem buffer handling API. Namely, these functions: v4l2_m2m_next_buf v4l2_m2m_last_buf v4l2_m2m_buf_remove v4l2_m2m_next_src_buf v4l2_m2m_next_dst_buf v4l2_m2m_last_src_buf v4l2_m2m_last_dst_buf v4l2_m2m_src_buf_remove v4l2_m2m_dst_buf_remove return a struct vb2_v4l2_buffer, and not a struct vb2_buffer. Fixing this is necessary to fix the mem2mem buffer handling API, changing the return to the correct struct vb2_v4l2_buffer instead of a void pointer. Signed-off-by: Ezequiel Garcia <ezequiel@collabora.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
* media: s5p-jpeg: Correct return type for mem2mem buffer helpersEzequiel Garcia2019-02-181-19/+19
| | | | | | | | | | | | | | | | | | | | | | | | | Fix the assigned type of mem2mem buffer handling API. Namely, these functions: v4l2_m2m_next_buf v4l2_m2m_last_buf v4l2_m2m_buf_remove v4l2_m2m_next_src_buf v4l2_m2m_next_dst_buf v4l2_m2m_last_src_buf v4l2_m2m_last_dst_buf v4l2_m2m_src_buf_remove v4l2_m2m_dst_buf_remove return a struct vb2_v4l2_buffer, and not a struct vb2_buffer. Fixing this is necessary to fix the mem2mem buffer handling API, changing the return to the correct struct vb2_v4l2_buffer instead of a void pointer. Signed-off-by: Ezequiel Garcia <ezequiel@collabora.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
* media: s5p-g2d: Correct return type for mem2mem buffer helpersEzequiel Garcia2019-02-181-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | Fix the assigned type of mem2mem buffer handling API. Namely, these functions: v4l2_m2m_next_buf v4l2_m2m_last_buf v4l2_m2m_buf_remove v4l2_m2m_next_src_buf v4l2_m2m_next_dst_buf v4l2_m2m_last_src_buf v4l2_m2m_last_dst_buf v4l2_m2m_src_buf_remove v4l2_m2m_dst_buf_remove return a struct vb2_v4l2_buffer, and not a struct vb2_buffer. Fixing this is necessary to fix the mem2mem buffer handling API, changing the return to the correct struct vb2_v4l2_buffer instead of a void pointer. Signed-off-by: Ezequiel Garcia <ezequiel@collabora.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
* media: rockchip/rga: Correct return type for mem2mem buffer helpersEzequiel Garcia2019-02-181-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | Fix the assigned type of mem2mem buffer handling API. Namely, these functions: v4l2_m2m_next_buf v4l2_m2m_last_buf v4l2_m2m_buf_remove v4l2_m2m_next_src_buf v4l2_m2m_next_dst_buf v4l2_m2m_last_src_buf v4l2_m2m_last_dst_buf v4l2_m2m_src_buf_remove v4l2_m2m_dst_buf_remove return a struct vb2_v4l2_buffer, and not a struct vb2_buffer. Fixing this is necessary to fix the mem2mem buffer handling API, changing the return to the correct struct vb2_v4l2_buffer instead of a void pointer. Signed-off-by: Ezequiel Garcia <ezequiel@collabora.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
* media: mx2_emmaprp: Correct return type for mem2mem buffer helpersEzequiel Garcia2019-02-181-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | Fix the assigned type of mem2mem buffer handling API. Namely, these functions: v4l2_m2m_next_buf v4l2_m2m_last_buf v4l2_m2m_buf_remove v4l2_m2m_next_src_buf v4l2_m2m_next_dst_buf v4l2_m2m_last_src_buf v4l2_m2m_last_dst_buf v4l2_m2m_src_buf_remove v4l2_m2m_dst_buf_remove return a struct vb2_v4l2_buffer, and not a struct vb2_buffer. Fixing this is necessary to fix the mem2mem buffer handling API, changing the return to the correct struct vb2_v4l2_buffer instead of a void pointer. Signed-off-by: Ezequiel Garcia <ezequiel@collabora.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
* media: mtk-vcodec: Correct return type for mem2mem buffer helpersEzequiel Garcia2019-02-182-80/+54Star
| | | | | | | | | | | | | | | | | | | | | | | | | Fix the assigned type of mem2mem buffer handling API. Namely, these functions: v4l2_m2m_next_buf v4l2_m2m_last_buf v4l2_m2m_buf_remove v4l2_m2m_next_src_buf v4l2_m2m_next_dst_buf v4l2_m2m_last_src_buf v4l2_m2m_last_dst_buf v4l2_m2m_src_buf_remove v4l2_m2m_dst_buf_remove return a struct vb2_v4l2_buffer, and not a struct vb2_buffer. Fixing this is necessary to fix the mem2mem buffer handling API, changing the return to the correct struct vb2_v4l2_buffer instead of a void pointer. Signed-off-by: Ezequiel Garcia <ezequiel@collabora.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
* media: mtk-mdp: Correct return type for mem2mem buffer helpersEzequiel Garcia2019-02-181-13/+7Star
| | | | | | | | | | | | | | | | | | | | | | | | | Fix the assigned type of mem2mem buffer handling API. Namely, these functions: v4l2_m2m_next_buf v4l2_m2m_last_buf v4l2_m2m_buf_remove v4l2_m2m_next_src_buf v4l2_m2m_next_dst_buf v4l2_m2m_last_src_buf v4l2_m2m_last_dst_buf v4l2_m2m_src_buf_remove v4l2_m2m_dst_buf_remove return a struct vb2_v4l2_buffer, and not a struct vb2_buffer. Fixing this is necessary to fix the mem2mem buffer handling API, changing the return to the correct struct vb2_v4l2_buffer instead of a void pointer. Signed-off-by: Ezequiel Garcia <ezequiel@collabora.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
* media: mtk-jpeg: Correct return type for mem2mem buffer helpersEzequiel Garcia2019-02-181-20/+20
| | | | | | | | | | | | | | | | | | | | | | | | | Fix the assigned type of mem2mem buffer handling API. Namely, these functions: v4l2_m2m_next_buf v4l2_m2m_last_buf v4l2_m2m_buf_remove v4l2_m2m_next_src_buf v4l2_m2m_next_dst_buf v4l2_m2m_last_src_buf v4l2_m2m_last_dst_buf v4l2_m2m_src_buf_remove v4l2_m2m_dst_buf_remove return a struct vb2_v4l2_buffer, and not a struct vb2_buffer. Fixing this is necessary to fix the mem2mem buffer handling API, changing the return to the correct struct vb2_v4l2_buffer instead of a void pointer. Signed-off-by: Ezequiel Garcia <ezequiel@collabora.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
* media: sun6i: Add support for JPEG media bus formatChen-Yu Tsai2019-02-183-0/+8
| | | | | | | | | | | | | | | | | The CSI controller can take raw data from the data bus and output it directly to capture buffers. This can be used to support the JPEG media bus format. While the controller can report minimum and maximum bytes per line, it has no way to report how many lines were captured in the last frame. Thus, even when the on-bus data is framed correctly, we have no way to accertain the actual amount of data captured, unless we scan the buffer for JPEG EOI markers, or sequential zeros. For now we leave bytesused alone, and leave it up to userspace applications to parse the data. Signed-off-by: Chen-Yu Tsai <wens@csie.org> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
* media: sun6i: Add support for RGB565 formatsChen-Yu Tsai2019-02-183-2/+21
| | | | | | | | | | | | The CSI controller can take raw data from the data bus and output RGB565 format. The controller does not distinguish between RGB565 LE and BE. Instead this is determined by the media bus format, i.e. the format or order the sensor is sending data in. Signed-off-by: Chen-Yu Tsai <wens@csie.org> Acked-by: Maxime Ripard <maxime.ripard@bootlin.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
* media: sun6i: Fix CSI regmap's max_registerChen-Yu Tsai2019-02-181-1/+1
| | | | | | | | | | | | | | | | | | | | | max_register is currently set to 0x1000. This is beyond the mapped address range of the hardware, so attempts to dump the regmap from debugfs would trigger a kernel exception. Furthermore, the useful registers only occupy a small section at the beginning of the full range. Change the value to 0x9c, the last known register on the V3s and H3. On the A31, the register range is extended to support additional capture channels. Since this is not yet supported, ignore it for now. Fixes: 5cc7522d8965 ("media: sun6i: Add support for Allwinner CSI V3s") Cc: <stable@vger.kernel.org> Signed-off-by: Chen-Yu Tsai <wens@csie.org> Acked-by: Maxime Ripard <maxime.ripard@bootlin.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
* media: vsp1: Fix smatch warningHans Verkuil2019-02-181-3/+3
| | | | | | | | | | | | | | | | drivers/media/platform/vsp1/vsp1_drm.c: drivers/media/platform/vsp1/vsp1_drm.c:336 vsp1_du_pipeline_setup_brx() error: we previously assumed 'pipe->brx' could be null (see line 244) smatch missed that if pipe->brx was NULL, then later on it will be set with a non-NULL value. But it is easier to just use the brx pointer so smatch doesn't get confused. Tested-on: Salvator-XS-ES2.0, Salvator-XS-M3N Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Reviewed-by: Kieran Bingham <kieran.bingham+renesas@ideasonboard.com> Tested-by: Kieran Bingham <kieran.bingham+renesas@ideasonboard.com> Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
* media: sun6i: Add A64 CSI block supportJagan Teki2019-02-181-0/+11
| | | | | | | | | | | | | | | | | | CSI block in Allwinner A64 has similar features as like in H3, but the default CSI_SCLK rate cannot work properly to drive the connected sensor interface. The tested mod cock rate is 300 MHz and BSP vfe media driver is also using the same rate. Unfortunately there is no valid information about clock rate in manual or any other sources except the BSP driver. so more faith on BSP code, because same has tested in mainline. So, add support for A64 CSI block by setting updated mod clock rate. Signed-off-by: Jagan Teki <jagan@amarulasolutions.com> Acked-by: Maxime Ripard <maxime.ripard@bootlin.com> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
* media: imx-pxp: Start using the format VUYA32 instead of YUV32 (v2)Vivek Kasireddy2019-02-181-4/+10
| | | | | | | | | | | | | | Buffers generated with YUV32 format seems to be incorrect, hence use VUYA32 instead. Changes from v1: Add both formats VUYA32 and VUYX32 but associate only VUYX32 to the output queue as the alpha channel of buffers is ignored on this queue. Signed-off-by: Vivek Kasireddy <vivek.kasireddy@intel.com> Reviewed-by: Philipp Zabel <p.zabel@pengutronix.de> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
* media: vivid: Add definitions for the 32-bit packed YUV formatsVivek Kasireddy2019-02-181-0/+30
| | | | | | | | | | | | Enable vivid to make use of the following formats: V4L2_PIX_FMT_AYUV32 V4L2_PIX_FMT_XYUV32 V4L2_PIX_FMT_VUYA32 V4L2_PIX_FMT_VUYX32 Signed-off-by: Vivek Kasireddy <vivek.kasireddy@intel.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
* media: vimc: fix memory leakHans Verkuil2019-02-181-0/+2
| | | | | | | | media_device_cleanup() wasn't called, which caused a small memory leak. Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
* media: vivid: two unregistration fixesHans Verkuil2019-02-181-3/+1Star
| | | | | | | | | | When the media device registration fails, don't call media_device_unregister since the device was never actually registered. When removing the module also call media_device_cleanup() to avoid a memory leak. Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
* media: soc_camera: Move to the staging treeSakari Ailus2019-02-186-2715/+0Star
| | | | | | | | | The SoC camera framework has no functional drivers left, something that has not changed for years. Move the leftovers to the staging tree. Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Acked-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
* media: vimc: Remove unused but set variablesLucas A. M. Magalhães2019-02-181-7/+0Star
| | | | | | | | | Remove unused but set variables to clean up the code and avoid warning. Signed-off-by: Lucas A. M. Magalhães <lucmaga@gmail.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
* media: vimc: add USERPTR supportHans Verkuil2019-02-181-1/+1
| | | | | | | | Add VB2_USERPTR to the vimc capture device. Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Acked-by: Helen Koike <helen.koike@collabora.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
* media: vim2m: fix build breakage due to a merge conflictMauro Carvalho Chehab2019-02-181-2/+1Star
| | | | | | | | | | | | A merge conflict rised when merging from -rc7. Fix it. In this specific case, we don't need the if anymore, as the work_run was moved to its rightful place (struct vim2m_ctx). Fixes: b3e64e5b0778 ("media: vim2m: use per-file handler work queue") Fixes: 240809ef6630 ("media: vim2m: only cancel work if it is for right context") Reviewed-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
* Merge tag 'v5.0-rc7' into patchworkMauro Carvalho Chehab2019-02-182-2/+4
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Linux 5.0-rc7 * tag 'v5.0-rc7': (1667 commits) Linux 5.0-rc7 Input: elan_i2c - add ACPI ID for touchpad in Lenovo V330-15ISK Input: st-keyscan - fix potential zalloc NULL dereference Input: apanel - switch to using brightness_set_blocking() powerpc/64s: Fix possible corruption on big endian due to pgd/pud_present() efi/arm: Revert "Defer persistent reservations until after paging_init()" arm64, mm, efi: Account for GICv3 LPI tables in static memblock reserve table sunrpc: fix 4 more call sites that were using stack memory with a scatterlist include/linux/module.h: copy __init/__exit attrs to init/cleanup_module Compiler Attributes: add support for __copy (gcc >= 9) lib/crc32.c: mark crc32_le_base/__crc32c_le_base aliases as __pure auxdisplay: ht16k33: fix potential user-after-free on module unload x86/platform/UV: Use efi_runtime_lock to serialise BIOS calls i2c: bcm2835: Clear current buffer pointers and counts after a transfer i2c: cadence: Fix the hold bit setting drm: Use array_size() when creating lease dm thin: fix bug where bio that overwrites thin block ignores FUA Revert "exec: load_script: don't blindly truncate shebang string" Revert "gfs2: read journal in large chunks to locate the head" net: ethernet: freescale: set FEC ethtool regs version ... Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
| * media: vim2m: only cancel work if it is for right contextHans Verkuil2019-01-161-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | cancel_delayed_work_sync() was called for any queue, but it should only be called for the queue that is associated with the currently running job. Otherwise, if two filehandles are streaming at the same time, then closing the first will cancel the work which might still be running for a job from the second filehandle. As a result the second filehandle will never be able to finish the job and an attempt to stop streaming on that second filehandle will stall. Fixes: 52117be68b82 ("media: vim2m: use cancel_delayed_work_sync instead of flush_schedule_work") Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Cc: <stable@vger.kernel.org> # for v4.20 and up Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
| * cross-tree: phase out dma_zalloc_coherent()Luis Chamberlain2019-01-081-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We already need to zero out memory for dma_alloc_coherent(), as such using dma_zalloc_coherent() is superflous. Phase it out. This change was generated with the following Coccinelle SmPL patch: @ replace_dma_zalloc_coherent @ expression dev, size, data, handle, flags; @@ -dma_zalloc_coherent(dev, size, handle, flags) +dma_alloc_coherent(dev, size, handle, flags) Suggested-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Luis Chamberlain <mcgrof@kernel.org> [hch: re-ran the script on the latest tree] Signed-off-by: Christoph Hellwig <hch@lst.de>
* | media: vimc: fill in bus_info in media_device_infoHans Verkuil2019-02-072-3/+3
| | | | | | | | | | | | | | | | | | | | | | It is good practice to fill in bus_info. Also just use 'platform:vimc' when filling in the bus_info in querycap: the bus_info has nothing to do with the video device name. Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Acked-by: Helen Koike <helen.koike@collabora.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
* | media: pxa_camera: fix smatch warningHans Verkuil2019-02-071-3/+5
| | | | | | | | | | | | | | | | | | | | | | drivers/media/platform/pxa_camera.c:2400 pxa_camera_probe() error: we previously assumed 'pcdev->pdata' could be null (see line 2397) First check if platform data is provided, then check if DT data is provided, and if neither is provided just return with -ENODEV. Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Acked-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
* | media: v4l2-mem2mem: Rename v4l2_m2m_buf_copy_data to v4l2_m2m_buf_copy_metadataEzequiel Garcia2019-02-072-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | The v4l2_m2m_buf_copy_data helper is used to copy the buffer metadata, such as its timestamp and its flags. Therefore, the v4l2_m2m_buf_copy_metadata name is more clear and avoids confusion with a payload data copy. Signed-off-by: Ezequiel Garcia <ezequiel@collabora.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> [hverkuil-cisco@xs4all.nl: also fix cedrus_dec.c] Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
* | media: vim2m: don't use curr_ctx->dev before checkingMauro Carvalho Chehab2019-02-071-1/+2
| | | | | | | | | | | | | | | | | | | | | | It seems that it is possible that dev to be null, as there's a warning printing: "Instance released before the end of transaction" Solves this warning: drivers/media/platform/vim2m.c: drivers/media/platform/vim2m.c:525 device_work() warn: variable dereferenced before check 'curr_ctx' (see line 523) Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
* | media: vivid: add vertical down sampling to imagesize calcAndré Almeida2019-02-071-3/+7
| | | | | | | | | | | | | | | | | | | | | | To correctly set the size of the image in a plane, it's needed to divide the height of image by the vertical down sampling factor. This was only happening in vivid_try_fmt_vid_cap(), but now it applied in others sizeimage calculations as well. Signed-off-by: André Almeida <andre.almeida@collabora.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
* | media: vimc: Add vimc-streamer for stream controlLucas A. M. Magalhães2019-02-079-147/+260
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add a linear pipeline logic for the stream control. It's created by walking backwards on the entity graph. When the stream starts it will simply loop through the pipeline calling the respective process_frame function of each entity. Fixes: f2fe89061d797 ("vimc: Virtual Media Controller core, capture and sensor") Cc: stable@vger.kernel.org # for v4.20 Signed-off-by: Lucas A. M. Magalhães <lucmaga@gmail.com> Acked-by: Helen Koike <helen.koike@collabora.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> [hverkuil-cisco@xs4all.nl: fixed small space-after-tab issue in the patch] Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
* | media: videobuf: use u64 for the timestamp internallyHans Verkuil2019-02-073-8/+8
| | | | | | | | | | | | | | | | | | | | Just like vb2 does, use u64 internally to store the timestamps of the buffers. Only convert to timeval when interfacing with userspace. Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Acked-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
* | media: vicodec: support SOURCE_CHANGE event for decoders onlyHans Verkuil2019-02-071-1/+6
| | | | | | | | | | | | | | | | The SOURCE_CHANGE event is decoder specific, so don't allow it for encoders. Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
* | media: vim2m: fill in bus_info in media_device_infoHans Verkuil2019-02-071-0/+2
| | | | | | | | | | | | | | It is good practice to fill in the bus_info. Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
* | media: vicodec: fill in bus_info in media_device_infoHans Verkuil2019-02-071-0/+2
| | | | | | | | | | | | | | It is good practice to fill in bus_info. Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
* | media: vicodec: check type in g/s_selectionHans Verkuil2019-02-071-2/+7
| | | | | | | | | | | | | | | | | | Check that the selection buf_type is valid before calling get_q_data() to avoid hitting the WARN(1) in that function if the buffer type is not valid. Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Reported-by: syzbot+44b24cff6bf96006ecfa@syzkaller.appspotmail.com Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
* | media: imx-pxp: fix duplicated if conditionPhilipp Zabel2019-02-071-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Fix a copy&paste error to make RGB -> BT.2020 YUV conversion actually selectable. Fixes the following warning: drivers/media/platform/imx-pxp.c:683:24: warning: duplicated ‘if’ condition [-Wduplicated-cond] Fixes: 51abcf7fdb70 ("media: imx-pxp: add i.MX Pixel Pipeline driver") Reported-by: David Binderman <dcb314@hotmail.com> Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
* | media: vim2m: allow setting the default transaction time via parameterMauro Carvalho Chehab2019-01-311-5/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | While there's a control to allow setting it at runtime, as the control handler is per file handler, only the application setting the m2m device can change it. As this is a custom control, it is unlikely that existing apps would be able to set it. Due to that, and due to the fact that v4l2-mem2mem serializes all accesses to a m2m device, trying to setup two GStreamer v4l2videoconvert instance at the same time will cause frame drops. So, add an alternate way of setting its default via a modprobe parameter. Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
* | media: vim2m: use per-file handler work queueMauro Carvalho Chehab2019-01-311-19/+19
| | | | | | | | | | | | | | | | | | | | It doesn't make sense to have a per-device work queue, as the scheduler should be called per file handler. Having a single one causes failures if multiple streams are filtered by vim2m. So, move it to be inside the context structure. Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
* | media: vim2m: fix driver for it to handle different fourcc formatsMauro Carvalho Chehab2019-01-311-140/+240
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Despite vim2m is reporting that it supports RGB565BE and YUYV, that's not true. Right now, it just says that it supports both format, but it doesn't actually support them. Also, horizontal flip is not properly implemented. It sounds that it was designed to do a pseudo-horizontal flip using 8 tiles. Yet, as it doesn't do format conversion, the result is a mess. I suspect that it was done this way in order to save CPU time, at the time of OMAP2 days. That's messy and doesn't really help if someone wants to use vim2m to test a pipeline. Worse than that, the unique RGB format it says it supports is RGB565BE, with is not supported by Gstreamer. That prevents practical usage of it, even for tests. So, instead, properly implement fourcc format conversions, adding a few more RGB formats: - RGB and BGR with 24 bits - RGB565LE (known as RGB16 at gstreamer) Also allows using any of the 5 supported formats as either capture or output. Note: The YUYV conversion routines are based on the conversion code written by Hans de Goede inside libv4lconvert (part of v4l-utils), released under LGPGL 2.1 (GPL 2.0 compatible). Tested all possible format combinations except for RGB565BE, as Gstreamer currently doesn't support it. Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
* | media: vivid: fix vid_out_buf_prepare()Hans Verkuil2019-01-311-7/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | The wrong size check was performed for output formats like NV24 which set vfmt->buffers to 1, but vfmt->planes is 2. It was incorrectly checking the payload size for plane 1, which doesn't exist. Note: vfmt->buffers refers to the number of per-plane-buffers that should be allocated. vfmt->planes refers to the number of planes that make up an image. vfmt->planes may be > vfmt->buffers. Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
* | media: vivid: add buf_out_validate callbackHans Verkuil2019-01-311-7/+16
| | | | | | | | | | | | | | | | | | Validate the field for an output buffer. This ensures that the field is validated when the buffer is queued to a request, and not when the request itself is queued, which is too late. Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
* | media: vim2m: add buf_out_validate callbackHans Verkuil2019-01-311-11/+16
| | | | | | | | | | | | | | | | | | Validate the field for an output buffer. This ensures that the field is validated when the buffer is queued to a request, and not when the request itself is queued, which is too late. Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
* | media: mtk-vcodec: Using common interface to manage vdec/venc clockYunfei Dong2019-01-313-166/+132Star
| | | | | | | | | | | | | | | | | | | | | | | | | | Vdec: Using standard CCF interface to set parent clock and clock rate in dtsi and using common interface to open/close video decoder clock. Venc: Using standard CCF interface to set parent clock in dtsi and using common interface to open/close video encoder clock. Signed-off-by: Yunfei Dong <yunfei.dong@mediatek.com> Signed-off-by: Qianqian Yan <qianqian.yan@mediatek.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
* | media: vicodec: get_next_header is staticMauro Carvalho Chehab2019-01-261-1/+2
| | | | | | | | | | | | | | | | | | drivers/media/platform/vicodec/vicodec-core.c:drivers/media/platform/vicodec/vicodec-core.c:210:23: warning: symbol 'get_next_header' was not declared. Should it be static? drivers/media/platform/vicodec/vicodec-core.c:210:23: warning: no previous prototype for 'get_next_header' [-Wmissing-prototypes] enum vb2_buffer_state get_next_header(struct vicodec_ctx *ctx, u8 **pp, u32 sz) ^~~~~~~~~~~~~~~ Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
* | media: vicodec: ensure comp frame pointer kept in rangeDafna Hirschfeld2019-01-264-25/+60
| | | | | | | | | | | | | | | | | | Make sure that the pointer to the compressed frame does not get out of the buffer. Signed-off-by: Dafna Hirschfeld <dafna3@gmail.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
* | media: vicodec: Add support for resolution change event.Dafna Hirschfeld2019-01-261-68/+294
| | | | | | | | | | | | | | | | | | | | | | If the the queues are not streaming then the first resolution change is handled in the buf_queue callback. The following resolution change events are handled in job_ready. Signed-off-by: Dafna Hirschfeld <dafna3@gmail.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> [hverkuil-cisco@xs4all.nl: wrap info_from_header prototype] Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>