lvgl / lv_drivers

TFT and touch pad drivers for LVGL embedded GUI library
https://docs.lvgl.io/master/porting/index.html
MIT License
306 stars 314 forks source link

Prevent screen clearing on framebuffer driver init #180

Closed Johennes closed 2 years ago

Johennes commented 2 years ago

The framebuffer driver clears the screen on initialization (see here). This is not desirable in cases where there is existing content on the screen and the UI is only supposed to be drawn in a subsection of the display. In my particular case, I have a Linux VT running on the screen and my application draws an on-screen keyboard in the lower part of the screen.

An easy solution for my specific case would be to simply remove the memset statement. I didn't notice any side effects of doing that. I'm not sure if maybe this is needed in different scenarios?

For the downstream issue see here.

embeddedt commented 2 years ago

@kisvegabor LVGL will always render to the entire screen size on the first frame, so this memset statement is probably not needed anymore, right?

kisvegabor commented 2 years ago

memset could be useful if it takes some time to get first screen rendered in order avoid seeing memory junk. With higher level drivers IMO we can remove memset.

Johennes commented 2 years ago

Just to make sure, you're saying it's ok to remove the memset in this case here? I wasn't sure if you considered the framebuffer driver a higher level driver or not. :sweat_smile:

embeddedt commented 2 years ago

I think the Linux framebuffer subsystem already clears the screen by default, but I could be wrong.

kisvegabor commented 2 years ago

I wasn't sure if you considered the framebuffer driver a higher level driver or not. sweat_smile

I think the frame buffer can be low level in an MCU, or high level on Linux. :smile: So I agree to remove the memset from "Linux-level" driver.