VirtualBox

Changeset 23588 in vbox


Ignore:
Timestamp:
Oct 6, 2009 5:27:32 PM (15 years ago)
Author:
vboxsync
Message:

video 2d accel: display warning in VM display settings dialog when VRAM ammount is insufficient for 2D

Location:
trunk/src/VBox/Frontends/VirtualBox
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/include/VBoxFBOverlay.h

    r23548 r23588  
    12361236    static bool isAcceleration2DVideoAvailable();
    12371237
     1238    /** additional video memory required for the best 2D support performance
     1239     *  total amount of VRAM required is thus calculated as requiredVideoMemory + required2DOffscreenVideoMemory  */
     1240    static quint64 required2DOffscreenVideoMemory();
     1241
    12381242    /* not supposed to be called by clients */
    12391243    int vhwaLoadExec(struct SSMHANDLE * pSSM, uint32_t u32Version);
  • trunk/src/VBox/Frontends/VirtualBox/include/VBoxGlobal.h

    r23438 r23588  
    773773#ifdef VBOX_WITH_VIDEOHWACCEL
    774774    static bool isAcceleration2DVideoAvailable();
    775 //    VBoxDefs::RenderMode vmAcceleration2DVideoRenderMode() {
    776 //#if 0
    777 //        return VBoxDefs::QGLOverlayMode;
    778 //#else
    779 //        return VBoxDefs::QGLMode;
    780 //#endif
    781 //        }
     775
     776    /** additional video memory required for the best 2D support performance
     777     *  total amount of VRAM required is thus calculated as requiredVideoMemory + required2DOffscreenVideoMemory  */
     778    static quint64 required2DOffscreenVideoMemory();
    782779#endif
    783780
  • trunk/src/VBox/Frontends/VirtualBox/src/VBoxFBOverlay.cpp

    r23579 r23588  
    57935793}
    57945794
     5795/** additional video memory required for the best 2D support performance
     5796 *  total amount of VRAM required is thus calculated as requiredVideoMemory + required2DOffscreenVideoMemory  */
     5797/* static */
     5798quint64 VBoxQGLOverlay::required2DOffscreenVideoMemory()
     5799{
     5800    /* HDTV == 1920x1080 ~ 2M
     5801     * for the 4:2:2 formats each pixel is 2Bytes
     5802     * so each frame may be 4MB
     5803     * so for triple-buffering we would need 12 MB */
     5804    return _1M * 12;
     5805}
     5806
    57955807VBoxVHWACommandElement * VBoxQGLOverlay::processCmdList(VBoxVHWACommandElement * pCmd)
    57965808{
  • trunk/src/VBox/Frontends/VirtualBox/src/VBoxGlobal.cpp

    r23442 r23588  
    41504150    return VBoxQGLOverlay::isAcceleration2DVideoAvailable();
    41514151}
     4152
     4153/** additional video memory required for the best 2D support performance
     4154 *  total amount of VRAM required is thus calculated as requiredVideoMemory + required2DOffscreenVideoMemory  */
     4155/* static */
     4156quint64 VBoxGlobal::required2DOffscreenVideoMemory()
     4157{
     4158    return VBoxQGLOverlay::required2DOffscreenVideoMemory();
     4159}
     4160
    41524161#endif
    41534162
  • trunk/src/VBox/Frontends/VirtualBox/src/VBoxVMSettingsDisplay.cpp

    r22519 r23588  
    164164    connect (mCb3D, SIGNAL (stateChanged (int)),
    165165             mValidator, SLOT (revalidate()));
     166#ifdef VBOX_WITH_VIDEOHWACCEL
     167    connect (mCb2DVideo, SIGNAL (stateChanged (int)),
     168             mValidator, SLOT (revalidate()));
     169#endif
    166170    connect (mCbVRDP, SIGNAL (toggled (bool)),
    167171             mValidator, SLOT (revalidate()));
     
    185189        return true;
    186190    }
     191#ifdef VBOX_WITH_VIDEOHWACCEL
     192    if (mCb2DVideo->isChecked())
     193    {
     194        quint64 needBytesWith2D = needBytes + VBoxGlobal::required2DOffscreenVideoMemory();
     195        if ((quint64) mSlMemory->value() * _1M < needBytesWith2D)
     196        {
     197            aWarning = tr (
     198                "you have assigned less than <b>%1</b> for video memory which is "
     199                "the minimum amount required for the HD Video to be played efficiently.")
     200                .arg (vboxGlobal().formatSize (needBytesWith2D, 0, VBoxDefs::FormatSize_RoundUp));
     201            return true;
     202        }
     203    }
     204#endif
    187205
    188206    /* 3D Acceleration support test */
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