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

Display buffer initialization for ESP32 #313

Closed
PGNetHun opened this issue Jan 10, 2024 · 4 comments
Closed

Display buffer initialization for ESP32 #313

PGNetHun opened this issue Jan 10, 2024 · 4 comments
Assignees

Comments

@PGNetHun
Copy link
Collaborator

PGNetHun commented Jan 10, 2024

Hello @XuNeo, @kisvegabor ,

There is a buffer allocation issue in display initialization for ESP32 ili9xxx driver:
https://github.com/lvgl/lv_binding_micropython/blob/master/driver/esp32/ili9XXX.py#L151

self.buf1 = esp.heap_caps_malloc(self.buf_size, esp.MALLOC_CAP.DMA)
self.buf2 = esp.heap_caps_malloc(self.buf_size, esp.MALLOC_CAP.DMA) if double_buffer else None

(ESP32 document about DMA-Capable memory allocation)

These 2 lines allocate memory which can be accessed by DMA, and returns void *, so a simple memory area, and it cannot be passed to lv_display_set_draw_buffers(lv_display_t * disp, lv_draw_buf_t * buf1, lv_draw_buf_t * buf2), which was refactored in this PR.
Neither lv.draw_buf_create() will not allocate DMA-capable memory area.

I see that there is also a lv_draw_buf_init() function, which accepts a void* memory area, but it tries to align it.

Why do we need lv_draw_buf_t everywhere, even for display buffer (and decoded image data)? Only to have word-aligned memory area?

Could you please check the above mentioned codes and help in this topic?

@PGNetHun
Copy link
Collaborator Author

PGNetHun commented Jan 11, 2024

Problem solved in other PR, and is merged to multi-instance branch for multi-instance PR.

Tested on real ESP32 devices with ST7789 and ILI9342C displays.

@kisvegabor
Copy link
Member

I've raised some concerns about if we really need draw_buf in lv_display_set_draw_buffers(). Could you tell your opinion in lvgl/lvgl#5204?

@XuNeo
Copy link
Contributor

XuNeo commented Jan 11, 2024

You are doing it right to use lv_draw_buf_init.

I see that there is also a lv_draw_buf_init() function, which accepts a void* memory area, but it tries to align it.

The issue is you have configured to do so.

https://github.com/lvgl/lv_binding_micropython/pull/314/files#diff-136397af91c41d3e65b59f16b7ae542b5545b37c353bd10417bdef6075be5821R82-R83

@XuNeo
Copy link
Contributor

XuNeo commented Jan 11, 2024

I've raised some concerns about if we really need draw_buf in lv_display_set_draw_buffers(). Could you tell your opinion in lvgl/lvgl#5204?

Let's open an new issue for it, so everyone can see it. Doing it now.

XuNeo added a commit to XuNeo/lvgl that referenced this issue Jan 11, 2024
Default to 1 to make it behave same to lvgl v8.
To avoid confusions raised in lvgl/lv_binding_micropython#313

Signed-off-by: Xu Xingliang <xuxingliang@xiaomi.com>
XuNeo added a commit to XuNeo/lvgl that referenced this issue Jan 11, 2024
The drivers have been changed back original logic.
Fix lvgl#5270
Related to lvgl#5204 lvgl/lv_binding_micropython#313
Discussion on lvgl#5273

Signed-off-by: Xu Xingliang <xuxingliang@xiaomi.com>
kisvegabor pushed a commit to lvgl/lvgl that referenced this issue Jan 11, 2024
The drivers have been changed back original logic. Fix #5270 Fix #5271
Related to #5204 lvgl/lv_binding_micropython#313
Discussion on #5273

Signed-off-by: Xu Xingliang <xuxingliang@xiaomi.com>
faxe1008 pushed a commit to faxe1008/zephyr-lvgl that referenced this issue Jan 24, 2024
The drivers have been changed back original logic. Fix #5270 Fix #5271
Related to #5204 lvgl/lv_binding_micropython#313
Discussion on #5273

Signed-off-by: Xu Xingliang <xuxingliang@xiaomi.com>
lion2tomato pushed a commit to lion2tomato/lvgl that referenced this issue Mar 19, 2024
VELAPLATFO-20122

The drivers have been changed back original logic. Fix lvgl#5270 Fix lvgl#5271
Related to lvgl#5204 lvgl/lv_binding_micropython#313
Discussion on lvgl#5273

Change-Id: I798af8753f50ba0eed9d6b7f00e184fb032bde1c
Signed-off-by: Xu Xingliang <xuxingliang@xiaomi.com>
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

No branches or pull requests

3 participants