Changeset 53528 in vbox for trunk/src/VBox/Main/src-client
- Timestamp:
- Dec 12, 2014 8:22:39 PM (10 years ago)
- Location:
- trunk/src/VBox/Main/src-client
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/src-client/ConsoleImpl.cpp
r53442 r53528 5184 5184 5185 5185 fireVRDEServerInfoChangedEvent(mEventSource); 5186 } 5187 5188 HRESULT Console::i_sendACPIMonitorHotPlugEvent() 5189 { 5190 LogFlowThisFuncEnter(); 5191 5192 AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS); 5193 5194 if ( mMachineState != MachineState_Running 5195 && mMachineState != MachineState_Teleporting 5196 && mMachineState != MachineState_LiveSnapshotting) 5197 return i_setInvalidMachineStateError(); 5198 5199 /* get the VM handle. */ 5200 SafeVMPtr ptrVM(this); 5201 if (!ptrVM.isOk()) 5202 return ptrVM.rc(); 5203 5204 // no need to release lock, as there are no cross-thread callbacks 5205 5206 /* get the acpi device interface and press the sleep button. */ 5207 PPDMIBASE pBase; 5208 int vrc = PDMR3QueryDeviceLun(ptrVM.rawUVM(), "acpi", 0, 0, &pBase); 5209 if (RT_SUCCESS(vrc)) 5210 { 5211 Assert(pBase); 5212 PPDMIACPIPORT pPort = PDMIBASE_QUERY_INTERFACE(pBase, PDMIACPIPORT); 5213 if (pPort) 5214 vrc = pPort->pfnMonitorHotPlugEvent(pPort); 5215 else 5216 vrc = VERR_PDM_MISSING_INTERFACE; 5217 } 5218 5219 HRESULT rc = RT_SUCCESS(vrc) ? S_OK : 5220 setError(VBOX_E_PDM_ERROR, 5221 tr("Sending monitor hot-plug event failed (%Rrc)"), 5222 vrc); 5223 5224 LogFlowThisFunc(("rc=%Rhrc\n", rc)); 5225 LogFlowThisFuncLeave(); 5226 return rc; 5186 5227 } 5187 5228 -
trunk/src/VBox/Main/src-client/DisplayImpl.cpp
r53201 r53528 20 20 #include "ConsoleImpl.h" 21 21 #include "ConsoleVRDPServer.h" 22 #include "GuestImpl.h" 22 23 #include "VMMDev.h" 23 24 … … 122 123 #ifdef VBOX_WITH_HGSMI 123 124 mu32UpdateVBVAFlags = 0; 125 mfVMMDevSupportsGraphics = false; 126 mfGuestVBVACapabilities = 0; 124 127 #endif 125 128 #ifdef VBOX_WITH_VPX … … 1032 1035 mParent->i_consoleVRDPServer()->SendUpdateBitmap(uScreenId, x, y, w, h); 1033 1036 } 1037 } 1038 1039 void Display::i_updateGuestGraphicsFacility(void) 1040 { 1041 Guest* pGuest = mParent->i_getGuest(); 1042 AssertPtrReturnVoid(pGuest); 1043 /* The following is from GuestImpl.cpp. */ 1044 /** @todo A nit: The timestamp is wrong on saved state restore. Would be better 1045 * to move the graphics and seamless capability -> facility translation to 1046 * VMMDev so this could be saved. */ 1047 RTTIMESPEC TimeSpecTS; 1048 RTTimeNow(&TimeSpecTS); 1049 1050 if ( mfVMMDevSupportsGraphics 1051 || (mfGuestVBVACapabilities & VBVACAPS_VIDEO_MODE_HINTS) != 0) 1052 pGuest->i_setAdditionsStatus(VBoxGuestFacilityType_Graphics, 1053 VBoxGuestFacilityStatus_Active, 1054 0 /*fFlags*/, &TimeSpecTS); 1055 else 1056 pGuest->i_setAdditionsStatus(VBoxGuestFacilityType_Graphics, 1057 VBoxGuestFacilityStatus_Inactive, 1058 0 /*fFlags*/, &TimeSpecTS); 1059 } 1060 1061 void Display::i_handleUpdateVMMDevSupportsGraphics(bool fSupportsGraphics) 1062 { 1063 AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS); 1064 if (mfVMMDevSupportsGraphics == fSupportsGraphics) 1065 return; 1066 mfVMMDevSupportsGraphics = fSupportsGraphics; 1067 i_updateGuestGraphicsFacility(); 1068 /* The VMMDev interface notifies the console. */ 1069 } 1070 1071 void Display::i_handleUpdateGuestVBVACapabilities(uint32_t fNewCapabilities) 1072 { 1073 AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS); 1074 bool fNotify = (fNewCapabilities & VBVACAPS_VIDEO_MODE_HINTS) != 0; 1075 1076 mfGuestVBVACapabilities = fNewCapabilities; 1077 if (!fNotify) 1078 return; 1079 i_updateGuestGraphicsFacility(); 1080 /* Tell the console about it */ 1081 mParent->i_onAdditionsStateChange(); 1034 1082 } 1035 1083 … … 1637 1685 alock.release(); 1638 1686 1687 /* We always send the hint to the graphics card in case the guest enables 1688 * support later. For now we notify exactly when support is enabled. */ 1689 mpDrv->pUpPort->pfnSendModeHint(mpDrv->pUpPort, aWidth, aHeight, 1690 aBitsPerPixel, aDisplay, 1691 aChangeOrigin ? aOriginX : ~0, 1692 aChangeOrigin ? aOriginY : ~0, 1693 RT_BOOL(aEnabled), 1694 mfGuestVBVACapabilities 1695 & VBVACAPS_VIDEO_MODE_HINTS); 1696 if ( mfGuestVBVACapabilities & VBVACAPS_VIDEO_MODE_HINTS 1697 && !(mfGuestVBVACapabilities & VBVACAPS_IRQ)) 1698 { 1699 HRESULT hrc = mParent->i_sendACPIMonitorHotPlugEvent(); 1700 if (FAILED(hrc)) 1701 return hrc; 1702 } 1703 1704 /* We currently never suppress the VMMDev hint if the guest has requested 1705 * it. Specifically the video graphics driver may not be responsible for 1706 * screen positioning in the guest virtual desktop, and the component 1707 * responsible may want to get the hint from VMMDev. */ 1639 1708 VMMDev *pVMMDev = mParent->i_getVMMDev(); 1640 1709 if (pVMMDev) … … 3781 3850 return VINF_SUCCESS; 3782 3851 } 3852 3853 DECLCALLBACK(void) Display::i_displayVBVAGuestCapabilityUpdate(PPDMIDISPLAYCONNECTOR pInterface, uint32_t fCapabilities) 3854 { 3855 LogFlowFunc(("\n")); 3856 3857 PDRVMAINDISPLAY pDrv = PDMIDISPLAYCONNECTOR_2_MAINDISPLAY(pInterface); 3858 Display *pThis = pDrv->pDisplay; 3859 3860 pThis->i_handleUpdateGuestVBVACapabilities(fCapabilities); 3861 } 3783 3862 #endif /* VBOX_WITH_HGSMI */ 3784 3863 … … 3881 3960 pThis->IConnector.pfnVBVAResize = Display::i_displayVBVAResize; 3882 3961 pThis->IConnector.pfnVBVAMousePointerShape = Display::i_displayVBVAMousePointerShape; 3962 pThis->IConnector.pfnVBVAGuestCapabilityUpdate = Display::i_displayVBVAGuestCapabilityUpdate; 3883 3963 #endif 3884 3964 -
trunk/src/VBox/Main/src-client/GuestImpl.cpp
r52085 r53528 1083 1083 0 /*fFlags*/, &TimeSpecTS); 1084 1084 /** @todo Add VMMDEV_GUEST_SUPPORTS_GUEST_HOST_WINDOW_MAPPING */ 1085 i_facilityUpdate(VBoxGuestFacilityType_Graphics, 1086 aCaps & VMMDEV_GUEST_SUPPORTS_GRAPHICS ? VBoxGuestFacilityStatus_Active : VBoxGuestFacilityStatus_Inactive, 1087 0 /*fFlags*/, &TimeSpecTS); 1088 } 1089 1085 } 1086 -
trunk/src/VBox/Main/src-client/VMMDevInterface.cpp
r52934 r53528 290 290 */ 291 291 pGuest->i_setSupportedFeatures(newCapabilities); 292 293 /* 294 * Tell the Display, so that it can update the "supports graphics" 295 * capability if the graphics card has not asserted it. 296 */ 297 Display* pDisplay = pConsole->i_getDisplay(); 298 AssertPtrReturnVoid(pDisplay); 299 pDisplay->i_handleUpdateVMMDevSupportsGraphics(newCapabilities 300 & VMMDEV_GUEST_SUPPORTS_GRAPHICS); 292 301 293 302 /*
Note:
See TracChangeset
for help on using the changeset viewer.