aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/platform (follow)
AgeCommit message (Collapse)AuthorFilesLines
2019-01-16media: vim2m: only cancel work if it is for right contextHans Verkuil1-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>
2019-01-08cross-tree: phase out dma_zalloc_coherent()Luis Chamberlain1-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>
2018-12-28mm: convert totalram_pages and totalhigh_pages variables to atomicArun KS1-1/+1
totalram_pages and totalhigh_pages are made static inline function. Main motivation was that managed_page_count_lock handling was complicating things. It was discussed in length here, https://lore.kernel.org/patchwork/patch/995739/#1181785 So it seemes better to remove the lock and convert variables to atomic, with preventing poteintial store-to-read tearing as a bonus. [akpm@linux-foundation.org: coding style fixes] Link: http://lkml.kernel.org/r/1542090790-21750-4-git-send-email-arunks@codeaurora.org Signed-off-by: Arun KS <arunks@codeaurora.org> Suggested-by: Michal Hocko <mhocko@suse.com> Suggested-by: Vlastimil Babka <vbabka@suse.cz> Reviewed-by: Konstantin Khlebnikov <khlebnikov@yandex-team.ru> Reviewed-by: Pavel Tatashin <pasha.tatashin@soleen.com> Acked-by: Michal Hocko <mhocko@suse.com> Acked-by: Vlastimil Babka <vbabka@suse.cz> Cc: David Hildenbrand <david@redhat.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2018-12-17Merge tag 'v4.20-rc7' into patchworkMauro Carvalho Chehab7-14/+11
Linux 4.20-rc7 * tag 'v4.20-rc7': (403 commits) Linux 4.20-rc7 scripts/spdxcheck.py: always open files in binary mode checkstack.pl: fix for aarch64 userfaultfd: check VM_MAYWRITE was set after verifying the uffd is registered fs/iomap.c: get/put the page in iomap_page_create/release() hugetlbfs: call VM_BUG_ON_PAGE earlier in free_huge_page() memblock: annotate memblock_is_reserved() with __init_memblock psi: fix reference to kernel commandline enable arch/sh/include/asm/io.h: provide prototypes for PCI I/O mapping in asm/io.h mm/sparse: add common helper to mark all memblocks present mm: introduce common STRUCT_PAGE_MAX_SHIFT define alpha: fix hang caused by the bootmem removal XArray: Fix xa_alloc when id exceeds max drm/vmwgfx: Protect from excessive execbuf kernel memory allocations v3 MAINTAINERS: Daniel for drm co-maintainer drm/amdgpu: drop fclk/gfxclk ratio setting IB/core: Fix oops in netdev_next_upper_dev_rcu() dm thin: bump target version drm/vmwgfx: remove redundant return ret statement drm/i915: Flush GPU relocs harder for gen3 ...
2018-12-12media: platform: Add Aspeed Video Engine driverEddie James3-0/+1739
The Video Engine (VE) embedded in the Aspeed AST2400 and AST2500 SOCs can capture and compress video data from digital or analog sources. With the Aspeed chip acting a service processor, the Video Engine can capture the host processor graphics output. Add a V4L2 driver to capture video data and compress it to JPEG images. Make the video frames available through the V4L2 streaming interface. Signed-off-by: Eddie James <eajames@linux.ibm.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
2018-12-07media: vimc: fix start stream when link is disabledHelen Fornazier1-0/+2
If link is disabled, media_entity_remote_pad returns NULL, causing a NULL pointer deference. Ignore links that are not enabled instead. Signed-off-by: Helen Koike <helen.koike@collabora.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
2018-12-07media: vivid: Improve timestampingGabriel Francisco Mandaji3-18/+40
Simulate a more precise timestamp by calculating it based on the current framerate. Signed-off-by: Gabriel Francisco Mandaji <gfmandaji@gmail.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> [hverkuil-cisco@xs4all.nl: replaced division by 2 with bit shift] Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
2018-12-07media: rcar-vin: add R8A77980 supportSergei Shtylyov1-0/+32
Add the R8A77980 SoC support to the R-Car VIN driver. Signed-off-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com> Acked-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
2018-12-07media: rcar-csi2: add R8A77980 supportSergei Shtylyov1-0/+11
Add the R-Car V3H (AKA R8A77980) SoC support to the R-Car CSI2 driver. Signed-off-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com> Acked-by: Rob Herring <robh@kernel.org> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
2018-12-07media: Use of_node_name_eq for node name comparisonsRob Herring3-9/+9
Convert string compares of DT node names to use of_node_name_eq helper instead. This removes direct access to the node name pointer. Cc: Kyungmin Park <kyungmin.park@samsung.com> Cc: Kukjin Kim <kgene@kernel.org> Cc: Krzysztof Kozlowski <krzk@kernel.org> Cc: Hyun Kwon <hyun.kwon@xilinx.com> Cc: Michal Simek <michal.simek@xilinx.com> Cc: linux-arm-kernel@lists.infradead.org Cc: linux-samsung-soc@vger.kernel.org Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Benoit Parrot <bparrot@ti.com> Signed-off-by: Rob Herring <robh@kernel.org> Reviewed-by: Sylwester Nawrocki <s.nawrocki@samsung.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
2018-12-07media: venus: core: Set dma maximum segment sizeVivek Gautam1-0/+8
Turning on CONFIG_DMA_API_DEBUG_SG results in the following error: [ 460.308650] ------------[ cut here ]------------ [ 460.313490] qcom-venus aa00000.video-codec: DMA-API: mapping sg segment longer than device claims to support [len=4194304] [max=65536] [ 460.326017] WARNING: CPU: 3 PID: 3555 at src/kernel/dma/debug.c:1301 debug_dma_map_sg+0x174/0x254 [ 460.338888] Modules linked in: venus_dec venus_enc videobuf2_dma_sg videobuf2_memops hci_uart btqca bluetooth venus_core v4l2_mem2mem videobuf2_v4l2 videobuf2_common ath10k_snoc ath10k_core ath lzo lzo_compress zramjoydev [ 460.375811] CPU: 3 PID: 3555 Comm: V4L2DecoderThre Tainted: G W 4.19.1 #82 [ 460.384223] Hardware name: Google Cheza (rev1) (DT) [ 460.389251] pstate: 60400009 (nZCv daif +PAN -UAO) [ 460.394191] pc : debug_dma_map_sg+0x174/0x254 [ 460.398680] lr : debug_dma_map_sg+0x174/0x254 [ 460.403162] sp : ffffff80200c37d0 [ 460.406583] x29: ffffff80200c3830 x28: 0000000000010000 [ 460.412056] x27: 00000000ffffffff x26: ffffffc0f785ea80 [ 460.417532] x25: 0000000000000000 x24: ffffffc0f4ea1290 [ 460.423001] x23: ffffffc09e700300 x22: ffffffc0f4ea1290 [ 460.428470] x21: ffffff8009037000 x20: 0000000000000001 [ 460.433936] x19: ffffff80091b0000 x18: 0000000000000000 [ 460.439411] x17: 0000000000000000 x16: 000000000000f251 [ 460.444885] x15: 0000000000000006 x14: 0720072007200720 [ 460.450354] x13: ffffff800af536e0 x12: 0000000000000000 [ 460.455822] x11: 0000000000000000 x10: 0000000000000000 [ 460.461288] x9 : 537944d9c6c48d00 x8 : 537944d9c6c48d00 [ 460.466758] x7 : 0000000000000000 x6 : ffffffc0f8d98f80 [ 460.472230] x5 : 0000000000000000 x4 : 0000000000000000 [ 460.477703] x3 : 000000000000008a x2 : ffffffc0fdb13948 [ 460.483170] x1 : ffffffc0fdb0b0b0 x0 : 000000000000007a [ 460.488640] Call trace: [ 460.491165] debug_dma_map_sg+0x174/0x254 [ 460.495307] vb2_dma_sg_alloc+0x260/0x2dc [videobuf2_dma_sg] [ 460.501150] __vb2_queue_alloc+0x164/0x374 [videobuf2_common] [ 460.507076] vb2_core_reqbufs+0xfc/0x23c [videobuf2_common] [ 460.512815] vb2_reqbufs+0x44/0x5c [videobuf2_v4l2] [ 460.517853] v4l2_m2m_reqbufs+0x44/0x78 [v4l2_mem2mem] [ 460.523144] v4l2_m2m_ioctl_reqbufs+0x1c/0x28 [v4l2_mem2mem] [ 460.528976] v4l_reqbufs+0x30/0x40 [ 460.532480] __video_do_ioctl+0x36c/0x454 [ 460.536610] video_usercopy+0x25c/0x51c [ 460.540572] video_ioctl2+0x38/0x48 [ 460.544176] v4l2_ioctl+0x60/0x74 [ 460.547602] do_video_ioctl+0x948/0x3520 [ 460.551648] v4l2_compat_ioctl32+0x60/0x98 [ 460.555872] __arm64_compat_sys_ioctl+0x134/0x20c [ 460.560718] el0_svc_common+0x9c/0xe4 [ 460.564498] el0_svc_compat_handler+0x2c/0x38 [ 460.568982] el0_svc_compat+0x8/0x18 [ 460.572672] ---[ end trace ce209b87b2f3af88 ]--- >From above warning one would deduce that the sg segment will overflow the device's capacity. In reality, the hardware can accommodate larger sg segments. So, initialize the max segment size properly to weed out this warning. Based on a similar patch sent by Sean Paul for mdss: https://patchwork.kernel.org/patch/10671457/ Signed-off-by: Vivek Gautam <vivek.gautam@codeaurora.org> Acked-by: Stanimir Varbanov <stanimir.varbanov@linaro.org> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
2018-12-07media: venus: Support V4L2 QP parameters in Venus encoderKelvin Lawson1-0/+19
Support V4L2 QP parameters in Venus encoder: * V4L2_CID_MPEG_VIDEO_H264_I_FRAME_QP * V4L2_CID_MPEG_VIDEO_H264_B_FRAME_QP * V4L2_CID_MPEG_VIDEO_H264_MIN_QP * V4L2_CID_MPEG_VIDEO_H264_MAX_QP Signed-off-by: Kelvin Lawson <klawson@lisden.com> Acked-by: Stanimir Varbanov <stanimir.varbanov@linaro.org> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
2018-12-07media: marvell-ccic: trivial fix to the datasheet URLLubomir Rintel1-1/+1
Update URL. Signed-off-by: Lubomir Rintel <lkundrak@v3.sk> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
2018-12-07media: sun6i: fix spelling mistake "droped" -> "dropped"Colin Ian King1-2/+2
There are spelling mistakes in dev_dbg messages, fix them. Signed-off-by: Colin Ian King <colin.king@canonical.com> 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>
2018-12-07media: coda: fix H.264 deblocking filter controlsPhilipp Zabel4-22/+20
Add support for the third loop filter mode V4L2_MPEG_VIDEO_H264_LOOP_FILTER_MODE_DISABLED_AT_SLICE_BOUNDARY, and fix V4L2_CID_MPEG_VIDEO_H264_LOOP_FILTER_ALPHA and V4L2_CID_MPEG_VIDEO_H264_LOOP_FILTER_BETA controls. The filter offset controls are signed values in the -6 to 6 range and are stored into the slice header fields slice_alpha_c0_offset_div2 and slice_beta_offset_div2. The actual filter offsets FilterOffsetA/B are double their value, in range of -12 to 12. Rename variables to more closely match the nomenclature in the H.264 specification. 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>
2018-12-07media: venus: add support for key frameMalathi Gottam1-1/+18
When client requests for a keyframe, set the property to hardware to generate the sync frame. Signed-off-by: Malathi Gottam <mgottam@codeaurora.org> Acked-by: Tomasz Figa <tfiga@chromium.org> Acked-by: Stanimir Varbanov <stanimir.varbanov@linaro.org> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
2018-12-05Merge commit '0072a0c14d5b7cb72c611d396f143f5dcd73ebe2' into patchworkMauro Carvalho Chehab1-1/+2
Merge from Upstream after the latest media fixes branch, because we need one patch that it is there. * commit '0072a0c14d5b7cb72c611d396f143f5dcd73ebe2': (1108 commits) ide: Change to use DEFINE_SHOW_ATTRIBUTE macro ide: pmac: add of_node_put() drivers/tty: add missing of_node_put() drivers/sbus/char: add of_node_put() sbus: char: add of_node_put() Linux 4.20-rc5 PCI: Fix incorrect value returned from pcie_get_speed_cap() MAINTAINERS: Update linux-mips mailing list address ocfs2: fix potential use after free mm/khugepaged: fix the xas_create_range() error path mm/khugepaged: collapse_shmem() do not crash on Compound mm/khugepaged: collapse_shmem() without freezing new_page mm/khugepaged: minor reorderings in collapse_shmem() mm/khugepaged: collapse_shmem() remember to clear holes mm/khugepaged: fix crashes due to misaccounted holes mm/khugepaged: collapse_shmem() stop if punched or truncated mm/huge_memory: fix lockdep complaint on 32-bit i_size_read() mm/huge_memory: splitting set mapping+index before unfreeze mm/huge_memory: rename freeze_page() to unmap_page() initramfs: clean old path before creating a hardlink ...
2018-12-05media: vicodec: Change variable namesDafna Hirschfeld1-46/+48
Change variables names in vicodec-core.c to *_src *_dst to improve readability 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>
2018-12-05media: sti/bdisp: don't pass GFP_DMA32 to dma_alloc_attrsChristoph Hellwig1-1/+1
The DMA API does its own zone decisions based on the coherent_dma_mask. Signed-off-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Benjamin Gaignard <benjamin.gaignard@linaro.org> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
2018-12-05media: imx-pxp: remove duplicated include from imx-pxp.cYueHaibing1-1/+0
Remove duplicated include. Signed-off-by: YueHaibing <yuehaibing@huawei.com> Acked-by: Philipp Zabel <p.zabel@pengutronix.de> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
2018-12-03media: seco-cec: add missing header file to fix buildRandy Dunlap1-0/+1
Fix build errors due to missing <linux/module.h> header file. The header file is inserted first because module-related errors begin showing up in <linux/acpi.h> (when CONFIG_ACPI is not set). Sample of build errors: In file included from ../include/linux/acpi.h:27:0, from ../drivers/media/platform/seco-cec/seco-cec.c:10: ../include/linux/device.h:1620:1: warning: data definition has no type or storage class [enabled by default] module_exit(__driver##_exit); ^ ../include/linux/platform_device.h:229:2: note: in expansion of macro 'module_driver' module_driver(__platform_driver, platform_driver_register, \ ^ ../drivers/media/platform/seco-cec/seco-cec.c:791:1: note: in expansion of macro 'module_platform_driver' module_platform_driver(secocec_driver); ^ ../include/linux/device.h:1620:1: error: type defaults to 'int' in declaration of 'module_exit' [-Werror=implicit-int] module_exit(__driver##_exit); ^ ../include/linux/platform_device.h:229:2: note: in expansion of macro 'module_driver' module_driver(__platform_driver, platform_driver_register, \ ^ ../drivers/media/platform/seco-cec/seco-cec.c:791:1: note: in expansion of macro 'module_platform_driver' module_platform_driver(secocec_driver); ^ In file included from ../include/linux/linkage.h:7:0, from ../include/linux/kernel.h:7, from ../include/linux/list.h:9, from ../include/linux/resource_ext.h:17, from ../include/linux/acpi.h:26, from ../drivers/media/platform/seco-cec/seco-cec.c:10: ../include/linux/export.h:18:30: warning: parameter names (without types) in function declaration [enabled by default] #define THIS_MODULE ((struct module *)0) ^ ../include/linux/platform_device.h:199:34: note: in expansion of macro 'THIS_MODULE' __platform_driver_register(drv, THIS_MODULE) ^ ../include/linux/device.h:1613:9: note: in expansion of macro 'platform_driver_register' return __register(&(__driver) , ##__VA_ARGS__); \ ^ ../include/linux/platform_device.h:229:2: note: in expansion of macro 'module_driver' module_driver(__platform_driver, platform_driver_register, \ ^ ../drivers/media/platform/seco-cec/seco-cec.c:791:1: note: in expansion of macro 'module_platform_driver' module_platform_driver(secocec_driver); ^ ../drivers/media/platform/seco-cec/seco-cec.c:793:20: error: expected declaration specifiers or '...' before string constant MODULE_DESCRIPTION("SECO CEC X86 Driver"); ^ ../drivers/media/platform/seco-cec/seco-cec.c:794:15: error: expected declaration specifiers or '...' before string constant MODULE_AUTHOR("Ettore Chimenti <ek5.chimenti@gmail.com>"); ^ ../drivers/media/platform/seco-cec/seco-cec.c:795:16: error: expected declaration specifiers or '...' before string constant MODULE_LICENSE("Dual BSD/GPL"); ^ In file included from ../include/linux/acpi.h:27:0, from ../drivers/media/platform/seco-cec/seco-cec.c:10: ../drivers/media/platform/seco-cec/seco-cec.c:791:24: warning: 'secocec_driver_init' defined but not used [-Wunused-function] module_platform_driver(secocec_driver); ^ ../include/linux/device.h:1611:19: note: in definition of macro 'module_driver' static int __init __driver##_init(void) \ ^ ../drivers/media/platform/seco-cec/seco-cec.c:791:1: note: in expansion of macro 'module_platform_driver' module_platform_driver(secocec_driver); Signed-off-by: Randy Dunlap <rdunlap@infradead.org> Cc: Ettore Chimenti <ek5.chimenti@gmail.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
2018-12-03media: vicodec: set state resolution from raw formatHans Verkuil1-3/+10
The state structure contains the resolution expected by the decoder and encoder. For an encoder that resolution should be taken from the OUTPUT format, and for a decoder from the CAPTURE format. If the wrong format is picked, a buffer overrun can occur if there is a mismatch between the CAPTURE and OUTPUT formats. The real fix would be to correctly implement the stateful codec specification, but that will take more time. For now just prevent the buffer overrun. Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
2018-12-03media: vivid: drop v4l2_ctrl_request_complete() from start_streamingHans Verkuil5-10/+0
If start_streaming() fails and all queued buffers are returned to vb2, then do not call v4l2_ctrl_request_complete(). Nothing happened to the request and the state should remain as it was before start_streaming was called. Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> 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>
2018-12-03media: vsp1: Fix LIF buffer thresholdsLaurent Pinchart1-1/+1
Commit de2bc45c84f7 ("media: vsp1: Update LIF buffer thresholds") updated the LIF buffer thresholds based on the VSP version, but used the wrong model mask. This resulted in all VSP instances to be treated as a Gen3 VSPD, breaking operation on all Gen2 platforms as well as on H3 ES2.0, M3-N, V3M and V3H. Fix it. Fixes: de2bc45c84f7 ("media: vsp1: Update LIF buffer thresholds") Reported-by: Colin Ian King <colin.king@canonical.com> Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> Reviewed-by: Kieran Bingham <kieran.bingham+renesas@ideasonboard.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
2018-12-03media: vicodec: move the GREY format to the end of the listHans Verkuil1-2/+1
With the GREY format at the beginning, the default format selected by vicodec would be GREY instead of YUV420. That didn't make sense, so move it to the end of the list. Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
2018-12-03media: vivid: add req_validate error injectionHans Verkuil3-1/+29
Add a new vivid button control to inject an error into the req_validate request callback. This will help testing with v4l2-compliance. Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
2018-12-03media: DaVinci-VPBE: fix error handling in vpbe_initialize()Alexey Khoroshilov1-2/+5
If vpbe_set_default_output() or vpbe_set_default_mode() fails, vpbe_initialize() returns error code without releasing resources. The patch adds error handling for that case. Found by Linux Driver Verification project (linuxtesting.org). Signed-off-by: Alexey Khoroshilov <khoroshilov@ispras.ru> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
2018-12-03media: vivid: fix smatch warningsHans Verkuil2-6/+19
Reorganize code to fix two smatch warnings: drivers/media/platform/vivid/vivid-core.c: drivers/media/platform/vivid/vivid-core.c:889 vivid_create_instance() warn: potentially one past the end of array 'dev->query_dv_timings_qmenu[dev->query_dv_timings_size]' drivers/media/platform/vivid/vivid-core.c: drivers/media/platform/vivid/vivid-core.c:889 vivid_create_instance() warn: potentially one past the end of array 'dev->query_dv_timings_qmenu[dev->query_dv_timings_size]' Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
2018-12-03media: mtk-vcodec: Remove VA from encoder frame buffersTomasz Figa3-6/+7
The encoder driver has no need to do any CPU access to the source frame buffers. Use a separate structure for holding DMA addresses and sizes for those and remove, so we do not end up introducing any erroneous dereferences of those VAs. This fixes DMA-buf import from exporters that do not provide contiguous kernel mappings, which includes the MTK DRM driver. Signed-off-by: Tomasz Figa <tfiga@chromium.org> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
2018-12-03media: camss: Take in account sensor skip framesTodor Tomov3-6/+20
When streaming is starting ask the sensor for its skip frames value. Max supported frame skip is 29 frames, so clip it if it is higher. Signed-off-by: Todor Tomov <todor.tomov@linaro.org> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
2018-12-03media: exynos4-is: fix spelling mistake ACTURATOR -> ACTUATORColin Ian King2-3/+3
Trivial fix to spelling mistake in macro name and text string ERROR_SENSOR_ACTURATOR_INIT_FAIL -> ERROR_SENSOR_ACTUATOR_INIT_FAIL 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>
2018-12-03media: xilinx: fix typo in formats tableAndrea Merello1-1/+1
In formats table the entry for CFA pattern "rggb" has GRBG fourcc. This patch fixes it. Signed-off-by: Mirco Di Salvo <mirco.disalvo@iit.it> Signed-off-by: Andrea Merello <andrea.merello@gmail.com> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
2018-12-03media: xilinx: Use SPDX-License-IdentifierDhaval Shah11-36/+13
SPDX-License-Identifier is used for the Xilinx Video IP and related drivers. [Added drivers/media/platform/xilinx/Kconfig] [Added drivers/media/platform/xilinx/Makefile] [Added include/dt-bindings/media/xilinx-vip.h] Signed-off-by: Dhaval Shah <dhaval23031987@gmail.com> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Acked-by: Michal Simek <michal.simek@xilinx.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
2018-12-03media: venus: fix reported size of 0-length buffersAlexandre Courbot1-3/+1
The last buffer is often signaled by an empty buffer with the V4L2_BUF_FLAG_LAST flag set. Such buffers were returned with the bytesused field set to the full size of the OPB, which leads user-space to believe that the buffer actually contains useful data. Fix this by passing the number of bytes reported used by the firmware. Signed-off-by: Alexandre Courbot <acourbot@chromium.org> Acked-by: Stanimir Varbanov <stanimir.varbanov@linaro.org> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
2018-12-03media: venus: dynamic handling of bitrateMalathi Gottam1-0/+15
Any request for a change in bitrate after both planes are streamed on is handled by setting the target bitrate property to hardware. Signed-off-by: Malathi Gottam <mgottam@codeaurora.org> Acked-by: Stanimir Varbanov <stanimir.varbanov@linaro.org> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
2018-11-27media: venus: handle peak bitrate set propertyMalathi Gottam2-1/+3
Max bitrate property is not supported for venus version 4xx. Return unsupported from packetization layer. Handle it in hfi_venus layer to exit gracefully to venc layer. Signed-off-by: Malathi Gottam <mgottam@codeaurora.org> Tested-by: Alexandre Courbot <acourbot@chromium.org> Acked-by: Stanimir Varbanov <stanimir.varbanov@linaro.org> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
2018-11-27media: venus: add support for USERPTR to queueMalathi Gottam1-2/+2
Add USERPTR to queue access methods by adding this support to io_modes on both the planes. Signed-off-by: Malathi Gottam <mgottam@codeaurora.org> Tested-by: Alexandre Courbot <acourbot@chromium.org> Acked-by: Stanimir Varbanov <stanimir.varbanov@linaro.org> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
2018-11-23media: seco-cec: declare ops as static constMauro Carvalho Chehab1-1/+1
As warned by smatch: drivers/media/platform/seco-cec/seco-cec.c:338:21: warning: symbol 'secocec_cec_adap_ops' was not declared. Should it be static? This struct should be static. Also, it is const, so declare it as such. Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
2018-11-23media: seco-cec: fix MakefileHans Verkuil1-1/+1
Fix the incorrect obj-y. Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
2018-11-23media: venus: firmware: add no TZ boot and shutdown routineVikash Garodia5-7/+97
Video hardware is mainly comprised of vcodec subsystem and video control subsystem. Video control has ARM9 which executes the video firmware instructions whereas vcodec does the video frame processing. This change adds support to load the video firmware and bring ARM9 out of reset for platforms which does not have trustzone. An iommu domain is associated and managed with the firmware device. Signed-off-by: Vikash Garodia <vgarodia@codeaurora.org> Acked-by: Stanimir Varbanov <stanimir.varbanov@linaro.org> Reviewed-by: Alexandre Courbot <acourbot@chromium.org> Tested-by: Alexandre Courbot <acourbot@chromium.org> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
2018-11-23media: venus: firmware: register separate platform_device for firmware loaderStanimir Varbanov4-4/+70
This registers a firmware platform_device and associate it with video-firmware DT subnode. Then calls dma configure to initialize dma and iommu. Signed-off-by: Stanimir Varbanov <stanimir.varbanov@linaro.org> Reviewed-by: Alexandre Courbot <acourbot@chromium.org> Tested-by: Alexandre Courbot <acourbot@chromium.org> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
2018-11-23media: venus: firmware: move load firmware in a separate functionVikash Garodia3-23/+38
Separate firmware loading part into a new function. Signed-off-by: Vikash Garodia <vgarodia@codeaurora.org> Acked-by: Stanimir Varbanov <stanimir.varbanov@linaro.org> Reviewed-by: Alexandre Courbot <acourbot@chromium.org> Tested-by: Alexandre Courbot <acourbot@chromium.org> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
2018-11-23media: venus: firmware: add routine to reset ARM9Vikash Garodia5-9/+57
Add routine to reset the ARM9 and brings it out of reset. Also abstract the Venus CPU state handling with a new function. This is in preparation to add PIL functionality in venus driver. Signed-off-by: Vikash Garodia <vgarodia@codeaurora.org> Acked-by: Stanimir Varbanov <stanimir.varbanov@linaro.org> Reviewed-by: Alexandre Courbot <acourbot@chromium.org> Tested-by: Alexandre Courbot <acourbot@chromium.org> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
2018-11-23media: vivid: free bitmap_cap when updating std/timings/etc.Hans Verkuil1-0/+2
When vivid_update_format_cap() is called it should free any overlay bitmap since the compose size will change. Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Reported-by: syzbot+0cc8e3cc63ca373722c6@syzkaller.appspotmail.com Cc: <stable@vger.kernel.org> # for v3.18 and up Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
2018-11-23media: vim2m: use cancel_delayed_work_sync instead of flush_schedule_workHans Verkuil1-1/+2
The use of flush_schedule_work() made no sense and caused a syzkaller error. Replace with the correct cancel_delayed_work_sync(). Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Reported-by: syzbot+69780d144754b8071f4b@syzkaller.appspotmail.com Cc: <stable@vger.kernel.org> # for v4.20 and up Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
2018-11-23media: vivid: fill in media_device bus_infoHans Verkuil1-0/+2
If you create multiple vivid instances, each with their own media device, then there was no way to tell them apart. Fill in the bus_info so each instance has a unique bus_info string. Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
2018-11-23media: rockchip/rga: constify video_device structureJulia Lawall1-1/+1
The video_device structure is only copied into another structure, so it can be const. Done with the help of Coccinelle. Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
2018-11-23media: vivid: set min width/height to a value > 0Hans Verkuil1-1/+1
The capture DV timings capabilities allowed for a minimum width and height of 0. So passing a timings struct with 0 values is allowed and will later cause a division by zero. Ensure that the width and height must be >= 16 to avoid this. Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Reported-by: syzbot+57c3d83d71187054d56f@syzkaller.appspotmail.com Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
2018-11-23media: vivid: fix error handling of kthread_runHans Verkuil2-2/+8
kthread_run returns an error pointer, but elsewhere in the code dev->kthread_vid_cap/out is checked against NULL. If kthread_run returns an error, then set the pointer to NULL. I chose this method over changing all kthread_vid_cap/out tests elsewhere since this is more robust. Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Reported-by: syzbot+53d5b2df0d9744411e2e@syzkaller.appspotmail.com Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
2018-11-23media: vimc: constify structures stored in fields of v4l2_subdev_ops structureJulia Lawall1-1/+1
The fields of a v4l2_subdev_ops structure are all const, so the structures that are stored there and are not used elsewhere can be const as well. Done with the help of Coccinelle. Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr> Acked-by: Helen Koike <helen.koike@collabora.com> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>