From: Marek Olšák Date: Fri, 24 Jan 2020 02:01:56 +0000 (-0500) Subject: glx: print FPS with 2 decimal places X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=01443dc7383f4634e4a66fa194ed51db74186128;p=mesa.git glx: print FPS with 2 decimal places useful if FPS is low. Reviewed-by: Bas Nieuwenhuizen Tested-by: Marge Bot Part-of: --- diff --git a/src/glx/dri2_glx.c b/src/glx/dri2_glx.c index 9c222d81312..f7e306e5dbc 100644 --- a/src/glx/dri2_glx.c +++ b/src/glx/dri2_glx.c @@ -776,7 +776,7 @@ static void show_fps(struct dri2_drawable *draw) if (draw->previous_time + interval * 1000000 <= current_time) { if (draw->previous_time) { - fprintf(stderr, "libGL: FPS = %.1f\n", + fprintf(stderr, "libGL: FPS = %.2f\n", ((uint64_t)draw->frames * 1000000) / (double)(current_time - draw->previous_time)); } diff --git a/src/glx/dri3_glx.c b/src/glx/dri3_glx.c index a5cf0e3bf32..4664733c655 100644 --- a/src/glx/dri3_glx.c +++ b/src/glx/dri3_glx.c @@ -147,7 +147,7 @@ glx_dri3_show_fps(struct loader_dri3_drawable *draw, uint64_t current_ust) /* DRI3+Present together uses microseconds for UST. */ if (priv->previous_ust + interval * 1000000 <= current_ust) { if (priv->previous_ust) { - fprintf(stderr, "libGL: FPS = %.1f\n", + fprintf(stderr, "libGL: FPS = %.2f\n", ((uint64_t) priv->frames * 1000000) / (double)(current_ust - priv->previous_ust)); }