summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Hellstrom <thellstrom@vmware.com>2012-02-08 15:00:20 +0100
committerThomas Hellstrom <thellstrom@vmware.com>2012-02-08 16:13:58 +0100
commitc5c38bab8c493985349356be5fadc14d3aee8040 (patch)
tree37058962fd19a86fb83b2f7ec1fe2dd959fef1c5
parent49b4cbc5100ce9a4cc40132c2839f9401a58b92e (diff)
vmware/legacy: Fix initial mode size v2
Commit "vmwlegacy: Make the default be a minium of 800x600..." read the dimensions from the incorrect register pair. v2: Also treat initial widths and heights larger than the maximum values as an error and revert back to the minimum. Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com> Reviewed-by: Jakob Bornecrantz <jakob@vmware.com>
-rw-r--r--src/vmware.c15
1 files changed, 11 insertions, 4 deletions
diff --git a/src/vmware.c b/src/vmware.c
index e29822f..f20ddb9 100644
--- a/src/vmware.c
+++ b/src/vmware.c
@@ -607,12 +607,19 @@ VMWAREPreInit(ScrnInfoPtr pScrn, int flags)
from = X_CONFIG;
}
- width = vmwareReadReg(pVMWARE, SVGA_REG_MAX_WIDTH);
- height = vmwareReadReg(pVMWARE, SVGA_REG_MAX_HEIGHT);
+ width = vmwareReadReg(pVMWARE, SVGA_REG_WIDTH);
+ height = vmwareReadReg(pVMWARE, SVGA_REG_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);
+
+ if (width > pVMWARE->maxWidth || height > pVMWARE->maxHeight) {
+ /*
+ * This is an error condition and shouldn't happen.
+ * revert to MIN_INITIAL_ values
+ */
+ width = VMW_MIN_INITIAL_WIDTH;
+ height = VMW_MIN_INITIAL_HEIGHT;
+ }
xf86DrvMsg(pScrn->scrnIndex, from,
"Will %sset up a driver mode with dimensions %dx%d.\n",