Changeset 95191 in vbox for trunk/src/VBox/Additions/WINNT/Graphics/Video
- Timestamp:
- Jun 3, 2022 6:49:41 PM (3 years ago)
- Location:
- trunk/src/VBox/Additions/WINNT/Graphics/Video/mp/wddm
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Additions/WINNT/Graphics/Video/mp/wddm/VBoxMPTypes.h
r94927 r95191 202 202 #endif 203 203 VBOXUHGSMI_BUFFER_TYPE_FLAGS fUhgsmiType; 204 int CurVidPnSourceId; /* Source index if used for a source, otherwise -1. */ 204 205 #ifdef VBOX_WITH_VMSVGA3D_DX 205 206 /* Direct3D driver data for .enmType == VBOXWDDM_ALLOC_TYPE_D3D. */ -
trunk/src/VBox/Additions/WINNT/Graphics/Video/mp/wddm/VBoxMPWddm.cpp
r95157 r95191 2140 2140 KeInitializeSpinLock(&pAllocation->OpenLock); 2141 2141 InitializeListHead(&pAllocation->OpenList); 2142 pAllocation->CurVidPnSourceId = -1; 2142 2143 2143 2144 switch (pAllocInfo->enmType) … … 2395 2396 vboxVDbgBreakFv(); 2396 2397 2398 PVBOXMP_DEVEXT pDevExt = (PVBOXMP_DEVEXT)hAdapter; 2399 2400 for (UINT i = 0; i < pDestroyAllocation->NumAllocations; ++i) 2401 { 2402 PVBOXWDDM_ALLOCATION pAllocation = (PVBOXWDDM_ALLOCATION)pDestroyAllocation->pAllocationList[0]; 2403 if (pAllocation->CurVidPnSourceId != -1) 2404 { 2405 VBOXWDDM_SOURCE *pSource = &pDevExt->aSources[pAllocation->CurVidPnSourceId]; 2406 vboxWddmAssignPrimary(pSource, NULL, pAllocation->CurVidPnSourceId); 2407 } 2408 } 2409 2397 2410 #ifdef VBOX_WITH_VMSVGA3D_DX 2398 2411 /* Check if this is a request from the D3D driver. */ … … 2408 2421 2409 2422 PVBOXWDDM_RESOURCE pRc = (PVBOXWDDM_RESOURCE)pDestroyAllocation->hResource; 2410 PVBOXMP_DEVEXT pDevExt = (PVBOXMP_DEVEXT)hAdapter;2411 2412 2423 if (pRc) 2413 2424 { -
trunk/src/VBox/Additions/WINNT/Graphics/Video/mp/wddm/VBoxMPWddm.h
r93115 r95191 122 122 pOldAlloc->bAssigned = FALSE; 123 123 Assert(pOldAlloc->AllocData.SurfDesc.VidPnSourceId == srcId); 124 pOldAlloc->CurVidPnSourceId = -1; 124 125 } 125 126 … … 129 130 pAllocation->bAssigned = TRUE; 130 131 pAllocation->bVisible = pSource->bVisible; 132 pAllocation->CurVidPnSourceId = srcId; 131 133 132 134 if (pSource->AllocData.hostID != pAllocation->AllocData.hostID) -
trunk/src/VBox/Additions/WINNT/Graphics/Video/mp/wddm/gallium/VBoxMPDX.cpp
r95086 r95191 215 215 pAllocation->dx.SegmentId = 2; 216 216 } 217 else 218 AssertFailedReturn(STATUS_INVALID_PARAMETER); 219 217 220 pAllocationInfo->EvictionSegmentSet = 0; 218 221 pAllocationInfo->MaximumRenamingListLength = 1; … … 343 346 pAllocation->dx.pMDL = 0; 344 347 345 /* Legacy. Unused. */346 348 KeInitializeSpinLock(&pAllocation->OpenLock); 347 349 InitializeListHead(&pAllocation->OpenList); 350 pAllocation->CurVidPnSourceId = -1; 348 351 349 352 if (pAllocation->dx.desc.enmAllocationType == VBOXDXALLOCATIONTYPE_SURFACE) … … 372 375 AssertReturn(pAllocation->enmType == VBOXWDDM_ALLOC_TYPE_D3D, STATUS_INVALID_PARAMETER); 373 376 377 Assert(pAllocation->cOpens == 0); 378 374 379 if (pAllocation->dx.desc.enmAllocationType == VBOXDXALLOCATIONTYPE_SURFACE) 375 380 Status = svgaDestroyAllocationSurface(pDevExt->pGa->hw.pSvga, pAllocation); … … 429 434 for (unsigned i = 0; i < pRender->PatchLocationListInSize; ++i) 430 435 { 436 if (cOut >= pRender->PatchLocationListOutSize) 437 { 438 /** @todo Merge generation of patches witht SvgaRenderCommandsD3D in order to correctly 439 * split a command buffer in case of STATUS_GRAPHICS_INSUFFICIENT_DMA_BUFFER? 440 */ 441 DEBUG_BREAKPOINT_TEST(); 442 Status = STATUS_GRAPHICS_INSUFFICIENT_DMA_BUFFER; 443 break; 444 } 445 431 446 D3DDDI_PATCHLOCATIONLIST const *pIn = &pRender->pPatchLocationListIn[i]; 432 447 void * const pPatchAddress = (uint8_t *)pvDmaBuffer + pIn->PatchOffset; 433 448 VBOXDXALLOCATIONTYPE const enmAllocationType = (VBOXDXALLOCATIONTYPE)pIn->DriverId; 449 450 /* "Even though the driver's DxgkDdiRender function pre-patches the DMA buffer, the driver 451 * must still insert all of the references to allocations into the output patch-location list 452 * that the pPatchLocationListOut member of DXGKARG_RENDER specifies." 453 */ 454 pRender->pPatchLocationListOut[cOut] = *pIn; 434 455 435 456 DXGK_ALLOCATIONLIST *pAllocationListEntry = &pRender->pAllocationList[pIn->AllocationIndex]; … … 442 463 if (enmAllocationType == VBOXDXALLOCATIONTYPE_SURFACE) 443 464 { 444 /* Surfaces might also need a mobid. */ 445 if (pAllocationListEntry->SegmentId == 3) 446 { 447 /* DEFAULT resources only require the sid, because they exist outside the guest. */ 448 Assert(pAllocation->dx.sid != SVGA3D_INVALID_ID); 449 Assert(pAllocation->dx.mobid != SVGA3D_INVALID_ID); 450 Assert(pAllocation->dx.SegmentId == 3); 451 465 if ( pAllocation->dx.sid != SVGA3D_INVALID_ID 466 && pAllocation->dx.mobid != SVGA3D_INVALID_ID) 452 467 *(uint32_t *)pPatchAddress = pAllocation->dx.sid; 453 continue;454 }455 else456 {457 /* For Aperture segment, the surface need a mob too, which must be created in BuildPagingBuffer. */458 if ( pAllocation->dx.sid != SVGA3D_INVALID_ID459 && pAllocation->dx.mobid != SVGA3D_INVALID_ID)460 {461 *(uint32_t *)pPatchAddress = pAllocation->dx.sid;462 continue;463 }464 }465 468 } 466 469 else if ( enmAllocationType == VBOXDXALLOCATIONTYPE_SHADERS … … 468 471 { 469 472 if (pAllocation->dx.mobid != SVGA3D_INVALID_ID) 470 {471 473 *(uint32_t *)pPatchAddress = pAllocation->dx.mobid; 472 continue;473 }474 474 } 475 475 } … … 479 479 || enmAllocationType == VBOXDXALLOCATIONTYPE_SHADERS 480 480 || enmAllocationType == VBOXDXALLOCATIONTYPE_CO) 481 {482 481 *(uint32_t *)pPatchAddress = SVGA3D_INVALID_ID; 483 continue; 484 } 485 } 486 487 pRender->pPatchLocationListOut[cOut++] = *pIn; 482 } 483 484 ++cOut; 488 485 } 489 486 … … 919 916 NTSTATUS APIENTRY DxgkDdiDXPatch(PVBOXMP_DEVEXT pDevExt, const DXGKARG_PATCH *pPatch) 920 917 { 921 GALOG(("pDmaBuffer = %p, cbDmaBuffer = %u, cPatches = %u\n",922 pPatch->pDmaBuffer, pPatch->DmaBufferSubmissionEndOffset - pPatch->DmaBufferSubmissionStartOffset,923 pPatch->PatchLocationListSubmissionLength));924 925 918 //DEBUG_BREAKPOINT_TEST(); 926 919 -
trunk/src/VBox/Additions/WINNT/Graphics/Video/mp/wddm/gallium/VBoxMPGaWddm.cpp
r95086 r95191 1276 1276 SvgaFlush(pDevExt->pGa->hw.pSvga); 1277 1277 1278 GALOG(("pDmaBuffer = %p, cbDmaBuffer = %u, cPatches = %u\n",1278 GALOG(("pDmaBuffer %p, cbDmaBuffer %u, PatchStart %u, cPatches %u, Flags 0xx, context type %d\n", 1279 1279 pPatch->pDmaBuffer, pPatch->DmaBufferSubmissionEndOffset - pPatch->DmaBufferSubmissionStartOffset, 1280 pPatch->PatchLocationListSubmissionLength)); 1281 1282 /* The driver does not need to modify paging and present commands here. */ 1283 if (pPatch->Flags.Paging || pPatch->Flags.Present) 1280 pPatch->PatchLocationListSubmissionStart, pPatch->PatchLocationListSubmissionLength, pPatch->Flags.Value, 1281 ((PVBOXWDDM_CONTEXT)pPatch->hContext)->enmType)); 1282 1283 /* The driver does not need to modify paging commands. */ 1284 if (pPatch->Flags.Paging) 1284 1285 return STATUS_SUCCESS; 1285 1286
Note:
See TracChangeset
for help on using the changeset viewer.