VirtualBox

Ignore:
Timestamp:
Sep 8, 2009 12:57:09 PM (16 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
52067
Message:

video hw accel: bugfixes

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

Legend:

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

    r22834 r22836  
    965965};
    966966
     967#define VBOXVHWACMDPIPEC_NEWEVENT      0x00000001
     968#define VBOXVHWACMDPIPEC_COMPLETEEVENT 0x00000002
    967969class VBoxVHWACommandElementProcessor
    968970{
     
    970972    VBoxVHWACommandElementProcessor(class VBoxConsoleView *aView);
    971973    ~VBoxVHWACommandElementProcessor();
    972     void postCmd(VBOXVHWA_PIPECMD_TYPE aType, void * pvData);
     974    void postCmd(VBOXVHWA_PIPECMD_TYPE aType, void * pvData, uint32_t flags);
     975    void completeCurrentEvent();
    973976    class VBoxVHWACommandElement * detachCmdList(class VBoxVHWACommandElement * pFirst2Free, VBoxVHWACommandElement * pLast2Free);
    974977
     
    11851188                             ULONG aW, ULONG aH);
    11861189
     1190    /**
     1191     * to be called on RequestResize framebuffer call
     1192     * @return true if the request was processed & should not be forwarded to the framebuffer
     1193     * false - otherwise */
     1194    bool onRequestResize (ULONG aScreenId, ULONG aPixelFormat,
     1195                              BYTE *aVRAM, ULONG aBitsPerPixel, ULONG aBytesPerLine,
     1196                              ULONG aWidth, ULONG aHeight,
     1197                              BOOL *aFinished)
     1198    {
     1199        mCmdPipe.completeCurrentEvent();
     1200        return false;
     1201    }
     1202
    11871203    VBOXFBOVERLAY_RESUT onPaintEvent (const QPaintEvent *pe, QRect *pRect);
    11881204    void onResizeEvent (const class VBoxResizeEvent *re);
     
    13081324    }
    13091325
     1326    STDMETHOD(RequestResize) (ULONG aScreenId, ULONG aPixelFormat,
     1327                              BYTE *aVRAM, ULONG aBitsPerPixel, ULONG aBytesPerLine,
     1328                              ULONG aWidth, ULONG aHeight,
     1329                              BOOL *aFinished)
     1330   {
     1331        if(mOverlay.onRequestResize (aScreenId, aPixelFormat,
     1332                aVRAM, aBitsPerPixel, aBytesPerLine,
     1333                aWidth, aHeight,
     1334                aFinished))
     1335        {
     1336            return S_OK;
     1337        }
     1338        return T::RequestResize (aScreenId, aPixelFormat,
     1339                aVRAM, aBitsPerPixel, aBytesPerLine,
     1340                aWidth, aHeight,
     1341                aFinished);
     1342   }
     1343
    13101344    STDMETHOD(NotifyUpdate) (ULONG aX, ULONG aY,
    13111345                             ULONG aW, ULONG aH)
  • trunk/src/VBox/Frontends/VirtualBox/src/VBoxFBOverlay.cpp

    r22834 r22836  
    34033403//            Assert(mbVGASurfCreated);
    34043404            mDisplay.getVGA()->getComplexList()->add(surf);
     3405#ifdef DEBUG_misha
    34053406            Assert(pCmd->SurfInfo.surfCaps & VBOXVHWA_SCAPS_VISIBLE);
     3407#endif
    34063408//            if(pCmd->SurfInfo.surfCaps & VBOXVHWA_SCAPS_VISIBLE)
    34073409            {
     
    37473749        vboxCheckUpdateAddress (pDstSurf, pCmd->u.in.offDstSurface);
    37483750        VBOXQGLLOG(("pDstSurf (0x%x)\n",pDstSurf));
     3751#ifdef DEBUG_misha
    37493752        Assert(pDstSurf == mDisplay.getVGA());
    37503753        Assert(mDisplay.getVGA() == mDisplay.getPrimary());
     3754#endif
    37513755        Assert(pDstSurf->getComplexList() == mDisplay.getVGA()->getComplexList());
    37523756
     
    51005104int VBoxQGLOverlay::onVHWACommand(struct _VBOXVHWACMD * pCmd)
    51015105{
    5102 //    Assert(0);
    5103 //    VBOXVHWACMD * pCmd = (VBOXVHWACMD*)pCommand;
     5106    uint32_t flags = 0;
     5107    switch(pCmd->enmCmd)
     5108    {
     5109        case VBOXVHWACMD_TYPE_SURF_FLIP:
     5110        case VBOXVHWACMD_TYPE_SURF_OVERLAY_UPDATE:
     5111        case VBOXVHWACMD_TYPE_SURF_OVERLAY_SETPOSITION:
     5112            flags |= VBOXVHWACMDPIPEC_COMPLETEEVENT;
     5113            break;
     5114        default:
     5115            break;
     5116    }//    Assert(0);
    51045117    /* indicate that we process and complete the command asynchronously */
    51055118    pCmd->Flags |= VBOXVHWACMD_FLAG_HG_ASYNCH;
    5106     /* post the command to the GUI thread for processing */
    5107 //    QApplication::postEvent (mView,
    5108 //                             new VBoxVHWACommandProcessEvent (pCmd));
    5109     mCmdPipe.postCmd(VBOXVHWA_PIPECMD_VHWA, pCmd);
     5119
     5120    mCmdPipe.postCmd(VBOXVHWA_PIPECMD_VHWA, pCmd, flags);
    51105121    return VINF_SUCCESS;
    5111 //    return E_NOTIMPL;
     5122
    51125123}
    51135124
     
    51385149#if 1
    51395150    QRect r(aX, aY, aW, aH);
    5140     mCmdPipe.postCmd(VBOXVHWA_PIPECMD_PAINT, &r);
     5151    mCmdPipe.postCmd(VBOXVHWA_PIPECMD_PAINT, &r, 0);
    51415152    return true;
    51425153#else
     
    56455656}
    56465657
    5647 void VBoxVHWACommandElementProcessor::postCmd(VBOXVHWA_PIPECMD_TYPE aType, void * pvData)
     5658void VBoxVHWACommandElementProcessor::completeCurrentEvent()
     5659{
     5660    RTCritSectEnter(&mCritSect);
     5661    mbNewEvent = true;
     5662    RTCritSectLeave(&mCritSect);
     5663}
     5664
     5665void VBoxVHWACommandElementProcessor::postCmd(VBOXVHWA_PIPECMD_TYPE aType, void * pvData, uint32_t flags)
    56485666{
    56495667    /* 1. lock*/
     
    56615679    }
    56625680    pCmd->setData(aType, pvData);
     5681
     5682    if((flags & VBOXVHWACMDPIPEC_NEWEVENT) != 0)
     5683    {
     5684        mbNewEvent = true;
     5685    }
     5686
    56635687    /* 2. if can add to current*/
    56645688    if(!mbNewEvent)
     
    56705694            mpLastEvent->pipe().put(pCmd);
    56715695            /* 3.b unlock and return */
     5696            if((flags & VBOXVHWACMDPIPEC_COMPLETEEVENT) != 0)
     5697            {
     5698                mbNewEvent = true;
     5699            }
    56725700            RTCritSectLeave(&mCritSect);
    56735701            return;
     
    56805708    /* 5. create & initialize new Event */
    56815709    VBoxVHWACommandProcessEvent *pCurrentEvent = new VBoxVHWACommandProcessEvent(pCmd);
     5710    pCurrentEvent->mpNext = NULL;
     5711
    56825712    /* 6. lock */
    56835713    RTCritSectEnter(&mCritSect);
     
    56885718        mpFirstEvent = pCurrentEvent;
    56895719        mpLastEvent = pCurrentEvent;
    5690         pCurrentEvent->mpNext = NULL;
    56915720    }
    56925721    else
     
    56965725    }
    56975726    /* 8. reset blocking events counter */
    5698     mbNewEvent = false;
     5727    mbNewEvent = ((flags & VBOXVHWACMDPIPEC_COMPLETEEVENT) != 0);
    56995728    /* 9. unlock */
    57005729    RTCritSectLeave(&mCritSect);
  • trunk/src/VBox/Frontends/VirtualBox/src/VBoxFBQGL.cpp

    r22826 r22836  
    7979#else
    8080    QRect r(aX, aY, aW, aH);
    81     mCmdPipe.postCmd(VBOXVHWA_PIPECMD_PAINT, &r);
     81    mCmdPipe.postCmd(VBOXVHWA_PIPECMD_PAINT, &r, 0);
    8282#endif
    8383    return S_OK;
     
    162162//    QApplication::postEvent (mView,
    163163//                             new VBoxVHWACommandProcessEvent (pCmd));
    164     mCmdPipe.postCmd(VBOXVHWA_PIPECMD_VHWA, pCmd);
     164    mCmdPipe.postCmd(VBOXVHWA_PIPECMD_VHWA, pCmd, 0);
    165165    return S_OK;
    166166}
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