Changeset 98670 in vbox
- Timestamp:
- Feb 21, 2023 11:47:35 AM (2 years ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src/runtime
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachine.cpp
r98669 r98670 386 386 /* Remember 'desired' visibility status: */ 387 387 // See note in UIMachineView::sltHandleNotifyChange() regarding the graphics controller check. */ 388 if (uisession()->machine().GetGraphicsAdapter().GetGraphicsControllerType() != KGraphicsControllerType_VMSVGA) 388 KGraphicsControllerType enmType = KGraphicsControllerType_Null; 389 acquireGraphicsControllerType(enmType); 390 if (enmType != KGraphicsControllerType_VMSVGA) 389 391 gEDataManager->setLastGuestScreenVisibilityStatus(uScreenId, fIsMonitorVisible, uiCommon().managedVMUuid()); 390 392 … … 432 434 /* Remember last full-screen size: */ 433 435 m_monitorLastFullScreenSizeVector[(int)uScreenId] = size; 436 } 437 438 bool UIMachine::acquireGraphicsControllerType(KGraphicsControllerType &enmType) 439 { 440 return uisession()->acquireGraphicsControllerType(enmType); 441 } 442 443 bool UIMachine::acquireVRAMSize(ulong &uSize) 444 { 445 return uisession()->acquireVRAMSize(uSize); 446 } 447 448 bool UIMachine::acquireWhetherAccelerate3DEnabled(bool &fEnabled) 449 { 450 return uisession()->acquireWhetherAccelerate3DEnabled(fEnabled); 434 451 } 435 452 -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachine.h
r98669 r98670 279 279 void setGuestResizeIgnored(bool fIgnored) { m_fIsGuestResizeIgnored = fIgnored; } 280 280 281 /** Acquires graphics controller type. */ 282 bool acquireGraphicsControllerType(KGraphicsControllerType &enmType); 283 /** Acquires VRAM size. */ 284 bool acquireVRAMSize(ulong &uSize); 285 /** Acquires whether accelerate 3D is enabled. */ 286 bool acquireWhetherAccelerate3DEnabled(bool &fEnabled); 281 287 /** Acquires monitor count. */ 282 288 bool acquireMonitorCount(ulong &uCount); -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineView.cpp
r98560 r98670 237 237 238 238 /* Propagate the scale-factor related attributes to 3D service if necessary: */ 239 if (machine().GetGraphicsAdapter().GetAccelerate3DEnabled()) 239 bool fAccelerate3DEnabled = false; 240 uimachine()->acquireWhetherAccelerate3DEnabled(fAccelerate3DEnabled); 241 if (fAccelerate3DEnabled) 240 242 { 241 243 double dScaleFactorFor3D = dScaleFactor; … … 672 674 uimachine()->invalidateAndUpdateScreen(m_uScreenId); 673 675 676 /* Acquire graphics controller type: */ 677 KGraphicsControllerType enmType = KGraphicsControllerType_Null; 678 uimachine()->acquireGraphicsControllerType(enmType); 679 674 680 /* If we are in normal or scaled mode and if GA are active, 675 681 * remember the guest-screen size to be able to restore it when necessary: */ … … 680 686 if ( !isFullscreenOrSeamless() 681 687 && uimachine()->isGuestSupportsGraphics() 682 && ( machine().GetGraphicsAdapter().GetGraphicsControllerType()!= KGraphicsControllerType_VMSVGA))688 && (enmType != KGraphicsControllerType_VMSVGA)) 683 689 setStoredGuestScreenSizeHint(frameBufferSizeNew); 684 690 … … 990 996 991 997 /* Propagate the scale-factor related attributes to 3D service if necessary: */ 992 if (machine().GetGraphicsAdapter().GetAccelerate3DEnabled()) 998 bool fAccelerate3DEnabled = false; 999 uimachine()->acquireWhetherAccelerate3DEnabled(fAccelerate3DEnabled); 1000 if (fAccelerate3DEnabled) 993 1001 { 994 1002 double dScaleFactorFor3D = dScaleFactor; … … 1222 1230 1223 1231 /* Propagate the scale-factor related attributes to 3D service if necessary: */ 1224 if (machine().GetGraphicsAdapter().GetAccelerate3DEnabled()) 1232 bool fAccelerate3DEnabled = false; 1233 uimachine()->acquireWhetherAccelerate3DEnabled(fAccelerate3DEnabled); 1234 if (fAccelerate3DEnabled) 1225 1235 { 1226 1236 double dScaleFactorFor3D = dScaleFactor; -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMultiScreenLayout.cpp
r98669 r98670 35 35 #include "UIMessageCenter.h" 36 36 #include "UIMultiScreenLayout.h" 37 38 /* COM includes: */39 #include "COMEnums.h"40 #include "CMachine.h"41 #include "CGraphicsAdapter.h"42 37 43 38 … … 225 220 if (uimachine()->isGuestSupportsGraphics()) 226 221 { 227 quint64 uAvailBits = machineLogic()->machine().GetGraphicsAdapter().GetVRAMSize() * _1M * 8; 228 quint64 uUsedBits = memoryRequirements(tmpMap); 222 ulong uVRAMSize = 0; 223 uimachine()->acquireVRAMSize(uVRAMSize); 224 const quint64 uAvailBits = uVRAMSize * _1M * 8; 225 const quint64 uUsedBits = memoryRequirements(tmpMap); 229 226 fSuccess = uAvailBits >= uUsedBits; 230 227 if (!fSuccess) -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UISession.cpp
r98669 r98670 625 625 } 626 626 627 bool UISession::acquireGraphicsControllerType(KGraphicsControllerType &enmType) 628 { 629 CMachine comMachine = machine(); 630 CGraphicsAdapter comAdapter = comMachine.GetGraphicsAdapter(); 631 bool fSuccess = comMachine.isOk(); 632 if (!fSuccess) 633 UINotificationMessage::cannotAcquireMachineParameter(comMachine); 634 else 635 { 636 const KGraphicsControllerType enmControllerType = comAdapter.GetGraphicsControllerType(); 637 fSuccess = comAdapter.isOk(); 638 if (!fSuccess) 639 UINotificationMessage::cannotAcquireGraphicsAdapterParameter(comAdapter); 640 else 641 enmType = enmControllerType; 642 } 643 return fSuccess; 644 } 645 646 bool UISession::acquireVRAMSize(ulong &uSize) 647 { 648 CMachine comMachine = machine(); 649 CGraphicsAdapter comAdapter = comMachine.GetGraphicsAdapter(); 650 bool fSuccess = comMachine.isOk(); 651 if (!fSuccess) 652 UINotificationMessage::cannotAcquireMachineParameter(comMachine); 653 else 654 { 655 const ULONG uVRAMSize = comAdapter.GetVRAMSize(); 656 fSuccess = comAdapter.isOk(); 657 if (!fSuccess) 658 UINotificationMessage::cannotAcquireGraphicsAdapterParameter(comAdapter); 659 else 660 uSize = uVRAMSize; 661 } 662 return fSuccess; 663 } 664 665 bool UISession::acquireWhetherAccelerate3DEnabled(bool &fEnabled) 666 { 667 CMachine comMachine = machine(); 668 CGraphicsAdapter comAdapter = comMachine.GetGraphicsAdapter(); 669 bool fSuccess = comMachine.isOk(); 670 if (!fSuccess) 671 UINotificationMessage::cannotAcquireMachineParameter(comMachine); 672 else 673 { 674 const BOOL fAccelerate3DEnabeld = comAdapter.GetAccelerate3DEnabled(); 675 fSuccess = comAdapter.isOk(); 676 if (!fSuccess) 677 UINotificationMessage::cannotAcquireGraphicsAdapterParameter(comAdapter); 678 else 679 fEnabled = fAccelerate3DEnabeld; 680 } 681 return fSuccess; 682 } 683 627 684 bool UISession::acquireMonitorCount(ulong &uCount) 628 685 { -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UISession.h
r98669 r98670 326 326 QSize frameBufferSize(ulong uScreenId) const; 327 327 328 /** Acquires graphics controller type. */ 329 bool acquireGraphicsControllerType(KGraphicsControllerType &enmType); 330 /** Acquires VRAM size. */ 331 bool acquireVRAMSize(ulong &uSize); 332 /** Acquires whether accelerate 3D is enabled. */ 333 bool acquireWhetherAccelerate3DEnabled(bool &fEnabled); 328 334 /** Acquires monitor count. */ 329 335 bool acquireMonitorCount(ulong &uCount); -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/fullscreen/UIMachineLogicFullscreen.cpp
r98669 r98670 84 84 if (uimachine()->isGuestSupportsGraphics()) 85 85 { 86 quint64 availBits = machine().GetGraphicsAdapter().GetVRAMSize() /* VRAM */ * _1M /* MiB to bytes */ * 8 /* to bits */; 87 quint64 usedBits = m_pScreenLayout->memoryRequirements(); 88 if (availBits < usedBits) 89 { 90 if (!msgCenter().cannotEnterFullscreenMode(0, 0, 0, (((usedBits + 7) / 8 + _1M - 1) / _1M) * _1M)) 86 ulong uVRAMSize = 0; 87 uimachine()->acquireVRAMSize(uVRAMSize); 88 quint64 uAvailBits = uVRAMSize * _1M /* MiB to bytes */ * 8 /* to bits */; 89 quint64 uUsedBits = m_pScreenLayout->memoryRequirements(); 90 if (uAvailBits < uUsedBits) 91 { 92 if (!msgCenter().cannotEnterFullscreenMode(0, 0, 0, (((uUsedBits + 7) / 8 + _1M - 1) / _1M) * _1M)) 91 93 return false; 92 94 } -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/scale/UIMachineViewScale.cpp
r98556 r98670 70 70 { 71 71 /* Propagate scale-factor to 3D service if necessary: */ 72 if (machine().GetGraphicsAdapter().GetAccelerate3DEnabled()) 72 bool fAccelerate3DEnabled = false; 73 uimachine()->acquireWhetherAccelerate3DEnabled(fAccelerate3DEnabled); 74 if (fAccelerate3DEnabled) 73 75 { 74 76 double xScaleFactor = (double)scaledSize.width() / frameBuffer()->width(); … … 129 131 { 130 132 /* Propagate scale-factor to 3D service if necessary: */ 131 if (machine().GetGraphicsAdapter().GetAccelerate3DEnabled()) 133 bool fAccelerate3DEnabled = false; 134 uimachine()->acquireWhetherAccelerate3DEnabled(fAccelerate3DEnabled); 135 if (fAccelerate3DEnabled) 132 136 { 133 137 double xScaleFactor = (double)scaledSize.width() / frameBuffer()->width(); … … 152 156 frameBuffer()->setUseUnscaledHiDPIOutput(fUseUnscaledHiDPIOutput); 153 157 /* Propagate unscaled-hidpi-output feature to 3D service if necessary: */ 154 if (machine().GetGraphicsAdapter().GetAccelerate3DEnabled()) 158 bool fAccelerate3DEnabled = false; 159 uimachine()->acquireWhetherAccelerate3DEnabled(fAccelerate3DEnabled); 160 if (fAccelerate3DEnabled) 155 161 uimachine()->notifyHiDPIOutputPolicyChange(fUseUnscaledHiDPIOutput); 156 162 -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/seamless/UIMachineLogicSeamless.cpp
r98669 r98670 81 81 if (uimachine()->isGuestSupportsSeamless()) 82 82 { 83 quint64 availBits = machine().GetGraphicsAdapter().GetVRAMSize() /* VRAM */ * _1M /* MiB to bytes */ * 8 /* to bits */; 84 quint64 usedBits = m_pScreenLayout->memoryRequirements(); 85 if (availBits < usedBits) 83 ulong uVRAMSize = 0; 84 uimachine()->acquireVRAMSize(uVRAMSize); 85 quint64 uAvailBits = uVRAMSize * _1M /* MiB to bytes */ * 8 /* to bits */; 86 quint64 uUsedBits = m_pScreenLayout->memoryRequirements(); 87 if (uAvailBits < uUsedBits) 86 88 { 87 89 msgCenter().cannotEnterSeamlessMode(0, 0, 0, 88 (((u sedBits + 7) / 8 + _1M - 1) / _1M) * _1M);90 (((uUsedBits + 7) / 8 + _1M - 1) / _1M) * _1M); 89 91 return false; 90 92 }
Note:
See TracChangeset
for help on using the changeset viewer.