lv_drivers: The wayland driver has a bug.
My English is not good that some sentences may be expressed incorrectly. If the statement is not accurate, try translating Chinese into English. 我的英语不是很好,部分句子可能表述不对。如果表述不准确,可以试试翻译将中文翻译成英文。
When I was using wayland, I found a bug that made the animation play incomplete
当我使用wayland时,我发现一个bug,这个bug使动画播放不完整
The bug is caused by the following code 这个bug是由下面这部分代码产生
else if (buffer->busy)
{
LV_LOG_WARN("skip flush since wayland backing buffer is busy");
printf("skip flush since wayland backing buffer is busy\n");
lv_disp_flush_ready(disp_drv);
return;
}
The wl_buffer is always busy because it is submitted many times in a frame 这是由于一帧中多次提交wl_buffer,导致wl_buffer总是处于忙碌状态
I tried to change it 我试过修改
#define LV_INV_BUF_SIZE 1
This keeps lvgl constantly in full screen refresh, and even then wl_buffer is often busy. But the weston I’m using can play 1080p@30 videos, and it should play lvgl. 这使lvgl经常处于全屏刷新,但即使这样wl_buffer也经常busy。但是我用的weston可以播放1080p@30的视频,不应该播不了lvgl。
So I removed the code about buffer->busy, and then everything works, is this method feasible? 所以我删除了buffer->busy这部分代码,然后一切都正常了,这个方法可行吗?
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Comments: 26 (15 by maintainers)
Hi,
I found some time to work on the Wayland driver. Can you please try the version available in draft PR #253 ?
The code there adds a second buffer to the Wayland driver, so one buffer is updated while another one is being displayed. In my tests, this eliminates the “busy buffer” issue.
Please note that the PR is still in draft state!
Apologies for the late response, life has dealt me a low hand on a bad turn. The root cause of this issue (and similar ones), comes down to the fact that the wayland driver only allocates a single backing buffer (per window/decoration/etc.). When this is busy (i.e. submitted to the wayland compositor), the driver is unable to continue drawing until this buffer becomes free (i.e. the wayland compositor returns the buffer).
This is less then ideal, and a more verbose solution is to have the driver allocate backing buffers on demand (thus allowing more the one buffer to be in flight between the client and compositor). I had started this transition (see #250) but unfortunately, it doesn’t look like I’ll be able to complete it (at least not in the near future). I’ve posted my WIP up so anyone can continue the crusade.
All the best, simplejack