summaryrefslogtreecommitdiff
path: root/src/vmware.c
diff options
context:
space:
mode:
authorPhilip Langdale <philipl@fido2.homeip.net>2007-02-08 17:08:08 -0800
committerPhilip Langdale <philipl@fido2.homeip.net>2007-02-08 17:08:08 -0800
commita8afe781e108773e4a575ecc3330a5aa83c1cbb9 (patch)
tree726e116759b819cf01cffb22362ee03b0130330a /src/vmware.c
parent520f570aa3869090eac3accf6a2b3886ab188590 (diff)
Add a bunch of useful modes to the mode list.
The X server prunes modes above the initial mode and the number of default modes varies with distro and server version. As it's easy to do, let's add a bunch of useful versions in the driver so that users don't have to mess with their config files as often.
Diffstat (limited to 'src/vmware.c')
-rw-r--r--src/vmware.c32
1 files changed, 32 insertions, 0 deletions
diff --git a/src/vmware.c b/src/vmware.c
index 576530c..ea3f117 100644
--- a/src/vmware.c
+++ b/src/vmware.c
@@ -37,6 +37,7 @@ char rcsId_vmware[] =
#include "vmware.h"
#include "guest_os.h"
#include "vm_device_version.h"
+#include "svga_modes.h"
#ifdef HaveDriverFuncs
#define VMWARE_DRIVER_FUNC HaveDriverFuncs
@@ -175,6 +176,21 @@ static const OptionInfoRec VMWAREOptions[] = {
{ -1, NULL, OPTV_NONE, {0}, FALSE }
};
+/* Table of default modes to always add to the mode list. */
+
+typedef struct {
+ int width;
+ int height;
+} VMWAREDefaultMode;
+
+#define SVGA_DEFAULT_MODE(width, height) { width, height, },
+
+static const VMWAREDefaultMode VMWAREDefaultModes[] = {
+ SVGA_DEFAULT_MODES
+};
+
+#undef SVGA_DEFAULT_MODE
+
static void VMWAREStopFIFO(ScrnInfoPtr pScrn);
static void VMWARESave(ScrnInfoPtr pScrn);
@@ -1560,6 +1576,22 @@ VMWAREScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv)
}
/*
+ * We explictly add a set of default modes because the X server will
+ * not include modes larger than the initial one.
+ */
+ {
+ unsigned int i;
+ unsigned int numModes = sizeof (VMWAREDefaultModes) / sizeof *(VMWAREDefaultModes);
+ char name[10];
+ for (i = 0; i < numModes; i++) {
+ snprintf(name, 10, "%dx%d",
+ VMWAREDefaultModes[i].width, VMWAREDefaultModes[i].height);
+ VMWAREAddDisplayMode(pScrn, name, VMWAREDefaultModes[i].width,
+ VMWAREDefaultModes[i].height);
+ }
+ }
+
+ /*
* We will lazily add the dynamic modes as the are needed when new
* modes are requested through the control extension.
*/