Changeset 30582 in vbox for trunk/src/VBox/Additions/WINNT/Graphics/Miniport/wddm/VBoxVideoWddm.cpp
- Timestamp:
- Jul 2, 2010 4:03:52 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Additions/WINNT/Graphics/Miniport/wddm/VBoxVideoWddm.cpp
r30566 r30582 1931 1931 case VBOXVDMACMD_TYPE_DMA_PRESENT_SHADOW2PRIMARY: 1932 1932 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]; 1936 1936 Assert(pPatchList->AllocationIndex == DXGK_PRESENT_SOURCE_INDEX); 1937 1937 Assert(pPatchList->PatchOffset == 0); … … 1941 1941 pPrivateData->SrcAllocInfo.offAlloc = (VBOXVIDEOOFFSET)pSrcAllocationList->PhysicalAddress.QuadPart; 1942 1942 1943 pPatchList = &pPatch->pPatchLocationList[ 1];1943 pPatchList = &pPatch->pPatchLocationList[pPatch->PatchLocationListSubmissionStart + 1]; 1944 1944 Assert(pPatchList->AllocationIndex == DXGK_PRESENT_DESTINATION_INDEX); 1945 1945 Assert(pPatchList->PatchOffset == 4); … … 1949 1949 pPrivateData->DstAllocInfo.offAlloc = (VBOXVIDEOOFFSET)pDstAllocationList->PhysicalAddress.QuadPart; 1950 1950 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; 1951 1962 } 1952 1963 default: … … 2187 2198 if (pRectsCmd) 2188 2199 { 2189 PVBOXWDDM_ALLOCATION p DstAlloc = pPrivateData->DstAllocInfo.pAlloc;2200 PVBOXWDDM_ALLOCATION pAlloc = pPrivateData->SrcAllocInfo.pAlloc; 2190 2201 pRectsCmd->pContext = pContext; 2191 2202 RECT r; 2192 2203 r.top = 0; 2193 2204 r.left = 0; 2194 r.right = p DstAlloc->SurfDesc.width;2195 r.bottom = p DstAlloc->SurfDesc.height;2205 r.right = pAlloc->SurfDesc.width; 2206 r.bottom = pAlloc->SurfDesc.height; 2196 2207 pRectsCmd->ContextsRects.ContextRect = r; 2197 2208 pRectsCmd->ContextsRects.UpdateRects.cRects = 1; … … 4047 4058 else if (pPresent->Flags.Flip) 4048 4059 { 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 */ 4050 4061 DXGK_ALLOCATIONLIST *pSrc = &pPresent->pAllocationList[DXGK_PRESENT_SOURCE_INDEX]; 4051 DXGK_ALLOCATIONLIST *pDst = &pPresent->pAllocationList[DXGK_PRESENT_DESTINATION_INDEX];4052 4062 PVBOXWDDM_ALLOCATION pSrcAlloc = vboxWddmGetAllocationFromAllocList(pDevExt, pSrc); 4053 4063 Assert(pSrcAlloc); 4054 4064 if (pSrcAlloc) 4055 4065 { 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; 4085 4080 } 4086 4081 else 4087 4082 { 4088 4083 /* 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)); 4090 4085 Status = STATUS_INVALID_HANDLE; 4091 4086 }
Note:
See TracChangeset
for help on using the changeset viewer.