VirtualBox

Changeset 22920 in vbox


Ignore:
Timestamp:
Sep 10, 2009 3:37:08 PM (15 years ago)
Author:
vboxsync
Message:

Video hw accel: fallback for PBO allocation failure

Location:
trunk
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/VBox/VBoxVideo.h

    r22592 r22920  
    585585        struct
    586586        {
    587             uint32_t ErrInfo;
     587            int32_t ErrInfo;
    588588        } out;
    589589    } u;
  • trunk/src/VBox/Additions/WINNT/Graphics/Display/dd.c

    r22408 r22920  
    816816            if(pCmd->rc == VINF_SUCCESS)
    817817            {
     818#ifdef DEBUGVHWASTRICT
    818819                Assert(!pBody->u.out.ErrInfo);
     820#endif
    819821                if(pBody->u.out.ErrInfo)
    820822                {
  • trunk/src/VBox/Additions/WINNT/Graphics/Miniport/VBoxVideoHGSMI.cpp

    r22848 r22920  
    12581258        if(pDispContext)
    12591259        {
     1260#ifdef DEBUGVHWASTRICT
    12601261            Assert(!pDispContext->bValid);
     1262#endif
    12611263            Assert(!pDispContext->pFirstCmd);
    12621264            Assert(!pDispContext->pLastCmd);
  • trunk/src/VBox/Devices/Graphics/HGSMI/HGSMIHost.cpp

    r22751 r22920  
    374374            }
    375375
    376 #ifdef DEBUG_misha
     376#ifdef DEBUGVHWASTRICT
    377377            /* guest usually completes commands in the order it receives it
    378378             * if we're here this would typically means there is some cmd loss */
  • trunk/src/VBox/Frontends/VirtualBox/src/VBoxFBOverlay.cpp

    r22912 r22920  
    783783    }
    784784
    785 #ifndef DEBUG_misha
     785#ifndef DEBUGVHWASTRICT
    786786    /* in case we do not support shaders & multitexturing we can not supprt dst colorkey,
    787787     * no sense to report Video Acceleration supported */
     
    19831983}
    19841984
    1985 #ifdef DEBUG_misha
     1985#ifdef DEBUGVHWASTRICT
    19861986bool g_DbgTest = false;
    19871987#endif
     
    19891989void VBoxVHWATexture::doUpdate(uchar * pAddress, const QRect * pRect)
    19901990{
    1991 #ifdef DEBUG_misha
     1991#ifdef DEBUGVHWASTRICT
    19921992    if(g_DbgTest)
    19931993    {
     
    20372037            );
    20382038
    2039 #ifdef DEBUG_misha
     2039#ifdef DEBUGVHWASTRICT
    20402040    if(g_DbgTest)
    20412041    {
     
    22032203    vboxglBindBuffer(GL_PIXEL_UNPACK_BUFFER, mPBO);
    22042204
    2205     GLvoid *buf = vboxglMapBuffer(GL_PIXEL_UNPACK_BUFFER, GL_WRITE_ONLY);
    2206 
     2205    GLvoid *buf;
     2206
     2207    VBOXQGL_CHECKERR(
     2208            buf = vboxglMapBuffer(GL_PIXEL_UNPACK_BUFFER, GL_WRITE_ONLY);
     2209            );
     2210    Assert(buf);
     2211    if(buf)
     2212    {
    22072213//    updateBuffer((uchar*)buf, pRect);
    2208     memcpy(buf, mAddress, memSize());
    2209 
    2210     bool unmapped = vboxglUnmapBuffer(GL_PIXEL_UNPACK_BUFFER);
    2211     Assert(unmapped);
    2212 
    2213     VBoxVHWATextureNP2Rect::doUpdate(0, &mRect);
    2214 
    2215     vboxglBindBuffer(GL_PIXEL_UNPACK_BUFFER, 0);
     2214        memcpy(buf, mAddress, memSize());
     2215
     2216        bool unmapped;
     2217        VBOXQGL_CHECKERR(
     2218                unmapped = vboxglUnmapBuffer(GL_PIXEL_UNPACK_BUFFER);
     2219                );
     2220
     2221        Assert(unmapped);
     2222
     2223        VBoxVHWATextureNP2Rect::doUpdate(0, &mRect);
     2224
     2225        vboxglBindBuffer(GL_PIXEL_UNPACK_BUFFER, 0);
     2226    }
     2227    else
     2228    {
     2229        VBOXQGLLOGREL(("failed to map PBO, trying fallback to non-PBO approach\n"));
     2230        /* try fallback to non-PBO approach */
     2231        vboxglBindBuffer(GL_PIXEL_UNPACK_BUFFER, 0);
     2232        VBoxVHWATextureNP2Rect::doUpdate(pAddress, pRect);
     2233    }
    22162234}
    22172235
     
    31773195    {
    31783196        Assert(0);
    3179         pCmd->u.out.ErrInfo = 1;
     3197        pCmd->u.out.ErrInfo = -1;
     3198        return VINF_SUCCESS;
     3199    }
     3200
     3201    if(pCmd->SurfInfo.surfCaps & VBOXVHWA_SCAPS_OFFSCREENPLAIN)
     3202    {
     3203#ifdef DEBUGVHWASTRICT
     3204        Assert(0);
     3205#endif
     3206        pCmd->u.out.ErrInfo = -1;
    31803207        return VINF_SUCCESS;
    31813208    }
     
    31873214    }
    31883215
    3189     if(pCmd->SurfInfo.surfCaps & VBOXVHWA_SCAPS_OFFSCREENPLAIN)
    3190     {
    3191 #ifdef DEBUG_misha
    3192         Assert(0);
    3193 #endif
    3194         pCmd->u.out.ErrInfo = 1;
    3195         return VINF_SUCCESS;
    3196     }
    31973216
    31983217    Assert(/*pCmd->SurfInfo.surfCaps & VBOXVHWA_SCAPS_OFFSCREENPLAIN
     
    32043223        {
    32053224            Assert(0);
    3206             pCmd->u.out.ErrInfo = 1;
     3225            pCmd->u.out.ErrInfo = -1;
    32073226            return VINF_SUCCESS;
    32083227        }
     
    32143233            {
    32153234                Assert(0);
    3216                 pCmd->u.out.ErrInfo = 1;
     3235                pCmd->u.out.ErrInfo = -1;
    32173236                return VINF_SUCCESS;
    32183237            }
     
    32343253            {
    32353254                Assert(0);
    3236                 pCmd->u.out.ErrInfo = 1;
     3255                pCmd->u.out.ErrInfo = -1;
    32373256                return VINF_SUCCESS;
    32383257            }
     
    32413260        {
    32423261            Assert(0);
    3243             pCmd->u.out.ErrInfo = 1;
     3262            pCmd->u.out.ErrInfo = -1;
    32443263            return VINF_SUCCESS;
    32453264        }
     
    34163435//            Assert(mbVGASurfCreated);
    34173436            mDisplay.getVGA()->getComplexList()->add(surf);
    3418 #ifdef DEBUG_misha
     3437#ifdef DEBUGVHWASTRICT
    34193438            Assert(pCmd->SurfInfo.surfCaps & VBOXVHWA_SCAPS_VISIBLE);
    34203439#endif
     
    37663785        vboxCheckUpdateAddress (pDstSurf, pCmd->u.in.offDstSurface);
    37673786        VBOXQGLLOG(("pDstSurf (0x%x)\n",pDstSurf));
    3768 #ifdef DEBUG_misha
     3787#ifdef DEBUGVHWASTRICT
    37693788        Assert(pDstSurf == mDisplay.getVGA());
    37703789        Assert(mDisplay.getVGA() == mDisplay.getPrimary());
     
    38223841    QPoint pos(pCmd->u.in.xPos, pCmd->u.in.yPos);
    38233842
    3824 #ifdef DEBUG_misha
     3843#ifdef DEBUGVHWASTRICT
    38253844    Assert(pDstSurf == mDisplay.getVGA());
    38263845    Assert(mDisplay.getVGA() == mDisplay.getPrimary());
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