[Spice-devel] [PATCH xf86-video-qxl 2/3] Change default virtual size to 1920x1080

Hans de Goede hdegoede at redhat.com
Thu Sep 23 00:03:31 PDT 2010


With the old default virtual size of 1024x768, using higher resolutions
is not possible without an xorg.conf. Since the default now a days is
to not have an xorg.conf, this is sort of unfortunate.

This patch makes these higher resolutions available by making the
default virtual size 1920x1080, while keeping the default resolution
used when none is specified through xorg.conf at 1024x786, so that
the spice client window won't be way too large for smaller screens
by default.

This change does come at the prize of using 5MB more memory, but that
seems like a reasonable price to pay to give us parity wrt supported
resolutions with the windows driver. Also this is a must have to allow
the to be written Linux agent to change the guest resolution to match
the client machines one when running in auto fullscreen mode.

In the long run we should add support for resizing the fb on the fly to
match the resolution.
---
 src/qxl_driver.c |   13 +++++++++++--
 1 files changed, 11 insertions(+), 2 deletions(-)

diff --git a/src/qxl_driver.c b/src/qxl_driver.c
index 6f76689..54466a2 100644
--- a/src/qxl_driver.c
+++ b/src/qxl_driver.c
@@ -1274,6 +1274,7 @@ qxl_pre_init(ScrnInfoPtr pScrn, int flags)
     qxl_screen_t *qxl = NULL;
     ClockRangePtr clockRanges = NULL;
     int *linePitches = NULL;
+    DisplayModePtr mode;
 
     CHECK_POINT();
     
@@ -1331,8 +1332,8 @@ qxl_pre_init(ScrnInfoPtr pScrn, int flags)
     }
 
     if (pScrn->display->virtualX == 0 && pScrn->display->virtualY == 0) {
-    	pScrn->display->virtualX = 1024;
-    	pScrn->display->virtualY = 768;
+    	pScrn->display->virtualX = 1920;
+    	pScrn->display->virtualY = 1080;
     }
 
     /* Add any modes not in xorg's default mode list */
@@ -1353,6 +1354,14 @@ qxl_pre_init(ScrnInfoPtr pScrn, int flags)
     
     xf86PruneDriverModes(pScrn);
     pScrn->currentMode = pScrn->modes;
+    /* If no modes are specified in xorg.conf, default to 1024x768 */
+    if (pScrn->display->modes == NULL || pScrn->display->modes[0] == NULL)
+        for (mode = pScrn->modes; mode; mode = mode->next)
+            if (mode->HDisplay == 1024 && mode->VDisplay == 768) {
+                pScrn->currentMode = mode;
+                break;
+            }
+
     xf86PrintModes(pScrn);
     xf86SetDpi(pScrn, 0, 0);
 
-- 
1.7.1



More information about the Spice-devel mailing list