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>
This commit is contained in:
Thomas Hellstrom
2011-03-30 12:37:24 +02:00
parent 04297d435b
commit 0142bb8d10

View File

@@ -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);