-
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
drivers: video: video_mcux_smartdma: add SMARTDMA video driver #72827
drivers: video: video_mcux_smartdma: add SMARTDMA video driver #72827
Conversation
96d24ea
to
ecdd67f
Compare
The following west manifest projects have been modified in this Pull Request:
Note: This message is automatically posted and updated by the Manifest GitHub Action. |
ecdd67f
to
7755b6a
Compare
Some news about it there, with a proposed API: #66994 (comment) |
Introduce driver for ov7670 camera, supporting QCIF,QVGA,CIF, and VGA resolution in YUV and RGB mode. Support was verified on the FRDM-MCXN947, using the SmartDMA camera engine, which is enabled in the following PR: zephyrproject-rtos#72827 Signed-off-by: Daniel DeGrasse <[email protected]>
here (need to click on "load diff") is a new API that seems underway: if (drv_data->fifo_length == 0) {
vbuf->flags = VIDEO_BUF_EOF;
} else {
vbuf->flags = VIDEO_BUF_FRAG;
k_work_submit_to_queue(&ac_work_q, &drv_data->buf_work);
} |
Yes, have marked resolved |
Introduce driver for ov7670 camera, supporting QCIF,QVGA,CIF, and VGA resolution in YUV and RGB mode. Support was verified on the FRDM-MCXN947, using the SmartDMA camera engine, which is enabled in the following PR: zephyrproject-rtos#72827 Signed-off-by: Daniel DeGrasse <[email protected]>
Introduce driver for ov7670 camera, supporting QCIF,QVGA,CIF, and VGA resolution in YUV and RGB mode. Support was verified on the FRDM-MCXN947, using the SmartDMA camera engine, which is enabled in the following PR: zephyrproject-rtos#72827 Signed-off-by: Daniel DeGrasse <[email protected]>
7755b6a
to
5028998
Compare
Introduce driver for ov7670 camera, supporting QCIF,QVGA,CIF, and VGA resolution in YUV and RGB mode. Support was verified on the FRDM-MCXN947, using the SmartDMA camera engine, which is enabled in the following PR: #72827 Signed-off-by: Daniel DeGrasse <[email protected]>
Introduce driver for ov7670 camera, supporting QCIF,QVGA,CIF, and VGA resolution in YUV and RGB mode. Support was verified on the FRDM-MCXN947, using the SmartDMA camera engine, which is enabled in the following PR: zephyrproject-rtos/zephyr#72827 (cherry picked from commit 3ce3ed3) Original-Signed-off-by: Daniel DeGrasse <[email protected]> GitOrigin-RevId: 3ce3ed3 Change-Id: I20f10c984e4a0c2a6c805fde3625c0b6310f4fe4 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/zephyr/+/5607905 Tested-by: ChromeOS Prod (Robot) <[email protected]> Reviewed-by: Fabio Baltieri <[email protected]> Commit-Queue: Fabio Baltieri <[email protected]>
5028998
to
bb59e5e
Compare
9bf9e5d
to
765cc42
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, is it ok to merge @danieldegrasse ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is true that many video processing cores have a line buffer, or a 5-line buffers (i.e. small kernels) rather than an XYZ bytes buffers.
A line-based min/max size sounds good.
Yes, provided you are ok with the API changes. Let me rebase to fix conflicts. |
d230daa
765cc42
to
d230daa
Compare
Add min and max line count to the video_caps structure- these fields can be used by applications to determine the size of video buffer they need to allocate for a video endpoint The min and max line count fields are designed to enable supporting endpoints that may produce or consume partial frames within each video buffer, and may support arbitrarily sized video buffers. Signed-off-by: Daniel DeGrasse <[email protected]>
Update existing video drivers to handle the min/max line count field within the video_caps structure. All drivers work with full frames currently, so use the special LINE_COUNT_HEIGHT value to indicate this. Signed-off-by: Daniel DeGrasse <[email protected]>
Update video samples to use min/max line count capabilities when allocating video buffers. Signed-off-by: Daniel DeGrasse <[email protected]>
Add line_offset field to the video_buffer structure. This field indicates the offset (in horizontal lines) within a frame that a video buffer starts at. This is useful for video devices that produce or consume video buffers that constitute a partial frame. Signed-off-by: Daniel DeGrasse <[email protected]>
Since all video drivers in tree use a full frame, their video buffers will always start at a line_offset of 0 within the frame. Signed-off-by: Daniel DeGrasse <[email protected]>
Handle line_offset field within video capture sample. Other samples do not support partial framebuffers and therefore can ignore this field. Signed-off-by: Daniel DeGrasse <[email protected]>
The SMARTDMA is a programmable DMA engine, and supports custom firmware in order to run complex DMA operations. Update the driver to increase the flexibility users have when configuring the SMARTDMA with custom firmware, and remove the RT500 display firmware specific definitions and functionality from the driver. This display setup is now handled from the MIPI DSI driver, since the firmware used for this case is specific to the MIPI DSI IP. This change also requires an update to the RT500 devicetree, as the register definition for the SMARTDMA has changed, so the base address must as well. Signed-off-by: Daniel DeGrasse <[email protected]>
Improve resolution init code for OV7670 driver, to properly program the full set of registers needed to realize a given output resolution. The settings for these registers are based on those used in the MCUX SDK driver, which are derived from the resolution register settings given in the OV7670 programming guide, with a different configuration for the CLKSRC and DBLV registers used for the input clock. Signed-off-by: Daniel DeGrasse <[email protected]>
Add SMARTDMA video driver. This driver uses the SMARTDMA engine as a parallel camera interface, which can read QVGA frames from a camera device. Due to SRAM constraints, the video driver divides the camera stream into multiple horizontal video buffers as it streams them back to an application. Signed-off-by: Daniel DeGrasse <[email protected]>
Add definition for SMARTDMA device to the MCXN94x devicetree. Signed-off-by: Daniel DeGrasse <[email protected]>
Add support for LPI2C7. This peripheral is used for interfacing with cameras connected to the J9 header. Signed-off-by: Daniel DeGrasse <[email protected]>
Add support for SMARTDMA camera engine, and a OV7670 parallel camera definition for the frdm_mcnx947 board. This support has been tested with the video capture sample. Signed-off-by: Daniel DeGrasse <[email protected]>
Add support for using the SMARTDMA engine on the FRDM-MCXN947 board with the video capture sample. Signed-off-by: Daniel DeGrasse <[email protected]>
Do not apply format setting unless needed. Also, correct the check for the RGB565 format setting- the zephyr display API treats RGB565 and BGR565 as big endian, so the format needed here is BGR565. Signed-off-by: Daniel DeGrasse <[email protected]>
d230daa
to
7763056
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for adjusting all the other drivers too!
Add SMARTDMA video driver. This driver uses the SMARTDMA engine as a
parallel camera interface, which can read QVGA frames from a camera
device. Due to SRAM constraints, the video driver divides the camera
stream into multiple horizontal video buffers as it streams them back to
an application.
Note that this PR also contains two additional major changes:
This PR depends on #72826 for camera supportPR has been tested on the following boards:
frdm_mcxn947//cpu0
:samples/subsys/video/capture
mimxrt595_evk//cm33
:samples/subsys/display/lvgl
(using G1120B0MIPI shield)