VirtualBox

Ignore:
Timestamp:
Jul 29, 2014 12:53:58 PM (10 years ago)
Author:
vboxsync
Message:

wddm: preemption fixes

Location:
trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk

  • trunk/src/VBox

  • trunk/src/VBox/Additions/WINNT/Graphics/Video/mp/wddm/VBoxMPVbva.cpp

    r51357 r52226  
    785785    PVBOXMP_DEVEXT pDevExt = pData->pDevExt;
    786786    VBOXCMDVBVA *pVbva = pData->pVbva;
    787     if (!pData->u32SubmitFenceId || pVbva->u32FenceCompleted == pData->u32SubmitFenceId)
     787    Assert(pVbva->u32FenceProcessed >= pVbva->u32FenceCompleted);
     788    if (!pData->u32SubmitFenceId || pVbva->u32FenceProcessed == pData->u32SubmitFenceId)
    788789    {
    789790        vboxCmdVbvaDdiNotifyCompleteIrq(pDevExt, pVbva, pData->u32PreemptFenceId, DXGK_INTERRUPT_DMA_PREEMPTED);
     
    793794    else
    794795    {
    795         Assert(pVbva->u32FenceCompleted < pData->u32SubmitFenceId);
     796        Assert(pVbva->u32FenceProcessed < pData->u32SubmitFenceId);
    796797        Assert(pVbva->cPreempt <= VBOXCMDVBVA_PREEMPT_EL_SIZE);
    797798        if (pVbva->cPreempt == VBOXCMDVBVA_PREEMPT_EL_SIZE)
     
    872873    /* last submitted fence id */
    873874    uint32_t u32FenceSubmitted;
     875    /* last processed fence id (i.e. either completed or cancelled) */
     876    uint32_t u32FenceProcessed;
    874877} VBOXCMDVBVA_CHECK_COMPLETED_CB;
    875878
     
    882885        pCompleted->u32FenceCompleted = pCompleted->pVbva->u32FenceCompleted;
    883886        pCompleted->u32FenceSubmitted = pCompleted->pVbva->u32FenceSubmitted;
     887        pCompleted->u32FenceProcessed = pCompleted->pVbva->u32FenceProcessed;
    884888    }
    885889    else
     
    888892        pCompleted->u32FenceCompleted = 0;
    889893        pCompleted->u32FenceSubmitted = 0;
     894        pCompleted->u32FenceProcessed = 0;
    890895    }
    891896    return bRc;
     
    893898
    894899
    895 static uint32_t vboxCmdVbvaCheckCompleted(PVBOXMP_DEVEXT pDevExt, VBOXCMDVBVA *pVbva, bool fPingHost, HGSMIGUESTCOMMANDCONTEXT *pCtx, bool fBufferOverflow, uint32_t *pu32FenceSubmitted)
     900static uint32_t vboxCmdVbvaCheckCompleted(PVBOXMP_DEVEXT pDevExt, VBOXCMDVBVA *pVbva, bool fPingHost, HGSMIGUESTCOMMANDCONTEXT *pCtx, bool fBufferOverflow, uint32_t *pu32FenceSubmitted, uint32_t *pu32FenceProcessed)
    896901{
    897902    if (fPingHost)
     
    903908    context.u32FenceCompleted = 0;
    904909    context.u32FenceSubmitted = 0;
     910    context.u32FenceProcessed = 0;
    905911    BOOLEAN bRet;
    906912    NTSTATUS Status = pDevExt->u.primary.DxgkInterface.DxgkCbSynchronizeExecution(
     
    915921        *pu32FenceSubmitted = context.u32FenceSubmitted;
    916922
     923    if (pu32FenceProcessed)
     924        *pu32FenceProcessed = context.u32FenceProcessed;
     925
    917926    return context.u32FenceCompleted;
    918927}
     
    922931    PVBOXMP_DEVEXT pDevExt = (PVBOXMP_DEVEXT)pvFlush;
    923932
    924     vboxCmdVbvaCheckCompleted(pDevExt, NULL,  true /*fPingHost*/, pHGSMICtx, true /*fBufferOverflow*/, NULL);
     933    vboxCmdVbvaCheckCompleted(pDevExt, NULL,  true /*fPingHost*/, pHGSMICtx, true /*fBufferOverflow*/, NULL, NULL);
    925934}
    926935
     
    11121121        VBoxVBVAExCBufferCompleted(&pVbva->Vbva);
    11131122
     1123        if (!u32FenceID)
     1124        {
     1125            WARN(("fence is NULL"));
     1126            continue;
     1127        }
     1128
     1129        pVbva->u32FenceProcessed = u32FenceID;
     1130
    11141131        if (u8State == VBOXCMDVBVA_STATE_IN_PROGRESS)
    1115         {
    1116             if (!u32FenceID)
    1117             {
    1118                 WARN(("fence is NULL"));
    1119                 continue;
    1120             }
    1121 
    11221132            pVbva->u32FenceCompleted = u32FenceID;
    1123         }
    11241133        else
    11251134        {
     
    11551164}
    11561165
    1157 uint32_t VBoxCmdVbvaCheckCompleted(PVBOXMP_DEVEXT pDevExt, VBOXCMDVBVA *pVbva, bool fPingHost, uint32_t *pu32FenceSubmitted)
    1158 {
    1159     return vboxCmdVbvaCheckCompleted(pDevExt, pVbva, fPingHost, &VBoxCommonFromDeviceExt(pDevExt)->guestCtx, false /* fBufferOverflow */, pu32FenceSubmitted);
     1166uint32_t VBoxCmdVbvaCheckCompleted(PVBOXMP_DEVEXT pDevExt, VBOXCMDVBVA *pVbva, bool fPingHost, uint32_t *pu32FenceSubmitted, uint32_t *pu32FenceProcessed)
     1167{
     1168    return vboxCmdVbvaCheckCompleted(pDevExt, pVbva, fPingHost, &VBoxCommonFromDeviceExt(pDevExt)->guestCtx, false /* fBufferOverflow */, pu32FenceSubmitted, pu32FenceProcessed);
    11601169}
    11611170
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