-
Notifications
You must be signed in to change notification settings - Fork 288
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
One pixel transformation for ILI948x #103
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi,
I found a few things that might be worth to discuss.
lv_color16_t *color_565 = (lv_color16_t *) color_map; | ||
for (uint32_t i = 0; i < size; i++, color_565++) { | ||
uint8_t spi_buf[3]; | ||
spi_buf[0] = color_565->ch.blue << 3; // Blue is 5bits wide, align to 8 bits |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This way there is no maxima blue. E.g. 0b11111 << 3
is 0b11111000
instead of 0b11111111
.
The original code converted to RGB666 and added the LSB twice.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! I couldn't get me head around the old conversion function. Will fix
lv_color16_t *color_565 = (lv_color16_t *) color_map; | ||
for (uint32_t i = 0; i < size; i++, color_565++) { | ||
uint8_t spi_buf[3]; | ||
spi_buf[0] = color_565->ch.blue << 3; // Blue is 5bits wide, align to 8 bits |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Assuming that on UI there are a lot of adjacent same color (e.g. a large white background, a blue button, etc) calculating only if the current color is different from the previous else coping the previous result might cause significant speed up.
@tore-espressif Let me know if you want me to test this PR, I got this hardware and an ESP32 dev kit. |
I tried to apply your patch for my ILI9488 display. Or have I done something wrong again? |
After a lot of searching on github, I stumbled upon repo https://github.com/anuprao/esp32_ili9488, which implements something similar for the ILI9488 display controller. Only the version of the LVGL is very old 5.3.0. Maybe this will come in handy for solving the problem?
|
Hello @SinglWolf , |
In my experience, this solution helps for the DMA issue, but renders the updates so slow, that the screen is not usable. |
Hello everyone,
|
ILI948x doesn't support 16bit color data in SPI mode, so we have to extrapolate from LVGL's RGB565 (16bit) to 18 bits.
Previously, the whole buffer was transformed, which required a lot of DMA capable RAM. This PR changes to transformation algorithm to process one pixel at a time.
Closes #85