[PATCH] Increase console refresh rate to let GVT-g VMs run at beyond 30 FPS

jeanniestevenson posted 1 patch 7 months ago
Failed in applying to current master (apply log)
[PATCH] Increase console refresh rate to let GVT-g VMs run at beyond 30 FPS
Posted by jeanniestevenson 7 months ago
Increase console refresh rate for guest operating systems using Intel GVT-g, corresponding to ~60fps. This increases the refresh rate of access to the display of the GUI, creating a much smoother user experience.

I've looked into why it is 30 by default and it appears to have been added in commit 313aa567104a63fbe84d6ec2eeff5b5c81cb3524 2 decades ago when VGA emulation was first added. This commit does not appear to break VGA emulation in my testing.

If there's enough interest (IE for 75 fps displays), this constant could be replaced by a function that gets a command-line flag that could be set with a QEMU arg, but I'm currently not familiar enough with QEMU's codebase know how to get the arguments for a VM to add such a charge.

Signed-off-by: Jeannie Stevenson <jeanniestevenson@protonmail.com>

diff --git a/include/ui/console.h b/include/ui/console.h
index acb61a7f15..f0c4e6ae4e 100644
--- a/include/ui/console.h
+++ b/include/ui/console.h
@@ -43,7 +43,7 @@ OBJECT_DECLARE_SIMPLE_TYPE(QemuFixedTextConsole, QEMU_FIXED_TEXT_CONSOLE)
 #define QEMU_CAPS_LOCK_LED   (1 << 2)
 
 /* in ms */
-#define GUI_REFRESH_INTERVAL_DEFAULT    30
+#define GUI_REFRESH_INTERVAL_DEFAULT    16
 #define GUI_REFRESH_INTERVAL_IDLE     3000
 
 /* Color number is match to standard vga palette */