aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media (follow)
AgeCommit message (Collapse)AuthorFilesLines
2021-04-06media: venus: hfi_parser: Check for instance after hfi platform getStanimir Varbanov1-3/+3
The inst function argument is != NULL only for Venus v1 and we did not migrate v1 to a hfi_platform abstraction yet. So check for instance != NULL only after hfi_platform_get returns no error. Fixes: e29929266be1 ("media: venus: Get codecs and capabilities from hfi platform") Cc: stable@vger.kernel.org # v5.12 Signed-off-by: Stanimir Varbanov <stanimir.varbanov@linaro.org> Tested-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2021-04-06media: venus: hfi_parser: Don't initialize parser on v1Stanimir Varbanov1-2/+4
The Venus v1 behaves differently comparing with the other Venus version in respect to capability parsing and when they are send to the driver. So we don't need to initialize hfi parser for multiple invocations like what we do for > v1 Venus versions. Fixes: 10865c98986b ("media: venus: parser: Prepare parser for multiple invocations") Cc: stable@vger.kernel.org # v5.10+ Signed-off-by: Stanimir Varbanov <stanimir.varbanov@linaro.org> Tested-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2021-04-06media: venus: venc: Add support for Long Term Reference (LTR) controlsDikshita Agarwal3-1/+57
Add support for below LTR controls in encoder: - V4L2_CID_MPEG_VIDEO_LTR_COUNT - V4L2_CID_MPEG_VIDEO_FRAME_LTR_INDEX - V4L2_CID_MPEG_VIDEO_USE_LTR_FRAMES Signed-off-by: Dikshita Agarwal <dikshita@codeaurora.org> Signed-off-by: Stanimir Varbanov <stanimir.varbanov@linaro.org> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2021-04-06media: v4l2-ctrl: add controls for long term reference.Dikshita Agarwal1-0/+14
Long Term Reference (LTR) frames are the frames that are encoded sometime in the past and stored in the DPB buffer list to be used as reference to encode future frames. This change adds controls to enable this feature. Signed-off-by: Dikshita Agarwal <dikshita@codeaurora.org> Reviewed-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Stanimir Varbanov <stanimir.varbanov@linaro.org> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2021-04-06media: venus: core: Drop second v4l2 device unregisterStanimir Varbanov1-2/+0
Wrong solution of rebase conflict leads to calling twice v4l2_device_unregister in .venus_remove. Delete the second one. Signed-off-by: Stanimir Varbanov <stanimir.varbanov@linaro.org> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2021-04-06media: i2c: imx258: add HDR controlKrzysztof Kozlowski1-0/+28
The IMX258 supports High Dynamic Range with 5 levels of low/high exposure ratio. Add a V4L2 control for HDR (WIDE_DYNAMIC_RANGE). Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2021-04-06media: i2c: imx219: Balance runtime PM use-countLad Prabhakar1-15/+17
Move incrementing/decrementing runtime PM count to imx219_start_streaming()/imx219_stop_streaming() functions respectively. This fixes an issue of unbalanced runtime PM count in resume callback error path where streaming is stopped and runtime PM count is left unbalanced. Fixes: 1283b3b8f82b9 ("media: i2c: Add driver for Sony IMX219 sensor") Reported-by: Pavel Machek <pavel@denx.de> Signed-off-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2021-04-06media: i2c: imx219: Move out locking/unlocking of vflip and hflip controls from imx219_set_streamLad Prabhakar1-6/+13
Move out locking/unlocking of vflip and hflip controls from imx219_set_stream() to the imx219_start_streaming()/ imx219_stop_streaming() respectively. This fixes an issue in resume callback error path where streaming is stopped and the controls are left in locked state. Fixes: 1283b3b8f82b9 ("media: i2c: Add driver for Sony IMX219 sensor") Reported-by: Pavel Machek <pavel@denx.de> Signed-off-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2021-04-06media: v4l: fwnode: Rename v4l2_async_register_subdev_sensor_commonSakari Ailus20-21/+21
Rename v4l2_async_register_subdev_sensor_common as v4l2_async_register_subdev_sensor. This is a part of the effort to make the long names present in V4L2 fwnode and async frameworks shorter. Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Reviewed-by: Ezequiel Garcia <ezequiel@collabora.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2021-04-06media: v4l: fwnode: Rename and make static V4L2 async notifier helperSakari Ailus1-5/+22
Rename v4l2_async_notifier_parse_fwnode_sensor_common() as v4l2_async_notifier_parse_fwnode_sensor() and make the function static, as it's not used by a driver and maybe never will. Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Reviewed-by: Ezequiel Garcia <ezequiel@collabora.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2021-04-06media: entity: Add lockdep check to media graph walkSakari Ailus1-0/+1
It was always assumed that walking the media graph would require holding the media_device graph_mutex but this was not documented nor checked for. Add a lockdep check to graph walk init and iter, and document the need for acquiring the graph_mutex. Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2021-04-06media: omap3isp: Acquire graph mutex for graph traversalSakari Ailus1-2/+14
Acquire the graph_mutex for traversing the media graph. This seems to have been missing all the time. Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2021-04-06media: i2c: remove unneeded variable 'ret'Yang Li1-2/+1
Fix the following coccicheck warning: ./drivers/media/i2c/ov8865.c:2527:5-8: Unneeded variable: "ret". Return "0" on line 2536 Reported-by: Abaci Robot <abaci@linux.alibaba.com> Signed-off-by: Yang Li <yang.lee@linux.alibaba.com> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2021-04-06media: i2c/ccs: fix kernel-doc header issuesHans Verkuil2-2/+4
Fix these kernel-doc warnings: drivers/media/i2c/ccs/ccs-data.h:144: warning: expecting prototype for struct ccs_pdaf_pix_loc_block_desc. Prototype was for struct ccs_pdaf_pix_loc_pixel_desc instead drivers/media/i2c/ccs/ccs-quirk.h:51: warning: Function parameter or member 'post_streamoff' not described in 'ccs_quirk' drivers/media/i2c/ccs/ccs-quirk.h:51: warning: Function parameter or member 'flags' not described in 'ccs_quirk' Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2021-04-06media: i2c: imx274: fix error return code of imx274_s_frame_interval()Jia-Ju Bai1-1/+2
When __v4l2_ctrl_modify_range() fails, no error return code of imx274_s_frame_interval() is assigned. To fix this bug, ret is assigned with the return valye of __v4l2_ctrl_modify_range(), and then ret is checked. Reported-by: TOTE Robot <oslab@tsinghua.edu.cn> Signed-off-by: Jia-Ju Bai <baijiaju1990@gmail.com> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2021-04-06media: ipu3-cio2: Fix pixel-rate derived link frequencySakari Ailus1-1/+1
The driver uses v4l2_get_link_freq() helper to obtain the link frequency using the LINK_FREQ but also the PIXEL_RATE control. The divisor for the pixel rate derived link frequency was wrong, missing the bus uses double data rate. Fix this. Reported-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Fixes: 4b6c129e87a3 ("media: ipu3-cio2: Use v4l2_get_link_freq helper") Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Bingbu Cao <bingbu.cao@intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2021-04-06media: ccs: Fix sub-device functionSakari Ailus1-2/+2
Fix sub-device function for the pixel array and the scaler. It seems that the pixel array had gotten assigned as SCALER whereas the scaler had CAM_SENSOR function. Fix this by setting the pixel array function to CAM_SENSOR and that of scaler to SCALER. Fixes: 9ec2ac9bd0f9 ("media: ccs: Give all subdevs a function") Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2021-04-06media: s5k5baf: remove trailing semicolon in macro definitionTom Rix1-1/+1
The macro use will already have a semicolon. Signed-off-by: Tom Rix <trix@redhat.com> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2021-04-06media: i2c: remove unneeded semicolonYang Li1-1/+1
Eliminate the following coccicheck warning: ./drivers/media/i2c/ov02a10.c:703:2-3: Unneeded semicolon Reported-by: Abaci Robot <abaci@linux.alibaba.com> Signed-off-by: Yang Li <yang.lee@linux.alibaba.com> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2021-04-06media: uvcvideo: Support devices that report an OT as an entity sourceLaurent Pinchart1-0/+32
Some devices reference an output terminal as the source of extension units. This is incorrect, as output terminals only have an input pin, and thus can't be connected to any entity in the forward direction. The resulting topology would cause issues when registering the media controller graph. To avoid this problem, connect the extension unit to the source of the output terminal instead. While at it, and while no device has been reported to be affected by this issue, also handle forward scans where two output terminals would be connected together, and skip the terminals found through such an invalid connection. Reported-and-tested-by: John Nealy <jnealy3@yahoo.com> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2021-04-06media: uvcvideo: Fix XU id print in forward scanLaurent Pinchart1-1/+1
An error message in the forward scan code incorrectly prints the ID of the source entity instead of the XU entity being scanned. Fix it. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2021-04-06media: vivid: update EDIDHans Verkuil1-3/+3
The EDID had a few mistakes as reported by edid-decode: Block 1, CTA-861 Extension Block: Video Data Block: For improved preferred timing interoperability, set 'Native detailed modes' to 1. Video Capability Data Block: S_PT is equal to S_IT and S_CE, so should be set to 0 instead. Fixed those. Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2021-04-06media: em28xx: fix memory leakMuhammad Usama Anjum1-0/+1
If some error occurs, URB buffers should also be freed. If they aren't freed with the dvb here, the em28xx_dvb_fini call doesn't frees the URB buffers as dvb is set to NULL. The function in which error occurs should do all the cleanup for the allocations it had done. Tested the patch with the reproducer provided by syzbot. This patch fixes the memleak. Reported-by: syzbot+889397c820fa56adf25d@syzkaller.appspotmail.com Signed-off-by: Muhammad Usama Anjum <musamaanjum@gmail.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2021-04-06media: cx88: Fix a typoBhaskar Chowdhury1-1/+1
s/sillicon/silicon/ Signed-off-by: Bhaskar Chowdhury <unixbhaskar@gmail.com> Acked-by: Randy Dunlap <rdunlap@infradead.org> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2021-04-06media: drivers/media/pci/bt8xx/bttv-cards: fix typosXiaofeng Cao1-10/+10
change 'vodeo' to 'video' change 'nevery' to 'never' change 'is' to 'it' change 'connevted' to 'connected' change 'swichers' to 'switchers' change 'strucure' to 'structure' change 'unblanced' to 'unbalanced' change 'fonctionality' to 'functionality' Signed-off-by: Xiaofeng Cao <caoxiaofeng@yulong.com> Acked-by: Randy Dunlap <rdunlap@infradead.org> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2021-04-06media: cobalt: fix initial EDIDHans Verkuil1-5/+5
The EDID failed with two edid-decode warnings: Block 1, CTA-861 Extension Block: Video Data Block: VIC 16 is the preferred timing, overriding the first detailed timings. Is this intended? Video Capability Data Block: S_PT is equal to S_IT and S_CE, so should be set to 0 instead. In addition, the first DTD had a wrong vsync value (6 instead of 5). Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2021-04-06media: s5p-mfc/s5p_mfc_common.h: fix kernel-doc warningsHans Verkuil1-14/+14
Trivial fixes for many kernel-doc warnings. Most of the comments before enums or struct can just be that: regular comments. So just change /** to /*. In one remaining case it was just a wrong construct: @mem_dev[] -> @mem_dev Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2021-04-06media: imx-jpeg: Pass the v4l2_jpeg_header header argument by referenceColin Ian King1-7/+7
Currently the header argument is being passed by value, so a copy of 256 byte structure on the stack is potentially occurring. Fix this by passing by reference to avoid any large stack copies. Addresses-Coverity: ("Big parameter passed by value") Fixes: 2db16c6ed72c ("media: imx-jpeg: Add V4L2 driver for i.MX8 JPEG Encoder/Decoder") 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+huawei@kernel.org>
2021-04-06media: imx-jpeg: Fix return value check in mxc_jpeg_attach_pm_domains()Wei Yongjun1-2/+2
In case of error, the function device_link_add() returns NULL pointer not ERR_PTR(). The IS_ERR() test in the return value check should be replaced with NULL test. Fixes: 2db16c6ed72c ("media: imx-jpeg: Add V4L2 driver for i.MX8 JPEG Encoder/Decoder") Reported-by: Hulk Robot <hulkci@huawei.com> Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2021-04-06media: imx-jpeg: Fix error return code in mxc_jpeg_probe()Wei Yongjun1-0/+2
Fix to return negative error code from the error handling case instead of 0, as done elsewhere in this function. Fixes: 2db16c6ed72c ("media: imx-jpeg: Add V4L2 driver for i.MX8 JPEG Encoder/Decoder") Reported-by: Hulk Robot <hulkci@huawei.com> Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2021-04-06media: imx-jpeg: Fix spelling mistake "Canot" -> "Cannot"Colin Ian King1-1/+1
There is a spelling mistake in a dev_err message. Fix it. 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+huawei@kernel.org>
2021-04-06media: exynos4-is: fix kernel-doc warningsHans Verkuil5-8/+29
Fixes these kernel-doc warnings: drivers/media/platform/exynos4-is/fimc-isp.h:139: warning: Function parameter or member 've' not described in 'fimc_is_video' drivers/media/platform/exynos4-is/fimc-isp.h:139: warning: Function parameter or member 'buf_count' not described in 'fimc_is_video' drivers/media/platform/exynos4-is/fimc-isp.h:139: warning: Function parameter or member 'buf_mask' not described in 'fimc_is_video' drivers/media/platform/exynos4-is/fimc-isp.h:139: warning: Function parameter or member 'streaming' not described in 'fimc_is_video' drivers/media/platform/exynos4-is/fimc-isp.h:139: warning: Function parameter or member 'buffers' not described in 'fimc_is_video' drivers/media/platform/exynos4-is/fimc-isp.h:139: warning: Function parameter or member 'pixfmt' not described in 'fimc_is_video' drivers/media/platform/exynos4-is/fimc-isp.h:176: warning: Function parameter or member 'src_fmt' not described in 'fimc_isp' drivers/media/platform/exynos4-is/fimc-isp.h:176: warning: Function parameter or member 'sink_fmt' not described in 'fimc_isp' drivers/media/platform/exynos4-is/fimc-isp.h:176: warning: Function parameter or member 'subdev_lock' not described in 'fimc_isp' drivers/media/platform/exynos4-is/fimc-lite.h:178: warning: Function parameter or member 'events' not described in 'fimc_lite' drivers/media/platform/exynos4-is/fimc-lite.h:178: warning: Function parameter or member 'streaming' not described in 'fimc_lite' drivers/media/platform/exynos4-is/media-dev.h:143: warning: Function parameter or member 'wbclk' not described in 'fimc_md' drivers/media/platform/exynos4-is/media-dev.h:143: warning: Function parameter or member 'fimc_lite' not described in 'fimc_md' drivers/media/platform/exynos4-is/media-dev.h:143: warning: Function parameter or member 'clk_provider' not described in 'fimc_md' drivers/media/platform/exynos4-is/media-dev.h:143: warning: Function parameter or member 'subdev_notifier' not described in 'fimc_md' drivers/media/platform/exynos4-is/media-dev.h:143: warning: Function parameter or member 'pipelines' not described in 'fimc_md' drivers/media/platform/exynos4-is/media-dev.h:143: warning: Function parameter or member 'link_setup_graph' not described in 'fimc_md' drivers/media/platform/exynos4-is/fimc-core.h:261: warning: Function parameter or member 'alpha' not described in 'fimc_frame' drivers/media/platform/exynos4-is/fimc-core.h:321: warning: Function parameter or member 'streaming' not described in 'fimc_vid_cap' drivers/media/platform/exynos4-is/fimc-core.h:429: warning: Function parameter or member 'drv_data' not described in 'fimc_dev' drivers/media/platform/exynos4-is/fimc-core.h:495: warning: Function parameter or member 'in_order_1p' not described in 'fimc_ctx' drivers/media/platform/exynos4-is/fimc-core.h:673: warning: Function parameter or member 'vid_cap' not described in 'fimc_active_queue_add' drivers/media/platform/exynos4-is/fimc-core.h:685: warning: Function parameter or member 'vid_cap' not described in 'fimc_active_queue_pop' drivers/media/platform/exynos4-is/fimc-core.h:700: warning: Function parameter or member 'vid_cap' not described in 'fimc_pending_queue_add' drivers/media/platform/exynos4-is/fimc-core.h:711: warning: Function parameter or member 'vid_cap' not described in 'fimc_pending_queue_pop' drivers/media/platform/exynos4-is/fimc-reg.h:333: warning: Function parameter or member 'dev' not described in 'fimc_hw_set_dma_seq' Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Acked-by: Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2021-04-06media: exynos-gsc/gsc-core.h: fix kernel-doc warningsHans Verkuil1-6/+13
Fixes these kernel-doc warnings: drivers/media/platform/exynos-gsc/gsc-core.h:76: warning: Enum value 'GSC_MIXER' not described in enum 'gsc_datapath' drivers/media/platform/exynos-gsc/gsc-core.h:76: warning: Enum value 'GSC_FIMD' not described in enum 'gsc_datapath' drivers/media/platform/exynos-gsc/gsc-core.h:76: warning: Excess enum value 'GSC_LOCAL' description in 'gsc_datapath' drivers/media/platform/exynos-gsc/gsc-core.h:124: warning: Function parameter or member 'color' not described in 'gsc_fmt' drivers/media/platform/exynos-gsc/gsc-core.h:124: warning: Function parameter or member 'num_comp' not described in 'gsc_fmt' drivers/media/platform/exynos-gsc/gsc-core.h:297: warning: Function parameter or member 'pix_max' not described in 'gsc_variant' drivers/media/platform/exynos-gsc/gsc-core.h:297: warning: Function parameter or member 'pix_min' not described in 'gsc_variant' drivers/media/platform/exynos-gsc/gsc-core.h:297: warning: Function parameter or member 'pix_align' not described in 'gsc_variant' drivers/media/platform/exynos-gsc/gsc-core.h:297: warning: Function parameter or member 'in_buf_cnt' not described in 'gsc_variant' drivers/media/platform/exynos-gsc/gsc-core.h:297: warning: Function parameter or member 'out_buf_cnt' not described in 'gsc_variant' drivers/media/platform/exynos-gsc/gsc-core.h:297: warning: Function parameter or member 'sc_up_max' not described in 'gsc_variant' drivers/media/platform/exynos-gsc/gsc-core.h:297: warning: Function parameter or member 'sc_down_max' not described in 'gsc_variant' drivers/media/platform/exynos-gsc/gsc-core.h:297: warning: Function parameter or member 'poly_sc_down_max' not described in 'gsc_variant' drivers/media/platform/exynos-gsc/gsc-core.h:297: warning: Function parameter or member 'pre_sc_down_max' not described in 'gsc_variant' drivers/media/platform/exynos-gsc/gsc-core.h:297: warning: Function parameter or member 'local_sc_down' not described in 'gsc_variant' drivers/media/platform/exynos-gsc/gsc-core.h:310: warning: Function parameter or member 'clk_names' not described in 'gsc_driverdata' drivers/media/platform/exynos-gsc/gsc-core.h:310: warning: Function parameter or member 'num_clocks' not described in 'gsc_driverdata' drivers/media/platform/exynos-gsc/gsc-core.h:340: warning: Function parameter or member 'num_clocks' not described in 'gsc_dev' drivers/media/platform/exynos-gsc/gsc-core.h:340: warning: Function parameter or member 'v4l2_dev' not described in 'gsc_dev' drivers/media/platform/exynos-gsc/gsc-core.h:376: warning: Function parameter or member 'rotation' not described in 'gsc_ctx' drivers/media/platform/exynos-gsc/gsc-core.h:376: warning: Function parameter or member 'hflip' not described in 'gsc_ctx' drivers/media/platform/exynos-gsc/gsc-core.h:376: warning: Function parameter or member 'vflip' not described in 'gsc_ctx' drivers/media/platform/exynos-gsc/gsc-core.h:376: warning: Function parameter or member 'gsc_ctrls' not described in 'gsc_ctx' drivers/media/platform/exynos-gsc/gsc-core.h:376: warning: Function parameter or member 'out_colorspace' not described in 'gsc_ctx' Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Acked-by: Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2021-04-06media: s5p-jpeg/jpeg-core.h: fix kernel-doc warningsHans Verkuil1-1/+4
Fixes these warnings: drivers/media/platform/s5p-jpeg/jpeg-core.h:136: warning: Function parameter or member 'irq_ret' not described in 's5p_jpeg' drivers/media/platform/s5p-jpeg/jpeg-core.h:136: warning: Function parameter or member 'irq_status' not described in 's5p_jpeg' drivers/media/platform/s5p-jpeg/jpeg-core.h:168: warning: Function parameter or member 'memplanes' not described in 's5p_jpeg_fmt' drivers/media/platform/s5p-jpeg/jpeg-core.h:168: warning: Function parameter or member 'subsampling' not described in 's5p_jpeg_fmt' Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Acked-by: Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2021-04-06media: s3c-camif/camif-core.h: fix kernel-doc warningsHans Verkuil1-3/+13
Fixes these warnings: drivers/media/platform/s3c-camif/camif-core.h:156: warning: Function parameter or member 'pix_limits' not described in 's3c_camif_variant' drivers/media/platform/s3c-camif/camif-core.h:156: warning: Function parameter or member 'has_img_effect' not described in 's3c_camif_variant' drivers/media/platform/s3c-camif/camif-core.h:156: warning: Function parameter or member 'vp_offset' not described in 's3c_camif_variant' drivers/media/platform/s3c-camif/camif-core.h:232: warning: Function parameter or member 'vdev' not described in 'camif_vp' drivers/media/platform/s3c-camif/camif-core.h:232: warning: Function parameter or member 'vb_queue' not described in 'camif_vp' drivers/media/platform/s3c-camif/camif-core.h:232: warning: Function parameter or member 'offset' not described in 'camif_vp' drivers/media/platform/s3c-camif/camif-core.h:297: warning: Function parameter or member 'ctrl_test_pattern' not described in 'camif_dev' drivers/media/platform/s3c-camif/camif-core.h:297: warning: Function parameter or member 'ctrl_colorfx' not described in 'camif_dev' drivers/media/platform/s3c-camif/camif-core.h:297: warning: Function parameter or member 'ctrl_colorfx_cbcr' not described in 'camif_dev' drivers/media/platform/s3c-camif/camif-core.h:297: warning: Function parameter or member 'colorfx' not described in 'camif_dev' drivers/media/platform/s3c-camif/camif-core.h:297: warning: Function parameter or member 'colorfx_cb' not described in 'camif_dev' drivers/media/platform/s3c-camif/camif-core.h:297: warning: Function parameter or member 'colorfx_cr' not described in 'camif_dev' Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Acked-by: Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2021-04-06media: allegro-dvt/nal-h264.h: fix kernel-doc: hdr -> hrdHans Verkuil1-1/+1
Give typo in kernel-doc documentation: hdr -> hrd Fixes this warning: drivers/media/platform/allegro-dvt/nal-h264.h:33: warning: expecting prototype for struct nal_h264_hdr_parameters. Prototype was for struct nal_h264_hrd_parameters instead Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Reviewed-by: Michael Tretter <m.tretter@pengutronix.de> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2021-04-05media: ipu3-cio2: Switch to use SOFTWARE_NODE_REFERENCE()Andy Shevchenko1-2/+2
This is useful to assign software node reference with arguments in a common way. Switch to use SOFTWARE_NODE_REFERENCE() here. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Link: https://lore.kernel.org/r/20210329151207.36619-6-andriy.shevchenko@linux.intel.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-03-23media: media/siano: Fix transmission parameters reporting for ISDB-TNicolas Stuardo Diaz1-4/+40
The currently used functions for converting the transmission mode and guard interval from the internal values to the DVBv5 API values do not return correct values for ISDB broadcasts: - The raw (debugfs) transmission mode is an integer whose values can be 1, 2 or 3, that corresponds to 2K, 4K and 8K FFT modes respectively. However sms_to_mode() expects values 2, 4 or 8. - Guard interval, as defined by smscoreapi.h returns "1 divided by value" instead of 0, 1, 2, and 3 as defined in sms_to_guard_interval_table(). This commit implements ISDB-T specific methods for converting the internal values for the aforementioned parameters to the DVBv5 API values. It also adds support for reporting FEC and time interleaving values for each one of the layers. [mchehab: fix two coding style whitespace warnings] Link: https://lore.kernel.org/linux-media/20201222030522.28774-1-nicolasstuardodiaz@gmail.com Signed-off-by: Nicolas Stuardo Diaz <nicolasstuardodiaz@gmail.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2021-03-22media: dvbdev: Fix memory leak in dvb_media_device_free()Peilin Ye1-0/+1
dvb_media_device_free() is leaking memory. Free `dvbdev->adapter->conn` before setting it to NULL, as documented in include/media/media-device.h: "The media_entity instance itself must be freed explicitly by the driver if required." Link: https://syzkaller.appspot.com/bug?id=9bbe4b842c98f0ed05c5eed77a226e9de33bf298 Link: https://lore.kernel.org/linux-media/20201211083039.521617-1-yepeilin.cs@gmail.com Cc: stable@vger.kernel.org Fixes: 0230d60e4661 ("[media] dvbdev: Add RF connector if needed") Reported-by: syzbot+7f09440acc069a0d38ac@syzkaller.appspotmail.com Signed-off-by: Peilin Ye <yepeilin.cs@gmail.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2021-03-22media: m88rs6000t: avoid potential out-of-bounds reads on arraysColin Ian King1-3/+3
There a 3 array for-loops that don't check the upper bounds of the index into arrays and this may lead to potential out-of-bounds reads. Fix this by adding array size upper bounds checks to be full safe. Addresses-Coverity: ("Out-of-bounds read") Link: https://lore.kernel.org/linux-media/20201007121628.20676-1-colin.king@canonical.com Fixes: 333829110f1d ("[media] m88rs6000t: add new dvb-s/s2 tuner for integrated chip M88RS6000") Signed-off-by: Colin Ian King <colin.king@canonical.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2021-03-22media: mantis: remove orphan mantis_core.cNecip Fazil Yildiran3-203/+0
There is no Makefile rule to have drivers/media/pci/mantis/mantis_core.o in build since the code overhaul with commit b3b961448f70 ("V4L/DVB (13795): [Mantis/Hopper] Code overhaul, add Hopper devices into the PCI ID list"). It looks like drivers/media/pci/mantis/mantis_core.c is a leftover. Remove the orphan code. Link: https://lore.kernel.org/linux-media/20200922132221.2051769-1-fazilyildiran@gmail.com Fixes: b3b961448f70 ("V4L/DVB (13795): [Mantis/Hopper] Code overhaul, add Hopper devices into the PCI ID list"). Signed-off-by: Necip Fazil Yildiran <fazilyildiran@gmail.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2021-03-22media: mantis: switch from 'pci_' to 'dma_' APIChristophe JAILLET2-11/+11
The wrappers in include/linux/pci-dma-compat.h should go away. The patch has been generated with the coccinelle script below and has been hand modified to replace GFP_ with a correct flag. It has been compile tested. When memory is allocated in 'mantis_alloc_buffers()' (mantis_dma.c) GFP_KERNEL can be used because it is called from 'mantis_dma_init()' which is only called from probe functions and no lock is taken in the between. @@ @@ - PCI_DMA_BIDIRECTIONAL + DMA_BIDIRECTIONAL @@ @@ - PCI_DMA_TODEVICE + DMA_TO_DEVICE @@ @@ - PCI_DMA_FROMDEVICE + DMA_FROM_DEVICE @@ @@ - PCI_DMA_NONE + DMA_NONE @@ expression e1, e2, e3; @@ - pci_alloc_consistent(e1, e2, e3) + dma_alloc_coherent(&e1->dev, e2, e3, GFP_) @@ expression e1, e2, e3; @@ - pci_zalloc_consistent(e1, e2, e3) + dma_alloc_coherent(&e1->dev, e2, e3, GFP_) @@ expression e1, e2, e3, e4; @@ - pci_free_consistent(e1, e2, e3, e4) + dma_free_coherent(&e1->dev, e2, e3, e4) @@ expression e1, e2, e3, e4; @@ - pci_map_single(e1, e2, e3, e4) + dma_map_single(&e1->dev, e2, e3, e4) @@ expression e1, e2, e3, e4; @@ - pci_unmap_single(e1, e2, e3, e4) + dma_unmap_single(&e1->dev, e2, e3, e4) @@ expression e1, e2, e3, e4, e5; @@ - pci_map_page(e1, e2, e3, e4, e5) + dma_map_page(&e1->dev, e2, e3, e4, e5) @@ expression e1, e2, e3, e4; @@ - pci_unmap_page(e1, e2, e3, e4) + dma_unmap_page(&e1->dev, e2, e3, e4) @@ expression e1, e2, e3, e4; @@ - pci_map_sg(e1, e2, e3, e4) + dma_map_sg(&e1->dev, e2, e3, e4) @@ expression e1, e2, e3, e4; @@ - pci_unmap_sg(e1, e2, e3, e4) + dma_unmap_sg(&e1->dev, e2, e3, e4) @@ expression e1, e2, e3, e4; @@ - pci_dma_sync_single_for_cpu(e1, e2, e3, e4) + dma_sync_single_for_cpu(&e1->dev, e2, e3, e4) @@ expression e1, e2, e3, e4; @@ - pci_dma_sync_single_for_device(e1, e2, e3, e4) + dma_sync_single_for_device(&e1->dev, e2, e3, e4) @@ expression e1, e2, e3, e4; @@ - pci_dma_sync_sg_for_cpu(e1, e2, e3, e4) + dma_sync_sg_for_cpu(&e1->dev, e2, e3, e4) @@ expression e1, e2, e3, e4; @@ - pci_dma_sync_sg_for_device(e1, e2, e3, e4) + dma_sync_sg_for_device(&e1->dev, e2, e3, e4) @@ expression e1, e2; @@ - pci_dma_mapping_error(e1, e2) + dma_mapping_error(&e1->dev, e2) @@ expression e1, e2; @@ - pci_set_dma_mask(e1, e2) + dma_set_mask(&e1->dev, e2) @@ expression e1, e2; @@ - pci_set_consistent_dma_mask(e1, e2) + dma_set_coherent_mask(&e1->dev, e2) Link: https://lore.kernel.org/linux-media/20200913145716.361507-1-christophe.jaillet@wanadoo.fr Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2021-03-22media: dvb-frontends: lgdt3306a.c: remove dead codeDaniel W. S. Almeida1-35/+2
Fix the following coccinelle report: drivers/media/dvb-frontends/lgdt3306a.c:718:5-8: Unneeded variable: "ret". Return "0" on line 744 Code was enclosed with #if 0 and thus this variable was not needed. Remove that function altogether. The lgdt3306a_spectral_inversion function was dropped completely since the function doesn't do anything. A comment was left at its calling site to let others know that spectral_inversion defaults already set for VSB and QAM Found using - Coccinelle (http://coccinelle.lip6.fr) Link: https://lore.kernel.org/linux-media/20200903131311.442255-1-dwlsalmeida@gmail.com Signed-off-by: Daniel W. S. Almeida <dwlsalmeida@gmail.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2021-03-22media: dvb_frontend: warn if frontend driver has API issuesMauro Carvalho Chehab1-0/+4
the kAPI for a frontend can use 3 different tuning methods: 1. The hardware tracks internally frequency shifts via its own internal zigzag logic; 2. The hardware has a custom zigzag method, implemented via fe search() ops; 3. The hardware doesn't have any internal zigzag logic. So, the Kernel needs to implement it. Drivers that use the in-kernel software zigzag are required to provide some parameters for the zigzag code to work. Failing to do that will just make the Kernel to tune several times to the very same frequency, delaying the tuning time for no good reason. This is actually a kAPI violation (and an uAPI one, as the frequency shift is exported to the uAPI). Emit a warning on such case, as the driver needs to be fixed. Link: https://lore.kernel.org/linux-media/6d5941e3ba77439bbc401207cd87d9b8748d5cb8.1616427172.git.mchehab+huawei@kernel.org Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2021-03-22media: dvb_frontend: don't call dvb_frontend_get_stepsize() twiceMauro Carvalho Chehab1-1/+1
Avoid calling the function twice, as it was just called at the previous line. Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2021-03-22media: dvb_frontend: move algo-specific settings to a functionMauro Carvalho Chehab1-41/+48
As we're planning to call this code from somewhere else, let's first move it to its own function. Link: https://lore.kernel.org/linux-media/daa69edd80e7fcf979062273f3067cb7b5573d52.1592419750.git.mchehab+huawei@kernel.org Reviewed-by: Marc Gonzalez <marc.w.gonzalez@free.fr> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2021-03-22media: cx25821: switch from 'pci_' to 'dma_' APIChristophe JAILLET2-6/+6
The wrappers in include/linux/pci-dma-compat.h should go away. The patch has been generated with the coccinelle script below and has been hand modified to replace GFP_ with a correct flag. It has been compile tested. When memory is allocated in 'cx25821_riscmem_alloc()' GFP_KERNEL can be used because either this flag is already used in the call chain, or it is called from a 'buf_prepare' function. The call chains are: vb2_ops.buf_prepare (in cx25821-video.c) cx25821_buffer_prepare (in cx25821-video.c) cx25821_risc_buffer cx25821_riscmem_alloc snd_cx25821_hw_params (in cx25821-alsa.c) <-- use GFP_KERNEL cx25821_risc_databuffer_audio cx25821_riscmem_alloc @@ @@ - PCI_DMA_BIDIRECTIONAL + DMA_BIDIRECTIONAL @@ @@ - PCI_DMA_TODEVICE + DMA_TO_DEVICE @@ @@ - PCI_DMA_FROMDEVICE + DMA_FROM_DEVICE @@ @@ - PCI_DMA_NONE + DMA_NONE @@ expression e1, e2, e3; @@ - pci_alloc_consistent(e1, e2, e3) + dma_alloc_coherent(&e1->dev, e2, e3, GFP_) @@ expression e1, e2, e3; @@ - pci_zalloc_consistent(e1, e2, e3) + dma_alloc_coherent(&e1->dev, e2, e3, GFP_) @@ expression e1, e2, e3, e4; @@ - pci_free_consistent(e1, e2, e3, e4) + dma_free_coherent(&e1->dev, e2, e3, e4) @@ expression e1, e2, e3, e4; @@ - pci_map_single(e1, e2, e3, e4) + dma_map_single(&e1->dev, e2, e3, e4) @@ expression e1, e2, e3, e4; @@ - pci_unmap_single(e1, e2, e3, e4) + dma_unmap_single(&e1->dev, e2, e3, e4) @@ expression e1, e2, e3, e4, e5; @@ - pci_map_page(e1, e2, e3, e4, e5) + dma_map_page(&e1->dev, e2, e3, e4, e5) @@ expression e1, e2, e3, e4; @@ - pci_unmap_page(e1, e2, e3, e4) + dma_unmap_page(&e1->dev, e2, e3, e4) @@ expression e1, e2, e3, e4; @@ - pci_map_sg(e1, e2, e3, e4) + dma_map_sg(&e1->dev, e2, e3, e4) @@ expression e1, e2, e3, e4; @@ - pci_unmap_sg(e1, e2, e3, e4) + dma_unmap_sg(&e1->dev, e2, e3, e4) @@ expression e1, e2, e3, e4; @@ - pci_dma_sync_single_for_cpu(e1, e2, e3, e4) + dma_sync_single_for_cpu(&e1->dev, e2, e3, e4) @@ expression e1, e2, e3, e4; @@ - pci_dma_sync_single_for_device(e1, e2, e3, e4) + dma_sync_single_for_device(&e1->dev, e2, e3, e4) @@ expression e1, e2, e3, e4; @@ - pci_dma_sync_sg_for_cpu(e1, e2, e3, e4) + dma_sync_sg_for_cpu(&e1->dev, e2, e3, e4) @@ expression e1, e2, e3, e4; @@ - pci_dma_sync_sg_for_device(e1, e2, e3, e4) + dma_sync_sg_for_device(&e1->dev, e2, e3, e4) @@ expression e1, e2; @@ - pci_dma_mapping_error(e1, e2) + dma_mapping_error(&e1->dev, e2) @@ expression e1, e2; @@ - pci_set_dma_mask(e1, e2) + dma_set_mask(&e1->dev, e2) @@ expression e1, e2; @@ - pci_set_consistent_dma_mask(e1, e2) + dma_set_coherent_mask(&e1->dev, e2) Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2021-03-22media: v4l2-mc: fix a warning messageAntti Keränen1-1/+1
The message erroneously told that the pad wasn't found from a tuner when in reality it wasn't found from a decoder. Signed-off-by: Antti Keränen <detegr@rbx.email> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2021-03-22media: adv7604: writing a one-block EDID failedHans Verkuil1-14/+16
The adv7604 refused to accept an one-block EDID, it required two blocks. Fix this. Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2021-03-22media: media/pci/pt1: Assign value when defining variableszuoqilin1-4/+2
When defining variables and assigning values can be done at the same time. Signed-off-by: zuoqilin <zuoqilin@yulong.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>