Changeset 105864 in vbox for trunk/src/VBox
- Timestamp:
- Aug 26, 2024 6:45:15 PM (3 months ago)
- Location:
- trunk/src/VBox
- Files:
-
- 19 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VBoxManage/VBoxManageInfo.cpp
r105266 r105864 1535 1535 1536 1536 SHOW_ULONG_PROP(pGraphicsAdapter, MonitorCount, "monitorcount", Info::tr("Monitor count:"), ""); 1537 SHOW_BOOLEAN_ PROP(pGraphicsAdapter, Accelerate3DEnabled, "accelerate3d", Info::tr("3D Acceleration:"));1537 SHOW_BOOLEAN_METHOD(pGraphicsAdapter, IsFeatureEnabled(GraphicsFeature_Acceleration3D, &f), "accelerate3d", "3D Acceleration:"); 1538 1538 #ifdef VBOX_WITH_VIDEOHWACCEL 1539 SHOW_BOOLEAN_ PROP(pGraphicsAdapter, Accelerate2DVideoEnabled, "accelerate2dvideo", Info::tr("2D Video Acceleration:"));1539 SHOW_BOOLEAN_METHOD(pGraphicsAdapter, IsFeatureEnabled(GraphicsFeature_Acceleration2DVideo, &f), "accelerate2dvideo", "2D Video Acceleration:"); 1540 1540 #endif 1541 1541 SHOW_BOOLEAN_PROP( machine, TeleporterEnabled, "teleporterenabled", Info::tr("Teleporter Enabled:")); -
trunk/src/VBox/Frontends/VBoxManage/VBoxManageModifyVM.cpp
r105080 r105864 1106 1106 case MODIFYVM_ACCELERATE3D: 1107 1107 { 1108 CHECK_ERROR(pGraphicsAdapter, COMSETTER(Accelerate3DEnabled)(ValueUnion.f));1108 CHECK_ERROR(pGraphicsAdapter, SetFeature(GraphicsFeature_Acceleration3D, ValueUnion.f)); 1109 1109 break; 1110 1110 } … … 1113 1113 case MODIFYVM_ACCELERATE2DVIDEO: 1114 1114 { 1115 CHECK_ERROR(pGraphicsAdapter, COMSETTER(Accelerate2DVideoEnabled)(ValueUnion.f));1115 CHECK_ERROR(pGraphicsAdapter, SetFeature(GraphicsFeature_Acceleration2DVideo, ValueUnion.f)); 1116 1116 break; 1117 1117 } -
trunk/src/VBox/Frontends/VBoxShell/vboxshell.py
r102957 r105864 1015 1015 print(" HPET [HPETEnabled]: %s" % (asState(mach.platform.x86.HPETEnabled))) 1016 1016 1017 print(" Hardware 3d acceleration [accelerate3DEnabled]: " + asState(mach.graphicsAdapter. accelerate3DEnabled))1018 print(" Hardware 2d video acceleration [accelerate2DVideoEnabled]: " + asState(mach.graphicsAdapter. accelerate2DVideoEnabled))1017 print(" Hardware 3d acceleration [accelerate3DEnabled]: " + asState(mach.graphicsAdapter.isFeatureEnabled(ctx['const'].GraphicsFeature_Acceleration3D))) 1018 print(" Hardware 2d video acceleration [accelerate2DVideoEnabled]: " + asState(mach.graphicsAdapter.isFeatureEnabled(ctx['const'].GraphicsFeature_Acceleration2DVideo))) 1019 1019 print(" Use universal time [RTCUseUTC]: %s" % (asState(mach.platform.RTCUseUTC))) 1020 1020 audioAdp = mach.audioSettings.adapter -
trunk/src/VBox/Frontends/VirtualBox/src/globals/UIDetailsGenerator.cpp
r105802 r105864 500 500 } 501 501 502 /* 3D acceleration: */503 502 if (fOptions & UIExtraDataMetaDefs::DetailsElementOptionTypeDisplay_Acceleration) 504 503 { 505 if (comGraphics.GetAccelerate3DEnabled()) 504 /* 3D acceleration: */ 505 if (comGraphics.IsFeatureEnabled(KGraphicsFeature_Acceleration3D)) 506 506 table << UITextTableLine(QApplication::translate("UIDetails", "3D Acceleration", "details (display)"), 507 507 QApplication::translate("UIDetails", "Enabled", "details (display/3D Acceleration)")); … … 1452 1452 1453 1453 /* 3D acceleration: */ 1454 fAcceleration3D = comGraphics. GetAccelerate3DEnabled();1454 fAcceleration3D = comGraphics.IsFeatureEnabled(KGraphicsFeature_Acceleration3D); 1455 1455 if (fAcceleration3D) 1456 1456 strInfo += e_strTableRow2 -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UISession.cpp
r105817 r105864 1605 1605 else 1606 1606 { 1607 const BOOL fAccelerate3DEnabeld = comAdapter. GetAccelerate3DEnabled();1607 const BOOL fAccelerate3DEnabeld = comAdapter.IsFeatureEnabled(KGraphicsFeature_Acceleration3D); 1608 1608 fSuccess = comAdapter.isOk(); 1609 1609 if (!fSuccess) -
trunk/src/VBox/Frontends/VirtualBox/src/settings/editors/UIGraphicsControllerEditor.cpp
r104313 r105864 164 164 : KPlatformArchitecture_x86; 165 165 CPlatformProperties comProperties = gpGlobalSession->virtualBox().GetPlatformProperties(enmArch); 166 m_supportedValues = comProperties.GetSupportedG raphicsControllerTypes();166 m_supportedValues = comProperties.GetSupportedGfxControllerTypes(); 167 167 168 168 /* Make sure requested value if sane is present as well: */ -
trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsDisplay.cpp
r105266 r105864 397 397 oldDisplayData.m_graphicsControllerType = comGraphics.GetGraphicsControllerType(); 398 398 #ifdef VBOX_WITH_3D_ACCELERATION 399 oldDisplayData.m_f3dAccelerationEnabled = comGraphics. GetAccelerate3DEnabled();399 oldDisplayData.m_f3dAccelerationEnabled = comGraphics.IsFeatureEnabled(KGraphicsFeature_Acceleration3D); 400 400 #endif 401 401 } … … 1131 1131 if (fSuccess && isMachineOffline() && newDisplayData.m_f3dAccelerationEnabled != oldDisplayData.m_f3dAccelerationEnabled) 1132 1132 { 1133 comGraphics.Set Accelerate3DEnabled(newDisplayData.m_f3dAccelerationEnabled);1133 comGraphics.SetFeature(KGraphicsFeature_Acceleration3D, newDisplayData.m_f3dAccelerationEnabled); 1134 1134 fSuccess = comGraphics.isOk(); 1135 1135 } 1136 1136 #endif 1137 1138 1137 /* Get machine ID for further activities: */ 1139 1138 QUuid uMachineId; -
trunk/src/VBox/Frontends/VirtualBox/src/snapshots/UISnapshotDetailsWidget.cpp
r105259 r105864 1488 1488 1489 1489 /* Acceleration? */ 1490 const QString str3DAccelerationStatus = comGraphics.GetAccelerate3DEnabled()1491 ? QApplication::translate("UIDetails", "Enabled", "details (display/3D Acceleration)")1492 : QString();1493 const QString str3DAccelerationStatusOld = comGraphicsOld.GetAccelerate3DEnabled()1494 ? QApplication::translate("UIDetails", "Enabled", "details (display/3D Acceleration)")1495 : QString();1490 const QString str3DAccelerationStatus = comGraphics.IsFeatureEnabled(KGraphicsFeature_Acceleration3D) 1491 ? QApplication::translate("UIDetails", "Enabled", "details (display/3D Acceleration)") 1492 : QString(); 1493 const QString str3DAccelerationStatusOld = comGraphicsOld.IsFeatureEnabled(KGraphicsFeature_Acceleration3D) 1494 ? QApplication::translate("UIDetails", "Enabled", "details (display/3D Acceleration)") 1495 : QString(); 1496 1496 if (!str3DAccelerationStatus.isNull()) 1497 1497 { -
trunk/src/VBox/Main/idl/VirtualBox.xidl
r105576 r105864 5813 5813 <interface 5814 5814 name="IGraphicsAdapter" extends="$unknown" 5815 uuid=" f692806f-febe-4049-b476-1292a8e45b09"5815 uuid="13ee6eb4-06fe-406b-ad69-f6e08b0587a3" 5816 5816 wsmap="managed" 5817 5817 rest="managed" … … 5829 5829 <attribute name="VRAMSize" type="unsigned long"> 5830 5830 <desc>Video memory size in megabytes.</desc> 5831 </attribute>5832 5833 <attribute name="accelerate3DEnabled" type="boolean" default="false">5834 <desc>5835 This setting determines whether VirtualBox allows this machine to make5836 use of the 3D graphics support available on the host.</desc>5837 </attribute>5838 5839 <attribute name="accelerate2DVideoEnabled" type="boolean" default="false">5840 <desc>5841 This setting determines whether VirtualBox allows this machine to make5842 use of the 2D video acceleration support available on the host.</desc>5843 5831 </attribute> 5844 5832 … … 5852 5840 </desc> 5853 5841 </attribute> 5842 5843 <method name="setFeature"> 5844 <desc>Sets a graphics controller feature.</desc> 5845 <param name="feature" type="GraphicsFeature" dir="in"> 5846 <desc> 5847 Graphics controller feature to set. 5848 </desc> 5849 </param> 5850 <param name="enabled" type="boolean" dir="in"> 5851 <desc> 5852 Whether to enable or disable the feature. 5853 </desc> 5854 </param> 5855 </method> 5856 5857 <method name="isFeatureEnabled" const="yes"> 5858 <desc>Returns whether a particular feature is enabled for this adapter or not.</desc> 5859 <param name="feature" type="GraphicsFeature" dir="in"> 5860 <desc>Feature to check for.</desc> 5861 </param> 5862 <param name="enabled" type="boolean" dir="return"> 5863 <desc>@c true if the feature is enabled, @c false if not.</desc> 5864 </param> 5865 </method> 5854 5866 5855 5867 </interface> … … 6825 6837 <const name="QemuRamFB" value="4"> 6826 6838 <desc>QEMU RAM based framebuffer based device.</desc> 6839 </const> 6840 </enum> 6841 6842 <enum 6843 name="GraphicsFeature" 6844 uuid="5cd900a5-ec77-4a08-8f8d-c0a36f462a7c" 6845 > 6846 <desc>Graphics features.</desc> 6847 <const name="None" value="0"> 6848 <desc>No feature specified, invalid.</desc> 6849 </const> 6850 <const name="Acceleration2DVideo" value="1"> 6851 <desc>2D video acceleration.</desc> 6852 </const> 6853 <const name="Acceleration3D" value="2"> 6854 <desc>3D acceleration.</desc> 6827 6855 </const> 6828 6856 </enum> … … 12881 12909 name="IPlatformProperties" 12882 12910 extends="$unknown" 12883 uuid=" a23502e4-cc54-490f-a344-c8ca8813f906"12911 uuid="5bae19d0-ca40-4ca2-a485-c8065190bbe5" 12884 12912 wsmap="managed" 12885 12913 rest="managed" … … 12960 12988 </attribute> 12961 12989 12962 <attribute name="supportedG raphicsControllerTypes" type="GraphicsControllerType" safearray="yes" readonly="yes">12990 <attribute name="supportedGfxControllerTypes" type="GraphicsControllerType" safearray="yes" readonly="yes"> 12963 12991 <desc> 12964 12992 Returns an array of officially supported values for enum <link to="GraphicsControllerType"/>, … … 13169 13197 </method> 13170 13198 13199 <method name="getSupportedGfxFeaturesForType"> 13200 <desc> 13201 Returns the supported features of a given graphics controller. 13202 </desc> 13203 13204 <param name="graphicsControllerType" type="GraphicsControllerType" dir="in"> 13205 <desc>Graphics controller type to return features for.</desc> 13206 </param> 13207 13208 <param name="supportedControllerFeatures" type="GraphicsFeature" safearray="yes" dir="return"> 13209 <desc>The graphics controller features which are valid.</desc> 13210 </param> 13211 </method> 13212 13171 13213 <method name="getDeviceTypesForStorageBus"> 13172 13214 <desc>Returns list of all the supported device types … … 13265 13307 name="ISystemProperties" 13266 13308 extends="$unknown" 13267 uuid=" c61e666e-34ab-403a-8160-78bd4512ca86"13309 uuid="925084b0-625f-422f-a67d-0ede1880a56c" 13268 13310 wsmap="managed" 13269 13311 rest="managed" … … 13630 13672 <desc> 13631 13673 Returns an array of officially supported values for enum <link to="ExportOptions"/>, 13674 in the sense of what is e.g. worth offering in the VirtualBox GUI. 13675 </desc> 13676 </attribute> 13677 13678 <attribute name="supportedGraphicsFeatures" type="GraphicsFeature" safearray="yes" readonly="yes"> 13679 <desc> 13680 Returns an array of officially supported values for enum <link to="GraphicsFeature"/>, 13632 13681 in the sense of what is e.g. worth offering in the VirtualBox GUI. 13633 13682 </desc> -
trunk/src/VBox/Main/include/GraphicsAdapterImpl.h
r98103 r105864 66 66 void i_copyFrom(GraphicsAdapter *aThat); 67 67 68 public: 69 70 // static helper functions 71 static int s_getSupportedFeatures(GraphicsControllerType_T enmController, std::vector<GraphicsFeature_T> &vecSupportedGraphicsFeatures); 72 static bool s_isFeatureSupported(GraphicsControllerType_T enmController, GraphicsFeature_T enmFeature); 73 68 74 private: 69 75 … … 73 79 HRESULT getVRAMSize(ULONG *aVRAMSize); 74 80 HRESULT setVRAMSize(ULONG aVRAMSize); 75 HRESULT getAccelerate3DEnabled(BOOL *aAccelerate3DEnabled); 76 HRESULT setAccelerate3DEnabled(BOOL aAccelerate3DEnabled); 77 HRESULT getAccelerate2DVideoEnabled(BOOL *aAccelerate2DVideoEnabled); 78 HRESULT setAccelerate2DVideoEnabled(BOOL aAccelerate2DVideoEnabled); 81 HRESULT setFeature(GraphicsFeature_T aFeature, BOOL aEnabled); 82 HRESULT isFeatureEnabled(GraphicsFeature_T aFeature, BOOL *aEnabled); 79 83 HRESULT getMonitorCount(ULONG *aMonitorCount); 80 84 HRESULT setMonitorCount(ULONG aMonitorCount); -
trunk/src/VBox/Main/include/PlatformPropertiesImpl.h
r104819 r105864 80 80 HRESULT getSupportedParavirtProviders(std::vector<ParavirtProvider_T> &aSupportedParavirtProviders) RT_OVERRIDE; 81 81 HRESULT getSupportedFirmwareTypes(std::vector<FirmwareType_T> &aSupportedFirmwareTypes) RT_OVERRIDE; 82 HRESULT getSupportedG raphicsControllerTypes(std::vector<GraphicsControllerType_T> &aSupportedGraphicsControllerTypes) RT_OVERRIDE;82 HRESULT getSupportedGfxControllerTypes(std::vector<GraphicsControllerType_T> &aSupportedGraphicsControllerTypes) RT_OVERRIDE; 83 83 HRESULT getSupportedGuestOSTypes(std::vector<ComPtr<IGuestOSType> > &aSupportedGuestOSTypes) RT_OVERRIDE; 84 84 HRESULT getSupportedNetAdpPromiscModePols(std::vector<NetworkAdapterPromiscModePolicy_T> &aSupportedNetworkAdapterPromiscModePolicies) RT_OVERRIDE; … … 111 111 HRESULT getSupportedVRAMRange(GraphicsControllerType_T aGraphicsControllerType, BOOL fAccelerate3DEnabled, 112 112 ULONG *aMinMB, ULONG *aMaxMB, ULONG *aStrideSizeMB) RT_OVERRIDE; 113 HRESULT getSupportedGfxFeaturesForType(GraphicsControllerType_T aGraphicsControllerType, 114 std::vector<GraphicsFeature_T> &aSupportedGraphicsFeatures); 113 115 HRESULT getDeviceTypesForStorageBus(StorageBus_T aBus, 114 116 std::vector<DeviceType_T> &aDeviceTypes) RT_OVERRIDE; -
trunk/src/VBox/Main/include/SystemPropertiesImpl.h
r103977 r105864 131 131 HRESULT getSupportedImportOptions(std::vector<ImportOptions_T> &aSupportedImportOptions) RT_OVERRIDE; 132 132 HRESULT getSupportedExportOptions(std::vector<ExportOptions_T> &aSupportedExportOptions) RT_OVERRIDE; 133 HRESULT getSupportedGraphicsFeatures(std::vector<GraphicsFeature_T> &aSupportedGraphicsFeatures) RT_OVERRIDE; 133 134 HRESULT getSupportedRecordingFeatures(std::vector<RecordingFeature_T> &aSupportedRecordingFeatures) RT_OVERRIDE; 134 135 HRESULT getSupportedRecordingAudioCodecs(std::vector<RecordingAudioCodec_T> &aSupportedRecordingAudioCodecs) RT_OVERRIDE; -
trunk/src/VBox/Main/src-all/PlatformPropertiesImpl.cpp
r104865 r105864 28 28 #define LOG_GROUP LOG_GROUP_MAIN_PLATFORMPROPERTIES 29 29 #include "PlatformPropertiesImpl.h" 30 #include "GraphicsAdapterImpl.h" /* For static helper functions. */ 30 31 #include "VirtualBoxImpl.h" 31 32 #include "LoggingNew.h" … … 40 41 // generated header 41 42 #include "SchemaDefs.h" 43 44 45 // defines 46 ///////////////////////////////////////////////////////////////////////////// 47 48 /** @def MY_VECTOR_ASSIGN_ARRAY 49 * Safe way to copy an array (static + const) into a vector w/ minimal typing. 50 * 51 * @param a_rVector The destination vector reference. 52 * @param a_aSrcArray The source array to assign to the vector. 53 */ 54 #if RT_GNUC_PREREQ(13, 0) && !RT_GNUC_PREREQ(14, 0) && defined(VBOX_WITH_GCC_SANITIZER) 55 /* Workaround for g++ 13.2 incorrectly failing on arrays with a single entry in ASAN builds. 56 This is restricted to [13.0, 14.0), assuming the issue was introduced in the 13 cycle 57 and will be fixed by the time 14 is done. If 14 doesn't fix it, extend the range 58 version by version till it is fixed. */ 59 # define MY_VECTOR_ASSIGN_ARRAY(a_rVector, a_aSrcArray) do { \ 60 _Pragma("GCC diagnostic push") _Pragma("GCC diagnostic ignored \"-Wstringop-overread\""); \ 61 (a_rVector).assign(&a_aSrcArray[0], &a_aSrcArray[RT_ELEMENTS(a_aSrcArray)]); \ 62 _Pragma("GCC diagnostic pop"); \ 63 } while (0) 64 #else 65 # define MY_VECTOR_ASSIGN_ARRAY(a_rVector, a_aSrcArray) do { \ 66 (a_rVector).assign(&a_aSrcArray[0], &a_aSrcArray[RT_ELEMENTS(a_aSrcArray)]); \ 67 } while (0) 68 #endif 42 69 43 70 … … 676 703 } 677 704 678 HRESULT PlatformProperties::getSupportedG raphicsControllerTypes(std::vector<GraphicsControllerType_T> &aSupportedGraphicsControllerTypes)705 HRESULT PlatformProperties::getSupportedGfxControllerTypes(std::vector<GraphicsControllerType_T> &aSupportedGraphicsControllerTypes) 679 706 { 680 707 switch (mPlatformArchitecture) … … 918 945 } 919 946 947 HRESULT PlatformProperties::getSupportedGfxFeaturesForType(GraphicsControllerType_T aGraphicsControllerType, 948 std::vector<GraphicsFeature_T> &aSupportedGraphicsFeatures) 949 { 950 int vrc = GraphicsAdapter::s_getSupportedFeatures(aGraphicsControllerType, aSupportedGraphicsFeatures); 951 if (RT_FAILURE(vrc)) 952 return setError(E_INVALIDARG, tr("The graphics controller type (%d) is invalid"), aGraphicsControllerType); 953 954 return S_OK; 955 } 956 920 957 HRESULT PlatformProperties::getSupportedAudioControllerTypes(std::vector<AudioControllerType_T> &aSupportedAudioControllerTypes) 921 958 { -
trunk/src/VBox/Main/src-client/ConsoleImplConfigCommon.cpp
r105163 r105864 5075 5075 5076 5076 BOOL f3DEnabled; 5077 hrc = ptrGraphicsAdapter-> COMGETTER(Accelerate3DEnabled)(&f3DEnabled); H();5077 hrc = ptrGraphicsAdapter->IsFeatureEnabled(GraphicsFeature_Acceleration3D, &f3DEnabled); H(); 5078 5078 InsertConfigInteger(pCfg, "3DEnabled", f3DEnabled); 5079 5079 -
trunk/src/VBox/Main/src-server/GraphicsAdapterImpl.cpp
r104819 r105864 37 37 38 38 #include <iprt/cpp/utils.h> 39 40 41 /** @def MY_VECTOR_ASSIGN_ARRAY 42 * Safe way to copy an array (static + const) into a vector w/ minimal typing. 43 * 44 * @param a_rVector The destination vector reference. 45 * @param a_aSrcArray The source array to assign to the vector. 46 */ 47 #if RT_GNUC_PREREQ(13, 0) && !RT_GNUC_PREREQ(14, 0) && defined(VBOX_WITH_GCC_SANITIZER) 48 /* Workaround for g++ 13.2 incorrectly failing on arrays with a single entry in ASAN builds. 49 This is restricted to [13.0, 14.0), assuming the issue was introduced in the 13 cycle 50 and will be fixed by the time 14 is done. If 14 doesn't fix it, extend the range 51 version by version till it is fixed. */ 52 # define MY_VECTOR_ASSIGN_ARRAY(a_rVector, a_aSrcArray) do { \ 53 _Pragma("GCC diagnostic push") _Pragma("GCC diagnostic ignored \"-Wstringop-overread\""); \ 54 (a_rVector).assign(&a_aSrcArray[0], &a_aSrcArray[RT_ELEMENTS(a_aSrcArray)]); \ 55 _Pragma("GCC diagnostic pop"); \ 56 } while (0) 57 #else 58 # define MY_VECTOR_ASSIGN_ARRAY(a_rVector, a_aSrcArray) do { \ 59 (a_rVector).assign(&a_aSrcArray[0], &a_aSrcArray[RT_ELEMENTS(a_aSrcArray)]); \ 60 } while (0) 61 #endif 39 62 40 63 … … 256 279 } 257 280 258 HRESULT GraphicsAdapter::getAccelerate3DEnabled(BOOL *aAccelerate3DEnabled) 259 { 260 AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS); 261 262 *aAccelerate3DEnabled = mData->fAccelerate3D; 263 264 return S_OK; 265 } 266 267 HRESULT GraphicsAdapter::setAccelerate3DEnabled(BOOL aAccelerate3DEnabled) 281 /** 282 * Static helper function to return all supported features for a given graphics controller. 283 * 284 * @returns VBox status code. 285 * @param enmController Graphics controller to return supported features for. 286 * @param vecSupportedGraphicsControllerFeatures Returned features on success. 287 */ 288 /* static */ 289 int GraphicsAdapter::s_getSupportedFeatures(GraphicsControllerType_T enmController, 290 std::vector<GraphicsFeature_T> &vecSupportedGraphicsFeatures) 291 { 292 switch (enmController) 293 { 294 #ifdef VBOX_WITH_VMSVGA 295 case GraphicsControllerType_VBoxSVGA: 296 { 297 static const GraphicsFeature_T s_aGraphicsFeatures[] = 298 { 299 # ifdef VBOX_WITH_VIDEOHWACCEL 300 GraphicsFeature_Acceleration2DVideo, 301 # endif 302 # ifdef VBOX_WITH_3D_ACCELERATION 303 GraphicsFeature_Acceleration3D 304 # endif 305 }; 306 MY_VECTOR_ASSIGN_ARRAY(vecSupportedGraphicsFeatures, s_aGraphicsFeatures); 307 break; 308 } 309 #endif 310 case GraphicsControllerType_VBoxVGA: 311 RT_FALL_THROUGH(); 312 case GraphicsControllerType_QemuRamFB: 313 { 314 static const GraphicsFeature_T s_aGraphicsFeatures[] = 315 { 316 GraphicsFeature_None 317 }; 318 MY_VECTOR_ASSIGN_ARRAY(vecSupportedGraphicsFeatures, s_aGraphicsFeatures); 319 break; 320 } 321 322 default: 323 return VERR_INVALID_PARAMETER; 324 } 325 326 return VINF_SUCCESS; 327 } 328 329 /** 330 * Static helper function to return whether a given graphics feature for a graphics controller is enabled or not. 331 * 332 * @returns \c true if the given feature is supported, or \c false if not. 333 * @param enmController Graphics controlller to query a feature for. 334 * @param enmFeature Feature to query. 335 */ 336 /* static */ 337 bool GraphicsAdapter::s_isFeatureSupported(GraphicsControllerType_T enmController, GraphicsFeature_T enmFeature) 338 { 339 std::vector<GraphicsFeature_T> vecSupportedGraphicsFeatures; 340 int vrc = GraphicsAdapter::s_getSupportedFeatures(enmController, vecSupportedGraphicsFeatures); 341 if (RT_SUCCESS(vrc)) 342 return std::find(vecSupportedGraphicsFeatures.begin(), 343 vecSupportedGraphicsFeatures.end(), enmFeature) != vecSupportedGraphicsFeatures.end(); 344 return false; 345 } 346 347 HRESULT GraphicsAdapter::setFeature(GraphicsFeature_T aFeature, BOOL aEnabled) 268 348 { 269 349 /* the machine needs to be mutable */ … … 273 353 AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS); 274 354 275 /** @todo check validity! */ 276 277 mParent->i_setModified(Machine::IsModified_GraphicsAdapter); 278 mData.backup(); 279 mData->fAccelerate3D = !!aAccelerate3DEnabled; 280 281 return S_OK; 282 } 283 284 285 HRESULT GraphicsAdapter::getAccelerate2DVideoEnabled(BOOL *aAccelerate2DVideoEnabled) 355 /* Validate if the given feature is supported by this graphics controller. */ 356 if (!GraphicsAdapter::s_isFeatureSupported(mData->graphicsControllerType, aFeature)) 357 return setError(VBOX_E_NOT_SUPPORTED, tr("The graphics controller does not support the given feature")); 358 359 bool *pfSetting = NULL; 360 switch (aFeature) 361 { 362 case GraphicsFeature_Acceleration2DVideo: 363 pfSetting = &mData->fAccelerate2DVideo; 364 break; 365 366 case GraphicsFeature_Acceleration3D: 367 pfSetting = &mData->fAccelerate3D; 368 break; 369 370 default: 371 break; 372 } 373 374 if (!pfSetting) 375 return setError(E_NOTIMPL, tr("The given feature is not implemented")); 376 377 if (*pfSetting != RT_BOOL(aEnabled)) 378 { 379 mParent->i_setModified(Machine::IsModified_GraphicsAdapter); 380 mData.backup(); 381 382 *pfSetting = RT_BOOL(aEnabled); 383 } 384 385 return S_OK; 386 } 387 388 HRESULT GraphicsAdapter::isFeatureEnabled(GraphicsFeature_T aFeature, BOOL *aEnabled) 286 389 { 287 390 AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS); 288 391 289 /* bugref:9691 The legacy VHWA acceleration has been disabled completely. */ 290 *aAccelerate2DVideoEnabled = FALSE; 291 292 return S_OK; 293 } 294 295 HRESULT GraphicsAdapter::setAccelerate2DVideoEnabled(BOOL aAccelerate2DVideoEnabled) 296 { 297 /* the machine needs to be mutable */ 298 AutoMutableStateDependency adep(mParent); 299 if (FAILED(adep.hrc())) return adep.hrc(); 300 301 AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS); 302 303 /** @todo check validity! */ 304 305 mParent->i_setModified(Machine::IsModified_GraphicsAdapter); 306 mData.backup(); 307 mData->fAccelerate2DVideo = !!aAccelerate2DVideoEnabled; 392 bool *pfSetting = NULL; 393 394 switch (aFeature) 395 { 396 #ifndef VBOX_WITH_VIRT_ARMV8 /* On macOS (ARM) we don't support any 2D/3D acceleration for now. */ 397 case GraphicsFeature_Acceleration2DVideo: 398 pfSetting = &mData->fAccelerate2DVideo; 399 *pfSetting = false; /* @bugref{9691} -- The legacy VHWA acceleration has been disabled completely. */ 400 break; 401 402 case GraphicsFeature_Acceleration3D: 403 pfSetting = &mData->fAccelerate3D; 404 break; 405 #endif 406 default: 407 break; 408 } 409 410 if (!pfSetting) 411 return VBOX_E_NOT_SUPPORTED; 412 413 *aEnabled = *pfSetting; 308 414 309 415 return S_OK; -
trunk/src/VBox/Main/src-server/MachineImpl.cpp
r105658 r105864 15232 15232 if (FAILED(hrc)) return hrc; 15233 15233 15234 hrc = mGraphicsAdapter->COMSETTER(Accelerate2DVideoEnabled)(fAccelerate2DVideoEnabled); 15235 if (FAILED(hrc)) return hrc; 15234 hrc = mGraphicsAdapter->SetFeature(GraphicsFeature_Acceleration2DVideo, fAccelerate2DVideoEnabled); 15235 if (FAILED(hrc)) 15236 { 15237 if (hrc != VBOX_E_NOT_SUPPORTED) 15238 return hrc; 15239 } 15236 15240 15237 15241 BOOL fAccelerate3DEnabled; … … 15239 15243 if (FAILED(hrc)) return hrc; 15240 15244 15241 hrc = mGraphicsAdapter->COMSETTER(Accelerate3DEnabled)(fAccelerate3DEnabled); 15242 if (FAILED(hrc)) return hrc; 15245 hrc = mGraphicsAdapter->SetFeature(GraphicsFeature_Acceleration2DVideo, fAccelerate3DEnabled); 15246 if (FAILED(hrc)) 15247 { 15248 if (hrc != VBOX_E_NOT_SUPPORTED) 15249 return hrc; 15250 } 15243 15251 15244 15252 /* Apply network adapters defaults */ -
trunk/src/VBox/Main/src-server/SystemPropertiesImpl.cpp
r105455 r105864 1176 1176 } 1177 1177 1178 HRESULT SystemProperties::getSupportedGraphicsFeatures(std::vector<GraphicsFeature_T> &aSupportedGraphicsFeatures) 1179 { 1180 static const GraphicsFeature_T s_aGraphicsFeatures[] = 1181 { 1182 #ifdef VBOX_WITH_VIDEOHWACCEL 1183 GraphicsFeature_Acceleration2DVideo, 1184 #endif 1185 #ifdef VBOX_WITH_3D_ACCELERATION 1186 GraphicsFeature_Acceleration3D 1187 #endif 1188 }; 1189 MY_VECTOR_ASSIGN_ARRAY(aSupportedGraphicsFeatures, s_aGraphicsFeatures); 1190 1191 return S_OK; 1192 } 1193 1178 1194 HRESULT SystemProperties::getSupportedRecordingFeatures(std::vector<RecordingFeature_T> &aSupportedRecordingFeatures) 1179 1195 { -
trunk/src/VBox/ValidationKit/testdriver/vbox.py
r105435 r105864 2353 2353 reporter.log(" HPET: %s" % (oVM.hpetEnabled,)); 2354 2354 if self.fpApiVer >= 6.1 and hasattr(oVM, 'graphicsAdapter'): 2355 reporter.log(" 3D acceleration: %s" % (oVM.graphicsAdapter.accelerate3DEnabled,)); 2356 reporter.log(" 2D acceleration: %s" % (oVM.graphicsAdapter.accelerate2DVideoEnabled,)); 2355 if self.fpApiVer >= 7.1 and hasattr(oVM.graphicsAdapter, 'isFeatureEnabled'): 2356 fAccelerate3DEnabled = \ 2357 oVM.graphicsAdapter.isFeatureEnabled(vboxcon.GraphicsFeature_Acceleration3D); 2358 fAccelerate2DVideoEnabled = \ 2359 oVM.graphicsAdapter.isFeatureEnabled(vboxcon.GraphicsFeature_Acceleration2DVideo); 2360 else: 2361 fAccelerate3DEnabled = oVM.graphicsAdapter.accelerate3DEnabled; 2362 fAccelerate2DVideoEnabled = oVM.graphicsAdapter.accelerate2DVideoEnabled; 2357 2363 else: 2358 reporter.log(" 3D acceleration: %s" % (oVM.accelerate3DEnabled,)); 2359 reporter.log(" 2D acceleration: %s" % (oVM.accelerate2DVideoEnabled,)); 2364 fAccelerate3DEnabled = oVM.accelerate3DEnabled; 2365 fAccelerate2DVideoEnabled = oVM.accelerate2DVideoEnabled; 2366 reporter.log(" 3D acceleration: %s" % (fAccelerate3DEnabled,)); 2367 reporter.log(" 2D acceleration: %s" % (fAccelerate2DVideoEnabled,)); 2360 2368 reporter.log(" TeleporterEnabled: %s" % (oVM.teleporterEnabled,)); 2361 2369 reporter.log(" TeleporterPort: %s" % (oVM.teleporterPort,)); -
trunk/src/VBox/ValidationKit/testdriver/vboxwrappers.py
r103702 r105864 1915 1915 try: 1916 1916 if self.fpApiVer >= 6.1 and hasattr(self.o.machine, 'graphicsAdapter'): 1917 self.o.machine.graphicsAdapter.accelerate3DEnabled = fEnabled; 1917 if self.fpApiVer >= 7.1 and hasattr(self.o.machine.graphicsAdapter, 'isFeatureEnabled'): 1918 self.o.machine.graphicsAdapter.setFeatureEnabled(vboxcon.GraphicsFeature_Acceleration3D, fEnabled); 1919 else: 1920 self.o.machine.graphicsAdapter.accelerate3DEnabled = fEnabled; 1918 1921 else: 1919 1922 self.o.machine.accelerate3DEnabled = fEnabled;
Note:
See TracChangeset
for help on using the changeset viewer.