How to know all the draw tasks are finished

Description

Is there any function to check if all the draw tasks are finished?
I know that whenever a (joined) area is drawn, the callback will be called.
If there are multiple joined areas, will the current mechanism wait for all areas being redrawn and called the flush callback “once”? (Based on the document, I think no.)

I need to wait for all the draw tasks finished before I render them to my device.

Any suggestions are appreciated.
Many thanks for your help.

monitor_cb will be called when all drawing is done.

@BLUE_S

If there are multiple joined areas, will the current mechanism wait for all areas being redrawn and called the flush callback “once”? (Based on the document, I think no.)

I have done a test on this with an online debugger. When the buffer is set to a smaller size than the whole frame, flushing callback is called more than once.

Example:

void lv_hal_init(void){
 hw_disp_init(); //low level display init 
 static lv_color_t lv_buf_array[LV_HOR_RES_MAX*LV_VER_RES_MAX];
 static lv_disp_buf_t lv_disp_buf;
 lv_disp_buf_init(&lv_disp_buf, lv_buf_array, NULL, LV_HOR_RES_MAX*LV_VER_RES_MAX);
}

When I ran the debugger with breakpoint set to my_flush_cb(), it halted on it only once with the whole display updated.

However, if I set the buffer size half with LV_VER_RES_MAX -> LV_VER_RES_MAX/2, update is done in two passes.

lv_disp_flush_is_last also can be used.