Changeset 26661 in vbox for trunk/src/VBox/Additions
- Timestamp:
- Feb 19, 2010 3:08:15 PM (15 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/VBoxVideoVdma.cpp
r26556 r26661 165 165 } 166 166 167 PVBOXVDMACBUF_DR vboxVdmaCBufDrCreate (PVBOXVDMAINFO pInfo, PVBOXVDMACMDBUF_INFO pBufInfo , uint32_t u32FenceId)167 PVBOXVDMACBUF_DR vboxVdmaCBufDrCreate (PVBOXVDMAINFO pInfo, PVBOXVDMACMDBUF_INFO pBufInfo) 168 168 { 169 169 PVBOXVDMACBUF_DR pCmdDr; … … 188 188 189 189 if (!(pBufInfo->fFlags & VBOXVDMACBUF_FLAG_BUF_VRAM_OFFSET)) 190 pCmdDr-> phBuf = pBufInfo->Location.phBuf;190 pCmdDr->Location.phBuf = pBufInfo->Location.phBuf; 191 191 else 192 pCmdDr-> phBuf = pBufInfo->Location.offVramBuf;192 pCmdDr->Location.offVramBuf = pBufInfo->Location.offVramBuf; 193 193 } 194 194 195 195 pCmdDr->fFlags = pBufInfo->fFlags; 196 196 pCmdDr->cbBuf = pBufInfo->cbBuf; 197 pCmdDr->u32FenceId = u32FenceId;197 pCmdDr->u32FenceId = pBufInfo->u32FenceId; 198 198 199 199 return pCmdDr; … … 259 259 } 260 260 261 int vboxVdmaCBufSubmit (PDEVICE_EXTENSION pDevExt, PVBOXVDMAINFO pInfo, PVBOXVDMACMDBUF_INFO pBufInfo , uint32_t u32FenceId)262 { 263 dfprintf((__FUNCTION__"\n")); 264 265 PVBOXVDMACBUF_DR pdr = vboxVdmaCBufDrCreate (pInfo, pBufInfo , u32FenceId);261 int vboxVdmaCBufSubmit (PDEVICE_EXTENSION pDevExt, PVBOXVDMAINFO pInfo, PVBOXVDMACMDBUF_INFO pBufInfo) 262 { 263 dfprintf((__FUNCTION__"\n")); 264 265 PVBOXVDMACBUF_DR pdr = vboxVdmaCBufDrCreate (pInfo, pBufInfo); 266 266 if (!pdr) 267 267 return VERR_OUT_OF_RESOURCES; -
trunk/src/VBox/Additions/WINNT/Graphics/Miniport/wddm/VBoxVideoVdma.h
r26556 r26661 38 38 void *pvBuf; 39 39 } Location; 40 uint32_t u32FenceId; 40 41 } VBOXVDMACMDBUF_INFO, *PVBOXVDMACMDBUF_INFO; 41 42 … … 45 46 int vboxVdmaFlush (struct _DEVICE_EXTENSION* pDevExt, PVBOXVDMAINFO pInfo); 46 47 int vboxVdmaDestroy (struct _DEVICE_EXTENSION* pDevExt, PVBOXVDMAINFO pInfo); 47 int vboxVdmaCBufSubmit (struct _DEVICE_EXTENSION* pDevExt, PVBOXVDMAINFO pInfo, PVBOXVDMACMDBUF_INFO pBufInfo , uint32_t u32FenceId);48 int vboxVdmaCBufSubmit (struct _DEVICE_EXTENSION* pDevExt, PVBOXVDMAINFO pInfo, PVBOXVDMACMDBUF_INFO pBufInfo); 48 49 49 50 #endif /* #ifndef ___VBoxVideoVdma_h___ */ -
trunk/src/VBox/Additions/WINNT/Graphics/Miniport/wddm/VBoxVideoWddm.cpp
r26630 r26661 1202 1202 PVBOXWDDM_ALLOCATION_SHAREDPRIMARYSURFACE pAlloc = VBOXWDDM_ALLOCATION_BODY(pAllocInfo, VBOXWDDM_ALLOCATION_SHAREDPRIMARYSURFACE); 1203 1203 PVBOXWDDM_ALLOCINFO_SHAREDPRIMARYSURFACE pAllocI = VBOXWDDM_ALLOCINFO_BODY(pAllocInfo, VBOXWDDM_ALLOCINFO_SHAREDPRIMARYSURFACE); 1204 // memcpy(&pAlloc->AllocInfo, pInfo, sizeof (pAlloc->AllocInfo));1205 1204 pAlloc->RefreshRate = pAllocI->RefreshRate; 1206 1205 pAlloc->VidPnSourceId = pAllocI->VidPnSourceId; 1207 pAlloc->offAddress = VBOXVIDEOOFFSET_VOID;1206 // pAlloc->offAddress = VBOXVIDEOOFFSET_VOID; 1208 1207 pAlloc->bVisible = FALSE; 1209 1208 … … 1500 1499 CONST DXGKARG_PATCH* pPatch) 1501 1500 { 1502 return STATUS_NOT_IMPLEMENTED; 1501 /* DxgkDdiPatch should be made pageable. */ 1502 PAGED_CODE(); 1503 1504 NTSTATUS Status = STATUS_SUCCESS; 1505 1506 dfprintf(("==> "__FUNCTION__ ", context(0x%x)\n", hAdapter)); 1507 1508 /* Value == 2 is Present 1509 * Value == 4 is RedirectedPresent 1510 * we do not expect any other flags to be set here */ 1511 Assert(pPatch->Flags.Value == 2 || pPatch->Flags.Value == 4); 1512 1513 uint8_t *pBuf = ((uint8_t *)pPatch->pDmaBuffer) + pPatch->DmaBufferPrivateDataSubmissionStartOffset; 1514 for (UINT i = pPatch->PatchLocationListSubmissionStart; i < pPatch->PatchLocationListSubmissionLength; ++i) 1515 { 1516 const D3DDDI_PATCHLOCATIONLIST* pPatchList = &pPatch->pPatchLocationList[i]; 1517 Assert(pPatchList->AllocationIndex < pPatch->AllocationListSize); 1518 const DXGK_ALLOCATIONLIST *pAllocationList = &pPatch->pAllocationList[pPatchList->AllocationIndex]; 1519 if (pAllocationList->PhysicalAddress.QuadPart) 1520 { 1521 Assert(pPatchList->PatchOffset < (pPatch->DmaBufferPrivateDataSubmissionEndOffset - pPatch->DmaBufferPrivateDataSubmissionStartOffset)); 1522 *((PHYSICAL_ADDRESS*)(pBuf+pPatchList->PatchOffset)) = pAllocationList->PhysicalAddress; 1523 } 1524 else 1525 { 1526 /* sanity */ 1527 if (pPatch->Flags.Value == 2 || pPatch->Flags.Value == 4) 1528 Assert(i == 0); 1529 } 1530 } 1531 1532 dfprintf(("<== "__FUNCTION__ ", context(0x%x)\n", hAdapter)); 1533 1534 return Status; 1503 1535 } 1504 1536 … … 1509 1541 CONST DXGKARG_SUBMITCOMMAND* pSubmitCommand) 1510 1542 { 1511 return STATUS_NOT_IMPLEMENTED; 1543 /* DxgkDdiSubmitCommand runs at dispatch, should not be pageable. */ 1544 NTSTATUS Status = STATUS_SUCCESS; 1545 1546 dfprintf(("==> "__FUNCTION__ ", context(0x%x)\n", hAdapter)); 1547 1548 PDEVICE_EXTENSION pDevExt = (PDEVICE_EXTENSION)hAdapter; 1549 VBOXVDMACMDBUF_INFO BufInfo = {0}; 1550 1551 Assert(pSubmitCommand->DmaBufferSegmentId); 1552 1553 /* the DMA command buffer is located in system RAM, the host will need to pick it from there */ 1554 //BufInfo.fFlags = 0; /* see VBOXVDMACBUF_FLAG_xx */ 1555 BufInfo.cbBuf = pSubmitCommand->DmaBufferPrivateDataSubmissionEndOffset - pSubmitCommand->DmaBufferPrivateDataSubmissionStartOffset; 1556 BufInfo.Location.phBuf = pSubmitCommand->DmaBufferPhysicalAddress.QuadPart + pSubmitCommand->DmaBufferPrivateDataSubmissionStartOffset; 1557 BufInfo.u32FenceId = pSubmitCommand->SubmissionFenceId; 1558 1559 int rc = vboxVdmaCBufSubmit (pDevExt, &pDevExt->u.primary.Vdma, &BufInfo); 1560 AssertRC(rc); 1561 if (!RT_SUCCESS(rc)) 1562 { 1563 switch (rc) 1564 { 1565 case VERR_OUT_OF_RESOURCES: 1566 /* @todo: try flushing.. */ 1567 Status = STATUS_INSUFFICIENT_RESOURCES; 1568 break; 1569 default: 1570 Status = STATUS_UNSUCCESSFUL; 1571 break; 1572 } 1573 } 1574 1575 dfprintf(("<== "__FUNCTION__ ", context(0x%x)\n", hAdapter)); 1576 1577 return Status; 1512 1578 } 1513 1579 … … 1527 1593 DXGKARG_BUILDPAGINGBUFFER* pBuildPagingBuffer) 1528 1594 { 1529 return STATUS_NOT_IMPLEMENTED; 1595 /* DxgkDdiBuildPagingBuffer should be made pageable. */ 1596 PAGED_CODE(); 1597 1598 NTSTATUS Status = STATUS_SUCCESS; 1599 1600 dfprintf(("==> "__FUNCTION__ ", context(0x%x)\n", hAdapter)); 1601 1602 dfprintf(("<== "__FUNCTION__ ", context(0x%x)\n", hAdapter)); 1603 1604 return Status; 1605 1530 1606 } 1531 1607 … … 2225 2301 if (vboxWddmPixFormatConversionSupported(pSrcAlloc->u.SurfInfo.format, pDstAlloc->u.SurfInfo.format)) 2226 2302 { 2227 memset(pPresent->pPatchLocationListOut, 0, 2*sizeof (D3DDDI_PATCHLOCATIONLIST));2228 pPresent->pPatchLocationListOut->PatchOffset = VBOXVDMACMD_BODY_FIELD_OFFSET(UINT, VBOXVDMACMD_DMA_PRESENT_BLT, offSrc);2303 memset(pPresent->pPatchLocationListOut, 0, 3*sizeof (D3DDDI_PATCHLOCATIONLIST)); 2304 pPresent->pPatchLocationListOut->PatchOffset = 0; 2229 2305 ++pPresent->pPatchLocationListOut; 2230 pPresent->pPatchLocationListOut->PatchOffset = VBOXVDMACMD_BODY_FIELD_OFFSET(UINT, VBOXVDMACMD_DMA_PRESENT_BLT, offDst); 2231 pPresent->pPatchLocationListOut->AllocationIndex = 1; 2306 pPresent->pPatchLocationListOut->PatchOffset = VBOXVDMACMD_BODY_FIELD_OFFSET(UINT, VBOXVDMACMD_DMA_PRESENT_BLT, phSrc); 2307 pPresent->pPatchLocationListOut->AllocationIndex = DXGK_PRESENT_SOURCE_INDEX; 2308 ++pPresent->pPatchLocationListOut; 2309 pPresent->pPatchLocationListOut->PatchOffset = VBOXVDMACMD_BODY_FIELD_OFFSET(UINT, VBOXVDMACMD_DMA_PRESENT_BLT, phDst); 2310 pPresent->pPatchLocationListOut->AllocationIndex = DXGK_PRESENT_DESTINATION_INDEX; 2232 2311 ++pPresent->pPatchLocationListOut; 2233 2312 … … 2235 2314 pCmd->u32CmdSpecific = 0; 2236 2315 PVBOXVDMACMD_DMA_PRESENT_BLT pTransfer = VBOXVDMACMD_BODY(pCmd, VBOXVDMACMD_DMA_PRESENT_BLT); 2237 pTransfer-> offSrc = vboxWddmOffsetFromPhAddress(pSrc->PhysicalAddress);2238 pTransfer-> offDst = vboxWddmOffsetFromPhAddress(pDst->PhysicalAddress);2316 pTransfer->phSrc = pSrc->PhysicalAddress.QuadPart; 2317 pTransfer->phDst = pDst->PhysicalAddress.QuadPart; 2239 2318 vboxWddmSurfDescFromAllocation(pSrcAlloc, &pTransfer->srcDesc); 2240 2319 vboxWddmSurfDescFromAllocation(pDstAlloc, &pTransfer->dstDesc); -
trunk/src/VBox/Additions/WINNT/Graphics/Miniport/wddm/VBoxVideoWddm.h
r26630 r26661 67 67 { 68 68 VBOXWDDM_ALLOC_TYPE enmType; 69 PHYSICAL_ADDRESS phAddress; 70 BOOLEAN bPagedIn; 69 71 union 70 72 { … … 83 85 D3DDDI_RATIONAL RefreshRate; 84 86 D3DDDI_VIDEO_PRESENT_SOURCE_ID VidPnSourceId; 85 VBOXVIDEOOFFSET offAddress;87 // VBOXVIDEOOFFSET offAddress; 86 88 BOOLEAN bVisible; 87 89 } VBOXWDDM_ALLOCATION_SHAREDPRIMARYSURFACE, *PVBOXWDDM_ALLOCATION_SHAREDPRIMARYSURFACE;
Note:
See TracChangeset
for help on using the changeset viewer.