VirtualBox

Changeset 98095 in vbox for trunk/src/VBox/Main/include


Ignore:
Timestamp:
Jan 16, 2023 3:17:49 PM (23 months ago)
Author:
vboxsync
Message:

Main/Console: Implemented a LED query optimization, where also keep track of LEDs on a per-type. This will prevent scanning all the sets and also skip any DeviceType_Null entries. bugref:9892

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Main/include/ConsoleImpl.h

    r98091 r98095  
    810810    typedef struct LEDSET *PLEDSET;
    811811    PPDMLED volatile *i_getLedSet(uint32_t iLedSet);
     812    void i_setLedType(DeviceType_T *penmSubTypeEntry, DeviceType_T enmNewType);
     813    HRESULT i_refreshLedTypeArrays(AutoReadLock *pReadLock);
    812814    uint32_t i_allocateDriverLeds(uint32_t cLeds, uint32_t fTypes, DeviceType_T **ppSubTypes);
    813     void i_attachStatusDriver(PCFGMNODE pCtlInst, DeviceType_T enmType);
     815    void i_attachStatusDriver(PCFGMNODE pCtlInst, DeviceType_T enmType, uint32_t cLeds = 1);
    814816    void i_attachStatusDriver(PCFGMNODE pCtlInst, uint32_t fTypes, uint32_t cLeds, DeviceType_T **ppaSubTypes,
    815817                              Console::MediumAttachmentMap *pmapMediumAttachments,
     
    10681070    /** @name LEDs and their management
    10691071     * @{ */
    1070     /** Read/write lock separating LED allocations (write) from queries (read). */
     1072    /** Read/write lock separating LED allocations and per-type data construction
     1073     * (write) from queries (read). */
    10711074    RWLockHandle            mLedLock;
     1075    /** LED configuration generation.  This is increased whenever a new set is
     1076     *  allocated or a sub-device type changes. */
     1077    uint32_t                muLedGen;
     1078    /** The LED configuration generation which maLedTypes was constructed for. */
     1079    uint32_t                muLedTypeGen;
    10721080    /** Number of LED sets in use in maLedSets. */
    10731081    uint32_t                mcLedSets;
     
    10851093        DeviceType_T       *paSubTypes;
    10861094    } maLedSets[32];
     1095    /** LEDs data organized by DeviceType_T.
     1096     * This is reconstructed by Console::i_refreshLedTypeArrays() when
     1097     * Console::getDeviceActivity is called and mLedTypeGen doesn't match
     1098     * muLedGen. */
     1099    struct
     1100    {
     1101        /** Number of possibly valid entries in pappLeds. */
     1102        uint32_t            cLeds;
     1103        /** Number of allocated entries. */
     1104        uint32_t            cAllocated;
     1105        /** Array of pointer to LEDSET::papLed entries.
     1106         * The indirection is due to Console::i_drvStatus_UnitChanged() only knowing
     1107         * about the LEDSET::papLeds. */
     1108        PPDMLED volatile  **pappLeds;
     1109    } maLedTypes[DeviceType_End];
    10871110    /** @} */
    10881111
Note: See TracChangeset for help on using the changeset viewer.

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