summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJakob Bornecrantz <jakob@vmware.com>2011-12-09 07:34:58 +0100
committerJakob Bornecrantz <jakob@vmware.com>2012-01-12 17:12:56 +0100
commit0628ad20f31a239f99fcbbfe42197c56a5ae8864 (patch)
tree01c1929a7e2f961383409b7fe907e55f6b70a8db
parent8ddbb3216d29b2ecd336d50461216feef0900fd9 (diff)
downloadxf86-video-vmware-0628ad20f31a239f99fcbbfe42197c56a5ae8864.tar.gz
xf86-video-vmware-0628ad20f31a239f99fcbbfe42197c56a5ae8864.tar.bz2
xf86-video-vmware-0628ad20f31a239f99fcbbfe42197c56a5ae8864.zip
vmwlegacy: Make the default be a minimum of 800x600
This patch and the corresponding vmwgfx patch formalizes both drivers on the same behviour. The minimum is 800x600 (unless the max size is smaller). This makes it unnecessary to check against VRAM size since it is always at least large enough to fit the max values. Signed-off-by: Jakob Bornecrantz <jakob@vmware.com>
-rw-r--r--src/vmware.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/src/vmware.c b/src/vmware.c
index e2fb67b..5eb2bf9 100644
--- a/src/vmware.c
+++ b/src/vmware.c
@@ -91,6 +91,9 @@ typedef struct {
int height;
} VMWAREDefaultMode;
+#define VMW_MIN_INITIAL_WIDTH 800
+#define VMW_MIN_INITIAL_HEIGHT 600
+
#define SVGA_DEFAULT_MODE(width, height) { width, height, },
static const VMWAREDefaultMode VMWAREDefaultModes[] = {
@@ -604,8 +607,14 @@ VMWAREPreInit(ScrnInfoPtr pScrn, int flags)
if (xf86GetOptValBool(options, OPTION_DEFAULT_MODE, &defaultMode)) {
from = X_CONFIG;
}
- width = vmwareReadReg(pVMWARE, SVGA_REG_WIDTH);
- height = vmwareReadReg(pVMWARE, SVGA_REG_HEIGHT);
+
+ width = vmwareReadReg(pVMWARE, SVGA_REG_MAX_WIDTH);
+ height = vmwareReadReg(pVMWARE, SVGA_REG_MAX_HEIGHT);
+ width = MAX(width, VMW_MIN_INITIAL_WIDTH);
+ height = MAX(height, VMW_MIN_INITIAL_HEIGHT);
+ width = MIN(width, pVMWARE->maxWidth);
+ height = MIN(height, pVMWARE->maxHeight);
+
xf86DrvMsg(pScrn->scrnIndex, from,
"Will %sset up a driver mode with dimensions %dx%d.\n",
defaultMode ? "" : "not ", width, height);