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: display: sdl: supporting display_read() and add some Kconfig options #67447

Merged
merged 4 commits into from
Jan 19, 2024

Conversation

soburi
Copy link
Member

@soburi soburi commented Jan 10, 2024

I fixed an issue where display_read() in the SDL driver was not working.

In the current implementation, use texture to represent screen images.
To read this, draw it once on another surface and then read it.

This PR also adds tests for display_read() and display_write().
But it was marked as build_only, so it will not run in the CI environment.
It will fail in the CI environment because a display device is not available.

I add the option SDL_DISPLAY_USE_HARDWARE_ACCELERATOR to run this test with the SDL software renderer.
If it runs tests with a hardware accelerator, the data obtained may differ depending on the hardware, so it should use a software renderer.
This option is also useful for testing higher-level graphics functions.

I also add the SDL_DISPLAY_MONO_MSB_FIRST option.
This option toggles the bit order for MONO01/MONO10. This is also reflected in capabilities. This is also a useful option for testing.

@soburi soburi force-pushed the display_read_sdl branch 5 times, most recently from 55c2774 to a778871 Compare January 11, 2024 22:54
Add SDL_DISPLAY_USE_HARDWARE_ACCELEREATOR to be able to switch
enable/disable hardware accelerator.

Signed-off-by: TOKITA Hiroshi <[email protected]>
@soburi soburi changed the title drivers: display: sdl: supporting display_read() and add USE_SOFTWARE_RENDERER option drivers: display: sdl: supporting display_read() and add USE_HARDWARE_ACCELERATOR option Jan 12, 2024
@soburi soburi marked this pull request as ready for review January 12, 2024 22:46
@zephyrbot zephyrbot requested a review from jfischer-no January 12, 2024 22:46
@soburi soburi changed the title drivers: display: sdl: supporting display_read() and add USE_HARDWARE_ACCELERATOR option drivers: display: sdl: supporting display_read() and add some Kconfig options Jan 15, 2024
@soburi soburi force-pushed the display_read_sdl branch 3 times, most recently from 452867b to f7309fd Compare January 16, 2024 03:48
@kartben kartben requested a review from aescolar January 19, 2024 05:45
@aescolar aescolar requested a review from dcpleung January 19, 2024 09:00
Copy link
Member

@aescolar aescolar left a comment

Choose a reason for hiding this comment

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

A few minor things

drivers/display/display_sdl_bottom.c Outdated Show resolved Hide resolved
tests/drivers/display/display_read_write/testcase.yaml Outdated Show resolved Hide resolved
tests/drivers/display/display_read_write/testcase.yaml Outdated Show resolved Hide resolved
tests/drivers/display/display_read_write/testcase.yaml Outdated Show resolved Hide resolved
Fixed an issue where `display_read()` in the SDL driver was not working.

In the current implementation, use texture to represent screen images.
To read this, draw it once on another surface and then read it.

Signed-off-by: TOKITA Hiroshi <[email protected]>
Added config for specifying bit order when using monochrome format.

Signed-off-by: TOKITA Hiroshi <[email protected]>
Add test for `display_read()` and `display_write()` api.

Note: The CI environment has no display device, which makes it fail
the tests. So, I make this test case `build_only`. But it can run in
a display device available environment.

Signed-off-by: TOKITA Hiroshi <[email protected]>
@fabiobaltieri fabiobaltieri merged commit 3578a9e into zephyrproject-rtos:main Jan 19, 2024
26 checks passed
@soburi soburi deleted the display_read_sdl branch January 19, 2024 20:12
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.

6 participants