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

drivers: video: emul: simplify, avoid mission creep #83220

Merged

Conversation

josuah
Copy link
Collaborator

@josuah josuah commented Dec 19, 2024

The general goal is making video_emul_* just enough complexity to test the APIs on CI.

  • Instead of storing a full frame in the emulated imager, only store one line.
  • Drop the test pattern generation, as VIDEO_SW_GENERATOR does it and no use in maintaining it twice.
  • Other fixes and minor improvements.

[EDIT: updated the PR goals mid-way]

@@ -157,7 +157,7 @@ ZTEST(video_common, test_video_vbuf)
zexpect_ok(video_set_format(rx_dev, VIDEO_EP_OUT, &fmt));

/* Allocate a buffer, assuming prj.conf gives enough memory for it */
vbuf = video_buffer_alloc(fmt.pitch * fmt.height, K_FOREVER);
vbuf = video_buffer_alloc(fmt.pitch * fmt.height, K_NO_WAIT);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change is not explained in the commit message. Also I suppose the below assertion is then not valid anymore?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point thank you, I will revisit it.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is now its own commit proposing not to wait CI timeout when running out of video memory.

@josuah josuah force-pushed the pr-video-emul-fewer-ram branch 2 times, most recently from da560ab to 31d459b Compare March 9, 2025 18:21
@josuah josuah changed the title drivers: video: emul: Use fewer ram drivers: video: emul: simplify, avoid mission creep Mar 9, 2025
@josuah josuah force-pushed the pr-video-emul-fewer-ram branch 2 times, most recently from 1890b61 to f26add3 Compare March 9, 2025 19:34
josuah added 5 commits March 19, 2025 18:34
Only store a single line of the full frame. This allows to support a
large enough frame size to remove the Kconfig option, which simplifies
the implementation (fewer checks needed).

Signed-off-by: Josuah Demangeon <me@josuah.net>
Depending on the log mode selected, the device name will be visible
for every log message, so not useful to add it again in the log payload.
Various other log improvements also added.

Signed-off-by: Josuah Demangeon <me@josuah.net>
Deduplicate the registers of "modes": only a single definition of each:
pixelformats, resolutions, framerate.

Signed-off-by: Josuah Demangeon <me@josuah.net>
Remove the test pattern generator implemented inline in video_emul_imager,
as this feature is overlapping with VIDEO_SW_GENERATOR, and does not add
value to the driver.

Signed-off-by: Josuah Demangeon <me@josuah.net>
Fail immediately during tests rather than letting K_FOREVER trigger a CI
timeout.

Signed-off-by: Josuah Demangeon <me@josuah.net>
@josuah josuah force-pushed the pr-video-emul-fewer-ram branch from f26add3 to cf9ae77 Compare March 19, 2025 18:34
Use a video control ID in the private range rather than using an existing
CID, as the emulated imager does not effectively applies these properties
to the image feed and are just for API test purpose.

Signed-off-by: Josuah Demangeon <me@josuah.net>
@kartben kartben merged commit 61a1cdf into zephyrproject-rtos:main Mar 20, 2025
20 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants