Changeset 32889 in vbox for trunk/src/VBox/Additions/WINNT/Graphics/Miniport
- Timestamp:
- Oct 4, 2010 11:14:12 PM (14 years ago)
- Location:
- trunk/src/VBox/Additions/WINNT/Graphics/Miniport
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Additions/WINNT/Graphics/Miniport/Makefile.kmk
r32877 r32889 90 90 endif 91 91 endif 92 ifdef VBOX VDMA_WITH_VDMA93 VBoxVideoWddm_DEFS += VBOX VDMA_WITH_VDMA92 ifdef VBOX_WITH_VDMA 93 VBoxVideoWddm_DEFS += VBOX_WITH_VDMA 94 94 endif 95 95 ifdef DEBUG_misha -
trunk/src/VBox/Additions/WINNT/Graphics/Miniport/VBoxVideo.h
r32876 r32889 336 336 VBOXSHGSMILIST VhwaCmdList; 337 337 #endif 338 BOOL bSetNotifyDxDpc;338 // BOOL bSetNotifyDxDpc; 339 339 BOOL bNotifyDxDpc; 340 340 -
trunk/src/VBox/Additions/WINNT/Graphics/Miniport/wddm/VBoxUhgsmi.h
r32877 r32889 34 34 struct 35 35 { 36 uint32_t bReadOnly : 1; 37 uint32_t bWriteOnly : 1; 38 uint32_t bDonotWait : 1; 39 uint32_t bDiscard : 1; 40 uint32_t Reserved : 28; 36 uint32_t bReadOnly : 1; 37 uint32_t bWriteOnly : 1; 38 uint32_t bDonotWait : 1; 39 uint32_t bDiscard : 1; 40 uint32_t bLockEntire : 1; 41 uint32_t Reserved : 27; 41 42 }; 42 43 uint32_t Value; … … 54 55 uint32_t bDoNotRetire : 1; /* <- the buffer will be used in a subsequent command */ 55 56 uint32_t bDoNotSignalCompletion : 1; /* <- do not signal notification object on completion for this alloc */ 56 uint32_t Reserved : 28; 57 uint32_t bEntireBuffer : 1; /* <- do not signal notification object on completion for this alloc */ 58 uint32_t Reserved : 27; 57 59 }; 58 60 uint32_t Value; -
trunk/src/VBox/Additions/WINNT/Graphics/Miniport/wddm/VBoxVideoMisc.cpp
r32766 r32889 693 693 NTSTATUS vboxWddmDisplaySettingsQueryPos(IN PDEVICE_EXTENSION pDeviceExtension, D3DDDI_VIDEO_PRESENT_SOURCE_ID VidPnSourceId, POINT * pPos) 694 694 { 695 Assert(KeGetCurrentIrql() == PASSIVE_LEVEL); 695 696 HANDLE hKey; 696 697 NTSTATUS Status = vboxWddmRegOpenDisplaySettingsKey(pDeviceExtension, VidPnSourceId, &hKey); -
trunk/src/VBox/Additions/WINNT/Graphics/Miniport/wddm/VBoxVideoVdma.cpp
r32877 r32889 1002 1002 static int vboxWddmVdmaSubmitHgsmi(struct _DEVICE_EXTENSION* pDevExt, PVBOXVDMAINFO pInfo, HGSMIOFFSET offDr) 1003 1003 { 1004 VBoxHGSMIGuestWrite( pDevExt, offDr);1004 VBoxHGSMIGuestWrite(hgsmiFromDeviceExt(pDevExt), offDr); 1005 1005 return VINF_SUCCESS; 1006 1006 } … … 1012 1012 int rc = VINF_SUCCESS; 1013 1013 1014 PVBOXVDMA_CTL pCmd = (PVBOXVDMA_CTL)VBoxSHGSMICommandAlloc(& pDevExt->u.primary.hgsmiAdapterHeap, sizeof (VBOXVDMA_CTL), HGSMI_CH_VBVA, VBVA_VDMA_CTL);1014 PVBOXVDMA_CTL pCmd = (PVBOXVDMA_CTL)VBoxSHGSMICommandAlloc(&hgsmiFromDeviceExt(pDevExt)->hgsmiAdapterHeap, sizeof (VBOXVDMA_CTL), HGSMI_CH_VBVA, VBVA_VDMA_CTL); 1015 1015 if (pCmd) 1016 1016 { … … 1019 1019 pCmd->i32Result = VERR_NOT_SUPPORTED; 1020 1020 1021 const VBOXSHGSMIHEADER* pHdr = VBoxSHGSMICommandPrepSynch(& pDevExt->u.primary.hgsmiAdapterHeap, pCmd);1021 const VBOXSHGSMIHEADER* pHdr = VBoxSHGSMICommandPrepSynch(&hgsmiFromDeviceExt(pDevExt)->hgsmiAdapterHeap, pCmd); 1022 1022 Assert(pHdr); 1023 1023 if (pHdr) … … 1025 1025 do 1026 1026 { 1027 HGSMIOFFSET offCmd = VBoxSHGSMICommandOffset(& pDevExt->u.primary.hgsmiAdapterHeap, pHdr);1027 HGSMIOFFSET offCmd = VBoxSHGSMICommandOffset(&hgsmiFromDeviceExt(pDevExt)->hgsmiAdapterHeap, pHdr); 1028 1028 Assert(offCmd != HGSMIOFFSET_VOID); 1029 1029 if (offCmd != HGSMIOFFSET_VOID) … … 1033 1033 if (RT_SUCCESS(rc)) 1034 1034 { 1035 rc = VBoxSHGSMICommandDoneSynch(& pDevExt->u.primary.hgsmiAdapterHeap, pHdr);1035 rc = VBoxSHGSMICommandDoneSynch(&hgsmiFromDeviceExt(pDevExt)->hgsmiAdapterHeap, pHdr); 1036 1036 AssertRC(rc); 1037 1037 if (RT_SUCCESS(rc)) … … 1046 1046 rc = VERR_INVALID_PARAMETER; 1047 1047 /* fail to submit, cancel it */ 1048 VBoxSHGSMICommandCancelSynch(& pDevExt->u.primary.hgsmiAdapterHeap, pHdr);1048 VBoxSHGSMICommandCancelSynch(&hgsmiFromDeviceExt(pDevExt)->hgsmiAdapterHeap, pHdr); 1049 1049 } while (0); 1050 1050 } 1051 1051 1052 VBoxSHGSMICommandFree (& pDevExt->u.primary.hgsmiAdapterHeap, pCmd);1052 VBoxSHGSMICommandFree (&hgsmiFromDeviceExt(pDevExt)->hgsmiAdapterHeap, pCmd); 1053 1053 } 1054 1054 else … … 1247 1247 } 1248 1248 1249 vboxVdmaDdiCmdCompletedIrq(pDevExt, &pDevExt->DdiCmdQueue, VBOXVDMADDI_CMD_FROM_BUF_DR(pDr), enmComplType); 1249 if (vboxVdmaDdiCmdCompletedIrq(pDevExt, &pDevExt->DdiCmdQueue, VBOXVDMADDI_CMD_FROM_BUF_DR(pDr), enmComplType)) 1250 { 1251 pDevExt->bNotifyDxDpc = TRUE; 1252 } 1250 1253 1251 1254 /* inform SHGSMI we DO NOT want to be called at DPC later */ -
trunk/src/VBox/Additions/WINNT/Graphics/Miniport/wddm/VBoxVideoVdma.h
r32877 r32889 79 79 } 80 80 81 DECLINLINE(BOOLEAN) vboxVdmaDdiCmdIsCompletedListEmptyIsr(PVBOXVDMADDI_CMD_QUEUE pQueue) 82 { 83 return IsListEmpty(&pQueue->DpcCmdQueue); 84 } 85 81 86 #define VBOXVDMADDI_CMD_FROM_ENTRY(_pEntry) ((PVBOXVDMADDI_CMD)(((uint8_t*)(_pEntry)) - RT_OFFSETOF(VBOXVDMADDI_CMD, QueueEntry))) 82 87 -
trunk/src/VBox/Additions/WINNT/Graphics/Miniport/wddm/VBoxVideoWddm.cpp
r32877 r32889 214 214 * Set the current mode into the hardware. 215 215 */ 216 NTSTATUS Status= vboxWddmDisplaySettingsQueryPos(pDevExt, VidPnSourceId, &pSource->VScreenPos);217 Assert(Status == STATUS_SUCCESS);218 Status = vboxWddmGhDisplaySetMode(pDevExt, pAllocation);216 // NTSTATUS Status= vboxWddmDisplaySettingsQueryPos(pDevExt, VidPnSourceId, &pSource->VScreenPos); 217 // Assert(Status == STATUS_SUCCESS); 218 NTSTATUS Status = vboxWddmGhDisplaySetMode(pDevExt, pAllocation); 219 219 Assert(Status == STATUS_SUCCESS); 220 220 if (Status == STATUS_SUCCESS) … … 886 886 } 887 887 888 if (pDevExt->b SetNotifyDxDpc)889 { 890 Assert(bNeedDpc == TRUE);891 pDevExt->bNotifyDxDpc = TRUE;892 pDevExt->bSetNotifyDxDpc = FALSE;888 if (pDevExt->bNotifyDxDpc) 889 { 890 // Assert(bNeedDpc == TRUE); 891 // pDevExt->bNotifyDxDpc = TRUE; 892 // pDevExt->bSetNotifyDxDpc = FALSE; 893 893 bNeedDpc = TRUE; 894 894 } … … 1442 1442 // } 1443 1443 //#endif 1444 case VBOXWDDM_ALLOC_TYPE_UMD_HGSMI_BUFFER: 1445 { 1446 ObDereferenceObject(pAllocation->pSynchEvent); 1447 break; 1448 } 1444 1449 default: 1445 1450 break; … … 1472 1477 if (pAllocation) 1473 1478 { 1474 pAllocation->enmType = pAllocInfo->enmType;1475 pAllocation->fRcFlags = pAllocInfo->fFlags;1476 pAllocation->offVram = VBOXVIDEOOFFSET_VOID;1477 pAllocation->SurfDesc = pAllocInfo->SurfDesc;1478 pAllocation->bVisible = FALSE;1479 pAllocation->bAssigned = FALSE;1480 1481 1479 pAllocationInfo->pPrivateDriverData = NULL; 1482 1480 pAllocationInfo->PrivateDriverDataSize = 0; 1483 1481 pAllocationInfo->Alignment = 0; 1484 pAllocationInfo->Size = pAllocInfo->SurfDesc.cbSize;1485 1482 pAllocationInfo->PitchAlignedSize = 0; 1486 1483 pAllocationInfo->HintedBank.Value = 0; … … 1495 1492 pAllocationInfo->AllocationPriority = D3DDDI_ALLOCATIONPRIORITY_NORMAL; 1496 1493 1494 pAllocation->enmType = pAllocInfo->enmType; 1495 pAllocation->offVram = VBOXVIDEOOFFSET_VOID; 1496 pAllocation->bVisible = FALSE; 1497 pAllocation->bAssigned = FALSE; 1498 1497 1499 switch (pAllocInfo->enmType) 1498 1500 { 1499 1501 case VBOXWDDM_ALLOC_TYPE_STD_SHAREDPRIMARYSURFACE: 1502 case VBOXWDDM_ALLOC_TYPE_UMD_RC_GENERIC: 1503 case VBOXWDDM_ALLOC_TYPE_STD_SHADOWSURFACE: 1504 case VBOXWDDM_ALLOC_TYPE_STD_STAGINGSURFACE: 1505 { 1506 pAllocation->fRcFlags = pAllocInfo->fFlags; 1507 pAllocation->SurfDesc = pAllocInfo->SurfDesc; 1508 1509 pAllocationInfo->Size = pAllocInfo->SurfDesc.cbSize; 1510 1511 switch (pAllocInfo->enmType) 1512 { 1513 case VBOXWDDM_ALLOC_TYPE_STD_SHAREDPRIMARYSURFACE: 1500 1514 #if 0 //defined(VBOXWDDM_RENDER_FROM_SHADOW) 1501 pAllocationInfo->SupportedReadSegmentSet = 2;1502 pAllocationInfo->SupportedWriteSegmentSet = 2;1515 pAllocationInfo->SupportedReadSegmentSet = 2; 1516 pAllocationInfo->SupportedWriteSegmentSet = 2; 1503 1517 #endif 1504 1518 #ifndef VBOXWDDM_RENDER_FROM_SHADOW 1505 pAllocationInfo->Flags.CpuVisible = 1;1519 pAllocationInfo->Flags.CpuVisible = 1; 1506 1520 #endif 1507 break; 1508 case VBOXWDDM_ALLOC_TYPE_UMD_RC_GENERIC: 1509 // Assert(pResource); 1510 // if (pResource) 1511 { 1512 // Assert(pResource->cAllocations); 1513 // if (pResource->cAllocations) 1514 { 1521 break; 1522 case VBOXWDDM_ALLOC_TYPE_UMD_RC_GENERIC: 1515 1523 #ifdef VBOX_WITH_VIDEOHWACCEL 1516 1524 if (pAllocInfo->fFlags.Overlay) … … 1544 1552 } 1545 1553 } 1546 } 1547 // else 1548 // Status = STATUS_INVALID_PARAMETER; 1554 break; 1555 case VBOXWDDM_ALLOC_TYPE_STD_SHADOWSURFACE: 1556 case VBOXWDDM_ALLOC_TYPE_STD_STAGINGSURFACE: 1557 pAllocationInfo->Flags.CpuVisible = 1; 1558 break; 1559 } 1560 1561 if (Status == STATUS_SUCCESS) 1562 { 1563 pAllocation->UsageHint.Version = 0; 1564 pAllocation->UsageHint.v1.Flags.Value = 0; 1565 pAllocation->UsageHint.v1.Format = pAllocInfo->SurfDesc.format; 1566 pAllocation->UsageHint.v1.SwizzledFormat = 0; 1567 pAllocation->UsageHint.v1.ByteOffset = 0; 1568 pAllocation->UsageHint.v1.Width = pAllocation->SurfDesc.width; 1569 pAllocation->UsageHint.v1.Height = pAllocation->SurfDesc.height; 1570 pAllocation->UsageHint.v1.Pitch = pAllocation->SurfDesc.pitch; 1571 pAllocation->UsageHint.v1.Depth = 0; 1572 pAllocation->UsageHint.v1.SlicePitch = 0; 1573 1574 Assert(!pAllocationInfo->pAllocationUsageHint); 1575 pAllocationInfo->pAllocationUsageHint = &pAllocation->UsageHint; 1576 } 1577 1578 break; 1579 } 1580 case VBOXWDDM_ALLOC_TYPE_UMD_HGSMI_BUFFER: 1581 { 1582 pAllocationInfo->Size = pAllocInfo->cbBuffer; 1583 pAllocation->enmSynchType = pAllocInfo->enmSynchType; 1584 pAllocation->SurfDesc.cbSize = pAllocInfo->cbBuffer; 1585 pAllocationInfo->Flags.CpuVisible = 1; 1586 pAllocationInfo->Flags.SynchronousPaging = 1; 1587 pAllocationInfo->AllocationPriority = D3DDDI_ALLOCATIONPRIORITY_MAXIMUM; 1588 switch (pAllocInfo->enmSynchType) 1589 { 1590 case VBOXUHGSMI_SYNCHOBJECT_TYPE_EVENT: 1591 Status = ObReferenceObjectByHandle(pAllocInfo->hSynch, EVENT_MODIFY_STATE, *ExEventObjectType, UserMode, 1592 (PVOID*)&pAllocation->pSynchEvent, 1593 NULL); 1594 Assert(Status == STATUS_SUCCESS); 1595 break; 1596 case VBOXUHGSMI_SYNCHOBJECT_TYPE_SEMAPHORE: 1597 Status = ObReferenceObjectByHandle(pAllocInfo->hSynch, EVENT_MODIFY_STATE, *ExSemaphoreObjectType, UserMode, 1598 (PVOID*)&pAllocation->pSynchSemaphore, 1599 NULL); 1600 Assert(Status == STATUS_SUCCESS); 1601 break; 1602 default: 1603 drprintf((__FUNCTION__ ": ERROR: invalid synch info type(%d)\n", pAllocInfo->enmSynchType)); 1604 AssertBreakpoint(); 1605 Status = STATUS_INVALID_PARAMETER; 1606 break; 1549 1607 } 1550 1608 break; 1551 case VBOXWDDM_ALLOC_TYPE_STD_SHADOWSURFACE: 1552 case VBOXWDDM_ALLOC_TYPE_STD_STAGINGSURFACE: 1553 pAllocationInfo->Flags.CpuVisible = 1; 1554 break; 1609 } 1610 1555 1611 default: 1556 1612 drprintf((__FUNCTION__ ": ERROR: invalid alloc info type(%d)\n", pAllocInfo->enmType)); … … 1558 1614 Status = STATUS_INVALID_PARAMETER; 1559 1615 break; 1560 } 1561 1562 if (Status == STATUS_SUCCESS) 1563 { 1564 pAllocation->UsageHint.Version = 0; 1565 pAllocation->UsageHint.v1.Flags.Value = 0; 1566 pAllocation->UsageHint.v1.Format = pAllocInfo->SurfDesc.format; 1567 pAllocation->UsageHint.v1.SwizzledFormat = 0; 1568 pAllocation->UsageHint.v1.ByteOffset = 0; 1569 pAllocation->UsageHint.v1.Width = pAllocation->SurfDesc.width; 1570 pAllocation->UsageHint.v1.Height = pAllocation->SurfDesc.height; 1571 pAllocation->UsageHint.v1.Pitch = pAllocation->SurfDesc.pitch; 1572 pAllocation->UsageHint.v1.Depth = 0; 1573 pAllocation->UsageHint.v1.SlicePitch = 0; 1574 1575 Assert(!pAllocationInfo->pAllocationUsageHint); 1576 pAllocationInfo->pAllocationUsageHint = &pAllocation->UsageHint; 1577 } 1578 else 1616 1617 } 1618 1619 if (Status != STATUS_SUCCESS) 1579 1620 vboxWddmAllocationDeleteFromResource(pResource, pAllocation); 1580 1621 } … … 1993 2034 if (pAllocationList->SegmentId) 1994 2035 { 1995 DXGK_ALLOCATIONLIST *pAllocation2Patch = (DXGK_ALLOCATIONLIST*) pPrivateBuf + pPatchList->PatchOffset;2036 DXGK_ALLOCATIONLIST *pAllocation2Patch = (DXGK_ALLOCATIONLIST*)(pPrivateBuf + pPatchList->PatchOffset); 1996 2037 pAllocation2Patch->SegmentId = pAllocationList->SegmentId; 1997 2038 pAllocation2Patch->PhysicalAddress = pAllocationList->PhysicalAddress; … … 2124 2165 DECLCALLBACK(VOID) vboxWddmDmaCompleteChromiumCmd(PDEVICE_EXTENSION pDevExt, PVBOXVDMADDI_CMD pCmd, PVOID pvContext) 2125 2166 { 2126 PVBOXVDMACBUF_DR pDr = ( pDr)pvContext;2167 PVBOXVDMACBUF_DR pDr = (PVBOXVDMACBUF_DR)pvContext; 2127 2168 PVBOXVDMACMD pHdr = VBOXVDMACBUF_DR_TAIL(pDr, VBOXVDMACMD); 2128 2169 UINT cBufs = pHdr->u32CmdSpecific; … … 2342 2383 pDr->fFlags = VBOXVDMACBUF_FLAG_BUF_FOLLOWS_DR; 2343 2384 pDr->cbBuf = cbCmd; 2344 pDr->u32FenceId = pSubmitCommand->SubmissionFenceId;2345 2385 pDr->rc = VERR_NOT_IMPLEMENTED; 2346 pDr->u64GuestContext = (uint64_t)pContext;2347 2386 2348 2387 PVBOXVDMACMD pHdr = VBOXVDMACBUF_DR_TAIL(pDr, VBOXVDMACMD); … … 2363 2402 PVBOXVDMADDI_CMD pDdiCmd = VBOXVDMADDI_CMD_FROM_BUF_DR(pDr); 2364 2403 vboxVdmaDdiCmdInit(pDdiCmd, pSubmitCommand->SubmissionFenceId, pContext, vboxWddmDmaCompleteChromiumCmd, pDr); 2365 NTSTATUS Status = vboxVdmaDdiCmdSubmitted(pDevExt, &pDevExt->DdiCmdQueue, &pCmd->DdiCmd);2404 NTSTATUS Status = vboxVdmaDdiCmdSubmitted(pDevExt, &pDevExt->DdiCmdQueue, pDdiCmd); 2366 2405 Assert(Status == STATUS_SUCCESS); 2367 2406 if (Status == STATUS_SUCCESS) … … 2378 2417 Assert(Status == STATUS_SUCCESS); 2379 2418 #endif 2419 break; 2380 2420 } 2381 2421 case VBOXVDMACMD_TYPE_DMA_PRESENT_FLIP: … … 2442 2482 { 2443 2483 AssertBreakpoint(); 2444 #if def VBOX_WITH_VDMA2484 #if 0 //def VBOX_WITH_VDMA 2445 2485 VBOXWDDM_DMA_PRIVATEDATA_PRESENTHDR *pPrivateData = (VBOXWDDM_DMA_PRIVATEDATA_PRESENTHDR*)pPrivateDataBase; 2446 2486 PVBOXVDMACBUF_DR pDr = vboxVdmaCBufDrCreate (&pDevExt->u.primary.Vdma, 0); … … 3434 3474 pSource->offVram = VBOXVIDEOOFFSET_VOID; 3435 3475 #endif 3476 Status= vboxWddmDisplaySettingsQueryPos(pDevExt, pSetVidPnSourceAddress->VidPnSourceId, &pSource->VScreenPos); 3477 Assert(Status == STATUS_SUCCESS); 3436 3478 /* should not generally happen, but still inform host*/ 3437 3479 Status = vboxWddmGhDisplaySetInfo(pDevExt, pSource, pSetVidPnSourceAddress->VidPnSourceId); … … 3500 3542 pSource->offVram = VBOXVIDEOOFFSET_VOID; 3501 3543 #endif 3502 #if 0 /* tmp */ 3544 Status= vboxWddmDisplaySettingsQueryPos(pDevExt, pSetVidPnSourceVisibility->VidPnSourceId, &pSource->VScreenPos); 3545 Assert(Status == STATUS_SUCCESS); 3503 3546 Status = vboxWddmGhDisplaySetInfo(pDevExt, pSource, pSetVidPnSourceVisibility->VidPnSourceId); 3504 3547 Assert(Status == STATUS_SUCCESS); 3505 3548 if (Status != STATUS_SUCCESS) 3506 3549 drprintf((__FUNCTION__": vboxWddmGhDisplaySetInfo failed, Status (0x%x)\n", Status)); 3507 #endif3508 3550 } 3509 3551 } … … 4579 4621 int rc = vboxVhwaHlpOverlayUpdate(pOverlay, &pUpdateOverlay->OverlayInfo); 4580 4622 AssertRC(rc); 4581 if (RT_FAILURE(rc)) 4623 if (RT_SUCCESS(rc)) 4624 { 4625 RECT DstRect; 4626 vboxVhwaHlpOverlayDstRectGet(pOverlay->pDevExt, pOverlay, &DstRect); 4627 Status = vboxVdmaHlpUpdatePrimary(pOverlay->pDevExt, pOverlay->VidPnSourceId, &DstRect); 4628 Assert(Status == STATUS_SUCCESS); 4629 } 4630 else 4582 4631 Status = STATUS_UNSUCCESSFUL; 4583 4632 … … 4668 4717 { 4669 4718 pDevExt->aSources[i].offVram = VBOXVIDEOOFFSET_VOID; 4719 Status= vboxWddmDisplaySettingsQueryPos(pDevExt, i, &pDevExt->aSources[i].VScreenPos); 4720 Assert(Status == STATUS_SUCCESS); 4670 4721 } 4671 4722 }
Note:
See TracChangeset
for help on using the changeset viewer.