VirtualBox

Changeset 105864 in vbox for trunk/src/VBox/Main/src-all


Ignore:
Timestamp:
Aug 26, 2024 6:45:15 PM (9 months ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
164584
Message:

Main: Added API for querying graphics features (2D Video / 3D Acceleration) of a specific graphics controller for a given platform and revamped the graphics controller attributes for 2D / 3D setters/getters to also use the new graphics features enumeration. Also, the system properties also now contain a dedicated API to query for graphics features (very basic for now, needs to be stuffed out). See SDK changelog for details. Added validation code when setting a specific graphics feature (which we never did before). bugref:10749

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Main/src-all/PlatformPropertiesImpl.cpp

    r104865 r105864  
    2828#define LOG_GROUP LOG_GROUP_MAIN_PLATFORMPROPERTIES
    2929#include "PlatformPropertiesImpl.h"
     30#include "GraphicsAdapterImpl.h" /* For static helper functions. */
    3031#include "VirtualBoxImpl.h"
    3132#include "LoggingNew.h"
     
    4041// generated header
    4142#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
    4269
    4370
     
    676703}
    677704
    678 HRESULT PlatformProperties::getSupportedGraphicsControllerTypes(std::vector<GraphicsControllerType_T> &aSupportedGraphicsControllerTypes)
     705HRESULT PlatformProperties::getSupportedGfxControllerTypes(std::vector<GraphicsControllerType_T> &aSupportedGraphicsControllerTypes)
    679706{
    680707    switch (mPlatformArchitecture)
     
    918945}
    919946
     947HRESULT 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
    920957HRESULT PlatformProperties::getSupportedAudioControllerTypes(std::vector<AudioControllerType_T> &aSupportedAudioControllerTypes)
    921958{
Note: See TracChangeset for help on using the changeset viewer.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette