VirtualBox

Changeset 106570 in vbox for trunk/src


Ignore:
Timestamp:
Oct 21, 2024 3:23:32 PM (4 months ago)
Author:
vboxsync
Message:

FE/Qt: bugref:10767: VM settings / Display page: Cleanup for VRAM editor, VRAM requirements calculation.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/src/settings/editors/UIVideoMemoryEditor.cpp

    r106568 r106570  
    6969    if (m_iValue != iValue)
    7070    {
    71         m_iValue = RT_MIN(iValue, m_iMaxVRAM);
     71        m_iValue = qMin(iValue, m_iMaxVRAM);
    7272        if (m_pSlider)
    7373            m_pSlider->setValue(m_iValue);
     
    314314        return;
    315315
    316     /* Init visible maximum VRAM: */
     316    /* Init recommended VRAM according to guest OS type and screen count: */
     317    int iNeedMBytes = UIGuestOSTypeHelpers::requiredVideoMemory(m_strGuestOSTypeId, m_cGuestScreenCount) / _1M;
     318
     319    /* Init visible maximum VRAM to be no less than 32MB per screen: */
    317320    int iMaxVRAMVisible = m_cGuestScreenCount * 32;
    318 
    319     /* Get monitors count and recommended VRAM: */
    320     int iNeedMBytes = UIGuestOSTypeHelpers::requiredVideoMemory(m_strGuestOSTypeId, m_cGuestScreenCount) / _1M;
    321 
    322321    /* Adjust visible maximum VRAM to be no less than 128MB (if possible): */
    323322    if (iMaxVRAMVisible < 128 && m_iMaxVRAM >= 128)
     
    329328        /* Adjust recommended VRAM to be no less than 128MB: */
    330329        iNeedMBytes = qMax(iNeedMBytes, 128);
     330
    331331        /* Adjust visible maximum VRAM to be no less than 256MB (if possible): */
    332332        if (iMaxVRAMVisible < 256 && m_iMaxVRAM >= 256)
     
    334334    }
    335335#endif /* VBOX_WITH_3D_ACCELERATION */
     336
     337    /* Adjust recommended VRAM to be no more than actual maximum VRAM: */
     338    iNeedMBytes = qMin(iNeedMBytes, m_iMaxVRAM);
    336339
    337340    /* Adjust visible maximum VRAM to be no less than initial VRAM: */
     
    339342    /* Adjust visible maximum VRAM to be no less than recommended VRAM: */
    340343    iMaxVRAMVisible = qMax(iMaxVRAMVisible, iNeedMBytes);
    341 
    342     /* Adjust recommended VRAM to be no more than actual maximum VRAM: */
    343     iNeedMBytes = qMin(iNeedMBytes, m_iMaxVRAM);
    344344    /* Adjust visible maximum VRAM to be no more than actual maximum VRAM: */
    345345    iMaxVRAMVisible = qMin(iMaxVRAMVisible, m_iMaxVRAM);
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