-
Notifications
You must be signed in to change notification settings - Fork 6.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improve NXP CSI and MIPI_CSI2Rx drivers #76475
Improve NXP CSI and MIPI_CSI2Rx drivers #76475
Conversation
2f6a738
to
ece0adc
Compare
6aee5b6
to
23af338
Compare
23af338
to
dcaf23c
Compare
Rebase because the PR #73009 is merged. |
dcaf23c
to
406703f
Compare
Switch to use the new video interfaces bindings Signed-off-by: Phi Bang Nguyen <[email protected]>
Switch to use the new video interfaces bindings Signed-off-by: Phi Bang Nguyen <[email protected]>
The ov5640 camera driver now supports both MIPI CSI2 (DPHY) and DVP modes. It is in MIPI CSI2 mode in this overlay. Add bus-type property for this. In this mode, data-lanes property is required as well. Signed-off-by: Phi Bang Nguyen <[email protected]>
Get number of data lanes from device tree instead of hard-coding it. Signed-off-by: Phi Bang Nguyen <[email protected]>
The peer remote device "sensor_dev" can be retrieved from the remote-endpoint-label. Direct reference via phandle is not needed. Signed-off-by: Phi Bang Nguyen <[email protected]>
Add set_ctrl callback to propagate controls to the sensor. Signed-off-by: Farah Fliss <[email protected]> Signed-off-by: Phi Bang Nguyen <[email protected]>
Instead of fixing csi2rx clock frequencies, set them according to the pixel rate got from the camera sensor. Signed-off-by: Trung Hieu Le <[email protected]> Signed-off-by: Phi Bang Nguyen <[email protected]>
Add support for changing frame rate. Signed-off-by: Trung Hieu Le <[email protected]> Signed-off-by: Phi Bang Nguyen <[email protected]>
As getting bytes per pixel of a pixel format is a very common operation, add an utility function for it instead of repeating the same codes in different drivers. Signed-off-by: Phi Bang Nguyen <[email protected]>
Add support for changing frame rate Signed-off-by: Trung Hieu Le <[email protected]> Signed-off-by: Phi Bang Nguyen <[email protected]>
Remove the obsolete comment about the init order of the CSI and the camera sensors (e.g. mt9m114) which is not true anymore. Signed-off-by: Phi Bang Nguyen <[email protected]>
The peer remote device "source_dev" can be retrieved from the remote-endpoint-label. Direct reference via phandle is not needed. Signed-off-by: Phi Bang Nguyen <[email protected]>
The CSI needs to be initialized BEFORE the camera sensor to provide clock to the camera sensor. It is now possible to do so as direct reference to the sensor via phandle is now removed. There will be no check failure on the init order anymore when compiling. Signed-off-by: Phi Bang Nguyen <[email protected]>
The CSI is an NXP IP and the driver has been very much changed by NXP, so add NXP copyright to it. Signed-off-by: Phi Bang Nguyen <[email protected]>
c89858b
to
d07370c
Compare
@danieldegrasse Regarding the commit "drivers: video: csi: Fix start / stop issue", your points are almost right. To summerize:
Given the strict timeline approaching and to facilitate the review, we removed this commit from the PR and wait for next time to submit it. |
Reading the video driver documentation, I think the behavior for There isn't clear documentation on how
@loicpoulain do you know which behavior is correct? I do not think we should flush or modify the output buffer queue when the stream is stopped. |
=> The CSI needs at least 2 buffers to be able to start. Remaining buffers in the input queue may be insufficient. That's why users need to re-queue buffer (option 1).
=> If users re-queue buffers (of course they will not allocate new buffers but re-use the ones in the buffer pool). We need to clean the output queue unless buffers will be present on both input and output queues. |
Sorry, I think I might have been unclear. My understanding is that user might interact with the video API like so:
At this point, if the CSI has processed buffer B we should expect that buffer to be in the output queue, and if the user tries to dequeue a video buffer they will get buffer B. Video buffer C is where I am not sure. I think that the buffer should remain in the input queue, so that if the user then does something like so:
They would receive buffer C. However, I'm not sure if this is correct, or if we should be clearing the input queue so that the user now would receive buffer A when they run the dequeue operation. Does this help clarify my question here? |
Yes, buffer C is in the input queue. But, sorry I don't really get your idea behind when raising these points (?) So, let me summerize what's going on in the application:
At this point, user can "stop stream" and this can happen at any step in the loop. So, the questions are:
My points are
A typical example of capturing application can be found here in Linux. They don't really do a restart but we can suppose that to restart, just call
|
This PR improves the NXP's csi and mipi_csi2_rx drivers including
Fixes #80304
This PR depends on
#74415 and #72254, also relates to #76144