| f368ded8 | 22-May-2026 |
Chen Ni <nichen@iscas.ac.cn> |
media: ti: j721e-csi2rx: Fix error handling for media_entity_remote_source_pad_unique()
The media_entity_remote_source_pad_unique() function returns an error pointer on failure, not NULL. Fix the ch
media: ti: j721e-csi2rx: Fix error handling for media_entity_remote_source_pad_unique()
The media_entity_remote_source_pad_unique() function returns an error pointer on failure, not NULL. Fix the check to use IS_ERR() and return PTR_ERR() to correctly handle allocation failures.
Fixes: 982135c0eac6 ("media: ti: j721e-csi2rx: add a subdev for the core device") Fixes: 3ed9c0a1fdba ("media: ti: j721e-csi2rx: add multistream support") Signed-off-by: Chen Ni <nichen@iscas.ac.cn> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
show more ...
|
| ec8d4573 | 20-May-2026 |
Jai Luthra <jai.luthra@ideasonboard.com> |
media: ti: j721e-csi2rx: Support system suspend using pm_notifier
As this device is the "orchestrator" for the rest of the media pipeline, we need to stop all on-going streams before system suspend
media: ti: j721e-csi2rx: Support system suspend using pm_notifier
As this device is the "orchestrator" for the rest of the media pipeline, we need to stop all on-going streams before system suspend and enable them back when the system wakes up from sleep.
Using .suspend/.resume callbacks does not work, as the order of those callbacks amongst various devices in the camera pipeline like the sensor, FPD serdes, CSI bridge etc. is impossible to enforce, even with device links. For example, the Cadence CSI bridge is a child device of this device, thus we cannot create a device link with the CSI bridge as a provider and this device as consumer. This can lead to situations where all the dependencies for the bridge have not yet resumed when we request the subdev to start streaming again through the .resume callback defined in this device.
Instead here we register a notifier callback with the PM framework which is triggered when the system is fully functional. At this point we can cleanly stop or start the streams, because we know all other devices and their dependencies are functional. A downside of this approach is that the userspace is also alive (not frozen yet, or just thawed), so the suspend notifier might complete before the userspace has completed all ioctls, like QBUF/DQBUF/STREAMON/STREAMOFF.
Tested-by: Rishikesh Donadkar <r-donadkar@ti.com> Reviewed-by: Rishikesh Donadkar <r-donadkar@ti.com> Signed-off-by: Jai Luthra <jai.luthra@ideasonboard.com> Signed-off-by: Rishikesh Donadkar <r-donadkar@ti.com> Reviewed-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
show more ...
|
| c0429f49 | 20-May-2026 |
Jai Luthra <jai.luthra@ideasonboard.com> |
media: ti: j721e-csi2rx: Support runtime suspend
Add support for runtime power-management to enable powering off the shared power domain between Cadence CSI2RX and TI CSI2RX wrapper when the device(
media: ti: j721e-csi2rx: Support runtime suspend
Add support for runtime power-management to enable powering off the shared power domain between Cadence CSI2RX and TI CSI2RX wrapper when the device(s) are not in use.
When powering off the IP, the PSI-L endpoint loses the paired DMA channels. Thus we have to release the DMA channels at runtime suspend and request them again at resume.
Tested-by: Rishikesh Donadkar <r-donadkar@ti.com> Reviewed-by: Rishikesh Donadkar <r-donadkar@ti.com> Reviewed-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com> Signed-off-by: Jai Luthra <jai.luthra@ideasonboard.com> Co-developed-by: Rishikesh Donadkar <r-donadkar@ti.com> Signed-off-by: Rishikesh Donadkar <r-donadkar@ti.com> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
show more ...
|
| 13ef2b0f | 20-May-2026 |
Rishikesh Donadkar <r-donadkar@ti.com> |
media: ti: j721e-csi2rx: Change the drain architecture for multistream
On buffer starvation the DMA is marked IDLE, and the stale data in the internal FIFOs gets drained only on the next VIDIOC_QBUF
media: ti: j721e-csi2rx: Change the drain architecture for multistream
On buffer starvation the DMA is marked IDLE, and the stale data in the internal FIFOs gets drained only on the next VIDIOC_QBUF call from the userspace. This approach works fine for a single stream case.
But in multistream scenarios, buffer starvation for one stream can block the shared HW FIFO of the CSI2RX IP. This can stall the pipeline for all other streams, even if buffers are available for them.
This patch introduces a new architecture, that continuously drains data from the shared HW FIFO into a small (32KiB) buffer if no buffers are made available to the driver from the userspace. This ensures independence between different streams, where a slower downstream element for one camera does not block streaming for other cameras.
Additionally, after we drain for a stream, the next frame will be a partial frame, as a portion of its data will have already been drained before a valid buffer is queued by user space to the driver. Return the partial frame to user space with VB2_BUF_STATE_ERROR.
Use wait for completion barrier to make sure the shared hardware FIFO is cleared of the data at the end of stream after the source has stopped sending data.
Reviewed-by: Jai Luthra <jai.luthra@ideasonboard.com> Reviewed-by: Yemike Abhilash Chandra <y-abhilashchandra@ti.com> Signed-off-by: Rishikesh Donadkar <r-donadkar@ti.com> Reviewed-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
show more ...
|
| 7b6887a0 | 20-May-2026 |
Jai Luthra <j-luthra@ti.com> |
media: ti: j721e-csi2rx: Submit all available buffers
We already make sure to submit all available buffers to DMA in each DMA completion callback.
Move that logic in a separate function, and use it
media: ti: j721e-csi2rx: Submit all available buffers
We already make sure to submit all available buffers to DMA in each DMA completion callback.
Move that logic in a separate function, and use it during stream start as well, as most application queue all their buffers before stream on.
Signed-off-by: Jai Luthra <j-luthra@ti.com> Reviewed-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com> Reviewed-by: Yemike Abhilash Chandra <y-abhilashchandra@ti.com> Co-developed-by: Rishikesh Donadkar <r-donadkar@ti.com> Signed-off-by: Rishikesh Donadkar <r-donadkar@ti.com> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
show more ...
|
| 3ed9c0a1 | 20-May-2026 |
Jai Luthra <j-luthra@ti.com> |
media: ti: j721e-csi2rx: add multistream support
Each CSI2 stream can be multiplexed into 32 independent streams, each identified by its virtual channel number and data type. The incoming data from
media: ti: j721e-csi2rx: add multistream support
Each CSI2 stream can be multiplexed into 32 independent streams, each identified by its virtual channel number and data type. The incoming data from these streams can be filtered on the basis of either the virtual channel or the data type.
To capture this multiplexed stream, the application needs to tell the driver how it wants to route the data. It needs to specify which context should process which stream. This is done via the new routing APIs.
Add ioctls to accept routing information from the application and save that in the driver. This can be used when starting streaming on a context to determine which route and consequently which virtual channel it should process.
De-assert the pixel interface reset on first start_streaming() and assert it on the last stop_streaming().
Reviewed-by: Yemike Abhilash Chandra <y-abhilashchandra@ti.com> Co-developed-by: Pratyush Yadav <p.yadav@ti.com> Signed-off-by: Pratyush Yadav <p.yadav@ti.com> Signed-off-by: Jai Luthra <j-luthra@ti.com> Co-developed-by: Rishikesh Donadkar <r-donadkar@ti.com> Signed-off-by: Rishikesh Donadkar <r-donadkar@ti.com> Reviewed-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
show more ...
|
| d71fc9d9 | 20-May-2026 |
Jai Luthra <j-luthra@ti.com> |
media: ti: j721e-csi2rx: add support for processing virtual channels
Use get_frame_desc() to get the frame desc from the connected source, and use the provided virtual channel and DT instead of defa
media: ti: j721e-csi2rx: add support for processing virtual channels
Use get_frame_desc() to get the frame desc from the connected source, and use the provided virtual channel and DT instead of defaults.
As we don't support multiple streams yet, we will just always use stream 0. If the source doesn't support get_frame_desc(), fall back to the previous method of always capturing virtual channel 0.
Reviewed-by: Yemike Abhilash Chandra <y-abhilashchandra@ti.com> Co-developed-by: Pratyush Yadav <p.yadav@ti.com> Signed-off-by: Pratyush Yadav <p.yadav@ti.com> Signed-off-by: Jai Luthra <j-luthra@ti.com> Signed-off-by: Rishikesh Donadkar <r-donadkar@ti.com> Reviewed-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
show more ...
|
| 57283236 | 20-May-2026 |
Pratyush Yadav <p.yadav@ti.com> |
media: ti: j721e-csi2rx: get number of contexts from device tree
Different platforms that use this driver might have different number of DMA channels allocated for CSI. So only as many DMA contexts
media: ti: j721e-csi2rx: get number of contexts from device tree
Different platforms that use this driver might have different number of DMA channels allocated for CSI. So only as many DMA contexts can be used as the number of DMA channels available. Get the number of channels provided via device tree and only configure that many contexts, and hence only that many pads.
Reviewed-by: Yemike Abhilash Chandra <y-abhilashchandra@ti.com> Reviewed-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com> Signed-off-by: Pratyush Yadav <p.yadav@ti.com> Co-developed-by: Jai Luthra <j-luthra@ti.com> Signed-off-by: Jai Luthra <j-luthra@ti.com> Signed-off-by: Rishikesh Donadkar <r-donadkar@ti.com> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
show more ...
|
| 982135c0 | 20-May-2026 |
Jai Luthra <j-luthra@ti.com> |
media: ti: j721e-csi2rx: add a subdev for the core device
With single stream capture, it was simpler to use the video device as the media entity representing the main TI CSI2RX device. Now with mult
media: ti: j721e-csi2rx: add a subdev for the core device
With single stream capture, it was simpler to use the video device as the media entity representing the main TI CSI2RX device. Now with multi stream capture coming into the picture, the model has shifted to each video device having a link to the main device's subdev. The routing would then be set on this subdev.
Add this subdev, link each context to this subdev's entity and link the subdev's entity to the source. Also add an array of media pads. It will have one sink pad and source pads equal to the number of contexts.
Support the new enable_stream()/disable_stream() APIs in the subdev instead of s_stream() hook.
Reviewed-by: Yemike Abhilash Chandra <y-abhilashchandra@ti.com> Co-developed-by: Pratyush Yadav <p.yadav@ti.com> Signed-off-by: Pratyush Yadav <p.yadav@ti.com> Signed-off-by: Jai Luthra <j-luthra@ti.com> Signed-off-by: Rishikesh Donadkar <r-donadkar@ti.com> Reviewed-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
show more ...
|
| 16fe3fc1 | 20-May-2026 |
Pratyush Yadav <p.yadav@ti.com> |
media: ti: j721e-csi2rx: allocate DMA channel based on context index
With multiple contexts, there needs to be a different DMA channel for each context. Earlier, the DMA channel name was hard coded
media: ti: j721e-csi2rx: allocate DMA channel based on context index
With multiple contexts, there needs to be a different DMA channel for each context. Earlier, the DMA channel name was hard coded to "rx0" for the sake of simplicity. Generate the DMA channel name based on its index and get the channel corresponding to the context.
Signed-off-by: Pratyush Yadav <p.yadav@ti.com> Signed-off-by: Jai Luthra <j-luthra@ti.com> Reviewed-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Yemike Abhilash Chandra <y-abhilashchandra@ti.com> Reviewed-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com> Signed-off-by: Rishikesh Donadkar <r-donadkar@ti.com> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
show more ...
|
| e94ae7d2 | 20-May-2026 |
Pratyush Yadav <p.yadav@ti.com> |
media: ti: j721e-csi2rx: prepare SHIM code for multiple contexts
Currently the SHIM code to configure the context only touches the first context. Add support for writing to the context's registers b
media: ti: j721e-csi2rx: prepare SHIM code for multiple contexts
Currently the SHIM code to configure the context only touches the first context. Add support for writing to the context's registers based on the context index.
Signed-off-by: Pratyush Yadav <p.yadav@ti.com> Signed-off-by: Jai Luthra <j-luthra@ti.com> Reviewed-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Yemike Abhilash Chandra <y-abhilashchandra@ti.com> Reviewed-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com> Signed-off-by: Rishikesh Donadkar <r-donadkar@ti.com> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
show more ...
|
| c071e5fd | 20-May-2026 |
Jai Luthra <j-luthra@ti.com> |
media: ti: j721e-csi2rx: separate out device and context
The TI CSI2RX wrapper has two parts: the main device and the DMA contexts. The driver was originally written with single camera capture in mi
media: ti: j721e-csi2rx: separate out device and context
The TI CSI2RX wrapper has two parts: the main device and the DMA contexts. The driver was originally written with single camera capture in mind, so only one DMA context was needed. For the sake of simplicity, the context specific stuff was not modeled different to the main device.
To enable multiplexed stream capture, the contexts need to be separated out from the main device. Create a struct ti_csi2rx_ctx that holds the DMA context specific things. Separate out functions handling the device and context related functionality.
Reviewed-by: Yemike Abhilash Chandra <y-abhilashchandra@ti.com> Reviewed-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com> Co-developed-by: Pratyush Yadav <p.yadav@ti.com> Signed-off-by: Pratyush Yadav <p.yadav@ti.com> Signed-off-by: Jai Luthra <j-luthra@ti.com> Signed-off-by: Rishikesh Donadkar <r-donadkar@ti.com> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
show more ...
|
| e0f1c9a9 | 26-Apr-2026 |
Myeonghun Pak <mhun512@gmail.com> |
media: ti: vpe: unwind v4l2 device registration on probe error
If the vpe_top resource is missing, vpe_probe() returns -ENODEV after v4l2_device_register() has succeeded. Probe failures do not call
media: ti: vpe: unwind v4l2 device registration on probe error
If the vpe_top resource is missing, vpe_probe() returns -ENODEV after v4l2_device_register() has succeeded. Probe failures do not call the driver's remove callback, so the v4l2 device remains registered on that error path.
Route that failure through the existing v4l2_device_unregister() unwind label, matching the other errors after v4l2_device_register().
Fixes: 4d59c7d45585 ("media: ti-vpe: vpe: Add missing null pointer checks") Cc: stable@vger.kernel.org Co-developed-by: Ijae Kim <ae878000@gmail.com> Signed-off-by: Ijae Kim <ae878000@gmail.com> Signed-off-by: Myeonghun Pak <mhun512@gmail.com> Reviewed-by: Yemike Abhilash Chandra <y-abhilashchandra@ti.com> Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>
show more ...
|
| e8f319ea | 17-Mar-2026 |
Felix Gu <ustc.gu@gmail.com> |
media: ti: vpe: Fix the error code of devm_kzalloc() in vip_probe_slice()
In vip_probe_slice(), the error check for devm_kzalloc() incorrectly uses PTR_ERR_OR_ZERO() which returns 0 for NULL pointer
media: ti: vpe: Fix the error code of devm_kzalloc() in vip_probe_slice()
In vip_probe_slice(), the error check for devm_kzalloc() incorrectly uses PTR_ERR_OR_ZERO() which returns 0 for NULL pointer.
Return -ENOMEM for devm_kzalloc() failure.
Fixes: fc2873aa4a21 ("media: ti: vpe: Add the VIP driver") Cc: stable@vger.kernel.org Signed-off-by: Felix Gu <ustc.gu@gmail.com> Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>
show more ...
|
| 5e78a431 | 17-Mar-2026 |
Felix Gu <ustc.gu@gmail.com> |
media: ti: vpe: Fix the error code of devm_request_irq()
Return the actual error code from devm_request_irq() instead of incorrectly returning -ENOMEM.
Fixes: fc2873aa4a21 ("media: ti: vpe: Add the
media: ti: vpe: Fix the error code of devm_request_irq()
Return the actual error code from devm_request_irq() instead of incorrectly returning -ENOMEM.
Fixes: fc2873aa4a21 ("media: ti: vpe: Add the VIP driver") Cc: stable@vger.kernel.org Signed-off-by: Felix Gu <ustc.gu@gmail.com> Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>
show more ...
|