summaryrefslogtreecommitdiffstats
path: root/drivers/media/platform
Commit message (Collapse)AuthorAgeFilesLines
...
* | media: atmel-isc: Add support for BT656 with CRC decodingKen Sloat2019-03-192-1/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | The ISC driver currently supports ITU-R 601 encoding which utilizes the external hsync and vsync signals. ITU-R 656 format removes the need for these pins by embedding the sync pulses within the data packet. To support this feature, enable necessary register bits when this feature is enabled via device tree. Signed-off-by: Ken Sloat <ksloat@aampglobal.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
* | media: stm32-dcmi: fix DMA corruption when stopping streamingHugues Fruchet2019-03-191-0/+17
| | | | | | | | | | | | | | | | | | | | Avoid call of dmaengine_terminate_all() between dmaengine_prep_slave_single() and dmaengine_submit() by locking the whole DMA submission sequence. Signed-off-by: Hugues Fruchet <hugues.fruchet@st.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
* | media: stm32-dcmi: fix check of pm_runtime_get_sync return valueHugues Fruchet2019-03-191-3/+3
| | | | | | | | | | | | | | | | | | | | | | Start streaming was sometimes failing because of pm_runtime_get_sync() non-0 return value. In fact return value was not an error but a positive value (1), indicating that PM was already enabled. Fix this by going to error path only with negative return value. Signed-off-by: Hugues Fruchet <hugues.fruchet@st.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
* | media: platform/sh_veu.c: remove redundant NULL pointer checksShaobo He2019-03-191-6/+0Star
| | | | | | | | | | | | | | | | | | | | | | | | Function `sh_veu_find_fmt` returns an address that is an addition of a base pointer `sh_veu_fmt` and an offset. The base pointer refers to a global variable of which address cannot be NULL. Therefore, this commit removes the NULL pointer checks on the return values of function `sh_veu_find_fmt`. Signed-off-by: Shaobo He <shaobo@cs.utah.edu> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
* | media: mtk-vcodec: fix access to vb2_v4l2_buffer structAlexandre Courbot2019-03-191-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Commit 0650a91499e0 ("media: mtk-vcodec: Correct return type for mem2mem buffer helpers") fixed the return types for mem2mem buffer helper functions, but omitted two occurrences that are accessed in the mtk_v4l2_debug() macro. These only trigger compiler errors when DEBUG is defined. Fixes: 0650a91499e0 ("media: mtk-vcodec: Correct return type for mem2mem buffer helpers") Signed-off-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>
* | media: rcar-vin: Enable support for r8a774a1Biju Das2019-03-191-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | Add the SoC specific information for RZ/G2M(r8a774a1) SoC. The VIN module of RZ/G2M is similar to R-Car M3-W. Signed-off-by: Biju Das <biju.das@bp.renesas.com> Reviewed-by: Fabrizio Castro <fabrizio.castro@bp.renesas.com> Acked-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se> Reviewed-by: Simon Horman <horms+renesas@verge.net.au> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
* | media: rcar-csi2: Enable support for r8a774a1Biju Das2019-03-191-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | Add the MIPI CSI-2 driver support for RZ/G2M(r8a774a1) SoC. The CSI-2 module of RZ/G2M is similar to R-Car M3-W. Signed-off-by: Biju Das <biju.das@bp.renesas.com> Reviewed-by: Fabrizio Castro <fabrizio.castro@bp.renesas.com> Acked-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se> Reviewed-by: Simon Horman <horms+renesas@verge.net.au> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
* | media: rcar_drif: Remove devm_ioremap_resource() error printingGeert Uytterhoeven2019-03-191-5/+3Star
| | | | | | | | | | | | | | | | | | | | | | devm_ioremap_resource() already prints an error message on failure, so there is no need to repeat that. Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be> Reviewed-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se> Reviewed-by: Simon Horman <horms+renesas@verge.net.au> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
* | media: rcar-vin: Fix lockdep warning at stream onNiklas Söderlund2019-03-191-11/+32
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Changes to v4l2-fwnode in commit [1] triggered a lockdep warning in rcar-vin. The first attempt to solve this warning in the rcar-vin driver was incomplete and only pushed the warning to happen at stream on time instead of at probe time. This change reverts the incomplete fix and properly fixes the warning by removing the need to hold the rcar-vin specific group lock when calling v4l2_async_notifier_parse_fwnode_endpoints_by_port(). And instead takes it in the callback where it's really needed. [1] commit eae2aed1eab9bf08 ("media: v4l2-fwnode: Switch to v4l2_async_notifier_add_subdev") Fixes: 6458afc8c49148f0 ("media: rcar-vin: remove unneeded locking in async callbacks") Signed-off-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se> Reviewed-by: Kieran Bingham <kieran.bingham+renesas@ideasonboard.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
* | media: vimc: use new release opHans Verkuil2019-03-195-9/+46
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Use the new v4l2_subdev_internal_ops release op to free the subdev memory only when the last user closed the file handle. Move v4l2_device_unregister_subdev() to the end of the vimc_ent_sd_unregister() function since now the unregister_subdev() call may free the vimc_ent_device struct which is used after the unregister_subdev() call. So this now has to be done last. Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
* | media: vimc: free vimc_cap_device when the last user disappearsHans Verkuil2019-03-191-3/+10
| | | | | | | | | | | | | | | | | | | | | | Don't free vimc_cap_device immediately, instead do this in the video_device release function which is called when the last user closes the video device. Only then is it safe to free the memory. Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
* | media: vimc: zero the media_device on probeHans Verkuil2019-03-191-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | The media_device is part of a static global vimc_device struct. The media framework expects this to be zeroed before it is used, however, since this is a global this is not the case if vimc is unbound and then bound again. So call memset to ensure any left-over values are cleared. Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
* | media: vim2m: replace devm_kzalloc by kzallocHans Verkuil2019-03-191-13/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It is not possible to use devm_kzalloc since that memory is freed immediately when the device instance is unbound. Various objects like the video device may still be in use since someone has the device node open, and when that is closed it expects the memory to be around. So use kzalloc and release it at the appropriate time. Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
* | media: vivid: use vzalloc for dev->bitmap_outHans Verkuil2019-03-191-5/+9
|/ | | | | | | | | | When vivid is unloaded it used vfree to free dev->bitmap_out, but it was actually allocated using kmalloc. Use vzalloc instead, conform what vivid-vid-cap.c does. Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
* Merge tag 'devicetree-for-5.1' of ↵Linus Torvalds2019-03-101-0/+7
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | git://git.kernel.org/pub/scm/linux/kernel/git/robh/linux Pull Devicetree updates from Rob Herring: - Fix a unittest failure on UML. Preparation for converting to kunit test framework. - Add annotations to dtx_diff output - Fix unittest reporting of expected error - Move DMA configuration for virtual devices into the driver that needs it (s5p-mfc) - Vendor prefixes for feiyang and techstar - Convert ARM GIC, GICv3, and L2x0 to DT schema - Add r8a7778/9 HSCIF serial bindings * tag 'devicetree-for-5.1' of git://git.kernel.org/pub/scm/linux/kernel/git/robh/linux: of: unittest: unflatten device tree on UML when testing dt-bindings: Add vendor prefix for feiyang dt-bindings: Add vendor prefix for techstar dt-bindings: display: add missing semicolon in example of: mark early_init_dt_alloc_reserved_memory_arch static of: add dtc annotations functionality to dtx_diff of: unittest: add caution to function header comment of: unittest: remove report of expected error dt-bindings: interrupt-controller: Convert ARM GICv3 to json-schema dt-bindings: interrupt-controller: Convert ARM GIC to json-schema dt-bindings: arm: l2x0: Convert L2 cache to json-schema media: s5p-mfc: Fix memdev DMA configuration dt-bindings: serial: sh-sci: Document r8a7778/9 HSCIF bindings
| * media: s5p-mfc: Fix memdev DMA configurationRobin Murphy2019-01-221-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Having of_reserved_mem_device_init() forcibly reconfigure DMA for all callers, potentially overriding the work done by a bus-specific .dma_configure method earlier, is at best a bad idea and at worst actively harmful. If drivers really need virtual devices to own dma-coherent memory, they should explicitly configure those devices based on the appropriate firmware node as they create them. It looks like the only driver not passing in a proper OF platform device is s5p-mfc, so move the rogue of_dma_configure() call into that driver where it logically belongs. Reviewed-by: Marek Szyprowski <m.szyprowski@samsung.com> Acked-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org> Signed-off-by: Robin Murphy <robin.murphy@arm.com> Signed-off-by: Rob Herring <robh@kernel.org>
* | media: vim2m: Address some coding style issuesMauro Carvalho Chehab2019-03-011-24/+28
| | | | | | | | | | | | | | | | | | | | | | | | As we did lots of change at vim2m driver, let's take the opportunity and make checkpatch happier, addressing the errors/warnings that makes sense. While here, increment driver's version. No functional changes. Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
* | media: vim2m: don't use BUG()Mauro Carvalho Chehab2019-03-011-4/+16
| | | | | | | | | | | | | | | | There's no reason why this driver should use BUG(). Instead, just properly handle issue, returning an error code where pertinent. Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
* | media: vim2m: speedup passthrough copyMauro Carvalho Chehab2019-03-011-20/+17Star
| | | | | | | | | | | | | | When in passthrough mode, copy the entire line at once, in order to make it faster (if not HFLIP). Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
* | media: vim2m: add an horizontal scalerMauro Carvalho Chehab2019-03-011-41/+55
| | | | | | | | | | | | | | Add an horizontal linear scaler using Breseham algorithm in order to speep up its calculus. Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
* | media: vim2m: don't accept YUYV anymore as output formatMauro Carvalho Chehab2019-03-011-55/+2Star
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Handling any Y,Cr,Cb formats require some extra logic, as it handles a group of two pixels. That's easy while we don't do horizontal scaling. However, doing horizontal scaling with such formats would require a lot more code, in order to avoid distortions, as, if it scales to two non-consecutive points, the logic would need to read 4 points in order to properly convert to RGB. As this is just a test driver, and we want fast algorithms, let's just get rid of this format as an output one. Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
* | media: vim2m: add vertical linear scalerMauro Carvalho Chehab2019-03-011-34/+33Star
| | | | | | | | | | | | | | When resolutions are different, the expected behavior is to scale the image. Implement a vertical scaler as the first step. Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
* | media: vim2m: better handle cap/out buffers with different sizesMauro Carvalho Chehab2019-03-011-36/+78
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The vim2m driver doesn't enforce that the capture and output buffers would have the same size. Do the right thing if the buffers are different, zeroing the buffer before writing, ensuring that lines will be aligned and it won't write past the buffer area. This is a temporary fix. A proper fix is to either implement a simple scaler at vim2m, or to better define the behaviour of M2M transform drivers at V4L2 API with regards to its capability of scaling the image or not. In any case, such changes would deserve a separate patch anyway, as it would imply on some behavoral change. Also, as we have an actual bug of writing data at wrong places, let's fix this here, and add a mental note that we need to properly address it. Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
* | media: vim2m: use different framesizes for bayer formatsMauro Carvalho Chehab2019-03-011-4/+34
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The only real restriction at vim2m is that width should be multiple of two, as the copy routine always copy two pixels each time. However, Bayer formats are defined as having a 2x2 matrix. So, odd vertical numbers would cause color distortions at the last line. So, it makes sense to use step 2 for vertical alignment on Bayer. With this patch, the reported formats for video capture will be: [0]: 'RGBP' (16-bit RGB 5-6-5) Size: Stepwise 32x32 - 640x480 with step 2/1 [1]: 'RGBR' (16-bit RGB 5-6-5 BE) Size: Stepwise 32x32 - 640x480 with step 2/1 [2]: 'RGB3' (24-bit RGB 8-8-8) Size: Stepwise 32x32 - 640x480 with step 2/1 [3]: 'BGR3' (24-bit BGR 8-8-8) Size: Stepwise 32x32 - 640x480 with step 2/1 [4]: 'YUYV' (YUYV 4:2:2) Size: Stepwise 32x32 - 640x480 with step 2/1 [5]: 'BA81' (8-bit Bayer BGBG/GRGR) Size: Stepwise 32x32 - 640x480 with step 2/2 [6]: 'GBRG' (8-bit Bayer GBGB/RGRG) Size: Stepwise 32x32 - 640x480 with step 2/2 [7]: 'GRBG' (8-bit Bayer GRGR/BGBG) Size: Stepwise 32x32 - 640x480 with step 2/2 [8]: 'RGGB' (8-bit Bayer RGRG/GBGB) Size: Stepwise 32x32 - 640x480 with step 2/2 Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
* | media: vim2m: add support for VIDIOC_ENUM_FRAMESIZESMauro Carvalho Chehab2019-03-011-9/+29
| | | | | | | | | | | | As we do alignments for width, expose it via V4L2 API. Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
* | media: vim2m: ensure that width is multiple of twoMauro Carvalho Chehab2019-03-011-1/+1
| | | | | | | | | | | | | | | | | | | | The copy logic assumes that the data width is multiple of two, as this is needed in order to support YUYV. There's no reason to force it to be 8-pixel aligned, as 2-pixel alignment is enough. Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
* | media: vim2m: improve debug messagesMauro Carvalho Chehab2019-03-011-15/+35
| | | | | | | | | | | | | | | | | | | | | | 1) Use two levels for debug: - level 1: setup stuff - level 2: add queue/dequeue messages 2) Better display the debug output, translating buffer type, fourcc and making some messages clearer. Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
* | media: vim2m: add bayer capture formatsMauro Carvalho Chehab2019-03-011-7/+97
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The vim2m device is interesting to simulate a webcam. As most sensors are arranged using bayer formats, the best is to support to output data using those formats. So, add support for them. All 4 8-bit bayer formats tested with: $ qvidcap -p & $ v4l2-ctl --stream-mmap --stream-out-mmap --stream-to-host localhost --stream-lossless --stream-out-hor-speed 1 -v pixelformat=RGGB It was tested also with GStreamer with: $ gst-validate-1.0 filesrc location=some_video.mp4 ! qtdemux ! avdec_h264 ! videoconvert ! videoscale ! v4l2convert disable-passthrough=1 extra-controls="s,horizontal_flip=0,vertical_flip=0" ! bayer2rgb ! videoconvert ! xvimagesink For all possible HFLIP/VFLIP values. Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
* | media: a few more typos at staging, pci, platform, radio and usbMauro Carvalho Chehab2019-03-011-1/+1
| | | | | | | | | | | | | | | | Those typos were left over from codespell check, on my first pass or belong to code added after the time I ran it. Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
* | 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>