VirtualBox

Ignore:
Timestamp:
Nov 15, 2011 11:23:35 AM (13 years ago)
Author:
vboxsync
Message:

wddm: fix paging buffer logic

File:
1 edited

Legend:

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

    r39245 r39305  
    23912391     * we do not expect any other flags to be set here */
    23922392//    Assert(pPatch->Flags.Value == 2 || pPatch->Flags.Value == 4);
    2393     Assert(pPatch->DmaBufferPrivateDataSize >= sizeof (VBOXWDDM_DMA_PRIVATEDATA_BASEHDR));
    2394     Assert(pPatch->DmaBufferPrivateDataSubmissionEndOffset - pPatch->DmaBufferPrivateDataSubmissionStartOffset >= sizeof (VBOXWDDM_DMA_PRIVATEDATA_BASEHDR));
    23952393    if (pPatch->DmaBufferPrivateDataSubmissionEndOffset - pPatch->DmaBufferPrivateDataSubmissionStartOffset >= sizeof (VBOXWDDM_DMA_PRIVATEDATA_BASEHDR))
    23962394    {
     2395        Assert(pPatch->DmaBufferPrivateDataSize >= sizeof (VBOXWDDM_DMA_PRIVATEDATA_BASEHDR));
    23972396        VBOXWDDM_DMA_PRIVATEDATA_BASEHDR *pPrivateDataBase = (VBOXWDDM_DMA_PRIVATEDATA_BASEHDR*)((uint8_t*)pPatch->pDmaBufferPrivateData + pPatch->DmaBufferPrivateDataSubmissionStartOffset);
    23982397        switch (pPrivateDataBase->enmCmd)
     
    25122511        }
    25132512    }
     2513    else if (pPatch->DmaBufferPrivateDataSubmissionEndOffset == pPatch->DmaBufferPrivateDataSubmissionStartOffset)
     2514    {
     2515        /* this is a NOP, just return success */
     2516        WARN(("null data size, treating as NOP"));
     2517        return STATUS_SUCCESS;
     2518    }
    25142519    else
    25152520    {
    2516         LOGREL(("DmaBufferPrivateDataSubmissionEndOffset (%d) - DmaBufferPrivateDataSubmissionStartOffset (%d) < sizeof (VBOXWDDM_DMA_PRIVATEDATA_BASEHDR) (%d)",
     2521        WARN(("DmaBufferPrivateDataSubmissionEndOffset (%d) - DmaBufferPrivateDataSubmissionStartOffset (%d) < sizeof (VBOXWDDM_DMA_PRIVATEDATA_BASEHDR) (%d)",
    25172522                pPatch->DmaBufferPrivateDataSubmissionEndOffset,
    25182523                pPatch->DmaBufferPrivateDataSubmissionStartOffset,
     
    26482653    PVBOXMP_DEVEXT pDevExt = (PVBOXMP_DEVEXT)hAdapter;
    26492654    PVBOXWDDM_CONTEXT pContext = (PVBOXWDDM_CONTEXT)pSubmitCommand->hContext;
     2655    PVBOXWDDM_DMA_PRIVATEDATA_BASEHDR pPrivateDataBase = NULL;
     2656    VBOXVDMACMD_TYPE enmCmd = VBOXVDMACMD_TYPE_UNDEFINED;
    26502657    Assert(pContext);
    26512658    Assert(pContext->pDevice);
     
    26552662    /* the DMA command buffer is located in system RAM, the host will need to pick it from there */
    26562663    //BufInfo.fFlags = 0; /* see VBOXVDMACBUF_FLAG_xx */
    2657     Assert(pSubmitCommand->DmaBufferPrivateDataSubmissionEndOffset - pSubmitCommand->DmaBufferPrivateDataSubmissionStartOffset >= sizeof (VBOXWDDM_DMA_PRIVATEDATA_BASEHDR));
    2658     if (pSubmitCommand->DmaBufferPrivateDataSubmissionEndOffset - pSubmitCommand->DmaBufferPrivateDataSubmissionStartOffset < sizeof (VBOXWDDM_DMA_PRIVATEDATA_BASEHDR))
    2659     {
    2660         LOGREL(("DmaBufferPrivateDataSubmissionEndOffset (%d) - DmaBufferPrivateDataSubmissionStartOffset (%d) < sizeof (VBOXWDDM_DMA_PRIVATEDATA_BASEHDR) (%d)",
     2664    if (pSubmitCommand->DmaBufferPrivateDataSubmissionEndOffset - pSubmitCommand->DmaBufferPrivateDataSubmissionStartOffset >= sizeof (VBOXWDDM_DMA_PRIVATEDATA_BASEHDR))
     2665    {
     2666        pPrivateDataBase = (PVBOXWDDM_DMA_PRIVATEDATA_BASEHDR)((uint8_t*)pSubmitCommand->pDmaBufferPrivateData + pSubmitCommand->DmaBufferPrivateDataSubmissionStartOffset);
     2667        Assert(pPrivateDataBase);
     2668        enmCmd = pPrivateDataBase->enmCmd;
     2669    }
     2670    else if (pSubmitCommand->DmaBufferPrivateDataSubmissionEndOffset == pSubmitCommand->DmaBufferPrivateDataSubmissionStartOffset)
     2671    {
     2672        WARN(("null data size, treating as NOP"));
     2673        enmCmd = VBOXVDMACMD_TYPE_DMA_NOP;
     2674    }
     2675    else
     2676    {
     2677        WARN(("DmaBufferPrivateDataSubmissionEndOffset (%d) - DmaBufferPrivateDataSubmissionStartOffset (%d) < sizeof (VBOXWDDM_DMA_PRIVATEDATA_BASEHDR) (%d)",
    26612678                pSubmitCommand->DmaBufferPrivateDataSubmissionEndOffset,
    26622679                pSubmitCommand->DmaBufferPrivateDataSubmissionStartOffset,
     
    26652682    }
    26662683
    2667     PVBOXWDDM_DMA_PRIVATEDATA_BASEHDR pPrivateDataBase = (PVBOXWDDM_DMA_PRIVATEDATA_BASEHDR)((uint8_t*)pSubmitCommand->pDmaBufferPrivateData + pSubmitCommand->DmaBufferPrivateDataSubmissionStartOffset);
    2668     Assert(pPrivateDataBase);
    2669     switch (pPrivateDataBase->enmCmd)
     2684    switch (enmCmd)
    26702685    {
    26712686#ifdef VBOXWDDM_RENDER_FROM_SHADOW
     
    29262941        default:
    29272942        {
    2928             AssertBreakpoint();
     2943            WARN(("unexpected command %d", enmCmd));
    29292944#if 0 //def VBOX_WITH_VDMA
    29302945            VBOXWDDM_DMA_PRIVATEDATA_PRESENTHDR *pPrivateData = (VBOXWDDM_DMA_PRIVATEDATA_PRESENTHDR*)pPrivateDataBase;
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