Changeset 32889 in vbox for trunk/src/VBox/Additions/WINNT/Graphics/Miniport/wddm/VBoxVideoWddm.cpp
- Timestamp:
- Oct 4, 2010 11:14:12 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
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.