VirtualBox

Changeset 38405 in vbox for trunk/src


Ignore:
Timestamp:
Aug 10, 2011 3:04:33 PM (13 years ago)
Author:
vboxsync
Message:

wddm: propper context destruction

Location:
trunk/src/VBox/Additions/WINNT/Graphics/Video/mp/wddm
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Additions/WINNT/Graphics/Video/mp/wddm/VBoxMPMisc.cpp

    r38144 r38405  
    375375{
    376376    VBOXWDDM_HTABLE_ITERATOR Iter;
    377     bool fRestart = false;
    378377    do
    379378    {
    380379        ExAcquireFastMutex(&pDevExt->ContextMutex);
    381380        vboxWddmHTableIterInit(&pContext->Swapchains, &Iter);
    382         do
    383         {
    384             PVBOXWDDM_SWAPCHAIN pSwapchain = (PVBOXWDDM_SWAPCHAIN)vboxWddmHTableIterNext(&Iter, NULL);
    385             if (!pSwapchain)
    386                 break;
    387 
    388             /* yes, we can call remove locked even when using iterator */
    389             vboxWddmSwapchainCtxRemoveLocked(pDevExt, pContext, pSwapchain);
    390     //        vboxWddmHTableIterRemoveCur(&Iter);
    391 
    392             ExReleaseFastMutex(&pDevExt->ContextMutex);
    393             /* we must not do vboxWddmSwapchainDestroy inside a context mutex */
    394             vboxWddmSwapchainDestroy(pDevExt, pSwapchain);
    395             fRestart = true;
    396         } while (1);
    397     } while (fRestart);
     381        PVBOXWDDM_SWAPCHAIN pSwapchain = (PVBOXWDDM_SWAPCHAIN)vboxWddmHTableIterNext(&Iter, NULL);
     382        if (!pSwapchain)
     383            break;
     384
     385        /* yes, we can call remove locked even when using iterator */
     386        vboxWddmSwapchainCtxRemoveLocked(pDevExt, pContext, pSwapchain);
     387
     388        ExReleaseFastMutex(&pDevExt->ContextMutex);
     389        /* we must not do vboxWddmSwapchainDestroy inside a context mutex */
     390        vboxWddmSwapchainDestroy(pDevExt, pSwapchain);
     391        /* start from the very beginning, we will quit the loop when no swapchains left */
     392    } while (1);
     393
     394    /* no swapchains left, we exiteed the while loop via the "break", and we still owning the mutex */
    398395    ExReleaseFastMutex(&pDevExt->ContextMutex);
    399396}
  • trunk/src/VBox/Additions/WINNT/Graphics/Video/mp/wddm/VBoxMPWddm.cpp

    r37889 r38405  
    55005500    }
    55015501
     5502    /* first terminate the swapchain, this will also ensure
     5503     * all currently pending driver->user Cm commands
     5504     * (i.e. visible regions commands) are completed */
     5505    vboxWddmSwapchainCtxTerm(pDevExt, pContext);
     5506
    55025507    NTSTATUS Status = vboxVideoAMgrCtxDestroy(&pContext->AllocContext);
    55035508    Assert(Status == STATUS_SUCCESS);
     
    55085513        if (Status == STATUS_SUCCESS)
    55095514        {
    5510             vboxWddmSwapchainCtxTerm(pDevExt, pContext);
    55115515            vboxWddmMemFree(pContext);
    55125516        }
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