From: Uwe Kleine-König <u...@kleine-koenig.org>

This allows to have qemu run at the native screen resolution of my
(physical) monitor.
This is inspired by a patch created by Andreas Dangel that I found on
https://adangel.org/2015/09/11/qemu-kvm-custom-resolutions/ .
---
Andreas's patch applied to 1.12.0, I rebased it to current master.

 vgasrc/cbvga.c     | 8 ++++++++
 vgasrc/svgamodes.c | 8 ++++++++
 2 files changed, 16 insertions(+)

diff --git a/vgasrc/cbvga.c b/vgasrc/cbvga.c
index 438d8fda6c6e..ac0b62c7bd25 100644
--- a/vgasrc/cbvga.c
+++ b/vgasrc/cbvga.c
@@ -81,6 +81,14 @@ static struct cbvga_mode_s
     { 0x190, { MM_DIRECT, 1920, 1080, 16, 8, 16, SEG_GRAPH } },
     { 0x191, { MM_DIRECT, 1920, 1080, 24, 8, 16, SEG_GRAPH } },
     { 0x192, { MM_DIRECT, 1920, 1080, 32, 8, 16, SEG_GRAPH } },
+
+    /* custom resolutions for 16:9 displays */
+    { 0x193, { MM_DIRECT, 1600,  900, 16, 8, 16, SEG_GRAPH } },
+    { 0x194, { MM_DIRECT, 1600,  900, 24, 8, 16, SEG_GRAPH } },
+    { 0x195, { MM_DIRECT, 1600,  900, 32, 8, 16, SEG_GRAPH } },
+    { 0x196, { MM_DIRECT, 2560, 1440, 16, 8, 16, SEG_GRAPH } },
+    { 0x197, { MM_DIRECT, 2560, 1440, 24, 8, 16, SEG_GRAPH } },
+    { 0x198, { MM_DIRECT, 2560, 1440, 32, 8, 16, SEG_GRAPH } },
 };
 
 struct vgamode_s *cbvga_find_mode(int mode)
diff --git a/vgasrc/svgamodes.c b/vgasrc/svgamodes.c
index 013504c3e691..f89ebef950a8 100644
--- a/vgasrc/svgamodes.c
+++ b/vgasrc/svgamodes.c
@@ -76,5 +76,13 @@ struct generic_svga_mode svga_modes[] VAR16 = {
     { 0x190, { MM_DIRECT, 1920, 1080, 16, 8, 16, SEG_GRAPH } },
     { 0x191, { MM_DIRECT, 1920, 1080, 24, 8, 16, SEG_GRAPH } },
     { 0x192, { MM_DIRECT, 1920, 1080, 32, 8, 16, SEG_GRAPH } },
+
+    /* custom resolutions for 16:9 displays */
+    { 0x193, { MM_DIRECT, 1600,  900, 16, 8, 16, SEG_GRAPH } },
+    { 0x194, { MM_DIRECT, 1600,  900, 24, 8, 16, SEG_GRAPH } },
+    { 0x195, { MM_DIRECT, 1600,  900, 32, 8, 16, SEG_GRAPH } },
+    { 0x196, { MM_DIRECT, 2560, 1440, 16, 8, 16, SEG_GRAPH } },
+    { 0x197, { MM_DIRECT, 2560, 1440, 24, 8, 16, SEG_GRAPH } },
+    { 0x198, { MM_DIRECT, 2560, 1440, 32, 8, 16, SEG_GRAPH } },
 };
 unsigned int svga_mcount VAR16 = ARRAY_SIZE(svga_modes);
-- 
2.20.1

Reply via email to