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
display: enable offloading render process to background thread #40
display: enable offloading render process to background thread #40
Conversation
f0a45fe
to
453eedd
Compare
Hi @danieldegrasse I have tried this one out but ran into some issues. How are you calling My issue is that I'm running Line 108 in 453eedd
lvgl_flush_thread_entry otherwise what I see there will only be a ping-pong between the thread running lv_task_handler and the new lvgl_flush_thread_entry without any gain from double buffering (same FPS as with single buffer).The way I "fixed" it was by adding a k_yield(); after k_msgq_put to let lvgl_flush_thread_entry run before rendering into next buffer, and got about 50% more FPS with this PR.
Another thing I thought about that may be a possible issue (please correct me if I'm wrong): |
Currently from the main thread, which should use priority 0. I am testing this using the LVGL benchmarking and widgets samples on an RT1060 EVK. I see what you mean that
|
Yes I think this should be documented that lvgl rendering has to run in a preemtable thread and that
Unfortunately due to some kconfigs such as BT and IPC my For now I think I'll just patch in the |
Enable offloading of display_write call to background thread for color displays. This feature is opt-in, as it may offer significant performance gains for every display pipeline. When enabled display_write and lv_disp_flush_ready will be called from a background thread. This means that while the display driver waits on the hardware to render the framebuffer, the LVGL rendering thread will not be blocked. Signed-off-by: Daniel DeGrasse <daniel.degrasse@nxp.com>
453eedd
to
7b6acfd
Compare
I've added some documentation to the latest push highlighting this, thanks for pointing it out.
Truthfully, I think that adding a |
@carlescufi are you aware of anyone else who can review this PR? |
I tried running the stress demo on a RT1060-EVKB with an RK043FN66HS-CTG, using |
This PR is such an amazing improvement for FPS, It would be very nice if it could get merged, either before (would be easier) or after #45 (if after I guess this PR needs to move to main repo). Since nothing have happened for a month, maybe we could ping it in discord "pr-help" channel to get more reviewers if that is needed? |
@danieldegrasse I just merged #45, let's get #61300 in then you should be able to just move this over and we should not have PR visibility issues anymore on this. I'll do a swipe of the lvgl open PRs as well after that. |
zephyrproject-rtos/zephyr#61300 is in, feel free to move this upstream. |
Closing this, as the changes will be integrated into Zephyr modules gluecode |
Description of the feature or fix
Enable offloading of display_write call to background thread for color displays. This feature is opt-in, as it may offer significant performance gains for every display pipeline.
When enabled display_write and lv_disp_flush_ready will be called from a background thread. This means that while the display driver waits on the hardware to render the framebuffer, the LVGL rendering thread will not be blocked.