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

Add compatibility with lvgl9 #313

Closed
wants to merge 6 commits into from
Closed

Conversation

etag4048
Copy link
Contributor

This PR adds compatibility with LVGL9.x

…ton >9.0.0

Resize before flush
Convert subsurfaces to sync mode
Added frame throttling
Also solve issues that appeared during early maximization of the window, when the initial w/h of the window
was bigger than the resolution of the compositor
Fix address arithmetic in cache_apply_areas, became apparent with version 9, fixes heavy glitching in weston
@etag4048
Copy link
Contributor Author

@kisvegabor We've added compatibility with lvgl9, currently finding a solution to handle color depths 8 and 1, because not all compositors support 8bit and 1bit colors format natively.. So conversion might be necessary.

@etag4048
Copy link
Contributor Author

etag4048 commented May 22, 2024

Tried to add support for 8bit and 1bit color formats, lv_drivers used to support RGB332 when using a color depth of 8bits up to version release/v8.4. Since version 9.0 however, LV_COLOR_FORMAT_NATIVE is set to L8 when the color depth is set to 8 bits.

However, Wayland compositors/DRMs on the desktop don't support index based color formats,
If I am not mistaken RGB565A8 and L8 are for destined for embedded targets, converting from an index-based color format to ARGB8888 is not the job of the wayland driver.

So this last commit aligns the Wayland driver to feature the same behavior as the Windows and SDL drivers. The next task would be to use RENDERING_MODE_DIRECT and flip the buffers as @WallaceIT suggested in issue #287

@kisvegabor
Copy link
Member

Hi Erik,

Thank you! I know for sure that this update was waited by many people!

Especially at the first pass it's ok support only the common color formats. Namely

  • RGB565
  • RGB888
  • XRGB888
  • ARGB888

We won't update this repo to v9. Could you add this driver to the lvgl repo targeting this folder?

@nicusorcitu
Copy link

@anaGrad

@sukesh-ak
Copy link

@kisvegabor

We won't update this repo to v9. Could you add this driver to the lvgl repo targeting this folder?

Can you suggest how to get lvgl 9.x working?
I am working on nVidia Jetson Orin NX 16GB which uses Ubuntu 22 so wanted to get lvgl 9.x running on it.

@kisvegabor
Copy link
Member

@sukesh-ak You can use e.g. this repo. It uses the builtin SDL driver of LVGL.

@vvn-git
Copy link

vvn-git commented Jun 19, 2024

@etag4048 please format the code style to LVGL alike style, like "if(0) {", instead of "if(0) \n {"...
I have some changes/fixes waiting to be committed to it . thanks.

@etag4048
Copy link
Contributor Author

@vvn-git Will do during the weekend or at the beginning of next week, the documentation needs to be converted to RST, and it needs to be properly integrated with the existing build system.

@OhtokaniPinzon
Copy link

Hi @etag4048 I was working some weeks ago on lv_drivers repo to run with lvgl9. Here are my changes so far https://github.com/OhtokaniPinzon/lv_drivers/tree/lvgl9-porting-master, this fix still has some visual artiffacts when testing some demos from lvgl repo, but besides that it seems to work.
Maybe both works can be combined, or maybe you can find the bugs on my fix.

@etag4048
Copy link
Contributor Author

etag4048 commented Jul 4, 2024

@OhtokaniPinzon Thank you, I will check it out soon, the day job is quite demanding lately :)

@OhtokaniPinzon
Copy link

Hi all,
@nicusorcitu
@etag4048
@kisvegabor
@sukesh-ak
@vvn-git

Some months ago I did a workaround on lv_drivers to support lvgl9 using wayland (https://github.com/OhtokaniPinzon/lv_drivers/tree/lvgl9-porting-master) and I was able to make it work, I was testing the "widgets" and "music" demos and worked fine, then I tested more demos and I saw some images corrupted on demos "benchmark" and "stress". I thought it was a bug caused by my porting.

But recently I tested the same demos also on lvgl9 but using framebuffer driver instead of wayland, I am using the lvgl9 fb provided driver: https://github.com/lvgl/lvgl/blob/release/v9.1/src/drivers/display/fb/lv_linux_fbdev.c
And I see the same images corrupted on demos "benchmark" and "stress".
I have also ran the same demos on lvgl v8 and everything works fine.

So maybe the bug is an lvgl9 internal bug or maybe a bug on the code of both demos. Or maybe it could be an error from lvgl9 framebuffer driver.
Have someone ever tested demos "benchmark" and "stress" on lvgl9?
Can you confirm if these demos can run properly on lvgl9?
Is there another way I can test demos "benchmark" and "stress" on lvgl9 without using wayland or framebuffer?

It would help a lot if we can confirm this information, if these bugs are successfully solved the wayland enablement of lvgl9 would be almost complete.

Best Regards!
Ohtokani Pinzón

@nicusorcitu
Copy link

@OhtokaniPinzon what is the output you see? Can you please post it here?

@nicusorcitu
Copy link

@cristian-stoica

@sukesh-ak
Copy link

@sukesh-ak You can use e.g. this repo. It uses the builtin SDL driver of LVGL.

@OhtokaniPinzon
I can confirm that this works well on Linux using SDL.
Just tested on NVidia Jetson Orin 16GB with Jetpack 6.x (Ubuntu 22.x)

@kisvegabor
Copy link
Member

I haven't tested the "stress test" recently, but I use the "benchmark" a lot. I had no issues with it.

@OhtokaniPinzon
Copy link

Hi all,

This is the output I get running the “stress” demo using only LVGL9 provided code without any modifications. This test was built using the framebuffer driver included in LVGL9 repo, running on i.MX93 EVK, The same test was performed just switching to LVGL V8 and works fine, so I think the issue is on LVGL9.

Best Regards!
Ohtokani

LVGL9-stress-demo.mp4

@kisvegabor
Copy link
Member

It's working well on my end with LVGL master, Linux frame buffer driver and the stress demo. What is the color depth of your display?

@nicusorcitu nicusorcitu mentioned this pull request Aug 29, 2024
@kisvegabor
Copy link
Member

The Wayland driver is added to LVGL v9: https://github.com/lvgl/lvgl/tree/master/src/drivers/wayland

I close this PR because lv_drivers won't be updated to LVGL v9 as now the lvgl repo has built-in drivers.

@kisvegabor kisvegabor closed this Aug 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants