Changeset 8425 in vbox for trunk/src/VBox
- Timestamp:
- Apr 28, 2008 3:03:37 PM (17 years ago)
- svn:sync-xref-src-repo-rev:
- 30274
- Location:
- trunk/src/VBox
- Files:
-
- 12 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Additions/common/VBoxGuestLib/VBoxGuestR3LibVideo.cpp
r8398 r8425 232 232 return fRc; 233 233 } 234 235 236 /**237 * Report the maximum resolution that we currently support to the host.238 *239 * @returns iprt status value.240 * @param cx The maximum horizontal resolution.241 * @param cy The maximum vertical resolution.242 */243 VBGLR3DECL(int) VbglR3ReportMaxGuestResolution(uint32_t cx, uint32_t cy)244 {245 int rc = VERR_UNRESOLVED_ERROR;246 VMMDevReqGuestResolution req;247 248 vmmdevInitRequest(&req.header, VMMDevReq_SetMaxGuestResolution);249 req.u32MaxWidth = cx;250 req.u32MaxHeight = cy;251 rc = vbglR3GRPerform(&req.header);252 if (!RT_SUCCESS(rc) || !RT_SUCCESS(req.header.rc))253 LogRelFunc(("error reporting maximum supported resolution to VMMDev. "254 "rc = %Vrc, VMMDev rc = %Vrc\n", rc, req.header.rc));255 if (RT_SUCCESS(rc))256 rc = req.header.rc;257 return rc;258 } -
trunk/src/VBox/Additions/x11/xgraphics/vboxutils.c
r8366 r8425 901 901 return VbglR3HostLikesVideoMode(cx, cy, cBits); 902 902 } 903 904 905 /**906 * Report the maximum resolution supported by the guest907 *908 * @returns true for success, false otherwise909 * @param u32Width maximum horizontal resolution supported910 * @param u32Height maximum vertical resolution supported911 */912 Bool913 vboxReportMaxGuestResolution(uint32_t u32Width, uint32_t u32Height)914 {915 int irc = VbglR3ReportMaxGuestResolution(u32Width, u32Height);916 return RT_SUCCESS(irc);917 } -
trunk/src/VBox/Additions/x11/xgraphics/vboxvideo.h
r8366 r8425 176 176 177 177 extern Bool vboxHostLikesVideoMode(uint32_t cx, uint32_t cy, uint32_t cBits); 178 extern Bool vboxReportMaxGuestResolution(uint32_t u32Width, uint32_t u32Height);179 178 180 179 #endif /* _VBOXVIDEO_H_ */ -
trunk/src/VBox/Devices/VMMDev/VBoxDev.cpp
r8325 r8425 572 572 573 573 pData->pDrv->pfnUpdateGuestCapabilities(pData->pDrv, pData->guestCaps); 574 pRequestHeader->rc = VINF_SUCCESS;575 }576 break;577 }578 579 case VMMDevReq_SetMaxGuestResolution:580 {581 if (pRequestHeader->size != sizeof(VMMDevReqGuestResolution))582 {583 AssertMsgFailed(("VMMDev guest resolution structure has invalid size!\n"));584 pRequestHeader->rc = VERR_INVALID_PARAMETER;585 }586 else587 {588 VMMDevReqGuestResolution *guestRes = (VMMDevReqGuestResolution*)pRequestHeader;589 590 pData->u32MaxGuestWidth = guestRes->u32MaxWidth;591 pData->u32MaxGuestHeight = guestRes->u32MaxHeight;592 593 LogRel(("Guest Additions maximum resolution of %dx%d reported\n",594 pData->u32MaxGuestWidth, pData->u32MaxGuestHeight));595 596 /* Only notify frontends that are interested (i.e. Main, but not BFE) */597 if (NULL != pData->pDrv->pfnUpdateMaxGuestResolution)598 pData->pDrv->pfnUpdateMaxGuestResolution(pData->pDrv, pData->u32MaxGuestWidth, pData->u32MaxGuestHeight);599 574 pRequestHeader->rc = VINF_SUCCESS; 600 575 } … … 1972 1947 1973 1948 1974 #define VMMDEV_SSM_VERSION 71949 #define VMMDEV_SSM_VERSION 6 1975 1950 1976 1951 /** … … 2003 1978 SSMR3PutU32(pSSMHandle, pData->guestCaps); 2004 1979 2005 SSMR3PutU32(pSSMHandle, pData->u32MaxGuestWidth);2006 SSMR3PutU32(pSSMHandle, pData->u32MaxGuestHeight);2007 2008 1980 #ifdef VBOX_HGCM 2009 1981 vmmdevHGCMSaveState (pData, pSSMHandle); … … 2024 1996 { 2025 1997 VMMDevState *pData = PDMINS2DATA(pDevIns, VMMDevState*); 2026 if ( SSM_VERSION_MAJOR_CHANGED(u32Version, VMMDEV_SSM_VERSION) 2027 || (SSM_VERSION_MINOR(u32Version) < 6)) 1998 if (u32Version != VMMDEV_SSM_VERSION) 2028 1999 return VERR_SSM_UNSUPPORTED_DATA_UNIT_VERSION; 2029 2000 SSMR3GetU32(pSSMHandle, &pData->hypervisorSize); … … 2046 2017 SSMR3GetU32(pSSMHandle, &pData->guestCaps); 2047 2018 2048 if ( SSM_VERSION_MAJOR(u32Version) > 02049 || SSM_VERSION_MINOR(u32Version) >= 7)2050 {2051 SSMR3GetU32(pSSMHandle, &pData->u32MaxGuestWidth);2052 SSMR3GetU32(pSSMHandle, &pData->u32MaxGuestHeight);2053 }2054 2055 2019 #ifdef VBOX_HGCM 2056 2020 vmmdevHGCMLoadState (pData, pSSMHandle); … … 2082 2046 if (pData->pDrv) 2083 2047 pData->pDrv->pfnUpdateGuestCapabilities(pData->pDrv, pData->guestCaps); 2084 2085 if ( pData->pDrv && pData->pDrv->pfnUpdateMaxGuestResolution)2086 pData->pDrv->pfnUpdateMaxGuestResolution(pData->pDrv, pData->u32MaxGuestWidth, pData->u32MaxGuestHeight);2087 2048 2088 2049 return VINF_SUCCESS; … … 2358 2319 pData->fu32AdditionsOk = false; 2359 2320 memset (&pData->guestInfo, 0, sizeof (pData->guestInfo)); 2360 2361 /* No maximum resolution specified yet */2362 pData->u32MaxGuestWidth = 0;2363 pData->u32MaxGuestHeight = 0;2364 2321 2365 2322 memset (&pData->lastReadDisplayChangeRequest, 0, sizeof (pData->lastReadDisplayChangeRequest)); -
trunk/src/VBox/Devices/VMMDev/VMMDevState.h
r8312 r8425 108 108 uint32_t u32VideoAccelEnabled; 109 109 110 /** Maximum guest resolution, width - a value of 0 mean no maximum */111 uint32_t u32MaxGuestWidth;112 /** Maximum guest resolution, height - a value of 0 mean no maximum */113 uint32_t u32MaxGuestHeight;114 115 110 /** resolution change request */ 116 111 struct -
trunk/src/VBox/Frontends/VBoxBFE/VMMDevInterface.cpp
r8312 r8425 421 421 pData->Connector.pfnUpdateGuestVersion = VMMDev::UpdateGuestVersion; 422 422 pData->Connector.pfnUpdateGuestCapabilities = VMMDev::UpdateGuestCapabilities; 423 pData->Connector.pfnUpdateMaxGuestResolution = NULL;424 423 pData->Connector.pfnUpdateMouseCapabilities = VMMDev::UpdateMouseCapabilities; 425 424 pData->Connector.pfnUpdatePointerShape = VMMDev::UpdatePointerShape; -
trunk/src/VBox/Frontends/VirtualBox/src/VBoxConsoleWnd.cpp
r8385 r8425 1971 1971 * csession.GetMachine().GetMonitorCount() /**< @todo fix assumption that all screens have same resolution */ 1972 1972 + 4096 * 8; /* adapter info */ 1973 CGuest guest = console->console().GetGuest(); 1974 LONG maxWidth = guest.GetMaxGuestWidth(); 1975 LONG maxHeight = guest.GetMaxGuestHeight(); 1976 /** @todo this implements the correct size computation for X11 guests. 1977 * Using a less wasteful approach than using a square region would be 1978 * appreciated, but this has to reflect what the guest additions do. */ 1979 if (maxWidth || maxHeight) 1980 usedBits = RT_MAX(usedBits, ( RT_MAX(screen.width(), screen.height()) 1981 * RT_MAX(screen.width(), screen.height()) 1982 * guestBpp 1983 + _1M * 8) /* current cache per screen - may be changed in future */ 1984 * csession.GetMachine().GetMonitorCount() /**< @todo fix assumption that all screens have same resolution */ 1985 + 4096 * 8); /* adapter info */ 1986 1987 if (aOn && ( (availBits < usedBits) 1988 || ((maxWidth != 0) && (maxWidth < screen.width())) 1989 || ((maxHeight != 0) && (maxHeight < screen.height())) 1990 ) 1991 ) 1973 1974 if (aOn && (availBits < usedBits)) 1992 1975 { 1993 1976 vboxProblem().cannotEnterSeamlessMode (screen.width(), -
trunk/src/VBox/Frontends/VirtualBox4/src/VBoxConsoleWnd.cpp
r8363 r8425 1994 1994 * csession.GetMachine().GetMonitorCount() /**< @todo fix assumption that all screens have same resolution */ 1995 1995 + 4096 * 8; /* adapter info */ 1996 CGuest guest = console->console().GetGuest(); 1997 LONG maxWidth = guest.GetMaxGuestWidth(); 1998 LONG maxHeight = guest.GetMaxGuestHeight(); 1999 if (aOn && ( (availBits < usedBits) 2000 || ((maxWidth != 0) && (maxWidth < screen.width())) 2001 || ((maxHeight != 0) && (maxHeight < screen.height())) 2002 ) 2003 ) 1996 if (aOn && (availBits < usedBits)) 2004 1997 { 2005 1998 vboxProblem().cannotEnterSeamlessMode (screen.width(), -
trunk/src/VBox/Main/GuestImpl.cpp
r8350 r8425 161 161 } 162 162 163 STDMETHODIMP Guest::COMGETTER(MaxGuestWidth) (ULONG *aMaxWidth)164 {165 if (!VALID_PTR(aMaxWidth))166 return E_POINTER;167 168 AutoCaller autoCaller (this);169 CheckComRCReturnRC (autoCaller.rc());170 171 AutoReadLock alock (this);172 173 *aMaxWidth = mData.mMaxWidth;174 175 return S_OK;176 }177 178 STDMETHODIMP Guest::COMGETTER(MaxGuestHeight) (ULONG *aMaxHeight)179 {180 if (!VALID_PTR(aMaxHeight))181 return E_POINTER;182 183 AutoCaller autoCaller (this);184 CheckComRCReturnRC (autoCaller.rc());185 186 AutoReadLock alock (this);187 188 *aMaxHeight = mData.mMaxHeight;189 190 return S_OK;191 }192 193 163 STDMETHODIMP Guest::COMGETTER(SupportsSeamless) (BOOL *aSupportsSeamless) 194 164 { … … 367 337 } 368 338 369 void Guest::set MaxGuestResolution (ULONG aMaxWidth, ULONG aMaxHeight)339 void Guest::setSupportsSeamless (BOOL aSupportsSeamless) 370 340 { 371 341 AutoCaller autoCaller (this); … … 374 344 AutoWriteLock alock (this); 375 345 376 mData.mMaxWidth = aMaxWidth; 377 mData.mMaxHeight = aMaxHeight; 378 } 379 380 void Guest::setSupportsSeamless (BOOL aSupportsSeamless) 346 mData.mSupportsSeamless = aSupportsSeamless; 347 } 348 349 void Guest::setSupportsGraphics (BOOL aSupportsGraphics) 381 350 { 382 351 AutoCaller autoCaller (this); … … 385 354 AutoWriteLock alock (this); 386 355 387 mData.mSupportsSeamless = aSupportsSeamless;388 }389 390 void Guest::setSupportsGraphics (BOOL aSupportsGraphics)391 {392 AutoCaller autoCaller (this);393 AssertComRCReturnVoid (autoCaller.rc());394 395 AutoWriteLock alock (this);396 397 356 mData.mSupportsGraphics = aSupportsGraphics; 398 357 } -
trunk/src/VBox/Main/VMMDevInterface.cpp
r8312 r8425 215 215 pDrv->pVMMDev->getParent()->onAdditionsStateChange(); 216 216 217 }218 219 /**220 * Update the maximum guest resolution.221 * This is called when the guest sends us a corresponding notification. The new resolution222 * is given and the connector should update its internal state.223 * @note This member can be left null if the connector is not interested in the224 * notification.225 *226 * @param pInterface Pointer to this interface.227 * @param u32MaxWidth New width.228 * @param u32MaxHeight New Height.229 * @thread The emulation thread.230 */231 DECLCALLBACK(void) vmmdevUpdateMaxGuestResolution(PPDMIVMMDEVCONNECTOR pInterface, uint32_t u32MaxWidth, uint32_t u32MaxHeight)232 {233 PDRVMAINVMMDEV pDrv = PDMIVMMDEVCONNECTOR_2_MAINVMMDEV(pInterface);234 235 /* store that information in IGuest */236 Guest* guest = pDrv->pVMMDev->getParent()->getGuest();237 Assert(guest);238 if (!guest)239 return;240 241 guest->setMaxGuestResolution(u32MaxWidth, u32MaxHeight);242 243 /* This information is queried when it is needed, so there is no need to244 issue any further notifications. */245 217 } 246 218 … … 705 677 pData->Connector.pfnUpdateGuestVersion = vmmdevUpdateGuestVersion; 706 678 pData->Connector.pfnUpdateGuestCapabilities = vmmdevUpdateGuestCapabilities; 707 pData->Connector.pfnUpdateMaxGuestResolution = vmmdevUpdateMaxGuestResolution;708 679 pData->Connector.pfnUpdateMouseCapabilities = vmmdevUpdateMouseCapabilities; 709 680 pData->Connector.pfnUpdatePointerShape = vmmdevUpdatePointerShape; -
trunk/src/VBox/Main/idl/VirtualBox.xidl
r8367 r8425 5184 5184 <interface 5185 5185 name="IGuest" extends="$unknown" 5186 uuid=" 655f0f7f-a35b-4e2f-a728-175d7e18dcce"5186 uuid="d8556fca-81bc-12af-fca3-365528fa38ca" 5187 5187 5188 5188 wsmap="suppress" … … 5227 5227 the version might be refused by VirtualBox (incompatible) or 5228 5228 other failures occured. 5229 </desc>5230 </attribute>5231 5232 <attribute name="maxGuestWidth" type="unsigned long" readonly="yes">5233 <desc>5234 The maximum horizontal resolution currently supported by the5235 Guest Additions for the purpose of host-initiated resiing5236 (and fullscreen and seamless). A value of zero means no5237 arbitrary maximum other than that imposed by VRAM limits.5238 </desc>5239 </attribute>5240 5241 <attribute name="maxGuestHeight" type="unsigned long" readonly="yes">5242 <desc>5243 The maximum vertical resolution currently supported by the5244 Guest Additions for the purpose of host-initiated resiing5245 (and fullscreen and seamless). A value of zero means no5246 arbitrary maximum other than that imposed by VRAM limits.5247 5229 </desc> 5248 5230 </attribute> -
trunk/src/VBox/Main/include/GuestImpl.h
r8323 r8425 61 61 STDMETHOD(COMGETTER(AdditionsActive)) (BOOL *aAdditionsActive); 62 62 STDMETHOD(COMGETTER(AdditionsVersion)) (BSTR *aAdditionsVersion); 63 STDMETHOD(COMGETTER(MaxGuestWidth)) (ULONG *aMaxWidth);64 STDMETHOD(COMGETTER(MaxGuestHeight)) (ULONG *aMaxHeight);65 63 STDMETHOD(COMGETTER(SupportsSeamless)) (BOOL *aSupportsSeamless); 66 64 STDMETHOD(COMGETTER(SupportsGraphics)) (BOOL *aSupportsGraphics); … … 78 76 void setAdditionsVersion (Bstr aVersion); 79 77 80 void setMaxGuestResolution (ULONG aMaxWidth, ULONG aMaxHeight);81 82 78 void setSupportsSeamless (BOOL aSupportsSeamless); 83 79 … … 93 89 struct Data 94 90 { 95 Data() : mAdditionsActive (FALSE), mMaxWidth (0), 96 mMaxHeight(0), mSupportsSeamless (FALSE), 91 Data() : mAdditionsActive (FALSE), mSupportsSeamless (FALSE), 97 92 /* Windows and OS/2 guests take this for granted */ 98 93 mSupportsGraphics (TRUE) {} … … 101 96 BOOL mAdditionsActive; 102 97 Bstr mAdditionsVersion; 103 /** The maximum width supported by the guest - zero means no maximum */104 ULONG mMaxWidth;105 /** The maximum height supported by the guest - zero means no maximum */106 ULONG mMaxHeight;107 98 BOOL mSupportsSeamless; 108 99 BOOL mSupportsGraphics;
Note:
See TracChangeset
for help on using the changeset viewer.