VirtualBox

Changeset 33617 in vbox for trunk/src/VBox


Ignore:
Timestamp:
Oct 29, 2010 3:08:08 PM (14 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
67228
Message:

wddm/3d: gui settings fixes

Location:
trunk/src/VBox/Frontends/VirtualBox/src/settings
Files:
4 edited

Legend:

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

    r33599 r33617  
    583583            qobject_cast<VBoxVMSettingsDisplay*>(m_pSelector->idToPage(VMSettingsPage_Display));
    584584#ifdef VBOX_WITH_CRHGSMI
    585         if (pGeneralPage && pDisplayPage &&
    586             pDisplayPage->isAcceleration3DSelected() && !pGeneralPage->isWddmSupportedForOSType())
    587         {
    588             int vramMb = pDisplayPage->getVramSizeMB();
    589             int requiredVramMb = pDisplayPage->getMinVramSizeMBForWddm3D();
    590             if (vramMb < requiredVramMb)
     585        if (pGeneralPage && pDisplayPage)
     586        {
     587            bool bWddmSupported = pGeneralPage->isWddmSupportedForOSType();
     588            pDisplayPage->setWddmMode(bWddmSupported);
     589            if (pDisplayPage->isAcceleration3DSelected() && bWddmSupported)
    591590            {
    592                 strWarning = tr(
    593                     "you have 3D Acceleration enabled for OS type using the WDDM Video Driver. "
    594                     "To make 3D work OK please set guest VRAM size to <b>%1</b>."
    595                     ).arg (vboxGlobal().formatSize (requiredVramMb * _1M, 0, VBoxDefs::FormatSize_RoundUp));
    596                 return true;
     591                int vramMb = pDisplayPage->getVramSizeMB();
     592                int requiredVramMb = pDisplayPage->getMinVramSizeMBForWddm3D();
     593                if (vramMb < requiredVramMb)
     594                {
     595                    strWarning = tr(
     596                        "You have 3D Acceleration enabled for a operation system which uses the WDDM video driver. "
     597                        "For maximal performance set the guest VRAM to at least <b>%1</b>."
     598                        ).arg (vboxGlobal().formatSize (requiredVramMb * _1M, 0, VBoxDefs::FormatSize_RoundUp));
     599                    return true;
     600                }
    597601            }
    598602        }
  • trunk/src/VBox/Frontends/VirtualBox/src/settings/vm/VBoxVMSettingsDisplay.cpp

    r33599 r33617  
    114114#endif
    115115
     116#ifdef VBOX_WITH_CRHGSMI
     117    m_bWddmMode = false;
     118#endif
     119
    116120    /* Applying language settings */
    117121    retranslateUi();
     
    139143{
    140144    return mSlMemory->value();
     145}
     146
     147void VBoxVMSettingsDisplay::setWddmMode(bool bWddm)
     148{
     149    if (bWddm == m_bWddmMode)
     150        return;
     151
     152    m_bWddmMode = bWddm;
     153    checkMultiMonitorReqs();
    141154}
    142155#endif
     
    223236#ifdef VBOX_WITH_VIDEOHWACCEL
    224237    connect (mCb2DVideo, SIGNAL (stateChanged (int)),
    225              mValidator, SLOT (revalidate()));
    226 #endif
    227 #ifdef VBOX_WITH_CRHGSMI
    228     connect (mCb3D, SIGNAL (stateChanged (int)),
    229238             mValidator, SLOT (revalidate()));
    230239#endif
     
    345354    quint64 needMBytes = VBoxGlobal::requiredVideoMemory (&mMachine, cVal) / _1M;
    346355    /* Limit the maximum memory to save careless users from setting useless big values */
    347     m_maxVRAMVisible = cVal * 32;
    348     if (m_maxVRAMVisible < 128)
    349         m_maxVRAMVisible = 128;
    350     if (m_maxVRAMVisible < m_initialVRAM)
    351         m_maxVRAMVisible = m_initialVRAM;
     356#ifdef VBOX_WITH_CRHGSMI
     357    if (m_bWddmMode && mCb3D->isChecked())
     358    {
     359        m_maxVRAMVisible = 256;
     360    }
     361    else
     362#endif
     363    {
     364        m_maxVRAMVisible = cVal * 32;
     365        if (m_maxVRAMVisible < 128)
     366            m_maxVRAMVisible = 128;
     367        if (m_maxVRAMVisible < m_initialVRAM)
     368            m_maxVRAMVisible = m_initialVRAM;
     369    }
    352370    mSlMemory->setWarningHint (1, needMBytes);
    353371    mSlMemory->setPageStep (calcPageStep (m_maxVRAMVisible));
  • trunk/src/VBox/Frontends/VirtualBox/src/settings/vm/VBoxVMSettingsDisplay.h

    r33599 r33617  
    4141    int getMinVramSizeMBForWddm3D() const;
    4242    int getVramSizeMB() const;
     43    void setWddmMode(bool bWddm);
    4344#endif
    4445
     
    7879    /* Initial VRAM value when the dialog is opened. */
    7980    int m_initialVRAM;
     81#ifdef VBOX_WITH_CRHGSMI
     82    /* specifies whether the guest os is wddm-capable */
     83    bool m_bWddmMode;
     84#endif
    8085};
    8186
  • trunk/src/VBox/Frontends/VirtualBox/src/settings/vm/VBoxVMSettingsGeneral.cpp

    r33599 r33617  
    6161
    6262#ifdef VBOX_WITH_CRHGSMI
     63#include <stdio.h>
    6364bool VBoxVMSettingsGeneral::isWddmSupportedForOSType() const
    6465{
    65     return mOSTypeSelector->type().GetId() == "Windows Vista"
    66             || mOSTypeSelector->type().GetId() == "Windows 7";
     66    const QString & id = mOSTypeSelector->type().GetId();
     67    printf("%S\n", id.utf16());
     68    bool bWddm = id == "WindowsVista" || id == "Windows7";
     69    return bWddm;
    6770}
    6871#endif
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