Changeset 33171 in vbox for trunk/src/VBox/Additions/WINNT/Graphics/Miniport
- Timestamp:
- Oct 15, 2010 11:10:10 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Additions/WINNT/Graphics/Miniport/wddm/VBoxVideoWddm.cpp
r33165 r33171 60 60 { 61 61 pInfo->offAlloc = (VBOXVIDEOOFFSET)pDmaAlloc->PhysicalAddress.QuadPart; 62 pInfo->segmentIdAlloc = pDmaAlloc->SegmentId; 63 } 64 else 65 pInfo->segmentIdAlloc = 0; 66 pInfo->srcId = pAlloc->SurfDesc.VidPnSourceId; 67 } 68 69 static void vboxWddmPopulateDmaAllocInfoWithOffset(PVBOXWDDM_DMA_ALLOCINFO pInfo, PVBOXWDDM_ALLOCATION pAlloc, DXGK_ALLOCATIONLIST *pDmaAlloc, uint32_t offStart) 70 { 71 pInfo->pAlloc = pAlloc; 72 if (pDmaAlloc->SegmentId) 73 { 74 pInfo->offAlloc = (VBOXVIDEOOFFSET)pDmaAlloc->PhysicalAddress.QuadPart + offStart; 62 75 pInfo->segmentIdAlloc = pDmaAlloc->SegmentId; 63 76 } … … 1437 1450 case VBOXWDDM_ALLOC_TYPE_UMD_HGSMI_BUFFER: 1438 1451 { 1439 ObDereferenceObject(pAllocation->pSynchEvent); 1452 if (pAllocation->pSynchEvent) 1453 { 1454 ObDereferenceObject(pAllocation->pSynchEvent); 1455 } 1440 1456 break; 1441 1457 } … … 1577 1593 pAllocation->SurfDesc.cbSize = pAllocInfo->cbBuffer; 1578 1594 pAllocationInfo->Flags.CpuVisible = 1; 1579 pAllocationInfo->Flags.SynchronousPaging = 1;1595 // pAllocationInfo->Flags.SynchronousPaging = 1; 1580 1596 pAllocationInfo->AllocationPriority = D3DDDI_ALLOCATIONPRIORITY_MAXIMUM; 1581 1597 switch (pAllocInfo->enmSynchType) … … 1595 1611 case VBOXUHGSMI_SYNCHOBJECT_TYPE_NONE: 1596 1612 pAllocation->pSynchEvent = NULL; 1597 Status = =STATUS_SUCCESS;1613 Status = STATUS_SUCCESS; 1598 1614 break; 1599 1615 default: … … 2033 2049 DXGK_ALLOCATIONLIST *pAllocation2Patch = (DXGK_ALLOCATIONLIST*)(pPrivateBuf + pPatchList->PatchOffset); 2034 2050 pAllocation2Patch->SegmentId = pAllocationList->SegmentId; 2035 pAllocation2Patch->PhysicalAddress = pAllocationList->PhysicalAddress; 2051 pAllocation2Patch->PhysicalAddress.QuadPart = pAllocationList->PhysicalAddress.QuadPart + pPatchList->AllocationOffset; 2052 Assert(!(pAllocationList->PhysicalAddress.QuadPart & 0xfffUL)); /* <- just a check to ensure allocation offset does not go here */ 2036 2053 } 2037 2054 } … … 2543 2560 2544 2561 NTSTATUS Status = STATUS_SUCCESS; 2562 PDEVICE_EXTENSION pDevExt = (PDEVICE_EXTENSION)hAdapter; 2545 2563 2546 2564 dfprintf(("==> "__FUNCTION__ ", context(0x%x)\n", hAdapter)); … … 2551 2569 case DXGK_OPERATION_TRANSFER: 2552 2570 { 2571 PVBOXWDDM_ALLOCATION pAlloc = (PVBOXWDDM_ALLOCATION)pBuildPagingBuffer->Transfer.hAllocation; 2572 uint8_t* pvVramBase = pDevExt->pvVisibleVram; 2573 SIZE_T cbSize = pBuildPagingBuffer->Transfer.TransferSize; 2574 uint8_t *pvSrc, *pvDst; 2575 if (pBuildPagingBuffer->Transfer.Source.SegmentId) 2576 { 2577 #ifdef DEBUG_misha 2578 Assert(pBuildPagingBuffer->Transfer.Source.SegmentAddress.QuadPart); 2579 #endif 2580 pvSrc = pvVramBase + pBuildPagingBuffer->Transfer.Source.SegmentAddress.QuadPart; 2581 pvSrc += pBuildPagingBuffer->Transfer.TransferOffset; 2582 } 2583 else 2584 { 2585 pvSrc = (uint8_t*)MmGetMdlVirtualAddress(pBuildPagingBuffer->Transfer.Source.pMdl); 2586 pvSrc += pBuildPagingBuffer->Transfer.MdlOffset * 0x1000 /* page size */; 2587 } 2588 2589 if (pBuildPagingBuffer->Transfer.Destination.SegmentId) 2590 { 2591 #ifdef DEBUG_misha 2592 Assert(pBuildPagingBuffer->Transfer.Destination.SegmentAddress.QuadPart); 2593 #endif 2594 pvDst = pvVramBase + pBuildPagingBuffer->Transfer.Destination.SegmentAddress.QuadPart; 2595 pvDst += pBuildPagingBuffer->Transfer.TransferOffset; 2596 } 2597 else 2598 { 2599 pvDst = (uint8_t*)MmGetMdlVirtualAddress(pBuildPagingBuffer->Transfer.Destination.pMdl); 2600 pvDst += pBuildPagingBuffer->Transfer.MdlOffset * 0x1000 /* page size */; 2601 } 2602 2603 memcpy(pvDst, pvSrc, cbSize); 2553 2604 // pBuildPagingBuffer->pDmaBuffer = (uint8_t*)pBuildPagingBuffer->pDmaBuffer + VBOXVDMACMD_SIZE(VBOXVDMACMD_DMA_BPB_TRANSFER); 2554 2605 break; … … 4067 4118 { 4068 4119 PVBOXWDDM_ALLOCATION pAlloc = vboxWddmGetAllocationFromAllocList(pDevExt, pAllocationList); 4069 vboxWddmPopulateDmaAllocInfo (&pSubmInfo->Alloc, pAlloc, pAllocationList);4120 vboxWddmPopulateDmaAllocInfoWithOffset(&pSubmInfo->Alloc, pAlloc, pAllocationList, pSubmUmInfo->offData); 4070 4121 4071 4122 pSubmInfo->cbData = pSubmUmInfo->cbData;
Note:
See TracChangeset
for help on using the changeset viewer.