Changeset 26050 in vbox for trunk/src/VBox/Additions/WINNT/Graphics
- Timestamp:
- Jan 26, 2010 3:27:55 PM (15 years ago)
- Location:
- trunk/src/VBox/Additions/WINNT/Graphics/Miniport
- Files:
-
- 1 added
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Additions/WINNT/Graphics/Miniport/Makefile.kmk
r25980 r26050 82 82 VBoxVideo.cpp \ 83 83 wddm/VBoxVideoWddm.cpp \ 84 wddm/VBoxVideoVidPn.cpp \ 84 85 wddm/VBoxVideoWddm.def \ 85 86 wddm/VBoxVideoWddm.rc -
trunk/src/VBox/Additions/WINNT/Graphics/Miniport/VBoxVideo.h
r26000 r26050 485 485 ); 486 486 RT_C_DECLS_END 487 488 NTSTATUS vboxVidPnCheckTopology(const D3DKMDT_HVIDPN hDesiredVidPn, 489 D3DKMDT_HVIDPNTOPOLOGY hVidPnTopology, const DXGK_VIDPNTOPOLOGY_INTERFACE* pVidPnTopologyInterface, 490 BOOLEAN *pbSupported); 491 492 NTSTATUS vboxVidPnCheckSourceModeInfo(const D3DKMDT_HVIDPN hDesiredVidPn, 493 const D3DKMDT_VIDPN_SOURCE_MODE *pNewVidPnSourceModeInfo, 494 BOOLEAN *pbSupported); 495 496 NTSTATUS vboxVidPnCheckSourceModeSet(const D3DKMDT_HVIDPN hDesiredVidPn, 497 D3DKMDT_HVIDPNSOURCEMODESET hNewVidPnSourceModeSet, const DXGK_VIDPNSOURCEMODESET_INTERFACE *pVidPnSourceModeSetInterface, 498 BOOLEAN *pbSupported); 499 500 NTSTATUS vboxVidPnCheckTargetModeInfo(const D3DKMDT_HVIDPN hDesiredVidPn, 501 const D3DKMDT_VIDPN_TARGET_MODE *pNewVidPnTargetModeInfo, 502 BOOLEAN *pbSupported); 503 504 NTSTATUS vboxVidPnCheckTargetModeSet(const D3DKMDT_HVIDPN hDesiredVidPn, 505 D3DKMDT_HVIDPNTARGETMODESET hNewVidPnTargetModeSet, const DXGK_VIDPNTARGETMODESET_INTERFACE *pVidPnTargetModeSetInterface, 506 BOOLEAN *pbSupported); 487 507 #endif 488 508 -
trunk/src/VBox/Additions/WINNT/Graphics/Miniport/wddm/VBoxVideoWddm.cpp
r26041 r26050 68 68 PCM_RESOURCE_LIST pRcList = pDeviceInfo->TranslatedResourceList; 69 69 /* @todo: verify resources */ 70 for (ULONG i = 0; i < pRcList->Count; ++i)70 for (ULONG i = 0; i < pRcList->Count; ++i) 71 71 { 72 72 PCM_FULL_RESOURCE_DESCRIPTOR pFRc = &pRcList->List[i]; 73 for (ULONG j = 0; j < pFRc->PartialResourceList.Count; ++j)73 for (ULONG j = 0; j < pFRc->PartialResourceList.Count; ++j) 74 74 { 75 75 PCM_PARTIAL_RESOURCE_DESCRIPTOR pPRc = &pFRc->PartialResourceList.PartialDescriptors[j]; 76 switch (pPRc->Type)76 switch (pPRc->Type) 77 77 { 78 78 case CmResourceTypePort: … … 125 125 126 126 PDEVICE_EXTENSION pContext = (PDEVICE_EXTENSION)vboxWddmMemAllocZero(sizeof(DEVICE_EXTENSION)); 127 if (pContext)127 if (pContext) 128 128 { 129 129 *MiniportDeviceContext = pContext; … … 171 171 DXGK_DEVICE_INFO DeviceInfo; 172 172 Status = pContext->u.primary.DxgkInterface.DxgkCbGetDeviceInformation (pContext->u.primary.DxgkInterface.DeviceHandle, &DeviceInfo); 173 if (Status == STATUS_SUCCESS)173 if (Status == STATUS_SUCCESS) 174 174 { 175 175 ULONG AdapterMemorySize; 176 176 Status = vboxWddmPickResources(pContext, &DeviceInfo, &AdapterMemorySize); 177 if (Status == STATUS_SUCCESS)177 if (Status == STATUS_SUCCESS) 178 178 { 179 179 /* Initialize VBoxGuest library, which is used for requests which go through VMMDev. */ … … 270 270 271 271 dfprintf(("==> "__FUNCTION__ ", context(0x%x)\n", MiniportDeviceContext)); 272 for (ULONG i = 0; i < ChildRelationsSize; i++)272 for (ULONG i = 0; i < ChildRelationsSize; i++) 273 273 { 274 274 ChildRelations[i].ChildDeviceType = TypeVideoOutput; … … 296 296 297 297 NTSTATUS Status = STATUS_SUCCESS; 298 switch (ChildStatus->Type)298 switch (ChildStatus->Type) 299 299 { 300 300 case StatusConnection: … … 372 372 ) 373 373 { 374 374 /* DxgkDdiResetDevice can be called at any IRQL, so it must be in nonpageable memory. */ 375 dfprintf(("==> "__FUNCTION__ ", context(0x%x)\n", MiniportDeviceContext)); 376 dfprintf(("<== "__FUNCTION__ ", context(0x%x)\n", MiniportDeviceContext)); 375 377 } 376 378 … … 379 381 ) 380 382 { 381 383 /* DxgkDdiUnload should be made pageable. */ 384 PAGED_CODE(); 385 dfprintf(("==> "__FUNCTION__ "\n")); 386 dfprintf(("<== "__FUNCTION__ "\n")); 382 387 } 383 388 … … 578 583 PAGED_CODE(); 579 584 580 /* @todo: implement a check */ 581 pIsSupportedVidPnArg->IsVidPnSupported = TRUE; 585 dfprintf(("==> "__FUNCTION__ ", context(0x%x)\n", hAdapter)); 586 587 PDEVICE_EXTENSION pContext = (PDEVICE_EXTENSION)hAdapter; 588 BOOLEAN bSupported = TRUE; 589 const DXGK_VIDPN_INTERFACE* pVidPnInterface = NULL; 590 NTSTATUS Status = pContext->u.primary.DxgkInterface.DxgkCbQueryVidPnInterface(pIsSupportedVidPnArg->hDesiredVidPn, DXGK_VIDPN_INTERFACE_VERSION_V1, &pVidPnInterface); 591 if (Status == STATUS_SUCCESS) 592 { 593 D3DKMDT_HVIDPNTOPOLOGY hVidPnTopology; 594 const DXGK_VIDPNTOPOLOGY_INTERFACE* pVidPnTopologyInterface; 595 Status = pVidPnInterface->pfnGetTopology(pIsSupportedVidPnArg->hDesiredVidPn, &hVidPnTopology, &pVidPnTopologyInterface); 596 if (Status == STATUS_SUCCESS) 597 { 598 Status = vboxVidPnCheckTopology(pIsSupportedVidPnArg->hDesiredVidPn, hVidPnTopology, pVidPnTopologyInterface, &bSupported); 599 if (Status == STATUS_SUCCESS && bSupported) 600 { 601 for (int id = 0; id < pContext->u.primary.cDisplays; id++) 602 { 603 D3DKMDT_HVIDPNSOURCEMODESET hNewVidPnSourceModeSet; 604 const DXGK_VIDPNSOURCEMODESET_INTERFACE *pVidPnSourceModeSetInterface; 605 Status = pVidPnInterface->pfnAcquireSourceModeSet(pIsSupportedVidPnArg->hDesiredVidPn, 606 id, 607 &hNewVidPnSourceModeSet, 608 &pVidPnSourceModeSetInterface); 609 if (Status == STATUS_SUCCESS) 610 { 611 Status = vboxVidPnCheckSourceModeSet(pIsSupportedVidPnArg->hDesiredVidPn, hNewVidPnSourceModeSet, pVidPnSourceModeSetInterface, &bSupported); 612 613 pVidPnInterface->pfnReleaseSourceModeSet(pIsSupportedVidPnArg->hDesiredVidPn, hNewVidPnSourceModeSet); 614 615 if (Status != STATUS_SUCCESS || !bSupported) 616 break; 617 } 618 else if (Status == STATUS_GRAPHICS_INVALID_VIDEO_PRESENT_SOURCE) 619 { 620 drprintf(("VBoxVideoWddm: Warning: pfnAcquireSourceModeSet returned STATUS_GRAPHICS_INVALID_VIDEO_PRESENT_SOURCE, continuing\n")); 621 Status = STATUS_SUCCESS; 622 } 623 else 624 { 625 drprintf(("VBoxVideoWddm: pfnAcquireSourceModeSet failed Status(0x%x)\n")); 626 break; 627 } 628 } 629 630 if (Status == STATUS_SUCCESS && bSupported) 631 { 632 for (int id = 0; id < pContext->u.primary.cDisplays; id++) 633 { 634 D3DKMDT_HVIDPNTARGETMODESET hNewVidPnTargetModeSet; 635 CONST DXGK_VIDPNTARGETMODESET_INTERFACE *pVidPnTargetModeSetInterface; 636 Status = pVidPnInterface->pfnAcquireTargetModeSet(pIsSupportedVidPnArg->hDesiredVidPn, 637 id, /*__in CONST D3DDDI_VIDEO_PRESENT_SOURCE_ID VidPnSourceId */ 638 &hNewVidPnTargetModeSet, 639 &pVidPnTargetModeSetInterface); 640 if (Status == STATUS_SUCCESS) 641 { 642 Status = vboxVidPnCheckTargetModeSet(pIsSupportedVidPnArg->hDesiredVidPn, hNewVidPnTargetModeSet, pVidPnTargetModeSetInterface, &bSupported); 643 644 pVidPnInterface->pfnReleaseTargetModeSet(pIsSupportedVidPnArg->hDesiredVidPn, hNewVidPnTargetModeSet); 645 646 if (Status != STATUS_SUCCESS || !bSupported) 647 break; 648 } 649 else if (Status == STATUS_GRAPHICS_INVALID_VIDEO_PRESENT_SOURCE) 650 { 651 drprintf(("VBoxVideoWddm: Warning: pfnAcquireSourceModeSet returned STATUS_GRAPHICS_INVALID_VIDEO_PRESENT_SOURCE, continuing\n")); 652 Status = STATUS_SUCCESS; 653 } 654 else 655 { 656 drprintf(("VBoxVideoWddm: pfnAcquireSourceModeSet failed Status(0x%x)\n")); 657 break; 658 } 659 } 660 } 661 } 662 } 663 else 664 { 665 drprintf(("VBoxVideoWddm: pfnGetTopology failed Status(0x%x)\n")); 666 } 667 } 668 else 669 { 670 drprintf(("VBoxVideoWddm: DxgkCbQueryVidPnInterface failed Status(0x%x)\n")); 671 } 672 pIsSupportedVidPnArg->IsVidPnSupported = bSupported; 673 674 dfprintf(("<== "__FUNCTION__ ", status(0x%x), context(0x%x)\n", Status, hAdapter)); 675 582 676 return STATUS_SUCCESS; 583 677 } … … 598 692 const DXGK_VIDPN_INTERFACE* pVidPnInterface = NULL; 599 693 NTSTATUS Status = pContext->u.primary.DxgkInterface.DxgkCbQueryVidPnInterface(pRecommendFunctionalVidPnArg->hRecommendedFunctionalVidPn, DXGK_VIDPN_INTERFACE_VERSION_V1, &pVidPnInterface); 600 if (Status == STATUS_SUCCESS)694 if (Status == STATUS_SUCCESS) 601 695 { 602 696 D3DKMDT_HVIDPNTOPOLOGY hVidPnTopology; 603 697 const DXGK_VIDPNTOPOLOGY_INTERFACE* pVidPnTopologyInterface; 604 698 Status = pVidPnInterface->pfnGetTopology(pRecommendFunctionalVidPnArg->hRecommendedFunctionalVidPn, &hVidPnTopology, &pVidPnTopologyInterface); 605 if (Status == STATUS_SUCCESS)699 if (Status == STATUS_SUCCESS) 606 700 { 607 701 D3DKMDT_VIDPN_PRESENT_PATH *pNewVidPnPresentPathInfo; 608 702 Status = pVidPnTopologyInterface->pfnCreateNewPathInfo(hVidPnTopology, &pNewVidPnPresentPathInfo); 609 if (Status == STATUS_SUCCESS)703 if (Status == STATUS_SUCCESS) 610 704 { 611 705 pNewVidPnPresentPathInfo->VidPnSourceId = 0; … … 640 734 pNewVidPnPresentPathInfo->GammaRamp.DataSize = 0; 641 735 Status = pVidPnTopologyInterface->pfnAddPath(hVidPnTopology, pNewVidPnPresentPathInfo); 642 if (Status == STATUS_SUCCESS)736 if (Status == STATUS_SUCCESS) 643 737 { 644 738 D3DKMDT_HVIDPNSOURCEMODESET hNewVidPnSourceModeSet; … … 648 742 &hNewVidPnSourceModeSet, 649 743 &pVidPnSourceModeSetInterface); 650 if (Status == STATUS_SUCCESS)744 if (Status == STATUS_SUCCESS) 651 745 { 652 746 D3DKMDT_VIDPN_SOURCE_MODE *pNewVidPnSourceModeInfo; 653 747 Status = pVidPnSourceModeSetInterface->pfnCreateNewModeInfo(hNewVidPnSourceModeSet, &pNewVidPnSourceModeInfo); 654 if (Status == STATUS_SUCCESS)748 if (Status == STATUS_SUCCESS) 655 749 { 656 750 D3DKMDT_VIDEO_PRESENT_SOURCE_MODE_ID modeId = pNewVidPnSourceModeInfo->Id; … … 665 759 pNewVidPnSourceModeInfo->Format.Graphics.PixelValueAccessMode = D3DKMDT_PVAM_DIRECT; 666 760 Status = pVidPnSourceModeSetInterface->pfnAddMode(hNewVidPnSourceModeSet, pNewVidPnSourceModeInfo); 667 if (Status == STATUS_SUCCESS)761 if (Status == STATUS_SUCCESS) 668 762 { 669 763 Status = pVidPnSourceModeSetInterface->pfnPinMode(hNewVidPnSourceModeSet, modeId); 670 if (Status == STATUS_SUCCESS)764 if (Status == STATUS_SUCCESS) 671 765 { 672 766 D3DKMDT_HVIDPNTARGETMODESET hNewVidPnTargetModeSet; … … 676 770 &hNewVidPnTargetModeSet, 677 771 &pVidPnTargetModeSetInterface); 678 if (Status == STATUS_SUCCESS)772 if (Status == STATUS_SUCCESS) 679 773 { 680 774 D3DKMDT_VIDPN_TARGET_MODE *pNewVidPnTargetModeInfo; 681 775 Status = pVidPnTargetModeSetInterface->pfnCreateNewModeInfo(hNewVidPnTargetModeSet, &pNewVidPnTargetModeInfo); 682 if (Status == STATUS_SUCCESS)776 if (Status == STATUS_SUCCESS) 683 777 { 684 778 D3DKMDT_VIDEO_PRESENT_TARGET_MODE_ID targetId = pNewVidPnTargetModeInfo->Id; … … 695 789 pNewVidPnTargetModeInfo->Preference = D3DKMDT_MP_PREFERRED; 696 790 Status = pVidPnTargetModeSetInterface->pfnAddMode(hNewVidPnTargetModeSet, pNewVidPnTargetModeInfo); 697 if (Status == STATUS_SUCCESS)791 if (Status == STATUS_SUCCESS) 698 792 { 699 793 Status = pVidPnTargetModeSetInterface->pfnPinMode(hNewVidPnTargetModeSet, targetId); 700 if (Status == STATUS_SUCCESS)794 if (Status == STATUS_SUCCESS) 701 795 { 702 796
Note:
See TracChangeset
for help on using the changeset viewer.