diff mbox series

[3/3] virtio-gpu: call dpy_gl_frame_counter at every guest scanout flush

Message ID 20210726222551.28795-3-dongwon.kim@intel.com (mailing list archive)
State New, archived
Headers show
Series [1/3] ui/gtk: adds status bar for expressing ups and fps | expand

Commit Message

Kim, Dongwon July 26, 2021, 10:25 p.m. UTC
dpy_gl_frame_counter needs to be called for guest scanout frame count
to calculate and display the performance figure - ups, the guest FB
update per seconds.

Signed-off-by: Dongwon Kim <dongwon.kim@intel.com>
---
 hw/display/virtio-gpu.c | 2 ++
 1 file changed, 2 insertions(+)
diff mbox series

Patch

diff --git a/hw/display/virtio-gpu.c b/hw/display/virtio-gpu.c
index e183f4ecda..722869864a 100644
--- a/hw/display/virtio-gpu.c
+++ b/hw/display/virtio-gpu.c
@@ -523,6 +523,7 @@  static void virtio_gpu_resource_flush(VirtIOGPU *g,
                 console_has_gl(scanout->con)) {
                 dpy_gl_update(scanout->con, 0, 0, scanout->width,
                               scanout->height);
+                dpy_gl_count_frame(scanout->con, true);
                 return;
             }
         }
@@ -566,6 +567,7 @@  static void virtio_gpu_resource_flush(VirtIOGPU *g,
                        extents->x1, extents->y1,
                        extents->x2 - extents->x1,
                        extents->y2 - extents->y1);
+        dpy_gl_count_frame(scanout->con, true);
 
         pixman_region_fini(&region);
         pixman_region_fini(&finalregion);