Changeset 27239 in vbox for trunk/src/VBox/Additions/WINNT
- Timestamp:
- Mar 10, 2010 10:35:04 AM (15 years ago)
- svn:sync-xref-src-repo-rev:
- 58623
- Location:
- trunk/src/VBox/Additions/WINNT/Graphics/Miniport
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Additions/WINNT/Graphics/Miniport/Helper.cpp
r27201 r27239 124 124 if (RT_FAILURE(rc)) 125 125 { 126 #ifndef DEBUG_misha 126 127 dprintf(("VBoxVideo::vboxLikesVideoMode: ERROR allocating request, rc = %Rrc\n", rc)); 128 #else 129 /* @todo: fixme: remove this ifdef*/ 130 #endif 127 131 /* Most likely the VBoxGuest driver is not loaded. 128 132 * To get at least the video working, report the mode as supported. … … 147 151 VbglGRFree(&req->header); 148 152 } 149 153 #ifndef DEBUG_misha 150 154 dprintf(("VBoxVideo::vboxLikesVideoMode: width: %d, height: %d, bpp: %d -> %s\n", width, height, bpp, (bRC == 1) ? "OK" : "FALSE")); 155 #else 156 /* @todo: fixme: remove this ifdef*/ 157 #endif 158 151 159 return bRC; 152 160 } … … 156 164 ULONG retHeight = 0; 157 165 166 #ifndef DEBUG_misha 158 167 dprintf(("VBoxVideo::vboxGetHeightReduction\n")); 168 #endif 159 169 160 170 VMMDevGetHeightReductionRequest *req = NULL; … … 163 173 if (RT_FAILURE(rc)) 164 174 { 175 #ifndef DEBUG_misha 165 176 dprintf(("VBoxVideo::vboxGetHeightReduction: ERROR allocating request, rc = %Rrc\n", rc)); 177 #endif 166 178 } 167 179 else -
trunk/src/VBox/Additions/WINNT/Graphics/Miniport/VBoxVideo.cpp
r27214 r27239 1175 1175 xres, yres, bpp)); 1176 1176 } 1177 #if def LOG_ENABLED1177 #if defined(LOG_ENABLED) && !defined(DEBUG_misha) 1178 1178 { 1179 1179 int i; -
trunk/src/VBox/Additions/WINNT/Graphics/Miniport/wddm/VBoxVideoVidPn.cpp
r27238 r27239 635 635 } 636 636 637 NTSTATUS vboxVidPnCreatePopulateSourceModeSetFromLegacy(PDEVICE_EXTENSION pDevExt, const D3DKMDT_HVIDPN hDesiredVidPn, const DXGK_VIDPN_INTERFACE* pVidPnInterface, 638 D3DDDI_VIDEO_PRESENT_SOURCE_ID srcId, 639 VIDEO_MODE_INFORMATION *pModes, uint32_t cModes, uint32_t iPreferredMode) 640 { 641 D3DKMDT_HVIDPNSOURCEMODESET hNewVidPnSourceModeSet; 642 const DXGK_VIDPNSOURCEMODESET_INTERFACE *pNewVidPnSourceModeSetInterface; 643 NTSTATUS Status = pVidPnInterface->pfnCreateNewSourceModeSet(hDesiredVidPn, 644 srcId, /*__in CONST D3DDDI_VIDEO_PRESENT_SOURCE_ID VidPnSourceId */ 645 &hNewVidPnSourceModeSet, 646 &pNewVidPnSourceModeSetInterface); 647 Assert(Status == STATUS_SUCCESS); 648 if (Status == STATUS_SUCCESS) 649 { 650 Status = vboxVidPnPopulateSourceModeSetFromLegacy(pDevExt, 651 hNewVidPnSourceModeSet, pNewVidPnSourceModeSetInterface, 652 pModes, cModes, iPreferredMode); 653 Assert(Status == STATUS_SUCCESS); 654 if (Status == STATUS_SUCCESS) 655 { 656 Status = pVidPnInterface->pfnAssignSourceModeSet(hDesiredVidPn, 657 srcId, 658 hNewVidPnSourceModeSet); 659 Assert(Status == STATUS_SUCCESS); 660 if(Status != STATUS_SUCCESS) 661 { 662 drprintf((__FUNCTION__": pfnAssignSourceModeSet failed Status(0x%x)\n", Status)); 663 pVidPnInterface->pfnReleaseSourceModeSet(hDesiredVidPn, hNewVidPnSourceModeSet); 664 } 665 } 666 else 667 { 668 drprintf((__FUNCTION__": vboxVidPnPopulateSourceModeSetFromLegacy failed Status(0x%x)\n", Status)); 669 pVidPnInterface->pfnReleaseSourceModeSet(hDesiredVidPn, hNewVidPnSourceModeSet); 670 } 671 } 672 else 673 drprintf((__FUNCTION__": pfnCreateNewSourceModeSet failed Status(0x%x)\n", Status)); 674 return Status; 675 } 676 677 NTSTATUS vboxVidPnCreatePopulateTargetModeSetFromLegacy(PDEVICE_EXTENSION pDevExt, const D3DKMDT_HVIDPN hDesiredVidPn, const DXGK_VIDPN_INTERFACE* pVidPnInterface, 678 D3DDDI_VIDEO_PRESENT_TARGET_ID tgtId, 679 D3DKMDT_2DREGION *pResolutions, 680 uint32_t cResolutions, 681 VIDEO_MODE_INFORMATION *pPreferredMode) 682 { 683 D3DKMDT_HVIDPNTARGETMODESET hNewVidPnTargetModeSet; 684 const DXGK_VIDPNTARGETMODESET_INTERFACE *pNewVidPnTargetModeSetInterface; 685 NTSTATUS Status = pVidPnInterface->pfnCreateNewTargetModeSet(hDesiredVidPn, 686 tgtId, /*__in CONST D3DDDI_VIDEO_PRESENT_TARGET_ID VidPnTargetId */ 687 &hNewVidPnTargetModeSet, 688 &pNewVidPnTargetModeSetInterface); 689 Assert(Status == STATUS_SUCCESS); 690 if (Status == STATUS_SUCCESS) 691 { 692 Status = vboxVidPnPopulateTargetModeSetFromLegacy(pDevExt, 693 hNewVidPnTargetModeSet, pNewVidPnTargetModeSetInterface, 694 pResolutions, cResolutions, pPreferredMode); 695 Assert(Status == STATUS_SUCCESS); 696 if (Status == STATUS_SUCCESS) 697 { 698 Status = pVidPnInterface->pfnAssignTargetModeSet(hDesiredVidPn, 699 tgtId, 700 hNewVidPnTargetModeSet); 701 Assert(Status == STATUS_SUCCESS); 702 if(Status != STATUS_SUCCESS) 703 { 704 drprintf((__FUNCTION__": pfnAssignTargetModeSet failed Status(0x%x)\n", Status)); 705 pVidPnInterface->pfnReleaseTargetModeSet(hDesiredVidPn, hNewVidPnTargetModeSet); 706 } 707 } 708 else 709 { 710 drprintf((__FUNCTION__": vboxVidPnPopulateTargetModeSetFromLegacy failed Status(0x%x)\n", Status)); 711 pVidPnInterface->pfnReleaseTargetModeSet(hDesiredVidPn, hNewVidPnTargetModeSet); 712 } 713 } 714 else 715 drprintf((__FUNCTION__": pfnCreateNewTargetModeSet failed Status(0x%x)\n", Status)); 716 return Status; 717 718 } 719 720 NTSTATUS vboxVidPnCreatePopulateVidPnFromLegacy(PDEVICE_EXTENSION pDevExt, D3DKMDT_HVIDPN hVidPn, const DXGK_VIDPN_INTERFACE* pVidPnInterface, 721 VIDEO_MODE_INFORMATION *pModes, uint32_t cModes, uint32_t iPreferredMode, 722 D3DKMDT_2DREGION *pResolutions, uint32_t cResolutions) 723 { 724 NTSTATUS Status; 725 D3DKMDT_HVIDPNTOPOLOGY hVidPnTopology; 726 const DXGK_VIDPNTOPOLOGY_INTERFACE* pVidPnTopologyInterface; 727 Status = pVidPnInterface->pfnGetTopology(hVidPn, &hVidPnTopology, &pVidPnTopologyInterface); 728 if (Status == STATUS_SUCCESS) 729 { 730 D3DKMDT_VIDPN_PRESENT_PATH *pNewVidPnPresentPathInfo; 731 Status = pVidPnTopologyInterface->pfnCreateNewPathInfo(hVidPnTopology, &pNewVidPnPresentPathInfo); 732 if (Status == STATUS_SUCCESS) 733 { 734 pNewVidPnPresentPathInfo->VidPnSourceId = 0; 735 pNewVidPnPresentPathInfo->VidPnTargetId = 0; 736 pNewVidPnPresentPathInfo->ImportanceOrdinal = D3DKMDT_VPPI_PRIMARY; 737 pNewVidPnPresentPathInfo->ContentTransformation.Scaling = D3DKMDT_VPPS_IDENTITY; 738 memset(&pNewVidPnPresentPathInfo->ContentTransformation.ScalingSupport, 739 0, sizeof (pNewVidPnPresentPathInfo->ContentTransformation.ScalingSupport)); 740 pNewVidPnPresentPathInfo->ContentTransformation.ScalingSupport.Identity = 1; 741 pNewVidPnPresentPathInfo->ContentTransformation.ScalingSupport.Centered = 1; 742 pNewVidPnPresentPathInfo->ContentTransformation.ScalingSupport.Stretched = 0; 743 pNewVidPnPresentPathInfo->ContentTransformation.Rotation = D3DKMDT_VPPR_IDENTITY; 744 pNewVidPnPresentPathInfo->ContentTransformation.RotationSupport.Identity = 1; 745 pNewVidPnPresentPathInfo->ContentTransformation.RotationSupport.Rotate180 = 0; 746 pNewVidPnPresentPathInfo->ContentTransformation.RotationSupport.Rotate270 = 0; 747 pNewVidPnPresentPathInfo->ContentTransformation.RotationSupport.Rotate90 = 0; 748 pNewVidPnPresentPathInfo->VisibleFromActiveTLOffset.cx = 0; 749 pNewVidPnPresentPathInfo->VisibleFromActiveTLOffset.cy = 0; 750 pNewVidPnPresentPathInfo->VisibleFromActiveBROffset.cx = 0; 751 pNewVidPnPresentPathInfo->VisibleFromActiveBROffset.cy = 0; 752 pNewVidPnPresentPathInfo->VidPnTargetColorBasis = D3DKMDT_CB_SRGB; /* @todo: how does it matters? */ 753 pNewVidPnPresentPathInfo->VidPnTargetColorCoeffDynamicRanges.FirstChannel = 8; 754 pNewVidPnPresentPathInfo->VidPnTargetColorCoeffDynamicRanges.SecondChannel = 8; 755 pNewVidPnPresentPathInfo->VidPnTargetColorCoeffDynamicRanges.ThirdChannel = 8; 756 pNewVidPnPresentPathInfo->VidPnTargetColorCoeffDynamicRanges.FourthChannel = 0; 757 pNewVidPnPresentPathInfo->Content = D3DKMDT_VPPC_GRAPHICS; 758 pNewVidPnPresentPathInfo->CopyProtection.CopyProtectionType = D3DKMDT_VPPMT_NOPROTECTION; 759 pNewVidPnPresentPathInfo->CopyProtection.APSTriggerBits = 0; 760 memset(&pNewVidPnPresentPathInfo->CopyProtection.CopyProtectionSupport, 0, sizeof (pNewVidPnPresentPathInfo->CopyProtection.CopyProtectionSupport)); 761 pNewVidPnPresentPathInfo->CopyProtection.CopyProtectionSupport.NoProtection = 1; 762 pNewVidPnPresentPathInfo->GammaRamp.Type = D3DDDI_GAMMARAMP_DEFAULT; 763 pNewVidPnPresentPathInfo->GammaRamp.DataSize = 0; 764 Status = pVidPnTopologyInterface->pfnAddPath(hVidPnTopology, pNewVidPnPresentPathInfo); 765 if (Status == STATUS_SUCCESS) 766 { 767 Status = vboxVidPnCreatePopulateSourceModeSetFromLegacy(pDevExt, hVidPn, pVidPnInterface, 0, pModes, cModes, iPreferredMode); 768 Assert(Status == STATUS_SUCCESS); 769 if (Status == STATUS_SUCCESS) 770 { 771 Status = vboxVidPnCreatePopulateTargetModeSetFromLegacy(pDevExt, hVidPn, pVidPnInterface, 0, 772 pResolutions, cResolutions, &pModes[iPreferredMode]); 773 Assert(Status == STATUS_SUCCESS); 774 if (Status != STATUS_SUCCESS) 775 drprintf((__FUNCTION__": vboxVidPnCreatePopulateTargetModeSetFromLegacy failed Status(0x%x)\n", Status)); 776 } 777 else 778 drprintf((__FUNCTION__": vboxVidPnCreatePopulateSourceModeSetFromLegacy failed Status(0x%x)\n", Status)); 779 } 780 else 781 { 782 drprintf((__FUNCTION__": pfnAddPath failed Status(0x%x)\n", Status)); 783 pVidPnTopologyInterface->pfnReleasePathInfo(hVidPnTopology, pNewVidPnPresentPathInfo); 784 pNewVidPnPresentPathInfo = NULL; 785 } 786 } 787 else 788 { 789 drprintf((__FUNCTION__": pfnCreateNewPathInfo failed Status(0x%x)\n", Status)); 790 } 791 } 792 else 793 { 794 drprintf((__FUNCTION__": pfnGetTopology failed Status(0x%x)\n", Status)); 795 } 796 797 return Status; 798 } 637 799 638 800 DECLCALLBACK(BOOLEAN) vboxVidPnCofuncModalityPathEnum(PDEVICE_EXTENSION pDevExt, const D3DKMDT_HVIDPN hDesiredVidPn, const DXGK_VIDPN_INTERFACE* pVidPnInterface, … … 699 861 { 700 862 /* just create and populate the new source mode set for now */ 701 D3DKMDT_HVIDPNSOURCEMODESET hNewVidPnSourceModeSet; 702 const DXGK_VIDPNSOURCEMODESET_INTERFACE *pNewVidPnSourceModeSetInterface; 703 Status = pVidPnInterface->pfnCreateNewSourceModeSet(hDesiredVidPn, 704 pNewVidPnPresentPathInfo->VidPnSourceId, /*__in CONST D3DDDI_VIDEO_PRESENT_SOURCE_ID VidPnSourceId */ 705 &hNewVidPnSourceModeSet, 706 &pNewVidPnSourceModeSetInterface); 863 Status = vboxVidPnCreatePopulateSourceModeSetFromLegacy(pDevExt, hDesiredVidPn, pVidPnInterface, 864 pNewVidPnPresentPathInfo->VidPnSourceId, 865 pModes, cModes, iPreferredMode); 707 866 Assert(Status == STATUS_SUCCESS); 708 if (Status == STATUS_SUCCESS) 709 { 710 Status = vboxVidPnPopulateSourceModeSetFromLegacy(pDevExt, 711 hNewVidPnSourceModeSet, pNewVidPnSourceModeSetInterface, 712 pModes, cModes, iPreferredMode); 713 Assert(Status == STATUS_SUCCESS); 714 if (Status == STATUS_SUCCESS) 715 { 716 Status = pVidPnInterface->pfnAssignSourceModeSet(hDesiredVidPn, 717 pNewVidPnPresentPathInfo->VidPnSourceId, 718 hNewVidPnSourceModeSet); 719 Assert(Status == STATUS_SUCCESS); 720 if(Status != STATUS_SUCCESS) 721 { 722 drprintf((__FUNCTION__": pfnAssignSourceModeSet failed Status(0x%x)\n", Status)); 723 pVidPnInterface->pfnReleaseSourceModeSet(hDesiredVidPn, hNewVidPnSourceModeSet); 724 } 725 } 726 else 727 { 728 drprintf((__FUNCTION__": vboxVidPnPopulateSourceModeSetFromLegacy failed Status(0x%x)\n", Status)); 729 pVidPnInterface->pfnReleaseSourceModeSet(hDesiredVidPn, hNewVidPnSourceModeSet); 730 } 731 } 732 else 733 drprintf((__FUNCTION__": pfnCreateNewSourceModeSet failed Status(0x%x)\n", Status)); 867 if (Status != STATUS_SUCCESS) 868 drprintf((__FUNCTION__": vboxVidPnCreatePopulateSourceModeSetFromLegacy failed Status(0x%x)\n", Status)); 734 869 } 735 870 else … … 771 906 { 772 907 /* just create and populate a new target mode info for now */ 773 D3DKMDT_HVIDPNTARGETMODESET hNewVidPnTargetModeSet; 774 const DXGK_VIDPNTARGETMODESET_INTERFACE *pNewVidPnTargetModeSetInterface; 775 Status = pVidPnInterface->pfnCreateNewTargetModeSet(hDesiredVidPn, 776 pNewVidPnPresentPathInfo->VidPnTargetId, /*__in CONST D3DDDI_VIDEO_PRESENT_TARGET_ID VidPnTargetId */ 777 &hNewVidPnTargetModeSet, 778 &pNewVidPnTargetModeSetInterface); 908 Status = vboxVidPnCreatePopulateTargetModeSetFromLegacy(pDevExt, hDesiredVidPn, pVidPnInterface, 909 pNewVidPnPresentPathInfo->VidPnTargetId, 910 pResolutions, 911 cResolutions, 912 &pModes[iPreferredMode]); 779 913 Assert(Status == STATUS_SUCCESS); 780 if (Status == STATUS_SUCCESS) 781 { 782 Status = vboxVidPnPopulateTargetModeSetFromLegacy(pDevExt, 783 hNewVidPnTargetModeSet, pNewVidPnTargetModeSetInterface, 784 pResolutions, cResolutions, &pModes[iPreferredMode]); 785 Assert(Status == STATUS_SUCCESS); 786 if (Status == STATUS_SUCCESS) 787 { 788 Status = pVidPnInterface->pfnAssignTargetModeSet(hDesiredVidPn, 789 pNewVidPnPresentPathInfo->VidPnTargetId, 790 hNewVidPnTargetModeSet); 791 Assert(Status == STATUS_SUCCESS); 792 if(Status != STATUS_SUCCESS) 793 { 794 drprintf((__FUNCTION__": pfnAssignTargetModeSet failed Status(0x%x)\n", Status)); 795 pVidPnInterface->pfnReleaseTargetModeSet(hDesiredVidPn, hNewVidPnTargetModeSet); 796 } 797 } 798 else 799 { 800 drprintf((__FUNCTION__": vboxVidPnPopulateTargetModeSetFromLegacy failed Status(0x%x)\n", Status)); 801 pVidPnInterface->pfnReleaseTargetModeSet(hDesiredVidPn, hNewVidPnTargetModeSet); 802 } 803 } 914 if (Status != STATUS_SUCCESS) 915 drprintf((__FUNCTION__": vboxVidPnCreatePopulateTargetModeSetFromLegacy failed Status(0x%x)\n", Status)); 804 916 } 805 917 else … … 818 930 return Status == STATUS_SUCCESS; 819 931 } 932 820 933 821 934 NTSTATUS vboxVidPnEnumSourceModes(PDEVICE_EXTENSION pDevExt, const D3DKMDT_HVIDPN hDesiredVidPn, const DXGK_VIDPN_INTERFACE* pVidPnInterface, -
trunk/src/VBox/Additions/WINNT/Graphics/Miniport/wddm/VBoxVideoVidPn.h
r27201 r27239 113 113 BOOLEAN bPreferred); 114 114 115 NTSTATUS vboxVidPnCreatePopulateVidPnFromLegacy(struct _DEVICE_EXTENSION* pDevExt, D3DKMDT_HVIDPN hVidPn, const DXGK_VIDPN_INTERFACE* pVidPnInterface, 116 VIDEO_MODE_INFORMATION *pModes, uint32_t cModes, uint32_t iPreferredMomde, 117 D3DKMDT_2DREGION *pResolutions, uint32_t cResolutions); 118 115 119 #endif /* #ifndef ___VBoxVideoVidPn_h___ */ -
trunk/src/VBox/Additions/WINNT/Graphics/Miniport/wddm/VBoxVideoWddm.cpp
r27225 r27239 550 550 551 551 dfprintf(("==> "__FUNCTION__ ", pdo(0x%x)\n", PhysicalDeviceObject)); 552 553 vboxVDbgBreakFv(); 554 552 555 NTSTATUS Status = STATUS_SUCCESS; 553 556 … … 583 586 584 587 dfprintf(("==> "__FUNCTION__ ", context(0x%x)\n", MiniportDeviceContext)); 588 589 vboxVDbgBreakFv(); 585 590 586 591 if ( ARGUMENT_PRESENT(MiniportDeviceContext) && … … 677 682 dfprintf(("==> "__FUNCTION__ ", context(0x%p)\n", MiniportDeviceContext)); 678 683 684 vboxVDbgBreakF(); 685 679 686 vboxWddmMemFree(MiniportDeviceContext); 680 687 … … 764 771 { 765 772 dfprintf(("==> "__FUNCTION__ ", context(0x%p), msg(0x%x)\n", MiniportDeviceContext, MessageNumber)); 773 774 vboxVDbgBreakF(); 766 775 767 776 PDEVICE_EXTENSION pDevExt = (PDEVICE_EXTENSION)MiniportDeviceContext; … … 875 884 { 876 885 dfprintf(("==> "__FUNCTION__ ", context(0x%p)\n", MiniportDeviceContext)); 886 887 vboxVDbgBreakF(); 877 888 878 889 PDEVICE_EXTENSION pDevExt = (PDEVICE_EXTENSION)MiniportDeviceContext; … … 1411 1422 1412 1423 dfprintf(("==> "__FUNCTION__ ", context(0x%x)\n", hAdapter)); 1424 1425 vboxVDbgBreakFv(); 1426 1413 1427 NTSTATUS Status = STATUS_SUCCESS; 1414 1428 … … 1606 1620 dfprintf(("==> "__FUNCTION__ ", context(0x%x)\n", hAdapter)); 1607 1621 1622 vboxVDbgBreakF(); 1623 1608 1624 /* Value == 2 is Present 1609 1625 * Value == 4 is RedirectedPresent … … 1645 1661 1646 1662 dfprintf(("==> "__FUNCTION__ ", context(0x%x)\n", hAdapter)); 1663 1664 vboxVDbgBreakF(); 1647 1665 1648 1666 PDEVICE_EXTENSION pDevExt = (PDEVICE_EXTENSION)hAdapter; … … 1861 1879 dfprintf(("==> "__FUNCTION__ ", context(0x%x)\n", hAdapter)); 1862 1880 1863 vboxVDbgBreakF ();1881 vboxVDbgBreakFv(); 1864 1882 1865 1883 PDEVICE_EXTENSION pContext = (PDEVICE_EXTENSION)hAdapter; … … 1967 1985 dfprintf(("==> "__FUNCTION__ ", context(0x%x)\n", hAdapter)); 1968 1986 1969 PDEVICE_EXTENSION pContext = (PDEVICE_EXTENSION)hAdapter; 1987 vboxVDbgBreakF(); 1988 1989 PDEVICE_EXTENSION pDevExt = (PDEVICE_EXTENSION)hAdapter; 1990 NTSTATUS Status; 1991 uint32_t cModes; 1992 uint32_t iPreferredMode; 1993 VIDEO_MODE_INFORMATION *pModes; 1994 uint32_t cResolutions; 1995 D3DKMDT_2DREGION *pResolutions; 1996 VBoxWddmGetModesTable(pDevExt, /* PDEVICE_EXTENSION DeviceExtension */ 1997 true, /* bool bRebuildTable*/ 1998 &pModes, /* VIDEO_MODE_INFORMATION ** ppModes*/ 1999 &cModes, /* uint32_t * pcModes */ 2000 &iPreferredMode, /* uint32_t * pPreferrableMode*/ 2001 &pResolutions, /* D3DKMDT_2DREGION **ppResolutions */ 2002 &cResolutions /* uint32_t * pcResolutions */); 2003 2004 1970 2005 const DXGK_VIDPN_INTERFACE* pVidPnInterface = NULL; 1971 NTSTATUS Status = pContext->u.primary.DxgkInterface.DxgkCbQueryVidPnInterface(pRecommendFunctionalVidPnArg->hRecommendedFunctionalVidPn, DXGK_VIDPN_INTERFACE_VERSION_V1, &pVidPnInterface); 2006 Status = pDevExt->u.primary.DxgkInterface.DxgkCbQueryVidPnInterface(pRecommendFunctionalVidPnArg->hRecommendedFunctionalVidPn, DXGK_VIDPN_INTERFACE_VERSION_V1, &pVidPnInterface); 2007 Assert(Status == STATUS_SUCCESS); 1972 2008 if (Status == STATUS_SUCCESS) 1973 2009 { 1974 D3DKMDT_HVIDPNTOPOLOGY hVidPnTopology; 1975 const DXGK_VIDPNTOPOLOGY_INTERFACE* pVidPnTopologyInterface; 1976 Status = pVidPnInterface->pfnGetTopology(pRecommendFunctionalVidPnArg->hRecommendedFunctionalVidPn, &hVidPnTopology, &pVidPnTopologyInterface); 1977 if (Status == STATUS_SUCCESS) 1978 { 1979 D3DKMDT_VIDPN_PRESENT_PATH *pNewVidPnPresentPathInfo; 1980 Status = pVidPnTopologyInterface->pfnCreateNewPathInfo(hVidPnTopology, &pNewVidPnPresentPathInfo); 1981 if (Status == STATUS_SUCCESS) 1982 { 1983 pNewVidPnPresentPathInfo->VidPnSourceId = 0; 1984 pNewVidPnPresentPathInfo->VidPnTargetId = 0; 1985 pNewVidPnPresentPathInfo->ImportanceOrdinal = D3DKMDT_VPPI_PRIMARY; 1986 pNewVidPnPresentPathInfo->ContentTransformation.Scaling = D3DKMDT_VPPS_IDENTITY; 1987 memset(&pNewVidPnPresentPathInfo->ContentTransformation.ScalingSupport, 1988 0, sizeof (pNewVidPnPresentPathInfo->ContentTransformation.ScalingSupport)); 1989 pNewVidPnPresentPathInfo->ContentTransformation.ScalingSupport.Identity = 1; 1990 pNewVidPnPresentPathInfo->ContentTransformation.ScalingSupport.Centered = 1; 1991 pNewVidPnPresentPathInfo->ContentTransformation.ScalingSupport.Stretched = 0; 1992 pNewVidPnPresentPathInfo->ContentTransformation.Rotation = D3DKMDT_VPPR_IDENTITY; 1993 pNewVidPnPresentPathInfo->ContentTransformation.RotationSupport.Identity = 1; 1994 pNewVidPnPresentPathInfo->ContentTransformation.RotationSupport.Rotate180 = 0; 1995 pNewVidPnPresentPathInfo->ContentTransformation.RotationSupport.Rotate270 = 0; 1996 pNewVidPnPresentPathInfo->ContentTransformation.RotationSupport.Rotate90 = 0; 1997 pNewVidPnPresentPathInfo->VisibleFromActiveTLOffset.cx = 0; 1998 pNewVidPnPresentPathInfo->VisibleFromActiveTLOffset.cy = 0; 1999 pNewVidPnPresentPathInfo->VisibleFromActiveBROffset.cx = 0; 2000 pNewVidPnPresentPathInfo->VisibleFromActiveBROffset.cy = 0; 2001 pNewVidPnPresentPathInfo->VidPnTargetColorBasis = D3DKMDT_CB_SRGB; /* @todo: how does it matters? */ 2002 pNewVidPnPresentPathInfo->VidPnTargetColorCoeffDynamicRanges.FirstChannel = 8; 2003 pNewVidPnPresentPathInfo->VidPnTargetColorCoeffDynamicRanges.SecondChannel = 8; 2004 pNewVidPnPresentPathInfo->VidPnTargetColorCoeffDynamicRanges.ThirdChannel = 8; 2005 pNewVidPnPresentPathInfo->VidPnTargetColorCoeffDynamicRanges.FourthChannel = 0; 2006 pNewVidPnPresentPathInfo->Content = D3DKMDT_VPPC_GRAPHICS; 2007 pNewVidPnPresentPathInfo->CopyProtection.CopyProtectionType = D3DKMDT_VPPMT_NOPROTECTION; 2008 pNewVidPnPresentPathInfo->CopyProtection.APSTriggerBits = 0; 2009 memset(&pNewVidPnPresentPathInfo->CopyProtection.CopyProtectionSupport, 0, sizeof (pNewVidPnPresentPathInfo->CopyProtection.CopyProtectionSupport)); 2010 pNewVidPnPresentPathInfo->CopyProtection.CopyProtectionSupport.NoProtection = 1; 2011 pNewVidPnPresentPathInfo->GammaRamp.Type = D3DDDI_GAMMARAMP_DEFAULT; 2012 pNewVidPnPresentPathInfo->GammaRamp.DataSize = 0; 2013 Status = pVidPnTopologyInterface->pfnAddPath(hVidPnTopology, pNewVidPnPresentPathInfo); 2014 if (Status == STATUS_SUCCESS) 2015 { 2016 D3DKMDT_HVIDPNSOURCEMODESET hNewVidPnSourceModeSet; 2017 const DXGK_VIDPNSOURCEMODESET_INTERFACE *pVidPnSourceModeSetInterface; 2018 Status = pVidPnInterface->pfnCreateNewSourceModeSet(pRecommendFunctionalVidPnArg->hRecommendedFunctionalVidPn, 2019 0, /*__in CONST D3DDDI_VIDEO_PRESENT_SOURCE_ID VidPnSourceId */ 2020 &hNewVidPnSourceModeSet, 2021 &pVidPnSourceModeSetInterface); 2022 if (Status == STATUS_SUCCESS) 2023 { 2024 D3DKMDT_VIDPN_SOURCE_MODE *pNewVidPnSourceModeInfo; 2025 Status = pVidPnSourceModeSetInterface->pfnCreateNewModeInfo(hNewVidPnSourceModeSet, &pNewVidPnSourceModeInfo); 2026 if (Status == STATUS_SUCCESS) 2027 { 2028 D3DKMDT_VIDEO_PRESENT_SOURCE_MODE_ID modeId = pNewVidPnSourceModeInfo->Id; 2029 pNewVidPnSourceModeInfo->Type = D3DKMDT_RMT_GRAPHICS; 2030 /* @todo: should we obtain the default mode from the host? */ 2031 pNewVidPnSourceModeInfo->Format.Graphics.PrimSurfSize.cx = 1024; 2032 pNewVidPnSourceModeInfo->Format.Graphics.PrimSurfSize.cy = 768; 2033 pNewVidPnSourceModeInfo->Format.Graphics.VisibleRegionSize = pNewVidPnSourceModeInfo->Format.Graphics.PrimSurfSize; 2034 pNewVidPnSourceModeInfo->Format.Graphics.Stride = pNewVidPnSourceModeInfo->Format.Graphics.PrimSurfSize.cx * 4; 2035 pNewVidPnSourceModeInfo->Format.Graphics.PixelFormat = D3DDDIFMT_X8R8G8B8; 2036 pNewVidPnSourceModeInfo->Format.Graphics.ColorBasis = D3DKMDT_CB_SRGB; 2037 pNewVidPnSourceModeInfo->Format.Graphics.PixelValueAccessMode = D3DKMDT_PVAM_DIRECT; 2038 Status = pVidPnSourceModeSetInterface->pfnAddMode(hNewVidPnSourceModeSet, pNewVidPnSourceModeInfo); 2039 if (Status == STATUS_SUCCESS) 2040 { 2041 Status = pVidPnSourceModeSetInterface->pfnPinMode(hNewVidPnSourceModeSet, modeId); 2042 if (Status == STATUS_SUCCESS) 2043 { 2044 D3DKMDT_HVIDPNTARGETMODESET hNewVidPnTargetModeSet; 2045 CONST DXGK_VIDPNTARGETMODESET_INTERFACE *pVidPnTargetModeSetInterface; 2046 Status = pVidPnInterface->pfnCreateNewTargetModeSet(pRecommendFunctionalVidPnArg->hRecommendedFunctionalVidPn, 2047 0, /* __in CONST D3DDDI_VIDEO_PRESENT_TARGET_ID VidPnTargetId */ 2048 &hNewVidPnTargetModeSet, 2049 &pVidPnTargetModeSetInterface); 2050 if (Status == STATUS_SUCCESS) 2051 { 2052 D3DKMDT_VIDPN_TARGET_MODE *pNewVidPnTargetModeInfo; 2053 Status = pVidPnTargetModeSetInterface->pfnCreateNewModeInfo(hNewVidPnTargetModeSet, &pNewVidPnTargetModeInfo); 2054 if (Status == STATUS_SUCCESS) 2055 { 2056 D3DKMDT_VIDEO_PRESENT_TARGET_MODE_ID targetId = pNewVidPnTargetModeInfo->Id; 2057 pNewVidPnTargetModeInfo->VideoSignalInfo.VideoStandard = D3DKMDT_VSS_OTHER; 2058 pNewVidPnTargetModeInfo->VideoSignalInfo.TotalSize.cx = 1024; 2059 pNewVidPnTargetModeInfo->VideoSignalInfo.TotalSize.cy = 768; 2060 pNewVidPnTargetModeInfo->VideoSignalInfo.ActiveSize = pNewVidPnTargetModeInfo->VideoSignalInfo.TotalSize; 2061 pNewVidPnTargetModeInfo->VideoSignalInfo.VSyncFreq.Numerator = 60; 2062 pNewVidPnTargetModeInfo->VideoSignalInfo.VSyncFreq.Denominator = 1; 2063 pNewVidPnTargetModeInfo->VideoSignalInfo.HSyncFreq.Numerator = 63 * 768; /* @todo: do we need that? */ 2064 pNewVidPnTargetModeInfo->VideoSignalInfo.HSyncFreq.Denominator = 1; 2065 pNewVidPnTargetModeInfo->VideoSignalInfo.PixelRate = 165000; /* ?? */ 2066 pNewVidPnTargetModeInfo->VideoSignalInfo.ScanLineOrdering = D3DDDI_VSSLO_PROGRESSIVE; 2067 pNewVidPnTargetModeInfo->Preference = D3DKMDT_MP_PREFERRED; 2068 Status = pVidPnTargetModeSetInterface->pfnAddMode(hNewVidPnTargetModeSet, pNewVidPnTargetModeInfo); 2069 if (Status == STATUS_SUCCESS) 2070 { 2071 Status = pVidPnTargetModeSetInterface->pfnPinMode(hNewVidPnTargetModeSet, targetId); 2072 if (Status == STATUS_SUCCESS) 2073 { 2074 2075 } 2076 else 2077 { 2078 drprintf(("VBoxVideoWddm: pfnPinMode (target) failed Status(0x%x)\n")); 2079 } 2080 } 2081 else 2082 { 2083 drprintf(("VBoxVideoWddm: pfnAddMode (target) failed Status(0x%x)\n")); 2084 pVidPnTargetModeSetInterface->pfnReleaseModeInfo(hNewVidPnTargetModeSet, pNewVidPnTargetModeInfo); 2085 pNewVidPnTargetModeInfo = NULL; 2086 } 2087 } 2088 else 2089 { 2090 drprintf(("VBoxVideoWddm: pfnCreateNewModeInfo (target) failed Status(0x%x)\n")); 2091 } 2092 } 2093 else 2094 { 2095 drprintf(("VBoxVideoWddm: pfnCreateNewTargetModeSet failed Status(0x%x)\n")); 2096 } 2097 } 2098 else 2099 { 2100 drprintf(("VBoxVideoWddm: pfnPinMode failed Status(0x%x)\n")); 2101 } 2102 } 2103 else 2104 { 2105 drprintf(("VBoxVideoWddm: pfnAddMode failed Status(0x%x)\n")); 2106 pVidPnSourceModeSetInterface->pfnReleaseModeInfo(hNewVidPnSourceModeSet, pNewVidPnSourceModeInfo); 2107 pNewVidPnSourceModeInfo = NULL; 2108 } 2109 } 2110 else 2111 { 2112 drprintf(("VBoxVideoWddm: pfnCreateNewModeInfo failed Status(0x%x)\n")); 2113 } 2114 } 2115 else 2116 { 2117 drprintf(("VBoxVideoWddm: pfnCreateNewSourceModeSet failed Status(0x%x)\n")); 2118 } 2119 } 2120 else 2121 { 2122 drprintf(("VBoxVideoWddm: pfnAddPath failed Status(0x%x)\n")); 2123 pVidPnTopologyInterface->pfnReleasePathInfo(hVidPnTopology, pNewVidPnPresentPathInfo); 2124 pNewVidPnPresentPathInfo = NULL; 2125 } 2126 } 2127 else 2128 { 2129 drprintf(("VBoxVideoWddm: pfnCreateNewPathInfo failed Status(0x%x)\n")); 2130 } 2131 } 2132 else 2133 { 2134 drprintf(("VBoxVideoWddm: pfnGetTopology failed Status(0x%x)\n")); 2135 } 2010 D3DKMDT_2DREGION PrefRegion; 2011 PrefRegion.cx = pModes[iPreferredMode].VisScreenHeight; 2012 PrefRegion.cy = pModes[iPreferredMode].VisScreenWidth; 2013 Status = vboxVidPnCreatePopulateVidPnFromLegacy(pDevExt, pRecommendFunctionalVidPnArg->hRecommendedFunctionalVidPn, pVidPnInterface, 2014 #if 0 2015 pModes, cModes, iPreferredMode, 2016 pResolutions, cResolutions 2017 #else 2018 &pModes[iPreferredMode], 1, 0, 2019 &PrefRegion, 1 2020 #endif 2021 ); 2022 Assert(Status == STATUS_SUCCESS); 2023 if (Status != STATUS_SUCCESS) 2024 drprintf((__FUNCTION__": vboxVidPnCreatePopulateVidPnFromLegacy failed Status(0x%x)\n", Status)); 2136 2025 } 2137 2026 else 2138 { 2139 drprintf(("VBoxVideoWddm: DxgkCbQueryVidPnInterface failed Status(0x%x)\n")); 2140 } 2027 drprintf((__FUNCTION__": DxgkCbQueryVidPnInterface failed Status(0x%x)\n", Status)); 2141 2028 2142 2029 dfprintf(("<== "__FUNCTION__ ", status(0x%x), context(0x%x)\n", Status, hAdapter)); … … 2157 2044 dfprintf(("==> "__FUNCTION__ ", context(0x%x)\n", hAdapter)); 2158 2045 2159 vboxVDbgBreakF ();2046 vboxVDbgBreakFv(); 2160 2047 2161 2048 PDEVICE_EXTENSION pContext = (PDEVICE_EXTENSION)hAdapter; … … 2419 2306 dfprintf(("==> "__FUNCTION__ ", hAdapter(0x%x)\n", hAdapter)); 2420 2307 2421 vboxVDbgBreakF ();2308 vboxVDbgBreakFv(); 2422 2309 2423 2310 PDEVICE_EXTENSION pDevExt = (PDEVICE_EXTENSION)hAdapter; … … 2563 2450 dfprintf(("==> "__FUNCTION__ ", hDevice(0x%x)\n", hDevice)); 2564 2451 2452 vboxVDbgBreakFv(); 2453 2565 2454 vboxWddmMemFree(hDevice); 2566 2455 … … 2611 2500 2612 2501 dfprintf(("==> "__FUNCTION__ ", hDevice(0x%x)\n", hDevice)); 2502 2503 vboxVDbgBreakFv(); 2613 2504 2614 2505 for (UINT i = 0; i < pCloseAllocation->NumAllocations; ++i) … … 2920 2811 { 2921 2812 dfprintf(("==> "__FUNCTION__ ", hContext(0x%x)\n", hContext)); 2813 vboxVDbgBreakFv(); 2922 2814 vboxWddmMemFree(hContext); 2923 2815 dfprintf(("<== "__FUNCTION__ ", hContext(0x%x)\n", hContext)); … … 2934 2826 { 2935 2827 drprintf(("==> "__FUNCTION__ ", MiniportDeviceContext(0x%x)\n", MiniportDeviceContext)); 2828 vboxVDbgBreakFv(); 2936 2829 AssertBreakpoint(); 2937 2830 drprintf(("<== "__FUNCTION__ ", MiniportDeviceContext(0x%x)\n", MiniportDeviceContext)); … … 2947 2840 { 2948 2841 dfprintf(("==> "__FUNCTION__ ", hAdapter(0x%x)\n", hAdapter)); 2842 vboxVDbgBreakFv(); 2949 2843 AssertBreakpoint(); 2950 2844 dfprintf(("<== "__FUNCTION__ ", hAdapter(0x%x)\n", hAdapter)); … … 2955 2849 { 2956 2850 dfprintf(("==> "__FUNCTION__ ", hAdapter(0x%x)\n", hAdapter)); 2851 vboxVDbgBreakFv(); 2957 2852 AssertBreakpoint(); 2958 2853 dfprintf(("<== "__FUNCTION__ ", hAdapter(0x%x)\n", hAdapter));
Note:
See TracChangeset
for help on using the changeset viewer.