diff options
author | Jakob Bornecrantz <jakob@vmware.com> | 2011-12-09 07:34:58 +0100 |
---|---|---|
committer | Jakob Bornecrantz <jakob@vmware.com> | 2012-01-12 17:12:56 +0100 |
commit | 0628ad20f31a239f99fcbbfe42197c56a5ae8864 (patch) | |
tree | 01c1929a7e2f961383409b7fe907e55f6b70a8db /src/vmware.c | |
parent | 8ddbb3216d29b2ecd336d50461216feef0900fd9 (diff) |
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>
Diffstat (limited to 'src/vmware.c')
-rw-r--r-- | src/vmware.c | 13 |
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); |