zephyrproject-rtos / zephyr

Primary Git Repository for the Zephyr Project. Zephyr is a new generation, scalable, optimized, secure RTOS for multiple hardware architectures.
https://docs.zephyrproject.org
Apache License 2.0
9.74k stars 6k forks source link

fb: cfb: Support memory constrainted system by partial frame transferring #72204

Open soburi opened 2 weeks ago

soburi commented 2 weeks ago

By dividing and transferring the frame, we can draw with less buffer. This function is helpful for displays on color LCDs in configurations where there is not enough offscreen buffer. (For example, Longan Nano LCD requires 160x80x 2bpp = 25Kbytes to allocate offscreen memory, but the SoC only has 32Kbytes of memory, so allocating offscreen buffers is unrealistic.)

This behavior occurs if the buffer size is smaller than the screen frame, and if the buffer is large enough, it behaves similarly to the existing behavior. If you divide and transfer, the drawing will be done all at once during cfb_finalize, so you need to hold the drawing operation until finalize is executed. For this reason, I'm introducing a drawing command mechanism and adding a command buffer.


This PR is part of a series of CFB enhancements (fourth of four https://github.com/zephyrproject-rtos/zephyr/issues/72177). I would appreciate it if you could check the https://github.com/zephyrproject-rtos/zephyr/pull/58817 part first.