summaryrefslogtreecommitdiff
path: root/drivers/media
AgeCommit message (Collapse)Author
2025-04-30media: omap3isp: drop wait_prepare/finish callbacksHans Verkuil
Since commit 88785982a19d ("media: vb2: use lock if wait_prepare/finish are NULL") it is no longer needed to set the wait_prepare/finish vb2_ops callbacks as long as the lock field in vb2_queue is set. Set the queue lock to &video->queue_lock, which makes it possible to drop the wait_prepare/finish callbacks. This simplifies the code and this is a step towards the goal of deleting these callbacks. Note that the lock field of struct video_device is never set in this driver, so the core v4l2_ioctl.c function v4l2_ioctl_get_lock() will never take a lock. Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl> Acked-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2025-04-25media: gspca: Add error handling for stv06xx_read_sensor()Wentao Liang
In hdcs_init(), the return value of stv06xx_read_sensor() needs to be checked. A proper implementation can be found in vv6410_dump(). Add a check in loop condition and propergate error code to fix this issue. Fixes: 4c98834addfe ("V4L/DVB (10048): gspca - stv06xx: New subdriver.") Cc: stable@vger.kernel.org # v2.6+ Signed-off-by: Wentao Liang <vulab@iscas.ac.cn> Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
2025-04-25media: platform: exynos4-is: Add hardware sync wait to fimc_is_hw_change_mode()Wentao Liang
In fimc_is_hw_change_mode(), the function changes camera modes without waiting for hardware completion, risking corrupted data or system hangs if subsequent operations proceed before the hardware is ready. Add fimc_is_hw_wait_intmsr0_intmsd0() after mode configuration, ensuring hardware state synchronization and stable interrupt handling. Signed-off-by: Wentao Liang <vulab@iscas.ac.cn> Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
2025-04-25media: adv7511-v4l2: use constants for BT.2020 colorimetryDmitry Baryshkov
Replace numeric values with constants from hdmi.h. Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com> Reviewed-by: Kieran Bingham <kieran.bingham+renesas@ideasonboard.com> Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
2025-04-25media: davinci: vpif: Fix memory leak in probe error pathDmitry Nikiforov
If an error occurs during the initialization of `pdev_display`, the allocated platform device `pdev_capture` is not released properly, leading to a memory leak. Adjust error path handling to fix the leak. Found by Linux Verification Center (linuxtesting.org) with SVACE. Fixes: 43acb728bbc4 ("media: davinci: vpif: fix use-after-free on driver unbind") Cc: stable@vger.kernel.org Signed-off-by: Dmitry Nikiforov <Dm1tryNk@yandex.ru> Reviewed-by: Johan Hovold <johan@kernel.org> Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
2025-04-25media: dvb: Fix typos bloc -> blockAndrew Kreimer
There are some typos in comments / dprintk messages: bloc -> block. Fix them via codespell. Signed-off-by: Andrew Kreimer <algonell@gmail.com> Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
2025-04-25media: vivid: Change the siize of the composingDenis Arefev
syzkaller found a bug: BUG: KASAN: vmalloc-out-of-bounds in tpg_fill_plane_pattern drivers/media/common/v4l2-tpg/v4l2-tpg-core.c:2608 [inline] BUG: KASAN: vmalloc-out-of-bounds in tpg_fill_plane_buffer+0x1a9c/0x5af0 drivers/media/common/v4l2-tpg/v4l2-tpg-core.c:2705 Write of size 1440 at addr ffffc9000d0ffda0 by task vivid-000-vid-c/5304 CPU: 0 UID: 0 PID: 5304 Comm: vivid-000-vid-c Not tainted 6.14.0-rc2-syzkaller-00039-g09fbf3d50205 #0 Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2~bpo12+1 04/01/2014 Call Trace: <TASK> __dump_stack lib/dump_stack.c:94 [inline] dump_stack_lvl+0x241/0x360 lib/dump_stack.c:120 print_address_description mm/kasan/report.c:378 [inline] print_report+0x169/0x550 mm/kasan/report.c:489 kasan_report+0x143/0x180 mm/kasan/report.c:602 kasan_check_range+0x282/0x290 mm/kasan/generic.c:189 __asan_memcpy+0x40/0x70 mm/kasan/shadow.c:106 tpg_fill_plane_pattern drivers/media/common/v4l2-tpg/v4l2-tpg-core.c:2608 [inline] tpg_fill_plane_buffer+0x1a9c/0x5af0 drivers/media/common/v4l2-tpg/v4l2-tpg-core.c:2705 vivid_fillbuff drivers/media/test-drivers/vivid/vivid-kthread-cap.c:470 [inline] vivid_thread_vid_cap_tick+0xf8e/0x60d0 drivers/media/test-drivers/vivid/vivid-kthread-cap.c:629 vivid_thread_vid_cap+0x8aa/0xf30 drivers/media/test-drivers/vivid/vivid-kthread-cap.c:767 kthread+0x7a9/0x920 kernel/kthread.c:464 ret_from_fork+0x4b/0x80 arch/x86/kernel/process.c:148 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:244 </TASK> The composition size cannot be larger than the size of fmt_cap_rect. So execute v4l2_rect_map_inside() even if has_compose_cap == 0. Fixes: 94a7ad928346 ("media: vivid: fix compose size exceed boundary") Cc: stable@vger.kernel.org Reported-by: syzbot+365005005522b70a36f2@syzkaller.appspotmail.com Closes: https://syzkaller.appspot.com/bug?id=8ed8e8cc30cbe0d86c9a25bd1d6a5775129b8ea3 Signed-off-by: Denis Arefev <arefev@swemel.ru> Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
2025-04-25media: platform: exynos4-is: Use of_get_available_child_by_name()Biju Das
Simplify fimc_md_is_isp_available() by using of_get_available_child_by_name(). Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com> Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
2025-04-25media: platform: cros-ec: Add Moxie to the match tableKen Lin
The Google Moxie device uses the same approach as the Google Brask which enables the HDMI CEC via the cros-ec-cec driver. Signed-off-by: Ken Lin <kenlin5@quanta.corp-partner.google.com> Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
2025-04-25media: stm32-dcmi: use devm_kmemdup_array()Raag Jadav
Convert to use devm_kmemdup_array() and while at it, make the size robust against type changes. Signed-off-by: Raag Jadav <raag.jadav@intel.com> Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
2025-04-25media: atmel-isi: use devm_kmemdup_array()Raag Jadav
Convert to use devm_kmemdup_array() and while at it, make the size robust against type changes. Signed-off-by: Raag Jadav <raag.jadav@intel.com> Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
2025-04-25media: mgb4: Enumerate only the available timingsMartin Tůma
Enumerate only the available (as given by the input source) timings, not all theoretically possible. Signed-off-by: Martin Tůma <martin.tuma@digiteqautomotive.com> Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
2025-04-25media: nuvoton: npcm-video: Prevent returning unsupported resolutionsMichael Chang
To restrict the returned resolution due to Nuvoton SoC hardware limitations. Signed-off-by: Michael Chang <zhang971090220@gmail.com> Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
2025-04-25media: nuvoton: npcm-video: Fix stuck due to no video signal errorMichael Chang
Fix the issue when start_frame and detect_resolution functions are executed at the same time, which may cause driver stops capturing due to status of no video signal error. Signed-off-by: Michael Chang <zhang971090220@gmail.com> Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
2025-04-25media: platform: cros-ec: Add Dirks to the match tableKells Ping
The Google Dirks device uses the same approach as the Google Brask which enables the HDMI CEC via the cros-ec-cec driver. Signed-off-by: Kells Ping <kellsping@gmail.com> Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
2025-04-25media: mgb4: Fix resolution change events triggeringMartin Tůma
Always generate the resolution change event when the HW reports it and only discard the streaming termination in case the new resolution is the same as the old one. The old logic prevented events on "no signal" -> "valid resolution" transitions as VIDIOC_QUERY_DV_TIMINGS never updates the timings when there is no signal present. Signed-off-by: Martin Tůma <martin.tuma@digiteqautomotive.com> Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
2025-04-25media: cxusb: no longer judge rbuf when the write failsEdward Adam Davis
syzbot reported a uninit-value in cxusb_i2c_xfer. [1] Only when the write operation of usb_bulk_msg() in dvb_usb_generic_rw() succeeds and rlen is greater than 0, the read operation of usb_bulk_msg() will be executed to read rlen bytes of data from the dvb device into the rbuf. In this case, although rlen is 1, the write operation failed which resulted in the dvb read operation not being executed, and ultimately variable i was not initialized. [1] BUG: KMSAN: uninit-value in cxusb_gpio_tuner drivers/media/usb/dvb-usb/cxusb.c:124 [inline] BUG: KMSAN: uninit-value in cxusb_i2c_xfer+0x153a/0x1a60 drivers/media/usb/dvb-usb/cxusb.c:196 cxusb_gpio_tuner drivers/media/usb/dvb-usb/cxusb.c:124 [inline] cxusb_i2c_xfer+0x153a/0x1a60 drivers/media/usb/dvb-usb/cxusb.c:196 __i2c_transfer+0xe25/0x3150 drivers/i2c/i2c-core-base.c:-1 i2c_transfer+0x317/0x4a0 drivers/i2c/i2c-core-base.c:2315 i2c_transfer_buffer_flags+0x125/0x1e0 drivers/i2c/i2c-core-base.c:2343 i2c_master_send include/linux/i2c.h:109 [inline] i2cdev_write+0x210/0x280 drivers/i2c/i2c-dev.c:183 do_loop_readv_writev fs/read_write.c:848 [inline] vfs_writev+0x963/0x14e0 fs/read_write.c:1057 do_writev+0x247/0x5c0 fs/read_write.c:1101 __do_sys_writev fs/read_write.c:1169 [inline] __se_sys_writev fs/read_write.c:1166 [inline] __x64_sys_writev+0x98/0xe0 fs/read_write.c:1166 x64_sys_call+0x2229/0x3c80 arch/x86/include/generated/asm/syscalls_64.h:21 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline] do_syscall_64+0xcd/0x1e0 arch/x86/entry/syscall_64.c:94 entry_SYSCALL_64_after_hwframe+0x77/0x7f Reported-by: syzbot+526bd95c0ec629993bf3@syzkaller.appspotmail.com Closes: https://syzkaller.appspot.com/bug?extid=526bd95c0ec629993bf3 Tested-by: syzbot+526bd95c0ec629993bf3@syzkaller.appspotmail.com Fixes: 22c6d93a7310 ("[PATCH] dvb: usb: support Medion hybrid USB2.0 DVB-T/analogue box") Cc: stable@vger.kernel.org Signed-off-by: Edward Adam Davis <eadavis@qq.com> Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
2025-04-25media: tw5864: Replace deprecated PCI functionsPhilipp Stanner
pcim_iomap_table() and pcim_iomap_regions() have been deprecated. pcim_iomap_regions(), furthermore, has so far wrongly been passed the device's name instead of the driver's name, which makes that function's debug prints useless. Replace the deprecated function with pcim_iomap_region(). Define the driver name globally and use it where appropriate. Signed-off-by: Philipp Stanner <phasta@kernel.org> Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
2025-04-25media: solo6x10: Replace deprecated PCI functionsPhilipp Stanner
pcim_iomap_table() and pcim_iomap_regions() have been deprecated. Replace them with pcim_iomap_region(). Signed-off-by: Philipp Stanner <phasta@kernel.org> Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
2025-04-25media: pt3: Replace deprecated PCI functionsPhilipp Stanner
pcim_iomap_table() and pcim_iomap_regions() have been deprecated. Replace them with pcim_iomap_region(). Signed-off-by: Philipp Stanner <phasta@kernel.org> Tested-by: Akihiro Tsukada <tskd08@gmail.com> Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
2025-04-25media: cec: extron-da-hd-4k-plus: Fix Wformat-truncationHans Verkuil
Fix gcc8 warning: drivers/media/cec/usb/extron-da-hd-4k-plus/extron-da-hd-4k-plus.c:1014:44: warning: 'DCEC' directive output may be truncated writing 4 bytes into a region of size between 0 and 53 [-Wformat-truncation=] Resizing the 'buf' and 'cmd' arrays fixed the warning. Signed-off-by: Ricardo Ribalda <ribalda@chromium.org> Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
2025-04-25media: videobuf2: check constants during build timeMichał Mirosław
There is nothing a driver author can do fix in the driver to make the global constants match. Since the assertion can be verified at build time, don't return EINVAL at runtime for it. Signed-off-by: Michał Mirosław <mirq-linux@rere.qmqm.pl> Acked-by: Marek Szyprowski <m.szyprowski@samsung.com> Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
2025-04-25media: vivid: Add more webcam resolutionsRicardo Ribalda
Add 3 more common resolution for webcams. This is required to increase the test coverage of unit tests based on vivid. Co-developed-by: Hidenori Kobayashi <hidenorik@chromium.org> Signed-off-by: Hidenori Kobayashi <hidenorik@chromium.org> Signed-off-by: Ricardo Ribalda <ribalda@chromium.org> Tested-by: Hidenori Kobayashi <hidenorik@chromium.org> # v4l2-compliance, Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
2025-04-25media: vivid: Fix requirement about webcam_intervalsRicardo Ribalda
Since commit f0b4a2c037c0 ("media: vivid: Extend FPS rates offered by simulated webcam") we do not require twice as many intervals as sizes. In fact, now we have 13 intervals and 6 sizes. Fix the comment. Signed-off-by: Ricardo Ribalda <ribalda@chromium.org> Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
2025-04-25media: vidtv: Terminating the subsequent process of initialization failureEdward Adam Davis
syzbot reported a slab-use-after-free Read in vidtv_mux_init. [1] After PSI initialization fails, the si member is accessed again, resulting in this uaf. After si initialization fails, the subsequent process needs to be exited. [1] BUG: KASAN: slab-use-after-free in vidtv_mux_pid_ctx_init drivers/media/test-drivers/vidtv/vidtv_mux.c:78 [inline] BUG: KASAN: slab-use-after-free in vidtv_mux_init+0xac2/0xbe0 drivers/media/test-drivers/vidtv/vidtv_mux.c:524 Read of size 8 at addr ffff88802fa42acc by task syz.2.37/6059 CPU: 0 UID: 0 PID: 6059 Comm: syz.2.37 Not tainted 6.14.0-rc5-syzkaller #0 Hardware name: Google Compute Engine, BIOS Google 02/12/2025 Call Trace: <TASK> __dump_stack lib/dump_stack.c:94 [inline] dump_stack_lvl+0x116/0x1f0 lib/dump_stack.c:120 print_address_description mm/kasan/report.c:408 [inline] print_report+0xc3/0x670 mm/kasan/report.c:521 kasan_report+0xd9/0x110 mm/kasan/report.c:634 vidtv_mux_pid_ctx_init drivers/media/test-drivers/vidtv/vidtv_mux.c:78 vidtv_mux_init+0xac2/0xbe0 drivers/media/test-drivers/vidtv/vidtv_mux.c:524 vidtv_start_streaming drivers/media/test-drivers/vidtv/vidtv_bridge.c:194 vidtv_start_feed drivers/media/test-drivers/vidtv/vidtv_bridge.c:239 dmx_section_feed_start_filtering drivers/media/dvb-core/dvb_demux.c:973 dvb_dmxdev_feed_start drivers/media/dvb-core/dmxdev.c:508 [inline] dvb_dmxdev_feed_restart.isra.0 drivers/media/dvb-core/dmxdev.c:537 dvb_dmxdev_filter_stop+0x2b4/0x3a0 drivers/media/dvb-core/dmxdev.c:564 dvb_dmxdev_filter_free drivers/media/dvb-core/dmxdev.c:840 [inline] dvb_demux_release+0x92/0x550 drivers/media/dvb-core/dmxdev.c:1246 __fput+0x3ff/0xb70 fs/file_table.c:464 task_work_run+0x14e/0x250 kernel/task_work.c:227 exit_task_work include/linux/task_work.h:40 [inline] do_exit+0xad8/0x2d70 kernel/exit.c:938 do_group_exit+0xd3/0x2a0 kernel/exit.c:1087 __do_sys_exit_group kernel/exit.c:1098 [inline] __se_sys_exit_group kernel/exit.c:1096 [inline] __x64_sys_exit_group+0x3e/0x50 kernel/exit.c:1096 x64_sys_call+0x151f/0x1720 arch/x86/include/generated/asm/syscalls_64.h:232 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xcd/0x250 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x77/0x7f RIP: 0033:0x7f871d58d169 Code: Unable to access opcode bytes at 0x7f871d58d13f. RSP: 002b:00007fff4b19a788 EFLAGS: 00000246 ORIG_RAX: 00000000000000e7 RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 00007f871d58d169 RDX: 0000000000000064 RSI: 0000000000000000 RDI: 0000000000000000 RBP: 00007fff4b19a7ec R08: 0000000b4b19a87f R09: 00000000000927c0 R10: 0000000000000001 R11: 0000000000000246 R12: 0000000000000003 R13: 00000000000927c0 R14: 000000000001d553 R15: 00007fff4b19a840 </TASK> Allocated by task 6059: kasan_save_stack+0x33/0x60 mm/kasan/common.c:47 kasan_save_track+0x14/0x30 mm/kasan/common.c:68 poison_kmalloc_redzone mm/kasan/common.c:377 [inline] __kasan_kmalloc+0xaa/0xb0 mm/kasan/common.c:394 kmalloc_noprof include/linux/slab.h:901 [inline] kzalloc_noprof include/linux/slab.h:1037 [inline] vidtv_psi_pat_table_init drivers/media/test-drivers/vidtv/vidtv_psi.c:970 vidtv_channel_si_init drivers/media/test-drivers/vidtv/vidtv_channel.c:423 vidtv_mux_init drivers/media/test-drivers/vidtv/vidtv_mux.c:519 vidtv_start_streaming drivers/media/test-drivers/vidtv/vidtv_bridge.c:194 vidtv_start_feed drivers/media/test-drivers/vidtv/vidtv_bridge.c:239 dmx_section_feed_start_filtering drivers/media/dvb-core/dvb_demux.c:973 dvb_dmxdev_feed_start drivers/media/dvb-core/dmxdev.c:508 [inline] dvb_dmxdev_feed_restart.isra.0 drivers/media/dvb-core/dmxdev.c:537 dvb_dmxdev_filter_stop+0x2b4/0x3a0 drivers/media/dvb-core/dmxdev.c:564 dvb_dmxdev_filter_free drivers/media/dvb-core/dmxdev.c:840 [inline] dvb_demux_release+0x92/0x550 drivers/media/dvb-core/dmxdev.c:1246 __fput+0x3ff/0xb70 fs/file_table.c:464 task_work_run+0x14e/0x250 kernel/task_work.c:227 exit_task_work include/linux/task_work.h:40 [inline] do_exit+0xad8/0x2d70 kernel/exit.c:938 do_group_exit+0xd3/0x2a0 kernel/exit.c:1087 __do_sys_exit_group kernel/exit.c:1098 [inline] __se_sys_exit_group kernel/exit.c:1096 [inline] __x64_sys_exit_group+0x3e/0x50 kernel/exit.c:1096 x64_sys_call arch/x86/include/generated/asm/syscalls_64.h:232 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xcd/0x250 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x77/0x7f Freed by task 6059: kasan_save_stack+0x33/0x60 mm/kasan/common.c:47 kasan_save_track+0x14/0x30 mm/kasan/common.c:68 kasan_save_free_info+0x3b/0x60 mm/kasan/generic.c:576 poison_slab_object mm/kasan/common.c:247 [inline] __kasan_slab_free+0x51/0x70 mm/kasan/common.c:264 kasan_slab_free include/linux/kasan.h:233 [inline] slab_free_hook mm/slub.c:2353 [inline] slab_free mm/slub.c:4609 [inline] kfree+0x2c4/0x4d0 mm/slub.c:4757 vidtv_channel_si_init drivers/media/test-drivers/vidtv/vidtv_channel.c:499 vidtv_mux_init drivers/media/test-drivers/vidtv/vidtv_mux.c:519 vidtv_start_streaming drivers/media/test-drivers/vidtv/vidtv_bridge.c:194 vidtv_start_feed drivers/media/test-drivers/vidtv/vidtv_bridge.c:239 dmx_section_feed_start_filtering drivers/media/dvb-core/dvb_demux.c:973 dvb_dmxdev_feed_start drivers/media/dvb-core/dmxdev.c:508 [inline] dvb_dmxdev_feed_restart.isra.0 drivers/media/dvb-core/dmxdev.c:537 dvb_dmxdev_filter_stop+0x2b4/0x3a0 drivers/media/dvb-core/dmxdev.c:564 dvb_dmxdev_filter_free drivers/media/dvb-core/dmxdev.c:840 [inline] dvb_demux_release+0x92/0x550 drivers/media/dvb-core/dmxdev.c:1246 __fput+0x3ff/0xb70 fs/file_table.c:464 task_work_run+0x14e/0x250 kernel/task_work.c:227 exit_task_work include/linux/task_work.h:40 [inline] do_exit+0xad8/0x2d70 kernel/exit.c:938 do_group_exit+0xd3/0x2a0 kernel/exit.c:1087 __do_sys_exit_group kernel/exit.c:1098 [inline] __se_sys_exit_group kernel/exit.c:1096 [inline] __x64_sys_exit_group+0x3e/0x50 kernel/exit.c:1096 x64_sys_call arch/x86/include/generated/asm/syscalls_64.h:232 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xcd/0x250 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x77/0x7f Fixes: 3be8037960bc ("media: vidtv: add error checks") Cc: stable@vger.kernel.org Reported-by: syzbot+0d33ab192bd50b6c91e6@syzkaller.appspotmail.com Closes: https://syzkaller.appspot.com/bug?extid=0d33ab192bd50b6c91e6 Signed-off-by: Edward Adam Davis <eadavis@qq.com> Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
2025-04-25media: pvrusb2: Remove unused pvr2_std_create_enumDr. David Alan Gilbert
pvr2_std_create_enum() has been unused since 2012's commit c0bb609fdc0b ("[media] pvrusb2: Get rid of obsolete code for video standard enumeration") Remove it. Signed-off-by: Dr. David Alan Gilbert <linux@treblig.org> Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
2025-04-25media: s5p-mfc: Support for handling RET_ENC_BUFFER_FULL interruptAakarsh Jain
When output encoded buffer size provided by userspace is insufficient with current encoding parameters, it leads to RET_ENC_BUFFER_FULL interrupt which was not handled in IRQ handler. On handling of RET_ENC_BUFFER_FULL interrupt leads to NAL_ABORT command from host to risc which in turn leads to RET_NAL_ABORT interrupt. On receiving RET_NAL_ABORT driver clears workbit and VB2 queues for cleaner closing of MFC instance. When user encounters "Call on DQBUF after unrecoverable error", userspace should close fd and restart with larger output encoder buffer size. Signed-off-by: Aakarsh Jain <aakarsh.jain@samsung.com> Acked-by: Marek Szyprowski <m.szyprowski@samsung.com> Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
2025-04-25media: vim2m: Add parametized support for multiplanar APIMatthew Majewski
Add support for the mulitiplaner API. The device can now act as either a multi-planar or a single-planar device depending on a module parameter, similar to the way vivid behaves. Multiplanar support was added by implementing the appropate try/get/set mplane functions, and by modifying the queue_setup() and buf_prepare() functions to handle multiple planes. Implementation was inspired by vivid. Signed-off-by: Matthew Majewski <mattwmajewski@gmail.com> Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
2025-04-25media: vim2m: Simplify try_fmtMatthew Majewski
Clean up vidioc_try_fmt with the following changes: 1. remove unsused vim2m_fmt parameter 2. use clamp() macro to restrain width/height bounds 3. use ALIGN() macro to align width/height 4. use v4l2_fill_pixfmt to set bytesperline/sizeimage Signed-off-by: Matthew Majewski <mattwmajewski@gmail.com> Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
2025-04-25media: v4l2-common: Add RGBR format infoMatthew Majewski
Add missing RGBR entry in the v4l2_format_info[] table. RGBR has identical format information to RGBP, as it is a big endian variant of RGB-5-6-5 pixel encoding according to the description in videodev2.h. Signed-off-by: Matthew Majewski <mattwmajewski@gmail.com> Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
2025-04-25media: remove STA2x11 media pci driverLukas Bulwahn
With commit dcbb01fbb7ae ("x86/pci: Remove old STA2x11 support"), the STA2X11 Video Input Port driver is not needed and cannot be built anymore. Remove the driver and its reference in media documentation. Signed-off-by: Lukas Bulwahn <lukas.bulwahn@redhat.com> Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
2025-04-25media: i2c: imx334: switch to {enable,disable}_streamsTarang Raval
Switch from s_stream to enable_streams and disable_streams callbacks. Signed-off-by: Tarang Raval <tarang.raval@siliconsignals.io> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
2025-04-25media: i2c: imx334: Use subdev state lock for synchronizationTarang Raval
Replace the custom mutex in the imx334 driver with the V4L2 subdev state lock for control synchronization. Initialize the subdev with v4l2_subdev_init_finalize in imx334_probe, adding proper cleanup in error paths and imx334_remove. This aligns the driver with V4L2 standards. Signed-off-by: Tarang Raval <tarang.raval@siliconsignals.io> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
2025-04-25media: i2c: imx334: Enable runtime PM before sub-device registrationTarang Raval
Runtime PM is fully initialized before calling v4l2_async_register_subdev_sensor(). Moving the runtime PM initialization earlier prevents potential access to an uninitialized or powered-down device. Signed-off-by: Tarang Raval <tarang.raval@siliconsignals.io> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
2025-04-25media: i2c: imx334: Fix runtime PM handling in remove functionTarang Raval
pm_runtime_suspended() only checks the current runtime PM status and does not modify it, making it ineffective in this context. This could result in improper power management if the device remains active when removed. This patch fixes the issue by introducing a check with pm_runtime_status_suspended() to determine if the device is already suspended. If it is not, it calls imx334_power_off() to power down the device and then uses pm_runtime_set_suspended() to correctly update the runtime PM status to suspended. Signed-off-by: Tarang Raval <tarang.raval@siliconsignals.io> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
2025-04-25media: i2c: imx334: Fix power management and control handlingTarang Raval
Some controls may need the sensor to be powered on to update their values. Currently, only the exposure control does this. To ensure proper handling, the power-up sequence is moved outside the switch-case. Additionally, VBLANK control is now processed earlier so its changes can correctly affect other controls. Signed-off-by: Tarang Raval <tarang.raval@siliconsignals.io> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
2025-04-25media: i2c: imx334: Configure lane mode dynamicallyTarang Raval
Configure the lane mode dynamically from the streaming function instead of using a hardcoded value. Signed-off-by: Tarang Raval <tarang.raval@siliconsignals.io> [Sakari Ailus: Fix checkpatch.pl issue, lower Dynamically.] Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
2025-04-25media: i2c: imx334: Remove redundant register entriesTarang Raval
IMX334_REG_{ADBIT, MDBIT, ADBIT1}: Already written in imx334_set_framefmt function. IMX334_REG_THSPREPARE: Unnecessary repeated writes removed. CCI_REG8(0x3e04): Unnecessary repeated writes removed. Signed-off-by: Tarang Raval <tarang.raval@siliconsignals.io> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
2025-04-25media: i2c: imx334: Convert to CCI register access helpersTarang Raval
Use the new common CCI register access helpers to replace the private register access helpers in the imx334 driver. This simplifies the driver by reducing the amount of code. Acked-by: Shravan Chippa <Shravan.Chippa@microchip.com> Signed-off-by: Tarang Raval <tarang.raval@siliconsignals.io> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
2025-04-25media: i2c: imx334: Simplify with dev_err_probe()Tarang Raval
Error handling in probe() can be a bit simpler with dev_err_probe(). also, Added missing newline characters (\n) in error messages. Signed-off-by: Tarang Raval <tarang.raval@siliconsignals.io> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
2025-04-25media: intel/ipu6: Fix dma mask for non-secure modeStanislaw Gruszka
We use dma_get_mask() of auxdev device for calculate iova pfn limit. This is always 32 bit mask as we do not initialize the mask (and we can not do so, since dev->dev_mask is NULL anyways for auxdev). Since we need 31 bit mask for non-secure mode use mmu_info->aperture_end which is properly initialized to correct mask for both modes. Fixes: daabc5c64703 ("media: ipu6: not override the dma_ops of device in driver") Cc: stable@vger.kernel.org Signed-off-by: Stanislaw Gruszka <stanislaw.gruszka@linux.intel.com> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
2025-04-25media: intel/ipu6: Minor dma_mask clenaupStanislaw Gruszka
Remove unused dma_mask field and ipu-dma.h includes. Signed-off-by: Stanislaw Gruszka <stanislaw.gruszka@linux.intel.com> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
2025-04-25media: ccs: Don't complain about missing "clock-frequency" propertySakari Ailus
The clock frequency is often available via the clock itself and not read by the driver from the "clock-frequency" property. Don't complain if the property doesn't exist. Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
2025-04-25media: ccs: Don't complain about lack of quirksSakari Ailus
Generally any deviance from the standard is handled via CCS static data nowadays and so not having quirks is expected. Don't warn about it. Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
2025-04-25media: ccs: Remove I²C write retry hackSakari Ailus
The I²C retry hack has been there in order to address transient I²C register write access issues on a few very old sensors and possibly it has addressed also first I²C access problems (device not responding until a certain amount of time has passed) but that is now separately handled. The retry hack has a good potential for introducing hard to debug problems in updating sensor settings while streaming. Remove it and instead pass those rare errors to the user space -- which is also what virtually all other drivers do. Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
2025-04-25media: ccs: Use read_poll_timeout() in reset pollingSakari Ailus
Use read_poll_timeout() in polling the device after a reset, either hard or soft. While at it, improve the related error message. Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
2025-04-25media: ccs: Try a little longer to access the sensor before giving upSakari Ailus
Some sensors take longer to respond after reset than the spec-required time. Try up to 1 s for the sensor to become accessible. Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
2025-04-25media: i2c: imx219: media: i2c: imx219: Enable runtime PM autosuspendTarang Raval
Use pm_runtime_put_autosuspend() instead of pm_runtime_put() to allow autosuspend. Set a 1000ms autosuspend delay in imx219_probe() to improve power efficiency. Signed-off-by: Tarang Raval <tarang.raval@siliconsignals.io> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
2025-04-25media: i2c: imx219: switch to {enable,disable}_streamsTarang Raval
Switch from s_stream to enable_streams and disable_streams callbacks. Signed-off-by: Tarang Raval <tarang.raval@siliconsignals.io> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
2025-04-25media: i2c: ov02e10: add OV02E10 image sensor driverJingjing Xiong
Add in the ov02e10 driver from the Intel IPU6 repository. Signed-off-by: Jingjing Xiong <jingjing.xiong@intel.com> Co-developed-by: Hao Yao <hao.yao@intel.com> Signed-off-by: Hao Yao <hao.yao@intel.com> Co-developed-by: Jim Lai <jim.lai@intel.com> Signed-off-by: Jim Lai <jim.lai@intel.com> Co-developed-by: You-Sheng Yang <vicamo.yang@canonical.com> Signed-off-by: You-Sheng Yang <vicamo.yang@canonical.com> Co-developed-by: Alan Stern <stern@rowland.harvard.edu> Signed-off-by: Alan Stern <stern@rowland.harvard.edu> Co-developed-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>