Changeset 30566 in vbox for trunk/src/VBox/Additions/WINNT/Graphics/Miniport/wddm/VBoxVideoWddm.cpp
- Timestamp:
- Jul 1, 2010 6:04:34 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Additions/WINNT/Graphics/Miniport/wddm/VBoxVideoWddm.cpp
r30563 r30566 1437 1437 { 1438 1438 case VBOXWDDM_ALLOC_TYPE_STD_SHAREDPRIMARYSURFACE: 1439 case VBOXWDDM_ALLOC_TYPE_UMD_RC_GENERIC: 1439 1440 { 1440 1441 if (pAllocation->bAssigned) … … 1930 1931 case VBOXVDMACMD_TYPE_DMA_PRESENT_SHADOW2PRIMARY: 1931 1932 case VBOXVDMACMD_TYPE_DMA_PRESENT_BLT: 1933 case VBOXVDMACMD_TYPE_DMA_PRESENT_FLIP: 1932 1934 { 1933 1935 const D3DDDI_PATCHLOCATIONLIST* pPatchList = &pPatch->pPatchLocationList[0]; … … 2101 2103 { 2102 2104 case VBOXWDDM_ALLOC_TYPE_STD_SHAREDPRIMARYSURFACE: 2105 case VBOXWDDM_ALLOC_TYPE_UMD_RC_GENERIC: 2103 2106 { 2104 VBOXWDDM_SOURCE *pSource = &pDevExt->aSources[pPrivateData->DstAllocInfo.srcId]; 2105 Assert(pSource->pPrimaryAllocation == pDstAlloc); 2106 switch (pSrcAlloc->enmType) 2107 if (pDstAlloc->bAssigned) 2107 2108 { 2108 case VBOXWDDM_ALLOC_TYPE_STD_SHADOWSURFACE: 2109 VBOXWDDM_SOURCE *pSource = &pDevExt->aSources[pPrivateData->DstAllocInfo.srcId]; 2110 Assert(pSource->pPrimaryAllocation == pDstAlloc); 2111 switch (pSrcAlloc->enmType) 2109 2112 { 2110 RECT rect; 2111 Assert(pContext->enmType == VBOXWDDM_CONTEXT_TYPE_SYSTEM); 2112 vboxWddmCheckUpdateShadowAddress(pDevExt, pSource, pPrivateData->SrcAllocInfo.segmentIdAlloc, pPrivateData->SrcAllocInfo.offAlloc); 2113 if (pBlt->DstRects.UpdateRects.cRects) 2113 case VBOXWDDM_ALLOC_TYPE_STD_SHADOWSURFACE: 2114 2114 { 2115 rect = pBlt->DstRects.UpdateRects.aRects[0]; 2116 for (UINT i = 1; i < pBlt->DstRects.UpdateRects.cRects; ++i) 2115 RECT rect; 2116 Assert(pContext->enmType == VBOXWDDM_CONTEXT_TYPE_SYSTEM); 2117 vboxWddmCheckUpdateShadowAddress(pDevExt, pSource, pPrivateData->SrcAllocInfo.segmentIdAlloc, pPrivateData->SrcAllocInfo.offAlloc); 2118 if (pBlt->DstRects.UpdateRects.cRects) 2117 2119 { 2118 vboxWddmRectUnited(&rect, &rect, &pBlt->DstRects.UpdateRects.aRects[i]); 2120 rect = pBlt->DstRects.UpdateRects.aRects[0]; 2121 for (UINT i = 1; i < pBlt->DstRects.UpdateRects.cRects; ++i) 2122 { 2123 vboxWddmRectUnited(&rect, &rect, &pBlt->DstRects.UpdateRects.aRects[i]); 2124 } 2119 2125 } 2126 else 2127 rect = pBlt->DstRects.ContextRect; 2128 2129 VBOXVBVA_OP(ReportDirtyRect, pDevExt, &pSource->Vbva, &rect); 2130 vboxWddmSubmitBltCmd(pDevExt, pContext, pBlt); 2131 break; 2120 2132 } 2121 else 2122 rect = pBlt->DstRects.ContextRect; 2123 2124 VBOXVBVA_OP(ReportDirtyRect, pDevExt, &pSource->Vbva, &rect); 2125 vboxWddmSubmitBltCmd(pDevExt, pContext, pBlt); 2126 break; 2133 case VBOXWDDM_ALLOC_TYPE_UMD_RC_GENERIC: 2134 { 2135 Assert(pContext->enmType == VBOXWDDM_CONTEXT_TYPE_CUSTOM_3D); 2136 Assert(pSrcAlloc->fRcFlags.RenderTarget); 2137 if (pSrcAlloc->fRcFlags.RenderTarget) 2138 { 2139 vboxWddmSubmitBltCmd(pDevExt, pContext, pBlt); 2140 } 2141 break; 2142 } 2143 default: 2144 AssertBreakpoint(); 2145 break; 2127 2146 } 2128 case VBOXWDDM_ALLOC_TYPE_UMD_RC_GENERIC:2129 {2130 Assert(pContext->enmType == VBOXWDDM_CONTEXT_TYPE_CUSTOM_3D);2131 Assert(pSrcAlloc->fRcFlags.RenderTarget);2132 if (pSrcAlloc->fRcFlags.RenderTarget)2133 {2134 vboxWddmSubmitBltCmd(pDevExt, pContext, pBlt);2135 }2136 break;2137 }2138 default:2139 AssertBreakpoint();2140 break;2141 2147 } 2142 2148 break; … … 2160 2166 AssertBreakpoint(); 2161 2167 break; 2168 } 2169 2170 VBOXWDDM_SHADOW_UPDATE_COMPLETION context; 2171 context.pDevExt = pDevExt; 2172 context.pTransactionData = pPrivateData; 2173 context.SubmissionFenceId = pSubmitCommand->SubmissionFenceId; 2174 Status = pDevExt->u.primary.DxgkInterface.DxgkCbSynchronizeExecution( 2175 pDevExt->u.primary.DxgkInterface.DeviceHandle, 2176 vboxWddmNotifyShadowUpdateCompletion, 2177 &context, 2178 0, /* IN ULONG MessageNumber */ 2179 &bRet); 2180 break; 2181 } 2182 case VBOXVDMACMD_TYPE_DMA_PRESENT_FLIP: 2183 { 2184 PVBOXWDDM_CONTEXT pContext = (PVBOXWDDM_CONTEXT)pSubmitCommand->hContext; 2185 PVBOXVDMAPIPE_CMD_RECTSINFO pRectsCmd = (PVBOXVDMAPIPE_CMD_RECTSINFO)vboxVdmaGgCmdCreate(&pDevExt->u.primary.Vdma.DmaGg, VBOXVDMAPIPE_CMD_TYPE_RECTSINFO, RT_OFFSETOF(VBOXVDMAPIPE_CMD_RECTSINFO, ContextsRects.UpdateRects.aRects[1])); 2186 Assert(pRectsCmd); 2187 if (pRectsCmd) 2188 { 2189 PVBOXWDDM_ALLOCATION pDstAlloc = pPrivateData->DstAllocInfo.pAlloc; 2190 pRectsCmd->pContext = pContext; 2191 RECT r; 2192 r.top = 0; 2193 r.left = 0; 2194 r.right = pDstAlloc->SurfDesc.width; 2195 r.bottom = pDstAlloc->SurfDesc.height; 2196 pRectsCmd->ContextsRects.ContextRect = r; 2197 pRectsCmd->ContextsRects.UpdateRects.cRects = 1; 2198 pRectsCmd->ContextsRects.UpdateRects.aRects[0] = r; 2199 NTSTATUS tmpStatus = vboxVdmaGgCmdSubmit(&pDevExt->u.primary.Vdma.DmaGg, &pRectsCmd->Hdr); 2200 Assert(tmpStatus == STATUS_SUCCESS); 2201 if (tmpStatus != STATUS_SUCCESS) 2202 vboxVdmaGgCmdDestroy(&pRectsCmd->Hdr); 2162 2203 } 2163 2204 … … 3083 3124 if (pAllocation) 3084 3125 { 3085 Assert(pAllocation->enmType == VBOXWDDM_ALLOC_TYPE_STD_SHAREDPRIMARYSURFACE);3126 // Assert(pAllocation->enmType == VBOXWDDM_ALLOC_TYPE_STD_SHAREDPRIMARYSURFACE); 3086 3127 pAllocation->offVram = (VBOXVIDEOOFFSET)pSetVidPnSourceAddress->PrimaryAddress.QuadPart; 3087 3128 pAllocation->SegmentId = pSetVidPnSourceAddress->PrimarySegment; … … 3624 3665 } 3625 3666 3667 #if 0 3626 3668 DECLINLINE(bool) vboxWddmCheckForVisiblePrimary(PDEVICE_EXTENSION pDevExt, PVBOXWDDM_ALLOCATION pAllocation) 3627 3669 { 3670 !!!primary could be of pAllocation->enmType == VBOXWDDM_ALLOC_TYPE_UMD_RC_GENERIC!!! 3628 3671 if (pAllocation->enmType != VBOXWDDM_ALLOC_TYPE_STD_SHAREDPRIMARYSURFACE) 3629 3672 return false; … … 3642 3685 return true; 3643 3686 } 3687 #endif 3644 3688 3645 3689 static void vboxWddmPopulateDmaAllocInfo(PVBOXWDDM_DMA_ALLOCINFO pInfo, PVBOXWDDM_ALLOCATION pAlloc, DXGK_ALLOCATIONLIST *pDmaAlloc) … … 4001 4045 #endif 4002 4046 } 4047 else if (pPresent->Flags.Flip) 4048 { 4049 Assert(pPresent->Flags.Value == 1); /* only Blt is set, we do not support anything else for now */ 4050 DXGK_ALLOCATIONLIST *pSrc = &pPresent->pAllocationList[DXGK_PRESENT_SOURCE_INDEX]; 4051 DXGK_ALLOCATIONLIST *pDst = &pPresent->pAllocationList[DXGK_PRESENT_DESTINATION_INDEX]; 4052 PVBOXWDDM_ALLOCATION pSrcAlloc = vboxWddmGetAllocationFromAllocList(pDevExt, pSrc); 4053 Assert(pSrcAlloc); 4054 if (pSrcAlloc) 4055 { 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 } 4085 } 4086 else 4087 { 4088 /* this should not happen actually */ 4089 drprintf((__FUNCTION__": failed to get Src Allocation info for hDeviceSpecificAllocation(0x%x)\n",pSrc->hDeviceSpecificAllocation)); 4090 Status = STATUS_INVALID_HANDLE; 4091 } 4092 } 4003 4093 else 4004 4094 {
Note:
See TracChangeset
for help on using the changeset viewer.