From 01443dc7383f4634e4a66fa194ed51db74186128 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Marek=20Ol=C5=A1=C3=A1k?= Date: Thu, 23 Jan 2020 21:01:56 -0500 Subject: [PATCH] glx: print FPS with 2 decimal places useful if FPS is low. Reviewed-by: Bas Nieuwenhuizen Tested-by: Marge Bot Part-of: --- src/glx/dri2_glx.c | 2 +- src/glx/dri3_glx.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) 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)); } -- 2.30.2