aboutsummaryrefslogtreecommitdiff
path: root/drivers/media/platform/nxp
AgeCommit message (Collapse)AuthorFilesLines
2023-04-12media: imx-jpeg: Fix incorrect indentationLaurent Pinchart1-4/+3
Variable initialization code in notify_src_chg() is incorrectly indented. Fix it. Signed-off-by: Laurent Pinchart <[email protected]> Reviewed-by: Sakari Ailus <[email protected]> Signed-off-by: Hans Verkuil <[email protected]>
2023-04-11media: imx: imx7-media-csi: Fail on invalid type in VIDIOC_G_SELECTIONAlexander Stein1-0/+3
This device only supports video capture, so bail out if invalid selection type is passed. Signed-off-by: Alexander Stein <[email protected]> Reviewed-by: Laurent Pinchart <[email protected]> Reviewed-by: Rui Miguel Silva <[email protected]> Signed-off-by: Laurent Pinchart <[email protected]> Signed-off-by: Hans Verkuil <[email protected]>
2023-04-11media: imx: imx7-media-csi: Fix mbus framefmt field initAlexander Stein1-0/+1
'field' is zero-initialized to V4L2_FIELD_ANY, which is an invalid value to return to userspace. Instead default to non-interleaving. Signed-off-by: Alexander Stein <[email protected]> Reviewed-by: Laurent Pinchart <[email protected]> Reviewed-by: Rui Miguel Silva <[email protected]> Signed-off-by: Laurent Pinchart <[email protected]> Signed-off-by: Hans Verkuil <[email protected]>
2023-04-11media: imx: imx7-media-csi: Fix error handling in imx7_csi_async_register()Frieder Schrempf1-10/+13
The CSI requires a connected source subdev to operate. If fwnode_graph_get_endpoint_by_id() fails and returns NULL, there is no point in going on. Print an error message and abort instead. Also we don't need to check for an existing asd. Any failure of v4l2_async_nf_add_fwnode_remote() should abort the probe. Suggested-by: Laurent Pinchart <[email protected]> Signed-off-by: Frieder Schrempf <[email protected]> Reviewed-by: Laurent Pinchart <[email protected]> Signed-off-by: Laurent Pinchart <[email protected]> Signed-off-by: Hans Verkuil <[email protected]>
2023-04-11media: mx2_emmaprp: 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 (mostly) ignored 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. 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]>
2023-04-11media: imx7-media-csi: 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 (mostly) ignored 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. 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]>
2023-04-11media: imx-pxp: 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 (mostly) ignored 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. 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]>
2023-04-11media: imx-mipi-csis: 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 (mostly) ignored 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. 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]>
2023-04-11media: mxc-jpeg: 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 (mostly) ignored 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. 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]>
2023-04-11media: dw100: 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 (mostly) ignored 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. 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: Xavier Roumegue <[email protected]> Signed-off-by: Hans Verkuil <[email protected]>
2023-03-19media: dw100: use devm_platform_get_and_ioremap_resource()Ye Xingchen1-3/+1
Convert platform_get_resource(), devm_ioremap_resource() to a single call to devm_platform_get_and_ioremap_resource(), as this is exactly what this function does. Signed-off-by: Ye Xingchen <[email protected]> Reviewed-by: Xavier Roumegue <[email protected]> Signed-off-by: Hans Verkuil <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2023-03-19media: imx-jpeg: Bounds check sizeimage accessKees Cook1-0/+5
The call of mxc_jpeg_get_plane_size() from mxc_jpeg_dec_irq() sets plane_no argument to 1. The compiler sees that it's possible to end up with an access beyond the bounds of sizeimage, if mem_planes was too large: if (plane_no >= fmt->mem_planes) // mem_planes = 2+ return 0; if (fmt->mem_planes == fmt->comp_planes) // comp_planes != mem_planes return q_data->sizeimage[plane_no]; if (plane_no < fmt->mem_planes - 1) // mem_planes = 2 return q_data->sizeimage[plane_no]; comp_planes == 0 or 1 is safe. comp_planes > 2 would be out of bounds. (This isn't currently possible given the contents of mxc_formats, though.) Silence the warning by bounds checking comp_planes for future robustness. Seen with GCC 13: In function 'mxc_jpeg_get_plane_size', inlined from 'mxc_jpeg_dec_irq' at ../drivers/media/platform/nxp/imx-jpeg/mxc-jpeg.c:729:14: ../drivers/media/platform/nxp/imx-jpeg/mxc-jpeg.c:641:42: warning: array subscript 2 is above array bounds of 'u32[2]' {aka 'unsigned int[2]'} [-Warray-bounds=] 641 | size += q_data->sizeimage[i]; | ~~~~~~~~~~~~~~~~~^~~ In file included from ../drivers/media/platform/nxp/imx-jpeg/mxc-jpeg-hw.h:112, from ../drivers/media/platform/nxp/imx-jpeg/mxc-jpeg.c:63: ../drivers/media/platform/nxp/imx-jpeg/mxc-jpeg.h: In function 'mxc_jpeg_dec_irq': ../drivers/media/platform/nxp/imx-jpeg/mxc-jpeg.h:84:41: note: while referencing 'sizeimage' 84 | u32 sizeimage[MXC_JPEG_MAX_PLANES]; | ^~~~~~~~~ Cc: Mirela Rabulea <[email protected]> Cc: NXP Linux Team <[email protected]> Cc: Shawn Guo <[email protected]> Cc: Sascha Hauer <[email protected]> Cc: Pengutronix Kernel Team <[email protected]> Cc: Fabio Estevam <[email protected]> Cc: [email protected] Signed-off-by: Kees Cook <[email protected]> Signed-off-by: Hans Verkuil <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2023-02-26media: imx-mipi-csis: Check csis_fmt validity before useMarek Vasut1-0/+3
The find_csis_format() may return NULL in case supported format is not found, check the return value of find_csis_format() before using the result to avoid NULL pointer dereference. Fixes: 11927d0fd0d0 ("media: imx-mipi-csis: Use V4L2 subdev active state") Signed-off-by: Marek Vasut <[email protected]> Signed-off-by: Laurent Pinchart <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2023-02-08media: imx-pxp: convert to regmapMichael Tretter1-8/+23
Replace the readl and writel with regmap to ease debugging the registers from userspace. Suggested-by: Alexander Stein <[email protected]> Signed-off-by: Michael Tretter <[email protected]> Reviewed-by: Philipp Zabel <[email protected]> Signed-off-by: Laurent Pinchart <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2023-02-08media: imx-pxp: Use non-threaded IRQLaurent Pinchart1-2/+2
There's no need to use threaded IRQs with the PXP, as the interrupt handler doesn't need to sleep and doesn't perform any time-consuming operation. Switch to regular IRQ handler. This fixes lockups of the PXP noticed on i.MX7, where the PXP would stop generating interrupts after a variable number of frames (from a few dozens to a few hundreds). The root cause is however unknown. Signed-off-by: Laurent Pinchart <[email protected]> Signed-off-by: Michael Tretter <[email protected]> Reviewed-by: Philipp Zabel <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2023-02-08media: imx-pxp: Introduce pxp_read() and pxp_write() wrappersLaurent Pinchart1-54/+64
Add pxp_read() and pxp_write() functions to wrap readl() and writel() respectively. This can be useful for debugging register accesses. Signed-off-by: Laurent Pinchart <[email protected]> Signed-off-by: Michael Tretter <[email protected]> Reviewed-by: Philipp Zabel <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2023-02-08media: imx-pxp: Implement frame size enumerationLaurent Pinchart1-0/+22
Implement support for the VIDIOC_ENUM_FRAMESIZES ioctl. Signed-off-by: Laurent Pinchart <[email protected]> Signed-off-by: Michael Tretter <[email protected]> Reviewed-by: Philipp Zabel <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2023-02-08media: imx-pxp: Pass pixel format value to find_format()Laurent Pinchart1-7/+7
The find_format() function looks up format information for a given pixel format. It takes a v4l2_format pointer, but only uses the contained pixel format value. To prepare it for being used by callers that don't have v4l2_format, modify it to take the pixel format value directly. Signed-off-by: Laurent Pinchart <[email protected]> Signed-off-by: Michael Tretter <[email protected]> Reviewed-by: Philipp Zabel <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2023-02-08media: imx-pxp: Add media controller supportLaurent Pinchart1-0/+35
Register a media device for the PXP, using the v4l2-mem2mem MC infrastructure to populate the media graph. No media device operation is implemented, the main use of the MC API is to allow consistent discovery of media devices for userspace. Signed-off-by: Laurent Pinchart <[email protected]> Signed-off-by: Michael Tretter <[email protected]> Reviewed-by: Philipp Zabel <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2023-02-08media: imx-pxp: Don't set bus_info manually in .querycap()Laurent Pinchart1-2/+0
The v4l2_capability.bus_info field is set by the V4L2 core when left empty by the .querycap() handler. This is the recommended practice, in order to ensure bus_info coherence between drivers. Don't set it manually. Signed-off-by: Laurent Pinchart <[email protected]> Signed-off-by: Michael Tretter <[email protected]> Reviewed-by: Philipp Zabel <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2023-02-08media: imx-pxp: Sort headers alphabeticallyLaurent Pinchart1-4/+4
Sorting headers alphabetically helps locating duplicates, and make it easier to figure out where to insert new headers. Signed-off-by: Laurent Pinchart <[email protected]> Signed-off-by: Michael Tretter <[email protected]> Reviewed-by: Philipp Zabel <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2023-02-08media: imx-pxp: add support for i.MX7DMichael Tretter1-0/+36
The i.MX7D needs a different data path configuration than the i.MX6ULL. Configure the data path as close as possible to the data path on the i.MX6ULL. Signed-off-by: Michael Tretter <[email protected]> Reviewed-by: Philipp Zabel <[email protected]> Signed-off-by: Laurent Pinchart <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2023-02-08media: imx-pxp: make data_path_ctrl0 platform dependentMichael Tretter1-3/+18
Unfortunately, the PXP_HW_VERSION register reports the PXP on the i.MX7D and on the i.MX6ULL as version 3.0, although the PXP versions on these SoCs have significant differences. Use the compatible to configure the ctrl0 register as required dependent on the platform. Signed-off-by: Michael Tretter <[email protected]> Reviewed-by: Philipp Zabel <[email protected]> Signed-off-by: Laurent Pinchart <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2023-02-08media: imx-pxp: disable LUT blockMichael Tretter1-5/+4
The LUT block is always configured in bypass mode. Take it entirely out of the pipeline by disabling it and routing the data path around the LUT. Signed-off-by: Michael Tretter <[email protected]> Reviewed-by: Philipp Zabel <[email protected]> Signed-off-by: Laurent Pinchart <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2023-02-08media: imx-pxp: explicitly disable unused blocksMichael Tretter1-12/+18
Various multiplexers in the pipeline are not used with the currently configured data path. Disable all unused multiplexers by selecting the "no output" (3) option. The datasheet doesn't explicitly require this, but the PXP has been seen to hang after processing a few hundreds of frames otherwise. As at it, add documentation for the multiplexers that are actually relevant for the data path. Signed-off-by: Michael Tretter <[email protected]> Reviewed-by: Philipp Zabel <[email protected]> Signed-off-by: Laurent Pinchart <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2023-02-08media: imx-pxp: extract helper function to setup data pathMichael Tretter1-20/+42
The driver must configure the data path through the Pixel Pipeline. Currently, the driver is using a fixed setup, but once there are different pipeline configurations, it is helpful to have a dedicated function for determining the register value for the data path. Signed-off-by: Michael Tretter <[email protected]> Reviewed-by: Philipp Zabel <[email protected]> Signed-off-by: Laurent Pinchart <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2023-02-08media: imx-pxp: detect PXP versionMichael Tretter1-0/+11
Different versions of the Pixel Pipeline have different blocks and their routing may be different. Read the PXP_HW_VERSION register to determine the version of the PXP and print it to the log for debugging purposes. Signed-off-by: Michael Tretter <[email protected]> Reviewed-by: Philipp Zabel <[email protected]> Signed-off-by: Laurent Pinchart <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2023-02-08media: imx-mipi-csis: Implement .init_cfg() using .set_fmt()Laurent Pinchart1-26/+22
The .set_fmt() handler is responsible for adjusting the requested format based on the device limitations. Implement .init_cfg() as a wrapper of .set_fmt(), to ensure that the initial configuration always matches the rules implemented in .set_fmt(), should they ever change. Signed-off-by: Laurent Pinchart <[email protected]> Tested-by: Adam Ford <[email protected]> #imx8mn-beacon Acked-by: Rui Miguel Silva <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2023-02-08media: imx-mipi-csis: Use V4L2 subdev active stateLaurent Pinchart1-88/+47
Use the V4L2 subdev active state API to store the active format. This simplifies the driver not only by dropping the mipi_csis_device csis_fmt and format_mbus fields, but it also allows dropping the device lock, replaced with the state lock. Signed-off-by: Laurent Pinchart <[email protected]> Tested-by: Adam Ford <[email protected]> #imx8mn-beacon Acked-by: Rui Miguel Silva <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2023-02-08media: imx-mipi-csis: Pass format explicitly to internal functionsLaurent Pinchart1-13/+21
To prepare for usage of the subdev active state that will replace the csis_fmt and format_mbus fields stored in the mipi_csis_device structure, pass the format explicitly to the functions called when starting streaming to avoid accessing those two fields. Not functional change intended. Signed-off-by: Laurent Pinchart <[email protected]> Tested-by: Adam Ford <[email protected]> #imx8mn-beacon Acked-by: Rui Miguel Silva <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2023-02-08media: imx-mipi-csis: Don't take lock in runtime PM handlersLaurent Pinchart1-17/+11
The runtime PM handlers don't need manual locking as - they are serialized by the runtime PM core - they can't race with other functions taking the same lock, as they don't access any data protect by that lock Drop the locking. Signed-off-by: Laurent Pinchart <[email protected]> Tested-by: Adam Ford <[email protected]> #imx8mn-beacon Acked-by: Rui Miguel Silva <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2023-02-08media: imx-mipi-csis: Rename error labels with 'err_' prefixLaurent Pinchart1-7/+7
It is customary to prefix error labels with 'err_' to make their purpose clearer. Do so in the probe function. Signed-off-by: Laurent Pinchart <[email protected]> Tested-by: Adam Ford <[email protected]> #imx8mn-beacon Acked-by: Rui Miguel Silva <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2023-02-08media: imx: imx7-media-csi: Use V4L2 subdev active stateLaurent Pinchart1-122/+51
Use the V4L2 subdev active state API to store the active format. This simplifies the driver not only by dropping the state stored in the imx7_csi structure, but also by replacing the manual lock with the state lock. The is_streaming field is now protected by the active state lock, either explicitly in .s_stream(), where the active state is locked manually, or implicitly in .set_fmt(), which is called with the state locked. Signed-off-by: Laurent Pinchart <[email protected]> Tested-by: Adam Ford <[email protected]> #imx8mm-beacon-kit Acked-by: Rui Miguel Silva <[email protected]> Tested-by: Martin Kepplinger <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2023-02-08media: imx: imx7-media-csi: Zero format struct before calling .get_fmt()Laurent Pinchart1-3/+4
The v4l2_subdev_format structure passed to the .get_fmt() subdev operation in imx7_csi_video_validate_fmt() isn't zeroed, which can cause undefined behaviour. Fix it. Signed-off-by: Laurent Pinchart <[email protected]> Tested-by: Adam Ford <[email protected]> #imx8mm-beacon-kit Acked-by: Rui Miguel Silva <[email protected]> Tested-by: Martin Kepplinger <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2023-02-08media: imx: imx7-media-csi: Cleanup errors in imx7_csi_async_register()Laurent Pinchart1-6/+7
It's good practice for functions to perform error cleanup internally when they fail, in order to not leave the device in a half-initialized state. Move the async notifier cleanup from the probe error path to the imx7_csi_async_register(), and drop the v4l2_async_nf_unregister() call as there is no error path after the async notifier gets registered. Signed-off-by: Laurent Pinchart <[email protected]> Tested-by: Adam Ford <[email protected]> #imx8mm-beacon-kit Acked-by: Rui Miguel Silva <[email protected]> Tested-by: Martin Kepplinger <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2023-02-08media: imx: imx7-media-csi: Drop unneeded pad checksLaurent Pinchart1-5/+1
The subdev core guarantees that the .set_fmt() operation is always called with a valid pad. Drop the unneeded pad checks. Signed-off-by: Laurent Pinchart <[email protected]> Tested-by: Adam Ford <[email protected]> #imx8mm-beacon-kit Acked-by: Rui Miguel Silva <[email protected]> Tested-by: Martin Kepplinger <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2023-02-08media: imx: imx7-media-csi: Drop unneeded src_sd checkLaurent Pinchart1-8/+0
The .s_stream() and .link_validate() operations can't be called with a NULL src_sd, as subdev nodes are not registered before the async notifier completes. Remove the unneeded checks. Signed-off-by: Laurent Pinchart <[email protected]> Tested-by: Adam Ford <[email protected]> #imx8mm-beacon-kit Acked-by: Rui Miguel Silva <[email protected]> Tested-by: Martin Kepplinger <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2023-02-08media: imx: imx7-media-csi: Drop unneeded check when starting streamingLaurent Pinchart1-3/+0
The .s_stream() operation is guaranteed not to be called to start/stop an already started/stopped subdev. Remove the unneeded check. Signed-off-by: Laurent Pinchart <[email protected]> Tested-by: Adam Ford <[email protected]> #imx8mm-beacon-kit Acked-by: Rui Miguel Silva <[email protected]> Tested-by: Martin Kepplinger <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2023-02-08media: imx: imx7-media-csi: Simplify imx7_csi_video_init_format()Laurent Pinchart1-11/+9
The imx7_csi_video_init_format() function instantiates a v4l2_subdev_format on the stack, to only use the .format field of that structure. Replace it with a v4l2_mbus_framefmt instance. Signed-off-by: Laurent Pinchart <[email protected]> Tested-by: Adam Ford <[email protected]> #imx8mm-beacon-kit Acked-by: Rui Miguel Silva <[email protected]> Tested-by: Martin Kepplinger <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2023-02-08media: imx: imx7-media-csi: Drop imx7_csi.cc fieldLaurent Pinchart1-9/+0
The imx7_csi.cc field is set but never used. Drop it. Signed-off-by: Laurent Pinchart <[email protected]> Tested-by: Adam Ford <[email protected]> #imx8mm-beacon-kit Acked-by: Rui Miguel Silva <[email protected]> Tested-by: Martin Kepplinger <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2023-02-08media: imx-jpeg: Apply clk_bulk api instead of operating specific clkMing Qian2-29/+10
using the api of clk_bulk can simplify the code. and the clock of the jpeg codec may be changed, the clk_bulk api can be compatible with the future change. Fixes: 4c2e5156d9fa ("media: imx-jpeg: Add pm-runtime support for imx-jpeg") Signed-off-by: Ming Qian <[email protected]> Signed-off-by: Hans Verkuil <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2023-01-22media: imx: imx7-media-csi: fix missing clk_disable_unprepare() in ↵Yang Yingliang1-1/+3
imx7_csi_init() Add missing clk_disable_unprepare(), if imx7_csi_dma_setup() fails in imx7_csi_init(). Fixes: ff43ca911978 ("media: imx: imx7-media-csi: Move CSI configuration before source start") Signed-off-by: Yang Yingliang <[email protected]> Reviewed-by: Rui Miguel Silva <[email protected]> Signed-off-by: Laurent Pinchart <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2023-01-22media: dw100: Add a missing unwind goto in dw100_probe()Xavier Roumegue1-1/+1
In case the IRQ allocation returns an error in dw100_probe(), the pm runtime is not disabled before to return. Add the missing unwind goto on the error handling path of the IRQ allocation request. Reported-by: kernel test robot <[email protected]> Reported-by: Dan Carpenter <[email protected]> Signed-off-by: Xavier Roumegue <[email protected]> Signed-off-by: Laurent Pinchart <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2022-11-25media: imx: Unstage the imx7-media-csi driverLaurent Pinchart3-0/+2422
The imx7-media-csi driver, currently in staging, is ready for prime-time. The staging TODO file lists a few items specific to that driver, that are already addressed (the "all of the above" part) or can be addressed later: - The frame interval monitoring support is a software mechanism to monitor the device for unexpected stalls, and should be part of the V4L2 core if desired. - Restricting the support media bus formats based on the SoC integration only aims at reducing userspace confusion by not enumerating options that are known not to be possible, it won't cause regressions if handled later. Move the description of the media bus format restriction TODO item to the driver, drop the other TODO items, and move the driver out of staging. Signed-off-by: Laurent Pinchart <[email protected]> Reviewed-by: Paul Elder <[email protected]> Acked-by: Rui Miguel Silva <[email protected]> Tested-by: Alexander Stein <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2022-11-15Merge tag 'br-v6.2d' of git://linuxtv.org/hverkuil/media_tree into media_stageMauro Carvalho Chehab1-0/+2
Tag branch * tag 'br-v6.2d' of git://linuxtv.org/hverkuil/media_tree: (35 commits) media: saa7164: remove variable cnt atomisp: fix potential NULL pointer dereferences radio-terratec: Remove variable p media: platform: s5p-mfc: Fix spelling mistake "mmaping" -> "mmapping" media: platform: mtk-mdp3: remove unused VIDEO_MEDIATEK_VPU config media: vivid: remove redundant assignment to variable checksum media: cedrus: h264: Optimize mv col buffer allocation media: cedrus: h265: Associate mv col buffers with buffer media: mediatek: vcodec: fix h264 cavlc bitstream fail media: cedrus: hevc: Fix offset adjustments media: imx-jpeg: Fix Coverity issue in probe media: v4l2-ioctl.c: Unify YCbCr/YUV terms in format descriptions media: atomisp: Fix spelling mistake "mis-match" -> "mismatch" media: c8sectpfe: Add missed header(s) media: adv748x: afe: Select input port when initializing AFE media: vimc: Update device configuration in the documentation media: adv748x: Remove dead function declaration media: mxl5005s: Make array RegAddr static const media: atomisp: Fix spelling mistake "modee" -> "mode" media: meson/vdec: always init coef_node_start ...
2022-10-24media: imx-jpeg: Fix Coverity issue in probeMirela Rabulea1-0/+2
Possible dereference null return after of_match_node, so check for NULL of_id. Signed-off-by: Mirela Rabulea <[email protected]> Signed-off-by: Hans Verkuil <[email protected]>
2022-09-30media: imx-jpeg: Lock on ioctl encoder/decoder stop cmdMing Qian1-0/+6
the ioctl encoder/decoder cmd is under queue lock, and buf_done is in the irq, it can't be locked with the mutex, they are not synchronized. when v4l2_update_last_buf_state is called to handle the encoder/decoder stop cmd, the last src buffer may be done at the same time. so it's possible that last_src_buf is set, but the output rdy_queue is empty, then driver won't mark it stopped, as v4l2_m2m_is_last_draining_src_buf() will always return false and v4l2_m2m_dst_buf_is_last() return false too. In this case, the drain will be blocked. add the hw lock around the ioctl encoder/decoder cmd, to synchronize with the buf_done. Fixes: 4911c5acf935 ("media: imx-jpeg: Implement drain using v4l2-mem2mem helpers") Signed-off-by: Ming Qian <[email protected]> Signed-off-by: Hans Verkuil <[email protected]>
2022-09-30media: imx-jpeg: Support contiguous and non contiguous formatMing Qian2-48/+186
mxc-jpeg supports non contiguous format nv12m, and in order to compatible with the devices that only support contiguous format nv12, jpeg can support nv12 and nv12m in the same time. Signed-off-by: Ming Qian <[email protected]> Signed-off-by: Hans Verkuil <[email protected]> [hverkuil: document is_rgb variable]
2022-09-30media: imx-jpeg: Implement g_selection and s_selectionMing Qian2-120/+208
The codec can support any image size WxH, with arbitrary W (image width) and H (image height) dimensions. But it requires buffer alignment, so driver can report the aligned resolution through the g_fmt, and report the actual resolution through the g_selection. For encoder, it even support to encode a smaller jpeg than the original picture through s_selection api. For the decoder, we do not support cropping a portion smaller than the original picture, due to hardware limitations (wrapper side). Fixes: 9e7aa76cdb02 ("media: imx-jpeg: Align upwards buffer size") Signed-off-by: Ming Qian <[email protected]> Signed-off-by: Hans Verkuil <[email protected]>
2022-09-30media: imx-jpeg: Disable useless interrupt to avoid kernel panicMing Qian1-1/+3
There is a hardware bug that the interrupt STMBUF_HALF may be triggered after or when disable interrupt. It may led to unexpected kernel panic. And interrupt STMBUF_HALF and STMBUF_RTND have no other effect. So disable them and the unused interrupts. meanwhile clear the interrupt status when disable interrupt. Signed-off-by: Ming Qian <[email protected]> Reviewed-by: Mirela Rabulea <[email protected]> Signed-off-by: Hans Verkuil <[email protected]>