aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2024-02-28media: go7007: fix a memleak in go7007_load_encoderZhipeng Lu1-3/+5
In go7007_load_encoder, bounce(i.e. go->boot_fw), is allocated without a deallocation thereafter. After the following call chain: saa7134_go7007_init |-> go7007_boot_encoder |-> go7007_load_encoder |-> kfree(go) go is freed and thus bounce is leaked. Fixes: 95ef39403f89 ("[media] go7007: remember boot firmware") Signed-off-by: Zhipeng Lu <[email protected]> Signed-off-by: Hans Verkuil <[email protected]>
2024-02-28media: dvb-frontends: avoid stack overflow warnings with clangArnd Bergmann1-26/+8
A previous patch worked around a KASAN issue in stv0367, now a similar problem showed up with clang: drivers/media/dvb-frontends/stv0367.c:1222:12: error: stack frame size (3624) exceeds limit (2048) in 'stv0367ter_set_frontend' [-Werror,-Wframe-larger-than] 1214 | static int stv0367ter_set_frontend(struct dvb_frontend *fe) Rework the stv0367_writereg() function to be simpler and mark both register access functions as noinline_for_stack so the temporary i2c_msg structures do not get duplicated on the stack when KASAN_STACK is enabled. Fixes: 3cd890dbe2a4 ("media: dvb-frontends: fix i2c access helpers for KASAN") Signed-off-by: Arnd Bergmann <[email protected]> Reviewed-by: Justin Stitt <[email protected]> Signed-off-by: Hans Verkuil <[email protected]>
2024-02-28media: pvrusb2: fix uaf in pvr2_context_set_notifyEdward Adam Davis1-1/+1
[Syzbot reported] BUG: KASAN: slab-use-after-free in pvr2_context_set_notify+0x2c4/0x310 drivers/media/usb/pvrusb2/pvrusb2-context.c:35 Read of size 4 at addr ffff888113aeb0d8 by task kworker/1:1/26 CPU: 1 PID: 26 Comm: kworker/1:1 Not tainted 6.8.0-rc1-syzkaller-00046-gf1a27f081c1f #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/25/2024 Workqueue: usb_hub_wq hub_event Call Trace: <TASK> __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0xd9/0x1b0 lib/dump_stack.c:106 print_address_description mm/kasan/report.c:377 [inline] print_report+0xc4/0x620 mm/kasan/report.c:488 kasan_report+0xda/0x110 mm/kasan/report.c:601 pvr2_context_set_notify+0x2c4/0x310 drivers/media/usb/pvrusb2/pvrusb2-context.c:35 pvr2_context_notify drivers/media/usb/pvrusb2/pvrusb2-context.c:95 [inline] pvr2_context_disconnect+0x94/0xb0 drivers/media/usb/pvrusb2/pvrusb2-context.c:272 Freed by task 906: kasan_save_stack+0x33/0x50 mm/kasan/common.c:47 kasan_save_track+0x14/0x30 mm/kasan/common.c:68 kasan_save_free_info+0x3f/0x60 mm/kasan/generic.c:640 poison_slab_object mm/kasan/common.c:241 [inline] __kasan_slab_free+0x106/0x1b0 mm/kasan/common.c:257 kasan_slab_free include/linux/kasan.h:184 [inline] slab_free_hook mm/slub.c:2121 [inline] slab_free mm/slub.c:4299 [inline] kfree+0x105/0x340 mm/slub.c:4409 pvr2_context_check drivers/media/usb/pvrusb2/pvrusb2-context.c:137 [inline] pvr2_context_thread_func+0x69d/0x960 drivers/media/usb/pvrusb2/pvrusb2-context.c:158 [Analyze] Task A set disconnect_flag = !0, which resulted in Task B's condition being met and releasing mp, leading to this issue. [Fix] Place the disconnect_flag assignment operation after all code in pvr2_context_disconnect() to avoid this issue. Reported-and-tested-by: [email protected] Fixes: e5be15c63804 ("V4L/DVB (7711): pvrusb2: Fix race on module unload") Signed-off-by: Edward Adam Davis <[email protected]> Signed-off-by: Hans Verkuil <[email protected]>
2024-02-28media: usb: s2255: Refactor s2255_get_fx2fwRicardo Ribalda1-3/+4
Resize the buffer to the actual size needed and initialize it. With this we can convince gcc-11 that the variable is not used uninitialized. drivers/media/usb/s2255/s2255drv.c:1914:25: warning: 'transBuffer' may be used uninitialized [-Wmaybe-uninitialized] Signed-off-by: Ricardo Ribalda <[email protected]> Signed-off-by: Hans Verkuil <[email protected]>
2024-02-28media: ti: j721e-csi2rx: Convert to platform remove callback returning voidUwe Kleine-König1-4/+2
The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new(), which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König <[email protected]> Signed-off-by: Hans Verkuil <[email protected]>
2024-02-28media: stm32-dcmipp: Convert to platform remove callback returning voidUwe Kleine-König1-4/+2
The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new(), which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König <[email protected]> Signed-off-by: Hans Verkuil <[email protected]>
2024-02-28media: nxp: imx8-isi: Convert to platform remove callback returning voidUwe Kleine-König1-4/+2
The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new(), which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König <[email protected]> Reviewed-by: Laurent Pinchart <[email protected]> Signed-off-by: Hans Verkuil <[email protected]>
2024-02-28media: nuvoton: Convert to platform remove callback returning voidUwe Kleine-König1-4/+2
The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new(), which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König <[email protected]> Signed-off-by: Hans Verkuil <[email protected]>
2024-02-28media: chips-media: wave5: Convert to platform remove callback returning voidUwe Kleine-König1-4/+2
The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new(), which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König <[email protected]> Reviewed-by: Nicolas Dufresne <[email protected]> Signed-off-by: Sebastian Fricke <[email protected]> Signed-off-by: Hans Verkuil <[email protected]>
2024-02-28media: chips-media: wave5: Remove unnecessary semicolonsThorsten Blum2-2/+2
Remove unnecessary semicolons reported by Coccinelle/coccicheck and the semantic patch at scripts/coccinelle/misc/semicolon.cocci. Signed-off-by: Thorsten Blum <[email protected]> Reviewed-by: Nicolas Dufresne <[email protected]> Signed-off-by: Sebastian Fricke <[email protected]> Signed-off-by: Hans Verkuil <[email protected]>
2024-02-23Merge tag 'tags/media-next-rkisp1-20240223' of ↵Hans Verkuil8-94/+501
git://git.kernel.org/pub/scm/linux/kernel/git/pinchartl/linux.git into media_stage This adds i.MX8MP support to the rkisp1 driver. Signed-off-by: Hans Verkuil <[email protected]> From: Laurent Pinchart <[email protected]> Link: https://patchwork.linuxtv.org/project/linux-media/patch/[email protected]/
2024-02-23media: i2c: imx290: Fix IMX920 typoAlexander Stein1-8/+8
Replace IMX920 by IMX290. Fixes: b4ab57b07c5b9 ("media: i2c: imx290: Add crop selection targets support") Signed-off-by: Alexander Stein <[email protected]> Reviewed-by: Manivannan Sadhasivam <[email protected]> Reviewed-by: Laurent Pinchart <[email protected]> Signed-off-by: Sakari Ailus <[email protected]> Signed-off-by: Hans Verkuil <[email protected]>
2024-02-23media: platform: replace of_graph_get_next_endpoint()Kuninori Morimoto6-9/+9
From DT point of view, in general, drivers should be asking for a specific port number because their function is fixed in the binding. of_graph_get_next_endpoint() doesn't match to this concept. Simply replace - of_graph_get_next_endpoint(xxx, NULL); + of_graph_get_endpoint_by_regs(xxx, 0, -1); Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Kuninori Morimoto <[email protected]> Signed-off-by: Sakari Ailus <[email protected]> Signed-off-by: Hans Verkuil <[email protected]>
2024-02-23media: i2c: replace of_graph_get_next_endpoint()Kuninori Morimoto13-14/+14
From DT point of view, in general, drivers should be asking for a specific port number because their function is fixed in the binding. of_graph_get_next_endpoint() doesn't match to this concept. Simply replace - of_graph_get_next_endpoint(xxx, NULL); + of_graph_get_endpoint_by_regs(xxx, 0, -1); Link: https://lore.kernel.org/r/[email protected] Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Kuninori Morimoto <[email protected]> Signed-off-by: Sakari Ailus <[email protected]> Signed-off-by: Hans Verkuil <[email protected]>
2024-02-23media: ivsc: csi: Make use of sub-device stateSakari Ailus1-70/+13
The MEI CSI driver was using sub-device state but still maintained its own format information and did its own locking. Rely on sub-device state instead. This also fixes a circular locking problem during link validation. Signed-off-by: Sakari Ailus <[email protected]> Signed-off-by: Hans Verkuil <[email protected]>
2024-02-23media: ivsc: csi: Swap SINK and SOURCE padsSakari Ailus1-2/+2
This patch swaps SINK and SOURCE pads of the MEI CSI sub-device. While this does change the UAPI by swapping the pads, the driver has never been usable in upstream kernel as the Intel IPU6 driver it depends on any functionality has not yet been merged. Fixes: 29006e196a56 ("media: pci: intel: ivsc: Add CSI submodule") Signed-off-by: Sakari Ailus <[email protected]> Signed-off-by: Hans Verkuil <[email protected]>
2024-02-23media: ipu-bridge: Serialise calls to IPU bridge initSakari Ailus1-0/+4
The IPU bridge initialisation will be called from multiple locations in the future. Serialise the access to devices' fwnodes in this context. Signed-off-by: Sakari Ailus <[email protected]> Signed-off-by: Hans Verkuil <[email protected]>
2024-02-23media: ipu-bridge: Move graph checking to IPU bridgeSakari Ailus2-28/+23
Move checking the graph to the IPU bridge. This way the caller won't need to do it. Signed-off-by: Sakari Ailus <[email protected]> Signed-off-by: Hans Verkuil <[email protected]>
2024-02-23media: ipu-bridge: Add ov01a10 in Dell XPS 9315Sakari Ailus1-0/+2
Add Omnivision ov01a10 sensor used in Dell XPS 9315, and use the driver default frequency. Signed-off-by: Sakari Ailus <[email protected]> Reviewed-by: Daniel Scally <[email protected]> Signed-off-by: Hans Verkuil <[email protected]>
2024-02-23media: imx335: Add support for test pattern generatorMatthias Fend1-1/+101
Add support for the sensor's test pattern generator. Signed-off-by: Matthias Fend <[email protected]> Signed-off-by: Kieran Bingham <[email protected]> Signed-off-by: Umang Jain <[email protected]> Signed-off-by: Sakari Ailus <[email protected]> Signed-off-by: Hans Verkuil <[email protected]>
2024-02-23media: imx335: Refactor power sequence to set controlsUmang Jain1-15/+20
Additional controls might require the sensor to be powered up to set the control value. Currently, only the exposure control powers up the sensor. Move the power up sequence out of the switch-case block. In a subsequent patch, test pattern control will be added that needs the sensor to be powered up. Hence, refactor the power sequence to be present outside the switch-case block. The VBLANK control is also moved out of the switch-case in order to be handled early on, to propagate the changes to other controls. Signed-off-by: Umang Jain <[email protected]> Signed-off-by: Sakari Ailus <[email protected]> Signed-off-by: Hans Verkuil <[email protected]>
2024-02-23media: imx335: Support multiple link frequencyUmang Jain1-14/+70
Support link frequency of 445MHz in addition to 594MHz. Break out the register set specific to each data lane rate and also add the general timing register set corresponding to the each data lane rate. Signed-off-by: Umang Jain <[email protected]> Signed-off-by: Sakari Ailus <[email protected]> Signed-off-by: Hans Verkuil <[email protected]>
2024-02-23media: imx335: Use v4l2_link_freq_to_bitmap helperUmang Jain1-18/+18
Use the v4l2_link_freq_to_bitmap() helper to figure out which driver-supported link frequencies can be used on a given system. Signed-off-by: Umang Jain <[email protected]> Signed-off-by: Sakari Ailus <[email protected]> Signed-off-by: Hans Verkuil <[email protected]>
2024-02-23media: imx335: Set reserved register to default valueUmang Jain1-1/+1
0x3a00 is a reserved register as per the datasheet. The driver currently sets to it 0x01 while the datasheet claims 0x00 to be the default value. On one of the setup based on i.MX8MP platform with IMX335, this register write broke the CSI-2 configuration. Setting 0x3a00 to its default value (i.e. 0x00) fixed the issue. It is not clear from the datasheet what this register write is responsible for but setting it to its default value seems the right thing to do, provided it has been found responsible to break CSI-2 configuration on one of the platform. Signed-off-by: Umang Jain <[email protected]> Reported-by: Matthias Fend <[email protected]> Signed-off-by: Sakari Ailus <[email protected]> Signed-off-by: Hans Verkuil <[email protected]>
2024-02-23media: i2c: dw9714: Fix occasional probe errorsOndrej Jirman1-0/+2
The powerup delay was not observed during probe, leading to occasional I2C communication failures in RPM suspend callback. Power delay is properly observed in resume callback already. Signed-off-by: Ondrej Jirman <[email protected]> Signed-off-by: Sakari Ailus <[email protected]> Signed-off-by: Hans Verkuil <[email protected]>
2024-02-23media: i2c: ov5645: Remove software reset entry from ov5645_global_init_settingBiju Das1-1/+4
The SYSTEM_CTRL0 register in ov5645 is almost similar to ov5640. But the hard reset control is mandatory for the ov5645 device, so there is no need for soft reset in the driver. Add a 1msec delay for the software power up (OV5645_SYSTEM_CTRL0_START) register in ov5645_global_init_setting. Without this delay sometimes the image is not captured at all when the i2c frequency is 400kHz. The changes are fixing both the greenish issue and image capture at 400kHz i2c frequency on Renesas RZ/G2L SMARC EVK platforms. Signed-off-by: Biju Das <[email protected]> Reviewed-by: Wolfram Sang <[email protected]> Reviewed-by: Kieran Bingham <[email protected]> Signed-off-by: Sakari Ailus <[email protected]> Signed-off-by: Hans Verkuil <[email protected]>
2024-02-23media: i2c: alvium: fix req_fr check in alvium_s_frame_interval()Tommaso Merciai1-8/+4
req_fr check in alvium_s_frame_interval() is incorrect. In particular req_fr can't be >=max and <= min at the same time. Ensure the requested frame rate remains within the supported range between min_fr and max_fr by clamping it. Also remove the unused dft_fr argument of alvium_get_frame_interval(). Signed-off-by: Tommaso Merciai <[email protected]> Signed-off-by: Sakari Ailus <[email protected]> Signed-off-by: Hans Verkuil <[email protected]>
2024-02-23media: i2c: alvium: store frame interval in subdev stateTommaso Merciai2-34/+15
Use the newly added storage for frame interval in the subdev state to simplify the driver. Signed-off-by: Tommaso Merciai <[email protected]> Reviewed-by: Laurent Pinchart <[email protected]> Signed-off-by: Sakari Ailus <[email protected]> Signed-off-by: Hans Verkuil <[email protected]>
2024-02-23media: i2c: alvium: inline set_frame_interval into s_frame_intervalTommaso Merciai1-33/+19
Inline alvium_set_frame_interval() into alvium_s_frame_interval(). The alvium_set_frame_interval() is called once only, by alvium_s_frame_interval(). The latter is a thin wrapper around the former. Inline the function in its caller to make the code more readable. Signed-off-by: Tommaso Merciai <[email protected]> Reviewed-by: Laurent Pinchart <[email protected]> Signed-off-by: Sakari Ailus <[email protected]> Signed-off-by: Hans Verkuil <[email protected]>
2024-02-23media: i2c: alvium: remove the fr field of the alvium_dev structureTommaso Merciai2-13/+12
The fr (frame rate) field of the alvium_dev structure is only used to pass result from alvium_set_frame_interval() to alvium_set_frame_rate() that writes this info into the hw reg. Replace it with a function parameter. Signed-off-by: Tommaso Merciai <[email protected]> Reviewed-by: Laurent Pinchart <[email protected]> Signed-off-by: Sakari Ailus <[email protected]> Signed-off-by: Hans Verkuil <[email protected]>
2024-02-23media: i2c: alvium: removal of dft_fr, min_fr and max_frTommaso Merciai2-21/+9
The dft_fr, min_fr and max_fr fields of the alvium_dev structure are only used to pass results from alvium_get_frame_interval() to its caller. Replace them with function parameters. Signed-off-by: Tommaso Merciai <[email protected]> Reviewed-by: Laurent Pinchart <[email protected]> Signed-off-by: Sakari Ailus <[email protected]> Signed-off-by: Hans Verkuil <[email protected]>
2024-02-23media: rkisp1: Add match data for i.MX8MP ISPPaul Elder1-0/+24
Add match data to the rkisp1 driver to match the i.MX8MP ISP. Signed-off-by: Paul Elder <[email protected]> Reviewed-by: Rob Herring <[email protected]> Tested-by: Alexander Stein <[email protected]> Tested-by: Adam Ford <[email protected]> Reviewed-by: Tomi Valkeinen <[email protected]> Reviewed-by: Laurent Pinchart <[email protected]> Signed-off-by: Laurent Pinchart <[email protected]>
2024-02-23media: rkisp1: Fix endianness on raw streams on i.MX8MPPaul Elder2-12/+85
The i.MX8MP has extra register fields in the memory interface control register for setting the output format, which work with the output alignment format register for byte-swapping and LSB/MSB alignment. With processed and 8-bit raw streams, it doesn't cause any problems to not set these, but with raw streams of higher bit depth the endianness is swapped and the data is not aligned properly. Add support for setting these registers and plumb them in to fix this. While at it, reflow a comment related to the forced configuration update. Signed-off-by: Paul Elder <[email protected]> Signed-off-by: Laurent Pinchart <[email protected]> Tested-by: Alexander Stein <[email protected]>
2024-02-23media: rkisp1: Add UYVY as an output formatPaul Elder1-0/+41
Add support for UYVY as an output format. The uv_swap bit in the MI_XTD_FORMAT_CTRL register that is used for the NV formats does not work for packed YUV formats. Thus, UYVY support is implemented via byte-swapping. This method clearly does not work for implementing support for YVYU and VYUY. Signed-off-by: Paul Elder <[email protected]> Reviewed-by: Laurent Pinchart <[email protected]> Signed-off-by: Laurent Pinchart <[email protected]> Tested-by: Alexander Stein <[email protected]> Tested-by: Adam Ford <[email protected]>
2024-02-23media: rkisp1: Add YC swap capabilityPaul Elder1-7/+19
The ISP version in the i.MX8MP has an MI_OUTPUT_ALIGN_FORMAT register that the rk3399 does not have. This register allows swapping bytes, which can be used to implement UYVY from YUYV. Add a flag to the format info in the list of formats supported by the capture v4l2 devices, and update enum_fmt and s_fmt to take it into account. To signify the presence of this feature, reuse the MAIN_STRIDE feature flag, as it is very likely that any ISP version that supports one of these two features will also support the other. Signed-off-by: Paul Elder <[email protected]> Reviewed-by: Laurent Pinchart <[email protected]> Signed-off-by: Laurent Pinchart <[email protected]> Tested-by: Alexander Stein <[email protected]> Tested-by: Adam Ford <[email protected]>
2024-02-23media: rkisp1: Support i.MX8MP's 34-bit DMAPaul Elder3-10/+22
On the ISP that is integrated in the i.MX8MP, DMA addresses have been extended to 34 bits, with the 32 MSBs stored in the DMA address registers and the 2 LSBs set to 0. To support this: - Shift the addresses to the right by 2 when writing to registers - Set the dma mask to 34 bits - Use dma_addr_t instead of u32 when storing the addresses Signed-off-by: Paul Elder <[email protected]> Reviewed-by: Laurent Pinchart <[email protected]> Signed-off-by: Tomi Valkeinen <[email protected]> Tested-by: Alexander Stein <[email protected]> Tested-by: Adam Ford <[email protected]> Reviewed-by: Tomi Valkeinen <[email protected]> Signed-off-by: Laurent Pinchart <[email protected]>
2024-02-23media: rkisp1: Configure gasket on i.MX8MPLaurent Pinchart3-3/+149
The i.MX8MP has a gasket between the CSI-2 receiver and the ISP. Configure and enable it when starting the ISP, and disable it when stopping. Signed-off-by: Laurent Pinchart <[email protected]> Signed-off-by: Paul Elder <[email protected]> Tested-by: Alexander Stein <[email protected]> Tested-by: Adam Ford <[email protected]> Reviewed-by: Tomi Valkeinen <[email protected]>
2024-02-23media: rkisp1: Add version enum for i.MX8MP ISPPaul Elder1-23/+27
The NXP i.MX8MP integrates an ISP8000Nano from VeriSilicon, which is a derivative of the ISP found in earlier Rockchip SoCs. It isn't clear at which exact point the two product lines have diverged, and there is no public information regarding the version numbering scheme of the ISP8000Nano. Nonetheless, this ISP is close enough to the V10 found in the RK3399 to be supported by the same driver. Add an entry for the ISP found in the NXP i.MX8MP to the version enum. Given the lack of information on the version numbering scheme, and on whether or not the version in the i.MX8MP is identical to other ISP8000Nano versions or has been customized for the i.MX8MP, depart from the number-based versions and name this new version V_IMX8MP. Update comments for the other versions and for relevant parameters blocks to clearly indicate the size of grids and histogram for the different versions. Signed-off-by: Paul Elder <[email protected]> Signed-off-by: Laurent Pinchart <[email protected]> Tested-by: Alexander Stein <[email protected]>
2024-02-23dt-bindings: media: rkisp1: Add i.MX8MP ISP to compatiblePaul Elder1-6/+31
The i.MX8MP ISP is compatbile with the rkisp1 driver. Add it to the list of compatible strings. While at it, expand on the description of the clocks to make it clear which clock in the i.MX8MP ISP they map to, based on the names from the datasheet. Signed-off-by: Paul Elder <[email protected]> Reviewed-by: Laurent Pinchart <[email protected]> Reviewed-by: Rob Herring <[email protected]> Tested-by: Alexander Stein <[email protected]> Tested-by: Adam Ford <[email protected]> Signed-off-by: Laurent Pinchart <[email protected]>
2024-02-23media: rkisp1: Support devices lacking dual cropPaul Elder3-7/+14
Some versions of the ISP supported by the rkisp1 driver, such as the ISP in the i.MX8MP, lack the dual crop registers and don't support cropping at the resizer input. They instead rely on cropping in the Image Stabilization module, at the output of the ISP, to modify the resizer input size and implement digital zoom. Add a dual crop feature flag to distinguish the versions of the ISP that support dual crop from those that don't, and make sure that the sink crop is set to the sink format when dual crop is not supported. Signed-off-by: Paul Elder <[email protected]> Tested-by: Alexander Stein <[email protected]> Tested-by: Adam Ford <[email protected]> Reviewed-by: Tomi Valkeinen <[email protected]> Reviewed-by: Laurent Pinchart <[email protected]> Signed-off-by: Laurent Pinchart <[email protected]>
2024-02-23media: rkisp1: Support devices lacking self pathPaul Elder4-8/+31
Some versions of the ISP supported by the rkisp1 driver, such as the ISP in the i.MX8MP, lack the self path. Support those ISP versions by adding a self path feature flag, and massage the rest of the driver to support the lack of a self path. Signed-off-by: Paul Elder <[email protected]> Reviewed-by: Laurent Pinchart <[email protected]> Tested-by: Alexander Stein <[email protected]> Tested-by: Adam Ford <[email protected]> Reviewed-by: Tomi Valkeinen <[email protected]> Signed-off-by: Laurent Pinchart <[email protected]>
2024-02-23media: rkisp1: Support setting memory stride for main pathPaul Elder3-15/+52
Some versions of the ISP supported by the rkisp1 driver, such as the ISP in the i.MX8MP, implement configurable memory stride for the main path the same way as already implemented by the driver for the self path. Support this feature by adding a main stride feature flag and program the corresponding registers accordingly. Signed-off-by: Laurent Pinchart <[email protected]> Signed-off-by: Paul Elder <[email protected]> Reviewed-by: Laurent Pinchart <[email protected]> Tested-by: Alexander Stein <[email protected]> Tested-by: Adam Ford <[email protected]> Reviewed-by: Tomi Valkeinen <[email protected]>
2024-02-23media: rkisp1: Add and use rkisp1_has_feature() macroLaurent Pinchart2-6/+9
Simplify feature tests with a macro that shortens lines. Signed-off-by: Laurent Pinchart <[email protected]> Reviewed-by: Paul Elder <[email protected]> Reviewed-by: Kieran Bingham <[email protected]> Signed-off-by: Paul Elder <[email protected]> Tested-by: Alexander Stein <[email protected]> Tested-by: Adam Ford <[email protected]> Reviewed-by: Tomi Valkeinen <[email protected]>
2024-02-16media: visl: Add codec specific variability on output framesDetlev Casanova1-0/+36
When running tests with different input data, the stable output frames could be too similar and hide possible issues. This commit adds variation by using some codec specific parameters. Only HEVC and H.264 support this. Reviewed-by: Daniel Almeida <[email protected]> Signed-off-by: Detlev Casanova <[email protected]> Signed-off-by: Hans Verkuil <[email protected]> [hverkuil: add media: prefix to Subject]
2024-02-16doc: media: visl: Document tpg_verbose parameterDetlev Casanova1-2/+10
Also document stable frames and what it means for testing tools. Signed-off-by: Detlev Casanova <[email protected]> Signed-off-by: Hans Verkuil <[email protected]> [hverkuil: add media: prefix to Subject]
2024-02-16media: visl: Add a tpg_verbose parameterDetlev Casanova3-118/+153
The text written on the output frames stable for a given input. Remove the unstable elements like pointers, buffer indexes or queues status so that frames are always identical and can be compared against a reference in automatic tests. As the unstable information can be relevant when debugging the API, add a tpg_verbose parameter to show them. Signed-off-by: Detlev Casanova <[email protected]> Signed-off-by: Hans Verkuil <[email protected]> [hverkuil: correct a few small checkpatch issues]
2024-02-16media: visl,vidtv: Set parameters permissions to 0444Detlev Casanova2-18/+18
This avoids confusion with default values and lets userspace programs get the modules parameters values at run time. This can be useful when setting up a test suite. Reviewed-by: Daniel Almeida <[email protected]> Signed-off-by: Detlev Casanova <[email protected]> Signed-off-by: Hans Verkuil <[email protected]>
2024-02-16media: v4l: marvell: select CONFIG_V4L2_ASYNC where neededArnd Bergmann1-0/+2
Drivers that call v4l2_async_nf_init() need to select the corresponding Kconfig symbol: ERROR: modpost: "v4l2_async_nf_init" [drivers/media/platform/marvell/cafe_ccic.ko] undefined! ERROR: modpost: "__v4l2_async_nf_add_i2c" [drivers/media/platform/marvell/cafe_ccic.ko] undefined! ERROR: modpost: "v4l2_async_nf_unregister" [drivers/media/platform/marvell/mcam-core.ko] undefined! ERROR: modpost: "v4l2_async_nf_init" [drivers/media/platform/marvell/mmp_camera.ko] undefined! ERROR: modpost: "__v4l2_async_nf_add_fwnode_remote" [drivers/media/platform/marvell/mmp_camera.ko] undefined! I checked all v4l2 drivers to see if anything else has the same bug, but these two appear to be the only ones. Signed-off-by: Arnd Bergmann <[email protected]> Acked-by: Sakari Ailus <[email protected]> Signed-off-by: Hans Verkuil <[email protected]>
2024-02-16media: pvrusb2: fix pvr2_stream_callback castsArnd Bergmann3-8/+12
clang-16 complains about a control flow integrity (KCFI) issue in pvrusb2, which casts three different prototypes into pvr2_stream_callback: drivers/media/usb/pvrusb2/pvrusb2-v4l2.c:1070:30: error: cast from 'void (*)(struct pvr2_v4l2_fh *)' to 'pvr2_stream_callback' (aka 'void (*)(void *)') converts to incompatible function type [-Werror,-Wcast-function-type-strict] 1070 | pvr2_stream_set_callback(sp,(pvr2_stream_callback)pvr2_v4l2_notify,fh); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ drivers/media/usb/pvrusb2/pvrusb2-context.c:110:6: error: cast from 'void (*)(struct pvr2_context *)' to 'void (*)(void *)' converts to incompatible function type [-Werror,-Wcast-function-type-strict] 110 | (void (*)(void *))pvr2_context_notify, | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ drivers/media/usb/pvrusb2/pvrusb2-dvb.c:152:6: error: cast from 'void (*)(struct pvr2_dvb_adapter *)' to 'pvr2_stream_callback' (aka 'void (*)(void *)') converts to incompatible function type [-Werror,-Wcast-function-type-strict] 152 | (pvr2_stream_callback) pvr2_dvb_notify, adap); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Change the functions to actually take a void* argument so the cast is no longer needed. Fixes: bb8ce9d9143c ("V4L/DVB (7682): pvrusb2-dvb: finish up stream & buffer handling") Signed-off-by: Arnd Bergmann <[email protected]> Signed-off-by: Hans Verkuil <[email protected]>
2024-02-16media: sta2x11: fix irq handler castArnd Bergmann1-5/+4
clang-16 warns about casting incompatible function pointers: drivers/media/pci/sta2x11/sta2x11_vip.c:1057:6: error: cast from 'irqreturn_t (*)(int, struct sta2x11_vip *)' (aka 'enum irqreturn (*)(int, struct sta2x11_vip *)') to 'irq_handler_t' (aka 'enum irqreturn (*)(int, void *)') converts to incompatible function type [-Werror,-Wcast-function-type-strict] Change the prototype of the irq handler to the regular version with a local variable to adjust the argument type. Signed-off-by: Arnd Bergmann <[email protected]> Signed-off-by: Hans Verkuil <[email protected]> [hverkuil: update argument documentation]