VirtualBox

Ignore:
Timestamp:
Jul 2, 2010 4:03:52 PM (14 years ago)
Author:
vboxsync
Message:

wddm/3d: better Blt impl + bugfixes

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Additions/WINNT/Graphics/Miniport/wddm/VBoxVideoWddm.cpp

    r30566 r30582  
    19311931            case VBOXVDMACMD_TYPE_DMA_PRESENT_SHADOW2PRIMARY:
    19321932            case VBOXVDMACMD_TYPE_DMA_PRESENT_BLT:
    1933             case VBOXVDMACMD_TYPE_DMA_PRESENT_FLIP:
    1934             {
    1935                 const D3DDDI_PATCHLOCATIONLIST* pPatchList = &pPatch->pPatchLocationList[0];
     1933            {
     1934                Assert(pPatch->PatchLocationListSubmissionLength == 2);
     1935                const D3DDDI_PATCHLOCATIONLIST* pPatchList = &pPatch->pPatchLocationList[pPatch->PatchLocationListSubmissionStart];
    19361936                Assert(pPatchList->AllocationIndex == DXGK_PRESENT_SOURCE_INDEX);
    19371937                Assert(pPatchList->PatchOffset == 0);
     
    19411941                pPrivateData->SrcAllocInfo.offAlloc = (VBOXVIDEOOFFSET)pSrcAllocationList->PhysicalAddress.QuadPart;
    19421942
    1943                 pPatchList = &pPatch->pPatchLocationList[1];
     1943                pPatchList = &pPatch->pPatchLocationList[pPatch->PatchLocationListSubmissionStart + 1];
    19441944                Assert(pPatchList->AllocationIndex == DXGK_PRESENT_DESTINATION_INDEX);
    19451945                Assert(pPatchList->PatchOffset == 4);
     
    19491949                pPrivateData->DstAllocInfo.offAlloc = (VBOXVIDEOOFFSET)pDstAllocationList->PhysicalAddress.QuadPart;
    19501950                break;
     1951            }
     1952            case VBOXVDMACMD_TYPE_DMA_PRESENT_FLIP:
     1953            {
     1954                Assert(pPatch->PatchLocationListSubmissionLength == 1);
     1955                const D3DDDI_PATCHLOCATIONLIST* pPatchList = &pPatch->pPatchLocationList[pPatch->PatchLocationListSubmissionStart];
     1956                Assert(pPatchList->AllocationIndex == DXGK_PRESENT_SOURCE_INDEX);
     1957                Assert(pPatchList->PatchOffset == 0);
     1958                const DXGK_ALLOCATIONLIST *pSrcAllocationList = &pPatch->pAllocationList[pPatchList->AllocationIndex];
     1959                Assert(pSrcAllocationList->SegmentId);
     1960                pPrivateData->SrcAllocInfo.segmentIdAlloc = pSrcAllocationList->SegmentId;
     1961                pPrivateData->SrcAllocInfo.offAlloc = (VBOXVIDEOOFFSET)pSrcAllocationList->PhysicalAddress.QuadPart;
    19511962            }
    19521963            default:
     
    21872198            if (pRectsCmd)
    21882199            {
    2189                 PVBOXWDDM_ALLOCATION pDstAlloc = pPrivateData->DstAllocInfo.pAlloc;
     2200                PVBOXWDDM_ALLOCATION pAlloc = pPrivateData->SrcAllocInfo.pAlloc;
    21902201                pRectsCmd->pContext = pContext;
    21912202                RECT r;
    21922203                r.top = 0;
    21932204                r.left = 0;
    2194                 r.right = pDstAlloc->SurfDesc.width;
    2195                 r.bottom = pDstAlloc->SurfDesc.height;
     2205                r.right = pAlloc->SurfDesc.width;
     2206                r.bottom = pAlloc->SurfDesc.height;
    21962207                pRectsCmd->ContextsRects.ContextRect = r;
    21972208                pRectsCmd->ContextsRects.UpdateRects.cRects = 1;
     
    40474058    else if (pPresent->Flags.Flip)
    40484059    {
    4049         Assert(pPresent->Flags.Value == 1); /* only Blt is set, we do not support anything else for now */
     4060        Assert(pPresent->Flags.Value == 4); /* only Blt is set, we do not support anything else for now */
    40504061        DXGK_ALLOCATIONLIST *pSrc =  &pPresent->pAllocationList[DXGK_PRESENT_SOURCE_INDEX];
    4051         DXGK_ALLOCATIONLIST *pDst =  &pPresent->pAllocationList[DXGK_PRESENT_DESTINATION_INDEX];
    40524062        PVBOXWDDM_ALLOCATION pSrcAlloc = vboxWddmGetAllocationFromAllocList(pDevExt, pSrc);
    40534063        Assert(pSrcAlloc);
    40544064        if (pSrcAlloc)
    40554065        {
    4056             PVBOXWDDM_ALLOCATION pDstAlloc = vboxWddmGetAllocationFromAllocList(pDevExt, pDst);
    4057             Assert(pDstAlloc);
    4058             if (pDstAlloc)
    4059             {
    4060                 Assert(cContexts3D);
    4061                 pPrivateData->enmCmd = VBOXVDMACMD_TYPE_DMA_PRESENT_FLIP;
    4062 
    4063                 vboxWddmPopulateDmaAllocInfo(&pPrivateData->SrcAllocInfo, pSrcAlloc, pSrc);
    4064                 vboxWddmPopulateDmaAllocInfo(&pPrivateData->DstAllocInfo, pDstAlloc, pDst);
    4065 
    4066                 UINT cbCmd = sizeof (VBOXVDMACMD_DMA_PRESENT_FLIP);
    4067                 pPresent->pDmaBufferPrivateData = (uint8_t*)pPresent->pDmaBufferPrivateData + cbCmd;
    4068                 pPresent->pDmaBuffer = ((uint8_t*)pPresent->pDmaBuffer) + VBOXWDDM_DUMMY_DMABUFFER_SIZE;
    4069                 Assert(pPresent->DmaSize >= VBOXWDDM_DUMMY_DMABUFFER_SIZE);
    4070 
    4071                 memset(pPresent->pPatchLocationListOut, 0, 2*sizeof (D3DDDI_PATCHLOCATIONLIST));
    4072                 pPresent->pPatchLocationListOut->PatchOffset = 0;
    4073                 pPresent->pPatchLocationListOut->AllocationIndex = DXGK_PRESENT_SOURCE_INDEX;
    4074                 ++pPresent->pPatchLocationListOut;
    4075                 pPresent->pPatchLocationListOut->PatchOffset = 4;
    4076                 pPresent->pPatchLocationListOut->AllocationIndex = DXGK_PRESENT_DESTINATION_INDEX;
    4077                 ++pPresent->pPatchLocationListOut;
    4078             }
    4079             else
    4080             {
    4081                 /* this should not happen actually */
    4082                 drprintf((__FUNCTION__": failed to get Dst Allocation info for hDeviceSpecificAllocation(0x%x)\n",pDst->hDeviceSpecificAllocation));
    4083                 Status = STATUS_INVALID_HANDLE;
    4084             }
     4066            Assert(cContexts3D);
     4067            pPrivateData->enmCmd = VBOXVDMACMD_TYPE_DMA_PRESENT_FLIP;
     4068
     4069            vboxWddmPopulateDmaAllocInfo(&pPrivateData->SrcAllocInfo, pSrcAlloc, pSrc);
     4070
     4071            UINT cbCmd = sizeof (VBOXVDMACMD_DMA_PRESENT_FLIP);
     4072            pPresent->pDmaBufferPrivateData = (uint8_t*)pPresent->pDmaBufferPrivateData + cbCmd;
     4073            pPresent->pDmaBuffer = ((uint8_t*)pPresent->pDmaBuffer) + VBOXWDDM_DUMMY_DMABUFFER_SIZE;
     4074            Assert(pPresent->DmaSize >= VBOXWDDM_DUMMY_DMABUFFER_SIZE);
     4075
     4076            memset(pPresent->pPatchLocationListOut, 0, sizeof (D3DDDI_PATCHLOCATIONLIST));
     4077            pPresent->pPatchLocationListOut->PatchOffset = 0;
     4078            pPresent->pPatchLocationListOut->AllocationIndex = DXGK_PRESENT_SOURCE_INDEX;
     4079            ++pPresent->pPatchLocationListOut;
    40854080        }
    40864081        else
    40874082        {
    40884083            /* this should not happen actually */
    4089             drprintf((__FUNCTION__": failed to get Src Allocation info for hDeviceSpecificAllocation(0x%x)\n",pSrc->hDeviceSpecificAllocation));
     4084            drprintf((__FUNCTION__": failed to get pSrc Allocation info for hDeviceSpecificAllocation(0x%x)\n",pSrc->hDeviceSpecificAllocation));
    40904085            Status = STATUS_INVALID_HANDLE;
    40914086        }
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