From 0142bb8d10edb153c9ce79a2ea3ff92a7fb15ac5 Mon Sep 17 00:00:00 2001 From: Thomas Hellstrom Date: Wed, 30 Mar 2011 12:37:24 +0200 Subject: [PATCH] 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 Reviewed-by: Alan Hourihane --- src/vmwaremodes.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) 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 #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); -- 2.7.4