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 |   12 ++++++++++--
 1 files changed, 10 insertions(+), 2 deletions(-)

diff --git a/src/qxl_driver.c b/src/qxl_driver.c
index fa79a3d..8492792 100644
--- a/src/qxl_driver.c
+++ b/src/qxl_driver.c
@@ -1332,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;
     }
 
     if (0 >= xf86ValidateModes(pScrn, pScrn->monitor->Modes,
@@ -1348,6 +1348,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.2.2

_______________________________________________
Spice-devel mailing list
Spice-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/spice-devel

Reply via email to