diff options
author | Thomas Hellstrom <thellstrom@vmware.com> | 2011-03-30 12:37:24 +0200 |
---|---|---|
committer | Thomas Hellstrom <thellstrom@vmware.com> | 2011-03-30 14:23:37 +0200 |
commit | 0142bb8d10edb153c9ce79a2ea3ff92a7fb15ac5 (patch) | |
tree | 68877d8cbabb6d5f39e61db27b91bf98c63945bb | |
parent | 04297d435b87e3d04a427ac8ef33d314727220e6 (diff) |
vmwlegacy: Don't prune modes based on the virtual size of the default mode
We might be pruning modes based on the virtual size of the default mode in
some situations. Avoid this by allowing a virtual size equal to the device
max size, unless the user has requested something else.
Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
Reviewed-by: Alan Hourihane <alanh@vmware.com>
-rw-r--r-- | src/vmwaremodes.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/vmwaremodes.c b/src/vmwaremodes.c index 6df977d..9a7b757 100644 --- a/src/vmwaremodes.c +++ b/src/vmwaremodes.c @@ -39,6 +39,7 @@ #include <xf86Modes.h> #endif #include "vm_basic_types.h" +#include "vmware.h" #ifndef M_T_DRIVER # define M_T_DRIVER 0x40 /* Supplied by the driver (EDID, etc) */ @@ -85,6 +86,7 @@ vmwareAddDefaultMode(ScrnInfoPtr pScrn, uint32 dwidth, uint32 dheight) char **dispModeList; char *dynModeName; char name[80]; + VMWAREPtr pVMWARE = VMWAREPTR(pScrn); /* First, add the default mode name to the display mode * requests. @@ -132,6 +134,20 @@ vmwareAddDefaultMode(ScrnInfoPtr pScrn, uint32 dwidth, uint32 dheight) dynamic.HTotal / 1000; mode = xf86DuplicateMode(&dynamic); modes = xf86ModesAdd(modes, mode); + + if (dispModeCount == 0) { + + /* + * We might also want to consider the case where + * dispModeCount != 0, but the requested display modes + * are not available. This is sufficient for now. + */ + + if (pScrn->display->virtualX == 0) + pScrn->display->virtualX = pVMWARE->maxWidth; + if (pScrn->display->virtualY == 0) + pScrn->display->virtualY = pVMWARE->maxHeight; + } } *monitorModes = xf86ModesAdd(*monitorModes, modes); |