-
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
video: emul: virtual driver for an imager and RX engine #79482
base: main
Are you sure you want to change the base?
Conversation
I note that the frame interval API was merged, this will need to include it. |
eb4a7a4
to
cfa3bfb
Compare
|
64e0235
to
9a1a450
Compare
12321fb
to
9d5cd84
Compare
force-push: unit tests for the emulated drivers: this covers the entire video API except To test: |
9d5cd84
to
5bcba0a
Compare
@josuah : Is the PR ready for review ? Sorry, I asked because I received email notifications of the continuous force-push rather often that make me thinking that this is in development phase. If so, is it better to limit the force push not only to avoid email notifications but also to reduce Zephyr CI kicked-off burden for every push ? If it's not the case, it's OK to do that. |
@ngphibang you are right, I should work on a separate [EDIT: this was thought as being ready at first, and then I thought "let's add unit tests to the same PR", and then "lets' add some more", etc: I should take some time to let things mature and be more reasonable] |
5bcba0a
to
85e458f
Compare
force-push:
|
85e458f
to
eb2d81e
Compare
force-push:
|
PR zephyrproject-rtos#79482 is where this commit would be added Signed-off-by: Josuah Demangeon <[email protected]>
PR zephyrproject-rtos#79482 is where this commit would be added Signed-off-by: Josuah Demangeon <[email protected]>
PR zephyrproject-rtos#79482 is where this commit would be added Signed-off-by: Josuah Demangeon <[email protected]>
PR zephyrproject-rtos#79482 is where this commit would be added Signed-off-by: Josuah Demangeon <[email protected]>
PR zephyrproject-rtos#79482 is where this commit would be added Signed-off-by: Josuah Demangeon <[email protected]>
PR zephyrproject-rtos#79482 is where this commit would be added Signed-off-by: Josuah Demangeon <[email protected]>
PR zephyrproject-rtos#79482 is where this commit would be added Signed-off-by: Josuah Demangeon <[email protected]>
In the process of implementing these emulated drivers, I introduced more video API helpers to reduce boilerplate. If introducing helpers does not make sense in this same PR, I can integrate them back into the emulated drivers to reduce the amount of things this introduces. |
I will try to review this whenever possible, thanks ! |
eb2d81e
to
87e71dd
Compare
drivers/video/video_emul_imager.c
Outdated
return emul_imager_write_reg(dev, EMUL_IMAGER_REG_CTRL, 0); | ||
} | ||
|
||
static const struct video_driver_api emul_imager_driver_api = { |
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.
Please use the DEVICE_API
wrapper.
static const struct video_driver_api emul_imager_driver_api = { | |
static DEVICE_API(video, emul_imager_driver_api) = { |
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.
Yes thank you, done.
This will be helpful for checking device types in the video shell based on this PR!
drivers/video/video_emul_rx.c
Outdated
return 0; | ||
} | ||
|
||
static const struct video_driver_api emul_rx_driver_api = { |
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.
static const struct video_driver_api emul_rx_driver_api = { | |
static DEVICE_API(video, emul_rx_driver_api) = { |
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.
Done as well, thank you for the reminder.
include/zephyr/drivers/video.h
Outdated
* | ||
* @return The frame interval value in microseconds. | ||
*/ | ||
uint64_t video_frmival_nsec(const struct video_frmival *frmival); |
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.
Could this be a simple inline helper?
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.
Yes I agree. Done now.
Introduce a video_get_format_index() utility to help finding a caps entry out of a given format. Introduce several utilities to seek and apply frame intervals. Signed-off-by: Josuah Demangeon <[email protected]>
Add a new implementation of a test pattern generator, with the same architecture as real drivers: split receiver core and I2C-controlled sub-device, with changes of video format in "zephyr,emul-imager" leads to different data produced by "zephyr,emul-rx". Signed-off-by: Josuah Demangeon <[email protected]>
87e71dd
to
6024bb9
Compare
This takes inspiration on the other skeleton.c drivers through Zephyr tree:
https://github.com/zephyrproject-rtos/zephyr/blob/main/drivers/usb/udc/udc_skeleton.c
https://github.com/zephyrproject-rtos/zephyr/blob/main/drivers/display/display_dummy.c
It acts as a starting point and as a puppet to explain API changes affecting image sensors.
Be used for providing test cases for the entire API, as required for stable APIs.
Utilities are introduced in the process to reduce boilerplate.
Twister command (new with this PR):
Fixes: #73867