Changeset 32107 in vbox
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/VBox/VBoxVideo.h
r30788 r32107 1180 1180 VBOXVDMACMD_TYPE_DMA_PRESENT_SHADOW2PRIMARY, 1181 1181 VBOXVDMACMD_TYPE_DMA_PRESENT_CLRFILL, 1182 VBOXVDMACMD_TYPE_DMA_PRESENT_FLIP 1182 VBOXVDMACMD_TYPE_DMA_PRESENT_FLIP, 1183 VBOXVDMACMD_TYPE_DMA_NOP 1183 1184 } VBOXVDMACMD_TYPE; 1184 1185 -
trunk/src/VBox/Additions/WINNT/Graphics/Display/wddm/VBoxDispD3D.cpp
r32061 r32107 4011 4011 if (pAlloc->pSecondaryOpenedD3DIf) 4012 4012 pAlloc->pSecondaryOpenedD3DIf->Release(); 4013 4014 EnterCriticalSection(&pDevice->DirtyAllocListLock); 4015 if (pAlloc->DirtyAllocListEntry.pNext) 4016 RTListNodeRemove(&pAlloc->DirtyAllocListEntry); 4017 LeaveCriticalSection(&pDevice->DirtyAllocListLock); 4013 4018 } 4014 4019 } … … 4182 4187 return hr; 4183 4188 } 4189 4190 typedef struct VBOXWDDMDISP_NSCADD 4191 { 4192 VOID* pvCommandBuffer; 4193 UINT cbCommandBuffer; 4194 D3DDDI_ALLOCATIONLIST* pAllocationList; 4195 UINT cAllocationList; 4196 D3DDDI_PATCHLOCATIONLIST* pPatchLocationList; 4197 UINT cPatchLocationList; 4198 UINT cAllocations; 4199 }VBOXWDDMDISP_NSCADD, *PVBOXWDDMDISP_NSCADD; 4200 4201 static HRESULT vboxWddmNSCAddAlloc(PVBOXWDDMDISP_NSCADD pData, PVBOXWDDMDISP_ALLOCATION pAlloc, BOOL bWrite) 4202 { 4203 HRESULT hr = S_OK; 4204 if (pData->cAllocationList && pData->cPatchLocationList && pData->cbCommandBuffer > 4) 4205 { 4206 memset(pData->pAllocationList, 0, sizeof (D3DDDI_ALLOCATIONLIST)); 4207 pData->pAllocationList[0].hAllocation = pAlloc->hAllocation; 4208 if (bWrite) 4209 pData->pAllocationList[0].WriteOperation = 1; 4210 4211 memset(pData->pPatchLocationList, 0, sizeof (D3DDDI_PATCHLOCATIONLIST)); 4212 pData->pPatchLocationList[0].PatchOffset = pData->cAllocations*4; 4213 pData->pPatchLocationList[0].AllocationIndex = pData->cAllocations; 4214 4215 pData->cbCommandBuffer -= 4; 4216 --pData->cAllocationList; 4217 --pData->cPatchLocationList; 4218 ++pData->cAllocations; 4219 } 4220 else 4221 hr = S_FALSE; 4222 4223 ++pData->pAllocationList; 4224 ++pData->pPatchLocationList; 4225 pData->pvCommandBuffer = (VOID*)(((uint8_t*)pData->pvCommandBuffer) + 4); 4226 4227 return hr; 4228 } 4229 4230 static HRESULT vboxWddmNotifySharedChange(PVBOXWDDMDISP_DEVICE pDevice) 4231 { 4232 VBOXWDDMDISP_NSCADD NscAdd; 4233 4234 do 4235 { 4236 NscAdd.pvCommandBuffer = pDevice->DefaultContext.ContextInfo.pCommandBuffer; 4237 NscAdd.cbCommandBuffer = pDevice->DefaultContext.ContextInfo.CommandBufferSize; 4238 NscAdd.pAllocationList = pDevice->DefaultContext.ContextInfo.pAllocationList; 4239 NscAdd.cAllocationList = pDevice->DefaultContext.ContextInfo.AllocationListSize; 4240 NscAdd.pPatchLocationList = pDevice->DefaultContext.ContextInfo.pPatchLocationList; 4241 NscAdd.cPatchLocationList = pDevice->DefaultContext.ContextInfo.PatchLocationListSize; 4242 NscAdd.cAllocations = 0; 4243 4244 EnterCriticalSection(&pDevice->DirtyAllocListLock); 4245 4246 PVBOXWDDMDISP_ALLOCATION pAlloc = RTListNodeGetFirst(&pDevice->DirtyAllocList, VBOXWDDMDISP_ALLOCATION, DirtyAllocListEntry); 4247 if (pAlloc) 4248 { 4249 HRESULT tmpHr = vboxWddmNSCAddAlloc(&NscAdd, pAlloc, TRUE); 4250 Assert(tmpHr == S_OK || tmpHr == S_FALSE); 4251 if (tmpHr == S_OK) 4252 { 4253 RTListNodeRemove(&pAlloc->DirtyAllocListEntry); 4254 LeaveCriticalSection(&pDevice->DirtyAllocListLock); 4255 continue; 4256 } 4257 4258 LeaveCriticalSection(&pDevice->DirtyAllocListLock); 4259 4260 } 4261 else 4262 { 4263 LeaveCriticalSection(&pDevice->DirtyAllocListLock); 4264 if (!NscAdd.cAllocations) 4265 break; 4266 } 4267 4268 D3DDDICB_RENDER RenderData = {0}; 4269 RenderData.CommandLength = pDevice->DefaultContext.ContextInfo.CommandBufferSize - NscAdd.cbCommandBuffer; 4270 Assert(RenderData.CommandLength); 4271 Assert(RenderData.CommandLength < UINT32_MAX/2); 4272 RenderData.CommandOffset = 0; 4273 RenderData.NumAllocations = pDevice->DefaultContext.ContextInfo.AllocationListSize - NscAdd.cAllocationList; 4274 Assert(RenderData.NumAllocations == NscAdd.cAllocations); 4275 RenderData.NumPatchLocations = pDevice->DefaultContext.ContextInfo.PatchLocationListSize - NscAdd.cPatchLocationList; 4276 Assert(RenderData.NumPatchLocations == NscAdd.cAllocations); 4277 RenderData.NewCommandBufferSize = sizeof (VBOXVDMACMD) + 4 * (100); 4278 RenderData.NewAllocationListSize = 100; 4279 RenderData.NewPatchLocationListSize = 100; 4280 RenderData.hContext = pDevice->DefaultContext.ContextInfo.hContext; 4281 4282 HRESULT hr = pDevice->RtCallbacks.pfnRenderCb(pDevice->hDevice, &RenderData); 4283 Assert(hr == S_OK); 4284 if (hr == S_OK) 4285 { 4286 pDevice->DefaultContext.ContextInfo.CommandBufferSize = RenderData.NewCommandBufferSize; 4287 pDevice->DefaultContext.ContextInfo.pCommandBuffer = RenderData.pNewCommandBuffer; 4288 pDevice->DefaultContext.ContextInfo.AllocationListSize = RenderData.NewAllocationListSize; 4289 pDevice->DefaultContext.ContextInfo.pAllocationList = RenderData.pNewAllocationList; 4290 pDevice->DefaultContext.ContextInfo.PatchLocationListSize = RenderData.NewPatchLocationListSize; 4291 pDevice->DefaultContext.ContextInfo.pPatchLocationList = RenderData.pNewPatchLocationList; 4292 } 4293 else 4294 break; 4295 } while (1); 4296 4297 return S_OK; 4298 } 4299 4184 4300 static HRESULT APIENTRY vboxWddmDDevFlush(HANDLE hDevice) 4185 4301 { … … 4210 4326 } 4211 4327 } 4328 4329 vboxWddmNotifySharedChange(pDevice); 4212 4330 } 4213 4331 vboxVDbgPrintF(("<== "__FUNCTION__", hDevice(0x%p), hr(0x%x)\n", hDevice, hr)); … … 4815 4933 #endif 4816 4934 4935 if (pDstRc->RcDesc.fFlags.SharedResource) 4936 { 4937 PVBOXWDDMDISP_ALLOCATION pAlloc = &pDstRc->aAllocations[pData->DstSubResourceIndex]; 4938 EnterCriticalSection(&pDevice->DirtyAllocListLock); 4939 if (!pAlloc->DirtyAllocListEntry.pNext) 4940 RTListAppend(&pDevice->DirtyAllocList, &pAlloc->DirtyAllocListEntry); 4941 LeaveCriticalSection(&pDevice->DirtyAllocListLock); 4942 } 4943 4817 4944 vboxVDbgPrintF(("<== "__FUNCTION__", hDevice(0x%p), hr(0x%x)\n", hDevice, hr)); 4818 4945 return hr; … … 5581 5708 pDevice->ViewPort.MinZ = 0.; 5582 5709 pDevice->ViewPort.MaxZ = 1.; 5710 5711 InitializeCriticalSection(&pDevice->DirtyAllocListLock); 5712 RTListInit(&pDevice->DirtyAllocList); 5583 5713 5584 5714 Assert(!pCreateData->AllocationListSize); -
trunk/src/VBox/Additions/WINNT/Graphics/Display/wddm/VBoxDispD3D.h
r31797 r32107 95 95 IDirect3DDevice9 *pDevice9If; 96 96 struct VBOXWDDMDISP_RESOURCE *pRenderTargetRc; 97 struct VBOXWDDMDISP_RESOURCE *pDstSharedRc; 97 98 uint32_t iRenderTargetFrontBuf; 98 99 HWND hWnd; … … 124 125 D3DVIEWPORT9 ViewPort; 125 126 VBOXWDDMDISP_CONTEXT DefaultContext; 127 128 CRITICAL_SECTION DirtyAllocListLock; 129 RTLISTNODE DirtyAllocList; 126 130 127 131 UINT iPrimaryScreen; … … 160 164 IUnknown *pSecondaryOpenedD3DIf; 161 165 VBOXDISP_D3DIFTYPE enmD3DIfType; 166 RTLISTNODE DirtyAllocListEntry; 162 167 HANDLE hSharedHandle; 163 168 VBOXWDDMDISP_LOCKINFO LockInfo; -
trunk/src/VBox/Additions/WINNT/Graphics/Miniport/wddm/VBoxVideoWddm.cpp
r31797 r32107 1954 1954 break; 1955 1955 } 1956 case VBOXVDMACMD_TYPE_DMA_NOP: 1957 break; 1956 1958 default: 1957 1959 { … … 2310 2312 break; 2311 2313 } 2314 case VBOXVDMACMD_TYPE_DMA_NOP: 2315 { 2316 PVBOXWDDM_CONTEXT pContext = (PVBOXWDDM_CONTEXT)pSubmitCommand->hContext; 2317 Assert(pContext); 2318 Status = vboxWddmDmaCmdNotifyCompletion(pDevExt, pContext, pSubmitCommand->SubmissionFenceId); 2319 Assert(Status == STATUS_SUCCESS); 2320 break; 2321 } 2312 2322 default: 2313 2323 { … … 3779 3789 drprintf(("==> "__FUNCTION__ ", !!NOT_IMPLEMENTED!! hContext(0x%x)\n", hContext)); 3780 3790 3791 pRender->pDmaBuffer = ((uint8_t*)pRender->pDmaBuffer) + pRender->CommandLength; 3792 /* @todo: impl */ 3781 3793 AssertBreakpoint(); 3782 3794
Note:
See TracChangeset
for help on using the changeset viewer.