When true double buffering is enabled, flush callback always receive area equal of LCD size. When framebuffers are located in cached memory, CPU cache need to be flushed for large memory block before the buffer can be processed by LCD controller. This is quite slow operation. Flush callback should receive array of invalidated areas, so smallest possible memory size can be flushed.
Currently flush CB receives the lv_disp_drv_t parameter, but if it would receive lv_disp_t parameter instead, inv_areas could be used for this.
The same issue appears also in general, when switching from CPU to any GPU(HW) operation. Before entering GPU related functions, CPU cache shuld be flushed to make sure HW see the results from previous CPU draw. Again, only regions that are in interest of GPU and were changed by CPU need to be flushed = as small area as possible. It would be good to have list of all areas accessed during current refresh cycle.
CPU cache flush could be as a callback, as it’s very HW and OS specific call.
Does it sound resonable?