Skip to content
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 mipicsi2rx drivers #76475

Open
wants to merge 14 commits into
base: main
Choose a base branch
from

Conversation

ngphibang
Copy link
Contributor

@ngphibang ngphibang commented Jul 30, 2024

This PR improves the NXP's csi and mipi_csi2_rx drivers which contains some minor fixes, optimization and especially, support for changing frame rate.

This PR depends on #74415 and #72254, also relates to #76144

@josuah josuah added priority: low Low impact/importance bug platform: NXP NXP area: Video Video subsystem platform: NXP Drivers NXP Semiconductors, drivers labels Aug 3, 2024
@ngphibang ngphibang marked this pull request as ready for review August 20, 2024 09:33
@ngphibang ngphibang force-pushed the improve_nxp_csi_mipicsi2rx_drivers branch from 2f6a738 to ece0adc Compare August 21, 2024 15:24
@zephyrbot zephyrbot added the area: Shields Shields (add-on boards) label Aug 21, 2024
@ngphibang ngphibang force-pushed the improve_nxp_csi_mipicsi2rx_drivers branch 2 times, most recently from 6aee5b6 to 23af338 Compare August 21, 2024 19:39
@trunghieulenxp trunghieulenxp force-pushed the improve_nxp_csi_mipicsi2rx_drivers branch from 23af338 to dcaf23c Compare August 28, 2024 09:48
@trunghieulenxp
Copy link
Contributor

trunghieulenxp commented Aug 28, 2024

Rebase because the PR #73009 is merged.

@trunghieulenxp trunghieulenxp force-pushed the improve_nxp_csi_mipicsi2rx_drivers branch from dcaf23c to 406703f Compare August 29, 2024 14:50
@trunghieulenxp trunghieulenxp force-pushed the improve_nxp_csi_mipicsi2rx_drivers branch from 406703f to e3ad022 Compare September 11, 2024 08:07
@trunghieulenxp
Copy link
Contributor

Rebase because the PR #76393 is merged

@danieldegrasse
Copy link
Collaborator

Rebase because the PR #76393 is merged

@trunghieulenxp while you are welcome to rebase as much as you please, it may not be worth bothering to do so until the dependent PRs are merged, especially if CI will fail until that point. If a change is large I'll often review it before CI is passing, but in this case the change is primarily at the driver level, so it likely won't generate a ton of engagement until CI can pass.

@ngphibang ngphibang force-pushed the improve_nxp_csi_mipicsi2rx_drivers branch from e3ad022 to 1263f40 Compare October 10, 2024 19:35
@ngphibang
Copy link
Contributor Author

Updated according changes in #74415.

@danieldegrasse : Yes, but since there are new changes comming, we update it regularly to not forget things :). Another reason is to cooperate with this PR.

@trunghieulenxp trunghieulenxp force-pushed the improve_nxp_csi_mipicsi2rx_drivers branch 2 times, most recently from 8e6411d to 6860d6f Compare October 14, 2024 12:32
ngphibang and others added 14 commits October 15, 2024 12:12
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]>
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]>
When stopping, video_flush() moves all the remaining buffers
from the fifo_in to the fifo_out queue.

When restarting, we have two issues:
- There might be insufficient or no buffers in the fifo_in
queue to get the pipeline started.

- When dequeuing, users might immediatly get the incorrect
buffers in the fifo_out which do not come from interruption.

Fix it by moving all the remaining buffers from the fifo_out
to the fifo_in before starting the video capture.

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]>
The mcux csi is an NXP IP and the driver has been recently changed much
by NXP, so add NXP copyright to it.

Signed-off-by: Phi Bang Nguyen <[email protected]>
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]>
Switch to use the new video interfaces binding

Signed-off-by: Phi Bang Nguyen <[email protected]>
Switch to use the new video interfaces binding

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]>
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]>
@trunghieulenxp trunghieulenxp force-pushed the improve_nxp_csi_mipicsi2rx_drivers branch from 6860d6f to 9e872df Compare October 15, 2024 12:28
@ngphibang ngphibang removed the priority: low Low impact/importance bug label Oct 15, 2024
@ngphibang
Copy link
Contributor Author

ngphibang commented Oct 15, 2024

As dependencies are now merged, could you help to review this to move this PR along ? @danieldegrasse , @josuah , @loicpoulain

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: Shields Shields (add-on boards) area: Video Video subsystem platform: NXP Drivers NXP Semiconductors, drivers platform: NXP NXP
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants