Interface GFX driver to LVGL in PIC32MZ DA

GoodMorning.
I improved the display refresh by inserting a wait for synchronism before the flush but I’m not sure if I have correctly registered the lvgl driver and the flush routine.

See my code:
static lv_disp_buf_t buf;

lv_disp_buf_init(&buf, frameBuffer, frameBuffer, LV_HOR_RES_MAX * LV_VER_RES_MAX);   /*Initialize the display buffer*/
static void disp_flush(lv_disp_drv_t * disp_drv, const lv_area_t * area, lv_color_t * color_p)
{
       /* IMPORTANT!!!
     * Inform the graphics library that you are ready with the flushing*/
    lv_disp_flush_ready(disp_drv);
}

Note: frameBuffer is pointer of memory that directly write on TFT.

It’s right my code?

Thanks