Changeset 33216 in vbox for trunk/src/VBox/Additions/WINNT/Graphics/Miniport
- Timestamp:
- Oct 18, 2010 7:26:40 PM (14 years ago)
- Location:
- trunk/src/VBox/Additions/WINNT/Graphics/Miniport/wddm
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Additions/WINNT/Graphics/Miniport/wddm/VBoxVideoShgsmi.cpp
r29742 r33216 65 65 { 66 66 PFNVBOXSHGSMICMDCOMPLETION pfnCompletion = (PFNVBOXSHGSMICMDCOMPLETION)pHeader->u64Info1; 67 pfnCompletion(pHeap, VBoxSHGSMIBufferData (pHeader), (PVOID)pHeader->u64Info2); 67 if (pfnCompletion) 68 pfnCompletion(pHeap, VBoxSHGSMIBufferData (pHeader), (PVOID)pHeader->u64Info2); 68 69 } 69 70 -
trunk/src/VBox/Additions/WINNT/Graphics/Miniport/wddm/VBoxVideoVdma.cpp
r32989 r33216 1289 1289 return rc; 1290 1290 } 1291 1292 int vboxVdmaCBufDrSubmitSynch(PDEVICE_EXTENSION pDevExt, PVBOXVDMAINFO pInfo, PVBOXVDMACBUF_DR pDr) 1293 { 1294 const VBOXSHGSMIHEADER* pHdr = VBoxSHGSMICommandPrepAsynch (&pInfo->CmdHeap, pDr, NULL, NULL, VBOXSHGSMI_FLAG_GH_SYNCH); 1295 Assert(pHdr); 1296 int rc = VERR_GENERAL_FAILURE; 1297 if (pHdr) 1298 { 1299 do 1300 { 1301 HGSMIOFFSET offCmd = VBoxSHGSMICommandOffset(&pInfo->CmdHeap, pHdr); 1302 Assert(offCmd != HGSMIOFFSET_VOID); 1303 if (offCmd != HGSMIOFFSET_VOID) 1304 { 1305 rc = vboxWddmVdmaSubmit(pDevExt, pInfo, offCmd); 1306 AssertRC(rc); 1307 if (RT_SUCCESS(rc)) 1308 { 1309 VBoxSHGSMICommandDoneAsynch(&pInfo->CmdHeap, pHdr); 1310 AssertRC(rc); 1311 break; 1312 } 1313 } 1314 else 1315 rc = VERR_INVALID_PARAMETER; 1316 /* fail to submit, cancel it */ 1317 VBoxSHGSMICommandCancelAsynch(&pInfo->CmdHeap, pHdr); 1318 } while (0); 1319 } 1320 else 1321 rc = VERR_INVALID_PARAMETER; 1322 return rc; 1323 } 1291 1324 #endif 1292 1325 -
trunk/src/VBox/Additions/WINNT/Graphics/Miniport/wddm/VBoxVideoVdma.h
r32889 r33216 280 280 int vboxVdmaFlush (struct _DEVICE_EXTENSION* pDevExt, PVBOXVDMAINFO pInfo); 281 281 int vboxVdmaCBufDrSubmit (struct _DEVICE_EXTENSION* pDevExt, PVBOXVDMAINFO pInfo, PVBOXVDMACBUF_DR pDr); 282 int vboxVdmaCBufDrSubmitSynch (PDEVICE_EXTENSION pDevExt, PVBOXVDMAINFO pInfo, PVBOXVDMACBUF_DR pDr); 282 283 struct VBOXVDMACBUF_DR* vboxVdmaCBufDrCreate (PVBOXVDMAINFO pInfo, uint32_t cbTrailingData); 283 284 void vboxVdmaCBufDrFree (PVBOXVDMAINFO pInfo, struct VBOXVDMACBUF_DR* pDr); -
trunk/src/VBox/Additions/WINNT/Graphics/Miniport/wddm/VBoxVideoWddm.cpp
r33171 r33216 2569 2569 case DXGK_OPERATION_TRANSFER: 2570 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 { 2571 UINT cbCmd = VBOXVDMACMD_SIZE(VBOXVDMACMD_DMA_BPB_TRANSFER); 2572 PVBOXVDMACBUF_DR pDr = vboxVdmaCBufDrCreate (&pDevExt->u.primary.Vdma, cbCmd); 2573 Assert(pDr); 2574 if (pDr) 2575 { 2576 // vboxVdmaCBufDrCreate zero initializes the pDr 2577 pDr->fFlags = VBOXVDMACBUF_FLAG_BUF_FOLLOWS_DR; 2578 pDr->cbBuf = cbCmd; 2579 pDr->rc = VERR_NOT_IMPLEMENTED; 2580 2581 PVBOXVDMACMD pHdr = VBOXVDMACBUF_DR_TAIL(pDr, VBOXVDMACMD); 2582 pHdr->enmType = VBOXVDMACMD_TYPE_DMA_BPB_TRANSFER; 2583 pHdr->u32CmdSpecific = 0; 2584 VBOXVDMACMD_DMA_BPB_TRANSFER *pBody = VBOXVDMACMD_BODY(pHdr, VBOXVDMACMD_DMA_BPB_TRANSFER); 2585 pBody->cbTransferSize = (uint32_t)pBuildPagingBuffer->Transfer.TransferSize; 2586 pBody->fFlags = 0; 2587 2588 if (pBuildPagingBuffer->Transfer.Source.SegmentId) 2589 { 2577 2590 #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; 2591 Assert(pBuildPagingBuffer->Transfer.Source.SegmentAddress.QuadPart); 2592 #endif 2593 uint64_t off = pBuildPagingBuffer->Transfer.Source.SegmentAddress.QuadPart; 2594 off += pBuildPagingBuffer->Transfer.TransferOffset; 2595 pBody->Src.offVramBuf = off; 2596 pBody->fFlags |= VBOXVDMACMD_DMA_BPB_TRANSFER_F_SRC_VRAMOFFSET; 2597 } 2598 else 2599 { 2600 pBody->Src.phBuf = MmGetMdlPfnArray(pBuildPagingBuffer->Transfer.Source.pMdl)[pBuildPagingBuffer->Transfer.MdlOffset] << 12; 2601 #ifdef DEBUG 2602 { 2603 PFN_NUMBER num = MmGetMdlPfnArray(pBuildPagingBuffer->Transfer.Source.pMdl)[pBuildPagingBuffer->Transfer.MdlOffset]; 2604 for (UINT i = 1; i < ((pBuildPagingBuffer->Transfer.TransferSize + 0xfff) >> 12); ++i) 2605 { 2606 PFN_NUMBER cur = MmGetMdlPfnArray(pBuildPagingBuffer->Transfer.Source.pMdl)[pBuildPagingBuffer->Transfer.MdlOffset+1]; 2607 Assert(cur == ++num); 2608 } 2609 } 2610 #endif 2611 } 2612 2613 if (pBuildPagingBuffer->Transfer.Destination.SegmentId) 2614 { 2615 #ifdef DEBUG_misha 2616 Assert(pBuildPagingBuffer->Transfer.Destination.SegmentAddress.QuadPart); 2617 #endif 2618 uint64_t off = pBuildPagingBuffer->Transfer.Destination.SegmentAddress.QuadPart; 2619 off += pBuildPagingBuffer->Transfer.TransferOffset; 2620 pBody->Dst.offVramBuf = off; 2621 pBody->fFlags |= VBOXVDMACMD_DMA_BPB_TRANSFER_F_DST_VRAMOFFSET; 2622 } 2623 else 2624 { 2625 pBody->Dst.phBuf = MmGetMdlPfnArray(pBuildPagingBuffer->Transfer.Destination.pMdl)[pBuildPagingBuffer->Transfer.MdlOffset] << 12; 2626 #ifdef DEBUG 2627 { 2628 PFN_NUMBER num = MmGetMdlPfnArray(pBuildPagingBuffer->Transfer.Destination.pMdl)[pBuildPagingBuffer->Transfer.MdlOffset]; 2629 for (UINT i = 1; i < ((pBuildPagingBuffer->Transfer.TransferSize + 0xfff) >> 12); ++i) 2630 { 2631 PFN_NUMBER cur = MmGetMdlPfnArray(pBuildPagingBuffer->Transfer.Destination.pMdl)[pBuildPagingBuffer->Transfer.MdlOffset+1]; 2632 Assert(cur == ++num); 2633 } 2634 } 2635 #endif 2636 } 2637 2638 int rc = vboxVdmaCBufDrSubmitSynch(pDevExt, &pDevExt->u.primary.Vdma, pDr); 2639 AssertRC(rc); 2640 if (RT_SUCCESS(rc)) 2641 Status = STATUS_SUCCESS; 2642 else 2643 Status = STATUS_UNSUCCESSFUL; 2644 2645 vboxVdmaCBufDrFree(&pDevExt->u.primary.Vdma, pDr); 2582 2646 } 2583 2647 else 2584 2648 { 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); 2604 // pBuildPagingBuffer->pDmaBuffer = (uint8_t*)pBuildPagingBuffer->pDmaBuffer + VBOXVDMACMD_SIZE(VBOXVDMACMD_DMA_BPB_TRANSFER); 2649 /* @todo: try flushing.. */ 2650 drprintf((__FUNCTION__": vboxVdmaCBufDrCreate returned NULL\n")); 2651 Status = STATUS_INSUFFICIENT_RESOURCES; 2652 } 2605 2653 break; 2606 2654 }
Note:
See TracChangeset
for help on using the changeset viewer.