summaryrefslogtreecommitdiff
path: root/src/vmware.h
diff options
context:
space:
mode:
authorMicah Dowty <micah@vmware.com>2009-05-12 16:44:42 -0700
committerPhilip Langdale <philipl@fido2.homeip.net>2009-05-12 16:44:42 -0700
commitb7dbdd28764a8f3883833ab818a7b7314632b0b2 (patch)
treed4c5f1cb2adfdd757cd0b5cece48e1c57939d500 /src/vmware.h
parentcfe8793180ec633dd7a17d059ad882ef461ed1d9 (diff)
Fix dynamic mode edge cases
The VMware Xorg driver supports dynamic modelines that can be set from userspace via an X extension. These are used to implement VM features which need to automatically change the resolution of the guest OS. This driver implements the feature using two modelines. The driver would alternately update one mode then the other, so that in typical usage one mode is current and the other is available for the next mode switch. This usually worked, but there were many edge cases that could cause this alternating pattern to get 'out of sync', so we'd end up changing the resolution of the current video mode. This could end up putting the X server in a state where the screen resolution has been changed, but the hardware was never reprogrammed for the new resolution. This patch fixes the problem by explicitly searching for a dynamic mode that isn't currently in use. We no longer rely on the alternating pattern.
Diffstat (limited to 'src/vmware.h')
-rw-r--r--src/vmware.h6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/vmware.h b/src/vmware.h
index 2b3c119..80393e6 100644
--- a/src/vmware.h
+++ b/src/vmware.h
@@ -46,6 +46,9 @@
/* Arbitrarily choose max cursor dimensions. The emulation doesn't care. */
#define MAX_CURS 32
+#define NUM_DYN_MODES 2
+
+
typedef struct {
CARD32 svga_reg_enable;
CARD32 svga_reg_width;
@@ -94,8 +97,7 @@ typedef struct {
VMWARERegRec SavedReg;
VMWARERegRec ModeReg;
- DisplayModePtr dynMode1;
- DisplayModePtr dynMode2;
+ DisplayModePtr dynModes[NUM_DYN_MODES];
Bool* pvtSema;