Changeset 30566 in vbox
- Timestamp:
- Jul 1, 2010 6:04:34 PM (15 years ago)
- Location:
- trunk
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/VBox/VBoxVideo.h
r30441 r30566 1177 1177 VBOXVDMACMD_TYPE_DMA_BPB_FILL, 1178 1178 VBOXVDMACMD_TYPE_DMA_PRESENT_SHADOW2PRIMARY, 1179 VBOXVDMACMD_TYPE_DMA_PRESENT_CLRFILL 1179 VBOXVDMACMD_TYPE_DMA_PRESENT_CLRFILL, 1180 VBOXVDMACMD_TYPE_DMA_PRESENT_FLIP 1180 1181 } VBOXVDMACMD_TYPE; 1181 1182 -
trunk/src/VBox/Additions/WINNT/Graphics/Display/wddm/VBoxDispD3D.cpp
r30563 r30566 1863 1863 static HRESULT APIENTRY vboxWddmDDevDrawIndexedPrimitive(HANDLE hDevice, CONST D3DDDIARG_DRAWINDEXEDPRIMITIVE* pData) 1864 1864 { 1865 vboxVDbgPrintF(("<== "__FUNCTION__", hDevice(0x%p)\n", hDevice)); 1866 AssertBreakpoint(); 1867 vboxVDbgPrintF(("==> "__FUNCTION__", hDevice(0x%p)\n", hDevice)); 1868 return E_FAIL; 1865 vboxVDbgPrintF(("==> "__FUNCTION__", hDevice(0x%p)\n", hDevice)); 1866 PVBOXWDDMDISP_DEVICE pDevice = (PVBOXWDDMDISP_DEVICE)hDevice; 1867 Assert(pDevice); 1868 Assert(pDevice->pDevice9If); 1869 HRESULT hr = pDevice->pDevice9If->DrawIndexedPrimitive( 1870 pData->PrimitiveType, 1871 pData->BaseVertexIndex, 1872 pData->MinIndex, 1873 pData->NumVertices, 1874 pData->StartIndex, 1875 pData->PrimitiveCount); 1876 Assert(hr == S_OK); 1877 1878 vboxVDbgPrintF(("<== "__FUNCTION__", hDevice(0x%p), hr(0x%x)\n", hDevice, hr)); 1879 return hr; 1869 1880 } 1870 1881 … … 2645 2656 Assert(hr == S_OK); 2646 2657 } 2647 else if (pRc->RcDesc.fFlags.IndexBuffer) 2648 { 2658 else 2659 { 2660 Assert(pAlloc->LockInfo.cLocks < UINT32_MAX); 2661 } 2662 } 2663 else if (pRc->RcDesc.fFlags.IndexBuffer) 2664 { 2665 Assert(pData->SubResourceIndex < pRc->cAllocations); 2666 PVBOXWDDMDISP_ALLOCATION pAlloc = &pRc->aAllocations[pData->SubResourceIndex]; 2667 2668 --pAlloc->LockInfo.cLocks; 2669 Assert(pAlloc->LockInfo.cLocks < UINT32_MAX); 2670 if (!pAlloc->LockInfo.cLocks 2671 && (!pAlloc->LockInfo.fFlags.MightDrawFromLocked 2672 || (!pAlloc->LockInfo.fFlags.Discard && !pAlloc->LockInfo.fFlags.NoOverwrite))) 2673 { 2674 // Assert(!pAlloc->LockInfo.cLocks); 2649 2675 IDirect3DIndexBuffer9 *pD3D9IBuf = (IDirect3DIndexBuffer9*)pAlloc->pD3DIf; 2650 2676 Assert(pD3D9IBuf); -
trunk/src/VBox/Additions/WINNT/Graphics/Miniport/wddm/VBoxVideoIf.h
r30536 r30566 44 44 , VBOXWDDM_ALLOC_TYPE_UMD_RC_GENERIC 45 45 } VBOXWDDM_ALLOC_TYPE; 46 47 /* usage */ 48 typedef enum 49 { 50 VBOXWDDM_ALLOCUSAGE_TYPE_UNEFINED = 0, 51 /* set for the allocation being primary */ 52 VBOXWDDM_ALLOCUSAGE_TYPE_PRIMARY, 53 } VBOXWDDM_ALLOCUSAGE_TYPE; 46 54 47 55 typedef struct VBOXWDDM_SURFACE_DESC -
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 { -
trunk/src/VBox/Additions/WINNT/Graphics/Miniport/wddm/VBoxVideoWddm.h
r30536 r30566 54 54 { 55 55 VBOXWDDM_ALLOC_TYPE enmType; 56 // VBOXWDDM_ALLOCUSAGE_TYPE enmCurrentUsage; 56 57 D3DDDI_RESOURCEFLAGS fRcFlags; 57 58 UINT SegmentId; … … 181 182 }VBOXWDDM_DMA_PRESENT_BLT, *PVBOXWDDM_DMA_PRESENT_BLT; 182 183 184 typedef struct VBOXVDMACMD_DMA_PRESENT_FLIP 185 { 186 VBOXWDDM_DMA_PRIVATEDATA_HDR Hdr; 187 } VBOXVDMACMD_DMA_PRESENT_FLIP, *PVBOXVDMACMD_DMA_PRESENT_FLIP; 188 183 189 184 190 typedef struct VBOXWDDM_OPENALLOCATION
Note:
See TracChangeset
for help on using the changeset viewer.