qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Dongwon Kim <dongwon.kim@intel.com>
To: qemu-devel@nongnu.org
Cc: Dongwon Kim <dongwon.kim@intel.com>
Subject: [PATCH 2/3] ui/gtk: calling gd_gl_frame_counter at every draw/swap
Date: Mon, 26 Jul 2021 15:25:50 -0700	[thread overview]
Message-ID: <20210726222551.28795-2-dongwon.kim@intel.com> (raw)
In-Reply-To: <20210726222551.28795-1-dongwon.kim@intel.com>

For FPS calculation, gd_gl_frame_counter is called at every
draw(gtk-gl-area) or swap(gtk-egl) activity.

Signed-off-by: Dongwon Kim <dongwon.kim@intel.com>
---
 ui/gtk-egl.c     | 2 ++
 ui/gtk-gl-area.c | 1 +
 2 files changed, 3 insertions(+)

diff --git a/ui/gtk-egl.c b/ui/gtk-egl.c
index 2a2e6d3a17..ac56f5b9f4 100644
--- a/ui/gtk-egl.c
+++ b/ui/gtk-egl.c
@@ -89,6 +89,7 @@ void gd_egl_draw(VirtualConsole *vc)
 
         eglSwapBuffers(qemu_egl_display, vc->gfx.esurface);
 
+        gd_gl_count_frame(&vc->gfx.dcl, false);
         vc->gfx.scale_x = (double)ww / surface_width(vc->gfx.ds);
         vc->gfx.scale_y = (double)wh / surface_height(vc->gfx.ds);
     }
@@ -290,6 +291,7 @@ void gd_egl_scanout_flush(DisplayChangeListener *dcl,
     }
 
     eglSwapBuffers(qemu_egl_display, vc->gfx.esurface);
+    gd_gl_count_frame(&vc->gfx.dcl, false);
 }
 
 void gtk_egl_init(DisplayGLMode mode)
diff --git a/ui/gtk-gl-area.c b/ui/gtk-gl-area.c
index dd5783fec7..a18b6ff425 100644
--- a/ui/gtk-gl-area.c
+++ b/ui/gtk-gl-area.c
@@ -72,6 +72,7 @@ void gd_gl_area_draw(VirtualConsole *vc)
     }
 
     glFlush();
+    gd_gl_count_frame(&vc->gfx.dcl, false);
     graphic_hw_gl_flushed(vc->gfx.dcl.con);
 }
 
-- 
2.17.1



  reply	other threads:[~2021-07-26 22:28 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-26 22:25 [PATCH 1/3] ui/gtk: adds status bar for expressing ups and fps Dongwon Kim
2021-07-26 22:25 ` Dongwon Kim [this message]
2021-07-26 22:25 ` [PATCH 3/3] virtio-gpu: call dpy_gl_frame_counter at every guest scanout flush Dongwon Kim
2021-07-27  8:24 ` [PATCH 1/3] ui/gtk: adds status bar for expressing ups and fps Daniel P. Berrangé
2021-07-27 18:46   ` Dongwon Kim
2021-07-29 23:47 ` Eric Blake

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210726222551.28795-2-dongwon.kim@intel.com \
    --to=dongwon.kim@intel.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).