-
Notifications
You must be signed in to change notification settings - Fork 8.3k
modules: lvgl: take into account initial display orientation #73474
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
modules: lvgl: take into account initial display orientation #73474
Conversation
Certain display drivers allow for setting an initial display orientation using a device tree property. LVGL should take this into account while initializing. I could have written "disp_drv.rotated = disp_data.cap.current_orientation" because the enums match, but they are different types and they might get mismatched in the future. Signed-off-by: Sven Depoorter <[email protected]>
|
Did you check by any chance how the |
|
@faxe1008 I didn't think of this when submitting. I don't have such input device to test with so I tried to build for SDL. Unfortunately, I have dependency issues to install the correct SDL version which I can't quickly resolve, so no "quick testing" for now. #73300 seems to take care but I'll have to check further if indeed the .rotated flag messes this up now somewhere in LVGL. |
|
I patched rotation support quite crudely into the sdl display: rotated.mp4Yeah this is definetely an issue. |
|
If lvgl_pointer_process_event has a similar approach as in https://github.com/lvgl/lvgl/blob/master/src/indev/lv_indev.c#L636 I did not expect this to be an issue but your test clearly shows there is an issue. |
|
From the looks of it LVGL should be doing the correct thing, I need to test this on real hardware though not on the bodged native_sim. Since I am out of office for the rest of the week I won't able to though. EDIT:// Yeah forgot to add the rotation into the capabilites struct within my hack: With LVGL performing the rotation this code needs to be removed since it will apply the rotation a second time:
Can you maybe remove this within your PR and add an explanation for it? |
|
I would like to do that, but I'm not sure if I'm able to because I have no means to test my changes. It also looks like a large part of #73300 needs to be reverted (or completely?) because it introduced tmp_point as well. |
|
Well you can verify the changes with a unit test:
With this setup you can test the rotations across the entire code path. |
|
Sounds like a good idea @faxe1008. Unfortunately I still can't install SDL2 (32bit version) on my system without breaking lots of stuff. I also can't seem to find a docker image for this purpose (with display/sdl suport). |
|
@Snevzor there is also the |
|
@faxe1008 thanks for the native_sim64 hint! The test you are writing will definitely fill a gap, and it looks great already! I'm learning a lot from it. |
|
Yes that makes sense @faxe1008. This PR can be closed then ;) |
|
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. |
Certain display drivers allow for setting an initial display orientation using a device tree property. LVGL should take this into account while initializing.