glx: print FPS with 2 decimal places
authorMarek Olšák <marek.olsak@amd.com>
Fri, 24 Jan 2020 02:01:56 +0000 (21:01 -0500)
committerMarek Olšák <marek.olsak@amd.com>
Tue, 11 Feb 2020 00:02:33 +0000 (19:02 -0500)
useful if FPS is low.

Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Tested-by: Marge Bot <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3590>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3590>

src/glx/dri2_glx.c
src/glx/dri3_glx.c

index 9c222d81312ac72c7f6c423048eb5fc549982195..f7e306e5dbca2fa94308aa44a5cb800b713733b7 100644 (file)
@@ -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));
       }
index a5cf0e3bf32c72b6649f0e72c6e532d7a627c124..4664733c6557facf6639f92fcf49115ac7f7f1b8 100644 (file)
@@ -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));
       }