-
Notifications
You must be signed in to change notification settings - Fork 6.5k
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
module: LVGL: Improve support for hardware display rotation #73556
Conversation
75d73fd
to
15e2bae
Compare
@@ -49,6 +49,8 @@ int set_lvgl_rendering_cb(lv_disp_drv_t *disp_drv); | |||
|
|||
void lvgl_flush_display(struct lvgl_display_flush *request); | |||
|
|||
int lvgl_reload_display_capabilities(void); |
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.
Add a comment that this should not be called while rendering is in progress.
Adds the rotation property to the dummy display binding to allow for setting an initial rotation within tests. Signed-off-by: Fabian Blatz <fabianblatz@gmail.com>
bc4f513
to
2e09ba8
Compare
Add a method which allows for syncing information within the display_data struct after the display has been rotated in the application using `display_set_orientation`. This also makes the implementation of various input devices unit testable without requiring a lot of overlay files. After the current implementation is verified against unit tests, the reload method will additionally set the `rotated` flag on the display driver. The LVGL code will then handle the translation of input devices points to points in the GUI according to the display rotation. Signed-off-by: Fabian Blatz <fabianblatz@gmail.com>
2e09ba8
to
e62ddaf
Compare
Changing this from draft state to review to get some more feedback and hopefully quite a few other pair of eyes on this since the coordinate conversion code has been tricky to handle. Added @ioannis-karachalios as a reviewer because of #73407 |
e62ddaf
to
973242a
Compare
Adds a test for lvgl input devices in various configurations, like rotated display, pointer inversions etc. Signed-off-by: Fabian Blatz <fabianblatz@gmail.com>
LVGL supports the `rotated` flag on its display drivers. It is used during input device coordinate processing to translate the physical touch points to the points in (rendered) GUI space. Previously this was done by the Zephyr gluecode on system init. With this change it is now possible to perform runtime rotation of the display, the `lvgl_reload_display_capabilities` method should be called right after `display_set_orientation`. Signed-off-by: Fabian Blatz <fabianblatz@gmail.com>
973242a
to
5d1112b
Compare
Perhaps the test can be expanded to take into account correct rotation initialisation based on the various rotation dts values as well? Like: looping through all dts values and then checking if the input values match. That way the updated LVGL init code is also tested. |
This pull request has been marked as stale because it has been open (more than) 60 days with no activity. Remove the stale label or add a comment saying that you would like to have the label removed otherwise this pull request will automatically be closed in 14 days. Note, that you can always re-open a closed pull request at any time. |
Originally brought up within #73474 this PR tries to improve the support for hardware based display rotation during runtime.
Since in the past few weeks quite a few bugfixes in regards to pointer input device handling were merged it would be useful to have them properly unit tested.
Test output: