mirror of
https://github.com/lvgl/lvgl.git
synced 2025-01-14 06:42:58 +08:00
fix(sysmon): separate render and flush time
This commit is contained in:
parent
9b64df0b74
commit
2f7816b30c
@ -380,7 +380,6 @@ void _lv_display_refr_timer(lv_timer_t * tmr)
|
|||||||
if(disp_refr->inv_p == 0) goto refr_finish;
|
if(disp_refr->inv_p == 0) goto refr_finish;
|
||||||
|
|
||||||
/*If refresh happened ...*/
|
/*If refresh happened ...*/
|
||||||
/*Call monitor cb if present*/
|
|
||||||
lv_display_send_event(disp_refr, LV_EVENT_RENDER_READY, NULL);
|
lv_display_send_event(disp_refr, LV_EVENT_RENDER_READY, NULL);
|
||||||
|
|
||||||
if(!lv_display_is_double_buffered(disp_refr) ||
|
if(!lv_display_is_double_buffered(disp_refr) ||
|
||||||
|
@ -149,11 +149,13 @@ static void perf_update_timer_cb(lv_timer_t * t)
|
|||||||
info->calculated.cpu = 100 - lv_timer_get_idle();
|
info->calculated.cpu = 100 - lv_timer_get_idle();
|
||||||
info->calculated.refr_avg_time = info->measured.refr_cnt ? (info->measured.refr_elaps_sum / info->measured.refr_cnt) :
|
info->calculated.refr_avg_time = info->measured.refr_cnt ? (info->measured.refr_elaps_sum / info->measured.refr_cnt) :
|
||||||
0;
|
0;
|
||||||
info->calculated.render_avg_time = info->measured.render_cnt ? (info->measured.render_elaps_sum /
|
|
||||||
info->measured.render_cnt) : 0;
|
|
||||||
info->calculated.flush_avg_time = info->measured.flush_cnt ? (info->measured.flush_elaps_sum / info->measured.flush_cnt)
|
info->calculated.flush_avg_time = info->measured.flush_cnt ? (info->measured.flush_elaps_sum / info->measured.flush_cnt)
|
||||||
: 0;
|
: 0;
|
||||||
info->calculated.render_real_avg_time = info->calculated.render_avg_time + info->calculated.flush_avg_time;
|
info->calculated.render_avg_time = info->measured.render_cnt ? (info->measured.render_elaps_sum /
|
||||||
|
info->measured.render_cnt) : 0;
|
||||||
|
|
||||||
|
/*Flush time was measured in rendering time*/
|
||||||
|
info->calculated.render_avg_time -= info->calculated.flush_avg_time;
|
||||||
|
|
||||||
info->calculated.cpu_avg_total = ((info->calculated.cpu_avg_total * (info->calculated.run_cnt - 1)) +
|
info->calculated.cpu_avg_total = ((info->calculated.cpu_avg_total * (info->calculated.run_cnt - 1)) +
|
||||||
info->calculated.cpu) / info->calculated.run_cnt;
|
info->calculated.cpu) / info->calculated.run_cnt;
|
||||||
@ -190,7 +192,8 @@ static void perf_observer_cb(lv_observer_t * observer, lv_subject_t * subject)
|
|||||||
"%" LV_PRIu32" FPS, %" LV_PRIu32 "%% CPU\n"
|
"%" LV_PRIu32" FPS, %" LV_PRIu32 "%% CPU\n"
|
||||||
"%" LV_PRIu32" ms (%" LV_PRIu32" | %" LV_PRIu32")",
|
"%" LV_PRIu32" ms (%" LV_PRIu32" | %" LV_PRIu32")",
|
||||||
perf->calculated.fps, perf->calculated.cpu,
|
perf->calculated.fps, perf->calculated.cpu,
|
||||||
perf->calculated.render_real_avg_time, perf->calculated.render_avg_time, perf->calculated.flush_avg_time
|
perf->calculated.render_avg_time + perf->calculated.flush_avg_time,
|
||||||
|
perf->calculated.render_avg_time, perf->calculated.flush_avg_time
|
||||||
);
|
);
|
||||||
#endif /*LV_USE_PERF_MONITOR_LOG_MODE*/
|
#endif /*LV_USE_PERF_MONITOR_LOG_MODE*/
|
||||||
}
|
}
|
||||||
|
@ -48,7 +48,7 @@ typedef struct {
|
|||||||
uint32_t refr_elaps_sum;
|
uint32_t refr_elaps_sum;
|
||||||
uint32_t refr_cnt;
|
uint32_t refr_cnt;
|
||||||
uint32_t render_start;
|
uint32_t render_start;
|
||||||
uint32_t render_elaps_sum;
|
uint32_t render_elaps_sum; /*Contains the flush time too*/
|
||||||
uint32_t render_cnt;
|
uint32_t render_cnt;
|
||||||
uint32_t flush_start;
|
uint32_t flush_start;
|
||||||
uint32_t flush_elaps_sum;
|
uint32_t flush_elaps_sum;
|
||||||
@ -59,9 +59,8 @@ typedef struct {
|
|||||||
uint32_t fps;
|
uint32_t fps;
|
||||||
uint32_t cpu;
|
uint32_t cpu;
|
||||||
uint32_t refr_avg_time;
|
uint32_t refr_avg_time;
|
||||||
uint32_t render_avg_time;
|
uint32_t render_avg_time; /**< Pure rendering time without flush time*/
|
||||||
uint32_t flush_avg_time;
|
uint32_t flush_avg_time; /**< Pure flushing time without rendering time*/
|
||||||
uint32_t render_real_avg_time;
|
|
||||||
uint32_t cpu_avg_total;
|
uint32_t cpu_avg_total;
|
||||||
uint32_t fps_avg_total;
|
uint32_t fps_avg_total;
|
||||||
uint32_t run_cnt;
|
uint32_t run_cnt;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user