Changeset 37188 in vbox for trunk/src/VBox/Additions/WINNT/Graphics/Video/mp/wddm
- Timestamp:
- May 23, 2011 6:24:48 PM (14 years ago)
- Location:
- trunk/src/VBox/Additions/WINNT/Graphics/Video/mp/wddm
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Additions/WINNT/Graphics/Video/mp/wddm/VBoxMPVidPn.cpp
r36955 r37188 556 556 } 557 557 558 #if 0 559 DECLCALLBACK(BOOLEAN) vboxVidPnCofuncModalitySourceModeCheck(PVBOXMP_DEVEXT pDevExt, const D3DKMDT_HVIDPN hDesiredVidPn, const DXGK_VIDPN_INTERFACE* pVidPnInterface, 560 D3DKMDT_HVIDPNSOURCEMODESET hNewVidPnSourceModeSet, const DXGK_VIDPNSOURCEMODESET_INTERFACE *pVidPnSourceModeSetInterface, 561 const D3DKMDT_VIDPN_SOURCE_MODE *pNewVidPnSourceModeInfo, PVOID pContext) 562 { 563 NTSTATUS Status = STATUS_SUCCESS; 564 PVBOXVIDPN_NEW_SRCMODESET_CHECK pCbContext = (PVBOXVIDPN_NEW_SRCMODESET_CHECK)pContext; 565 pCbContext->CommonInfo.Status = STATUS_SUCCESS; 566 567 pVidPnSourceModeSetInterface->pfnReleaseModeInfo(hNewVidPnSourceModeSet, pNewVidPnSourceModeInfo); 568 569 pCbContext->CommonInfo.Status = Status; 570 return Status == STATUS_SUCCESS; 571 } 572 573 DECLCALLBACK(BOOLEAN) vboxVidPnCofuncModalitySourceModeEnum(PVBOXMP_DEVEXT pDevExt, const D3DKMDT_HVIDPN hDesiredVidPn, const DXGK_VIDPN_INTERFACE* pVidPnInterface, 574 D3DKMDT_HVIDPNSOURCEMODESET hNewVidPnSourceModeSet, const DXGK_VIDPNSOURCEMODESET_INTERFACE *pVidPnSourceModeSetInterface, 575 const D3DKMDT_VIDPN_SOURCE_MODE *pNewVidPnSourceModeInfo, PVOID pContext) 576 { 577 NTSTATUS Status = STATUS_SUCCESS; 578 PVBOXVIDPNCMCONTEXT pCbContext = (PVBOXVIDPNCMCONTEXT)pContext; 579 pCbContext->Status = STATUS_SUCCESS; 580 581 pVidPnSourceModeSetInterface->pfnReleaseModeInfo(hNewVidPnSourceModeSet, pNewVidPnSourceModeInfo); 582 583 pCbContext->Status = Status; 584 return Status == STATUS_SUCCESS; 585 } 586 587 DECLCALLBACK(BOOLEAN) vboxVidPnCofuncModalityTargetModeEnum(PVBOXMP_DEVEXT pDevExt, const D3DKMDT_HVIDPN hDesiredVidPn, const DXGK_VIDPN_INTERFACE* pVidPnInterface, 588 D3DKMDT_HVIDPNTARGETMODESET hNewVidPnTargetModeSet, const DXGK_VIDPNTARGETMODESET_INTERFACE *pVidPnTargetModeSetInterface, 589 const D3DKMDT_VIDPN_TARGET_MODE *pNewVidPnTargetModeInfo, PVOID pContext) 590 { 591 NTSTATUS Status = STATUS_SUCCESS; 592 PVBOXVIDPNCMCONTEXT pCbContext = (PVBOXVIDPNCMCONTEXT)pContext; 593 pCbContext->Status = STATUS_SUCCESS; 594 595 pVidPnTargetModeSetInterface->pfnReleaseModeInfo(hNewVidPnTargetModeSet, pNewVidPnTargetModeInfo); 596 597 pCbContext->Status = Status; 598 return Status == STATUS_SUCCESS; 599 } 600 #endif 601 602 NTSTATUS vboxVidPnPopulateSourceModeInfoFromLegacy(PVBOXMP_DEVEXT pDevExt, 603 D3DKMDT_VIDPN_SOURCE_MODE *pNewVidPnSourceModeInfo, 558 NTSTATUS vboxVidPnPopulateSourceModeInfoFromLegacy(D3DKMDT_VIDPN_SOURCE_MODE *pNewVidPnSourceModeInfo, 604 559 VIDEO_MODE_INFORMATION *pMode) 605 560 { … … 640 595 } 641 596 642 NTSTATUS vboxVidPnPopulateSourceModeSetFromLegacy(PVBOXMP_DEVEXT pDevExt,643 D3DKMDT_HVIDPNSOURCEMODESET hNewVidPnSourceModeSet,644 const DXGK_VIDPNSOURCEMODESET_INTERFACE *pNewVidPnSourceModeSetInterface,645 VIDEO_MODE_INFORMATION *pModes,646 uint32_t cModes,647 int iPreferredMode,648 D3DKMDT_VIDEO_PRESENT_SOURCE_MODE_ID *pPreferredModeId)649 {650 NTSTATUS Status = STATUS_SUCCESS;651 D3DKMDT_VIDEO_PRESENT_SOURCE_MODE_ID PreferredModeId = D3DDDI_ID_UNINITIALIZED;652 for (uint32_t i = 0; i < cModes; ++i)653 {654 D3DKMDT_VIDPN_SOURCE_MODE *pNewVidPnSourceModeInfo;655 /* disable 24 bpp for now */656 if (pModes[i].BitsPerPlane == 24)657 continue;658 659 Status = pNewVidPnSourceModeSetInterface->pfnCreateNewModeInfo(hNewVidPnSourceModeSet, &pNewVidPnSourceModeInfo);660 Assert(Status == STATUS_SUCCESS);661 if (Status == STATUS_SUCCESS)662 {663 Status = vboxVidPnPopulateSourceModeInfoFromLegacy(pDevExt, pNewVidPnSourceModeInfo, &pModes[i]);664 Assert(Status == STATUS_SUCCESS);665 if (Status == STATUS_SUCCESS)666 {667 D3DKMDT_VIDEO_PRESENT_SOURCE_MODE_ID modeId = pNewVidPnSourceModeInfo->Id;668 Status = pNewVidPnSourceModeSetInterface->pfnAddMode(hNewVidPnSourceModeSet, pNewVidPnSourceModeInfo);669 Assert(Status == STATUS_SUCCESS);670 if (Status == STATUS_SUCCESS)671 {672 if (iPreferredMode == i)673 {674 PreferredModeId = modeId;675 // AssertBreakpoint();676 // Status = pNewVidPnSourceModeSetInterface->pfnPinMode(hNewVidPnSourceModeSet, modeId);677 // Assert(Status == STATUS_SUCCESS);678 // if (Status != STATUS_SUCCESS)679 // {680 // LOGREL(("pfnPinMode failed, Status(0x%x)", Status));681 // /* don't treat it as fatal */682 // Status = STATUS_SUCCESS;683 // }684 }685 }686 else687 {688 LOGREL(("pfnAddMode failed, Status(0x%x)", Status));689 pNewVidPnSourceModeSetInterface->pfnReleaseModeInfo(hNewVidPnSourceModeSet, pNewVidPnSourceModeInfo);690 break;691 }692 }693 else694 {695 LOGREL(("pfnCreateNewModeInfo failed, Status(0x%x)", Status));696 pNewVidPnSourceModeSetInterface->pfnReleaseModeInfo(hNewVidPnSourceModeSet, pNewVidPnSourceModeInfo);697 break;698 }699 }700 }701 702 if (pPreferredModeId)703 *pPreferredModeId = PreferredModeId;704 705 return Status;706 }707 708 597 NTSTATUS vboxVidPnPopulateMonitorSourceModeInfoFromLegacy(PVBOXMP_DEVEXT pDevExt, 709 598 D3DKMDT_MONITOR_SOURCE_MODE *pMonitorSourceMode, … … 777 666 } 778 667 779 NTSTATUS vboxVidPnPopulateTargetModeInfoFromLegacy(D3DKMDT_VIDPN_TARGET_MODE *pNewVidPnTargetModeInfo, 780 D3DKMDT_2DREGION *pResolution, 781 BOOLEAN bPreferred) 782 { 783 Assert(!bPreferred); 784 // pNewVidPnTargetModeInfo->Preference = bPreferred ? D3DKMDT_MP_PREFERRED : D3DKMDT_MP_NOTPREFERRED; 785 pNewVidPnTargetModeInfo->Preference = D3DKMDT_MP_PREFERRED; 786 668 NTSTATUS vboxVidPnPopulateTargetModeInfoFromLegacy(D3DKMDT_VIDPN_TARGET_MODE *pNewVidPnTargetModeInfo, D3DKMDT_2DREGION *pResolution) 669 { 670 pNewVidPnTargetModeInfo->Preference = D3DKMDT_MP_NOTPREFERRED; 787 671 return vboxVidPnPopulateVideoSignalInfo(&pNewVidPnTargetModeInfo->VideoSignalInfo, pResolution, 60 /* ULONG VSync */); 788 }789 790 #define VBOXVIDPN_MODESET_NO_PIN_PREFERRED 0x00000001791 #define VBOXVIDPN_MODESET_MARK_PREFERRED 0x00000002792 793 NTSTATUS vboxVidPnPopulateTargetModeSetFromLegacy(PVBOXMP_DEVEXT pDevExt,794 D3DKMDT_HVIDPNTARGETMODESET hNewVidPnTargetModeSet,795 const DXGK_VIDPNTARGETMODESET_INTERFACE *pNewVidPnTargetModeSetInterface,796 D3DKMDT_2DREGION *pResolutions,797 uint32_t cResolutions,798 VIDEO_MODE_INFORMATION *pPreferredMode,799 uint32_t fFlags,800 D3DKMDT_VIDEO_PRESENT_TARGET_MODE_ID *pPreferredModeId)801 {802 NTSTATUS Status = STATUS_SUCCESS;803 D3DKMDT_VIDEO_PRESENT_TARGET_MODE_ID PreferredModeId = D3DDDI_ID_UNINITIALIZED;804 for (uint32_t i = 0; i < cResolutions; ++i)805 {806 D3DKMDT_VIDPN_TARGET_MODE *pNewVidPnTargetModeInfo;807 Status = pNewVidPnTargetModeSetInterface->pfnCreateNewModeInfo(hNewVidPnTargetModeSet, &pNewVidPnTargetModeInfo);808 Assert(Status == STATUS_SUCCESS);809 if (Status == STATUS_SUCCESS)810 {811 bool bPreferred = pPreferredMode ? pPreferredMode->VisScreenWidth == pResolutions[i].cx812 && pPreferredMode->VisScreenHeight == pResolutions[i].cy : FALSE;813 Status = vboxVidPnPopulateTargetModeInfoFromLegacy(pNewVidPnTargetModeInfo, &pResolutions[i], bPreferred && (fFlags & VBOXVIDPN_MODESET_MARK_PREFERRED));814 Assert(Status == STATUS_SUCCESS);815 if (Status == STATUS_SUCCESS)816 {817 D3DKMDT_VIDEO_PRESENT_SOURCE_MODE_ID modeId = pNewVidPnTargetModeInfo->Id;818 Status = pNewVidPnTargetModeSetInterface->pfnAddMode(hNewVidPnTargetModeSet, pNewVidPnTargetModeInfo);819 Assert(Status == STATUS_SUCCESS);820 if (Status == STATUS_SUCCESS)821 {822 if (bPreferred) // && !(fFlags & VBOXVIDPN_MODESET_NO_PIN_PREFERRED))823 {824 PreferredModeId = modeId;825 // AssertBreakpoint();826 // Status = pNewVidPnTargetModeSetInterface->pfnPinMode(hNewVidPnTargetModeSet, modeId);827 // Assert(Status == STATUS_SUCCESS);828 // if (Status != STATUS_SUCCESS)829 // {830 // LOGREL(("pfnPinMode failed, Status(0x%x)", Status));831 // /* don't treat it as fatal */832 // Status = STATUS_SUCCESS;833 // }834 }835 }836 else837 {838 LOGREL(("pfnAddMode failed, Status(0x%x)", Status));839 pNewVidPnTargetModeSetInterface->pfnReleaseModeInfo(hNewVidPnTargetModeSet, pNewVidPnTargetModeInfo);840 break;841 }842 }843 else844 {845 LOGREL(("pfnCreateNewModeInfo failed, Status(0x%x)", Status));846 pNewVidPnTargetModeSetInterface->pfnReleaseModeInfo(hNewVidPnTargetModeSet, pNewVidPnTargetModeInfo);847 break;848 }849 }850 }851 852 if (pPreferredModeId)853 *pPreferredModeId = PreferredModeId;854 return Status;855 }856 857 NTSTATUS vboxVidPnCreatePopulateSourceModeSetFromLegacy(PVBOXMP_DEVEXT pDevExt, const D3DKMDT_HVIDPN hDesiredVidPn, const DXGK_VIDPN_INTERFACE* pVidPnInterface,858 D3DDDI_VIDEO_PRESENT_SOURCE_ID srcId,859 VIDEO_MODE_INFORMATION *pModes, uint32_t cModes, int iPreferredMode, D3DKMDT_VIDEO_PRESENT_SOURCE_MODE_ID *pPreferredModeId)860 {861 D3DKMDT_HVIDPNSOURCEMODESET hNewVidPnSourceModeSet;862 const DXGK_VIDPNSOURCEMODESET_INTERFACE *pNewVidPnSourceModeSetInterface;863 NTSTATUS Status = pVidPnInterface->pfnCreateNewSourceModeSet(hDesiredVidPn,864 srcId, /*__in CONST D3DDDI_VIDEO_PRESENT_SOURCE_ID VidPnSourceId */865 &hNewVidPnSourceModeSet,866 &pNewVidPnSourceModeSetInterface);867 Assert(Status == STATUS_SUCCESS);868 if (Status == STATUS_SUCCESS)869 {870 Status = vboxVidPnPopulateSourceModeSetFromLegacy(pDevExt,871 hNewVidPnSourceModeSet, pNewVidPnSourceModeSetInterface,872 pModes, cModes, iPreferredMode, pPreferredModeId);873 Assert(Status == STATUS_SUCCESS);874 if (Status == STATUS_SUCCESS)875 {876 Status = pVidPnInterface->pfnAssignSourceModeSet(hDesiredVidPn,877 srcId,878 hNewVidPnSourceModeSet);879 Assert(Status == STATUS_SUCCESS);880 if(Status != STATUS_SUCCESS)881 {882 LOGREL(("pfnAssignSourceModeSet failed Status(0x%x)", Status));883 pVidPnInterface->pfnReleaseSourceModeSet(hDesiredVidPn, hNewVidPnSourceModeSet);884 }885 }886 else887 {888 LOGREL(("vboxVidPnPopulateSourceModeSetFromLegacy failed Status(0x%x)", Status));889 pVidPnInterface->pfnReleaseSourceModeSet(hDesiredVidPn, hNewVidPnSourceModeSet);890 }891 }892 else893 LOGREL(("pfnCreateNewSourceModeSet failed Status(0x%x)", Status));894 return Status;895 }896 897 NTSTATUS vboxVidPnCreatePopulateTargetModeSetFromLegacy(PVBOXMP_DEVEXT pDevExt, const D3DKMDT_HVIDPN hDesiredVidPn, const DXGK_VIDPN_INTERFACE* pVidPnInterface,898 D3DDDI_VIDEO_PRESENT_TARGET_ID tgtId,899 D3DKMDT_2DREGION *pResolutions,900 uint32_t cResolutions,901 VIDEO_MODE_INFORMATION *pPreferredMode, uint32_t fFlags,902 D3DKMDT_VIDEO_PRESENT_TARGET_MODE_ID *pPreferredModeId)903 {904 D3DKMDT_HVIDPNTARGETMODESET hNewVidPnTargetModeSet;905 const DXGK_VIDPNTARGETMODESET_INTERFACE *pNewVidPnTargetModeSetInterface;906 NTSTATUS Status = pVidPnInterface->pfnCreateNewTargetModeSet(hDesiredVidPn,907 tgtId, /*__in CONST D3DDDI_VIDEO_PRESENT_TARGET_ID VidPnTargetId */908 &hNewVidPnTargetModeSet,909 &pNewVidPnTargetModeSetInterface);910 Assert(Status == STATUS_SUCCESS);911 if (Status == STATUS_SUCCESS)912 {913 Status = vboxVidPnPopulateTargetModeSetFromLegacy(pDevExt,914 hNewVidPnTargetModeSet, pNewVidPnTargetModeSetInterface,915 pResolutions, cResolutions, pPreferredMode, fFlags, pPreferredModeId);916 Assert(Status == STATUS_SUCCESS);917 if (Status == STATUS_SUCCESS)918 {919 Status = pVidPnInterface->pfnAssignTargetModeSet(hDesiredVidPn,920 tgtId,921 hNewVidPnTargetModeSet);922 Assert(Status == STATUS_SUCCESS);923 if(Status != STATUS_SUCCESS)924 {925 LOGREL(("pfnAssignTargetModeSet failed Status(0x%x)", Status));926 pVidPnInterface->pfnReleaseTargetModeSet(hDesiredVidPn, hNewVidPnTargetModeSet);927 }928 }929 else930 {931 LOGREL(("vboxVidPnPopulateTargetModeSetFromLegacy failed Status(0x%x)", Status));932 pVidPnInterface->pfnReleaseTargetModeSet(hDesiredVidPn, hNewVidPnTargetModeSet);933 }934 }935 else936 LOGREL(("pfnCreateNewTargetModeSet failed Status(0x%x)", Status));937 return Status;938 939 672 } 940 673 … … 955 688 { 956 689 D3DKMDT_VIDPN_TARGET_MODE dummyMode = {0}; 957 Status = vboxVidPnPopulateTargetModeInfoFromLegacy(&dummyMode, &pData->pResolutions[i] , FALSE);690 Status = vboxVidPnPopulateTargetModeInfoFromLegacy(&dummyMode, &pData->pResolutions[i]); 958 691 Assert(Status == STATUS_SUCCESS); 959 692 if (Status == STATUS_SUCCESS) … … 1077 810 } 1078 811 1079 NTSTATUS vboxVidPnCreatePopulateVidPnFromLegacy(PVBOXMP_DEVEXT pDevExt, D3DKMDT_HVIDPN hVidPn, const DXGK_VIDPN_INTERFACE* pVidPnInterface, 1080 VIDEO_MODE_INFORMATION *pModes, uint32_t cModes, int iPreferredMode, 1081 D3DKMDT_2DREGION *pResolutions, uint32_t cResolutions, 1082 const D3DDDI_VIDEO_PRESENT_SOURCE_ID srcId, const D3DDDI_VIDEO_PRESENT_TARGET_ID tgtId) 812 static NTSTATUS vboxVidPnPathAdd(D3DKMDT_HVIDPN hVidPn, const DXGK_VIDPN_INTERFACE* pVidPnInterface, 813 const D3DDDI_VIDEO_PRESENT_SOURCE_ID VidPnSourceId, const D3DDDI_VIDEO_PRESENT_TARGET_ID VidPnTargetId) 1083 814 { 1084 815 D3DKMDT_HVIDPNTOPOLOGY hVidPnTopology; 1085 816 const DXGK_VIDPNTOPOLOGY_INTERFACE* pVidPnTopologyInterface; 1086 VIDEO_MODE_INFORMATION *pPreferredMode = iPreferredMode >= 0 ? &pModes[iPreferredMode] : NULL; 1087 D3DKMDT_VIDEO_PRESENT_SOURCE_MODE_ID PreferredSrcModeId = D3DDDI_ID_UNINITIALIZED; 817 NTSTATUS Status = pVidPnInterface->pfnGetTopology(hVidPn, &hVidPnTopology, &pVidPnTopologyInterface); 818 if (!NT_SUCCESS(Status)) 819 { 820 AssertFailed(); 821 return Status; 822 } 823 824 D3DKMDT_VIDPN_PRESENT_PATH *pNewVidPnPresentPathInfo; 825 Status = pVidPnTopologyInterface->pfnCreateNewPathInfo(hVidPnTopology, &pNewVidPnPresentPathInfo); 826 if (!NT_SUCCESS(Status)) 827 { 828 AssertFailed(); 829 return Status; 830 } 831 832 pNewVidPnPresentPathInfo->VidPnSourceId = VidPnSourceId; 833 pNewVidPnPresentPathInfo->VidPnTargetId = VidPnTargetId; 834 pNewVidPnPresentPathInfo->ImportanceOrdinal = D3DKMDT_VPPI_PRIMARY; 835 pNewVidPnPresentPathInfo->ContentTransformation.Scaling = D3DKMDT_VPPS_IDENTITY; 836 memset(&pNewVidPnPresentPathInfo->ContentTransformation.ScalingSupport, 837 0, sizeof (pNewVidPnPresentPathInfo->ContentTransformation.ScalingSupport)); 838 pNewVidPnPresentPathInfo->ContentTransformation.ScalingSupport.Identity = 1; 839 pNewVidPnPresentPathInfo->ContentTransformation.ScalingSupport.Centered = 0; 840 pNewVidPnPresentPathInfo->ContentTransformation.ScalingSupport.Stretched = 0; 841 pNewVidPnPresentPathInfo->ContentTransformation.Rotation = D3DKMDT_VPPR_IDENTITY; 842 pNewVidPnPresentPathInfo->ContentTransformation.RotationSupport.Identity = 1; 843 pNewVidPnPresentPathInfo->ContentTransformation.RotationSupport.Rotate180 = 0; 844 pNewVidPnPresentPathInfo->ContentTransformation.RotationSupport.Rotate270 = 0; 845 pNewVidPnPresentPathInfo->ContentTransformation.RotationSupport.Rotate90 = 0; 846 pNewVidPnPresentPathInfo->VisibleFromActiveTLOffset.cx = 0; 847 pNewVidPnPresentPathInfo->VisibleFromActiveTLOffset.cy = 0; 848 pNewVidPnPresentPathInfo->VisibleFromActiveBROffset.cx = 0; 849 pNewVidPnPresentPathInfo->VisibleFromActiveBROffset.cy = 0; 850 pNewVidPnPresentPathInfo->VidPnTargetColorBasis = D3DKMDT_CB_SRGB; /* @todo: how does it matters? */ 851 pNewVidPnPresentPathInfo->VidPnTargetColorCoeffDynamicRanges.FirstChannel = 8; 852 pNewVidPnPresentPathInfo->VidPnTargetColorCoeffDynamicRanges.SecondChannel = 8; 853 pNewVidPnPresentPathInfo->VidPnTargetColorCoeffDynamicRanges.ThirdChannel = 8; 854 pNewVidPnPresentPathInfo->VidPnTargetColorCoeffDynamicRanges.FourthChannel = 0; 855 pNewVidPnPresentPathInfo->Content = D3DKMDT_VPPC_GRAPHICS; 856 pNewVidPnPresentPathInfo->CopyProtection.CopyProtectionType = D3DKMDT_VPPMT_UNINITIALIZED; 857 // pNewVidPnPresentPathInfo->CopyProtection.CopyProtectionType = D3DKMDT_VPPMT_NOPROTECTION; 858 pNewVidPnPresentPathInfo->CopyProtection.APSTriggerBits = 0; 859 memset(&pNewVidPnPresentPathInfo->CopyProtection.CopyProtectionSupport, 0, sizeof (pNewVidPnPresentPathInfo->CopyProtection.CopyProtectionSupport)); 860 // pNewVidPnPresentPathInfo->CopyProtection.CopyProtectionSupport.NoProtection = 1; 861 memset (&pNewVidPnPresentPathInfo->GammaRamp, 0, sizeof (pNewVidPnPresentPathInfo->GammaRamp)); 862 // pNewVidPnPresentPathInfo->GammaRamp.Type = D3DDDI_GAMMARAMP_DEFAULT; 863 // pNewVidPnPresentPathInfo->GammaRamp.DataSize = 0; 864 Status = pVidPnTopologyInterface->pfnAddPath(hVidPnTopology, pNewVidPnPresentPathInfo); 865 if (!NT_SUCCESS(Status)) 866 { 867 AssertFailed(); 868 NTSTATUS tmpStatus = pVidPnTopologyInterface->pfnReleasePathInfo(hVidPnTopology, pNewVidPnPresentPathInfo); 869 Assert(NT_SUCCESS(tmpStatus)); 870 } 871 872 return Status; 873 } 874 875 static NTSTATUS vboxVidPnCreatePopulateSourceModeInfoFromLegacy(D3DKMDT_HVIDPN hVidPn, const DXGK_VIDPN_INTERFACE* pVidPnInterface, 876 const D3DDDI_VIDEO_PRESENT_SOURCE_ID VidPnSourceId, 877 VIDEO_MODE_INFORMATION *pModes, uint32_t cModes, int iModeToPin, 878 D3DKMDT_VIDEO_PRESENT_SOURCE_MODE_ID *pModeIdToPin, 879 BOOLEAN fDoPin 880 ) 881 { 1088 882 D3DKMDT_HVIDPNSOURCEMODESET hNewVidPnSourceModeSet; 1089 883 const DXGK_VIDPNSOURCEMODESET_INTERFACE *pNewVidPnSourceModeSetInterface; 1090 884 885 if (pModeIdToPin) 886 *pModeIdToPin = D3DDDI_ID_UNINITIALIZED; 887 1091 888 NTSTATUS Status = pVidPnInterface->pfnCreateNewSourceModeSet(hVidPn, 1092 srcId, /*__in CONST D3DDDI_VIDEO_PRESENT_SOURCE_ID VidPnSourceId */889 VidPnSourceId, 1093 890 &hNewVidPnSourceModeSet, 1094 891 &pNewVidPnSourceModeSetInterface); 1095 Assert(Status == STATUS_SUCCESS); 1096 if (Status == STATUS_SUCCESS) 1097 { 1098 Status = vboxVidPnPopulateSourceModeSetFromLegacy(pDevExt, 1099 hNewVidPnSourceModeSet, pNewVidPnSourceModeSetInterface, 1100 pModes, cModes, iPreferredMode, &PreferredSrcModeId); 1101 Assert(Status == STATUS_SUCCESS); 1102 if (Status == STATUS_SUCCESS) 1103 { 1104 Status = pVidPnInterface->pfnAssignSourceModeSet(hVidPn, 1105 srcId, 1106 hNewVidPnSourceModeSet); 1107 Assert(Status == STATUS_SUCCESS); 1108 if(Status == STATUS_SUCCESS) 1109 { 1110 Assert(PreferredSrcModeId != D3DDDI_ID_UNINITIALIZED); 1111 D3DKMDT_VIDEO_PRESENT_TARGET_MODE_ID PreferredTrgModeId = D3DDDI_ID_UNINITIALIZED; 1112 D3DKMDT_HVIDPNTARGETMODESET hNewVidPnTargetModeSet; 1113 const DXGK_VIDPNTARGETMODESET_INTERFACE *pNewVidPnTargetModeSetInterface; 1114 NTSTATUS Status = pVidPnInterface->pfnCreateNewTargetModeSet(hVidPn, 1115 tgtId, /*__in CONST D3DDDI_VIDEO_PRESENT_TARGET_ID VidPnTargetId */ 1116 &hNewVidPnTargetModeSet, 1117 &pNewVidPnTargetModeSetInterface); 1118 Assert(Status == STATUS_SUCCESS); 1119 if (Status == STATUS_SUCCESS) 1120 { 1121 Status = vboxVidPnPopulateTargetModeSetFromLegacy(pDevExt, 1122 hNewVidPnTargetModeSet, pNewVidPnTargetModeSetInterface, 1123 pResolutions, cResolutions, pPreferredMode, 0 /* flags */, &PreferredTrgModeId); 1124 Assert(Status == STATUS_SUCCESS); 1125 if (Status == STATUS_SUCCESS) 1126 { 1127 Status = pVidPnInterface->pfnAssignTargetModeSet(hVidPn, 1128 tgtId, 1129 hNewVidPnTargetModeSet); 1130 Assert(Status == STATUS_SUCCESS); 1131 if(Status == STATUS_SUCCESS) 1132 { 1133 1134 Assert(PreferredTrgModeId != D3DDDI_ID_UNINITIALIZED); 1135 Status = pVidPnInterface->pfnGetTopology(hVidPn, &hVidPnTopology, &pVidPnTopologyInterface); 1136 if (Status == STATUS_SUCCESS) 1137 { 1138 D3DKMDT_VIDPN_PRESENT_PATH *pNewVidPnPresentPathInfo; 1139 Status = pVidPnTopologyInterface->pfnCreateNewPathInfo(hVidPnTopology, &pNewVidPnPresentPathInfo); 1140 if (Status == STATUS_SUCCESS) 1141 { 1142 pNewVidPnPresentPathInfo->VidPnSourceId = srcId; 1143 pNewVidPnPresentPathInfo->VidPnTargetId = tgtId; 1144 pNewVidPnPresentPathInfo->ImportanceOrdinal = D3DKMDT_VPPI_PRIMARY; 1145 pNewVidPnPresentPathInfo->ContentTransformation.Scaling = D3DKMDT_VPPS_IDENTITY; 1146 memset(&pNewVidPnPresentPathInfo->ContentTransformation.ScalingSupport, 1147 0, sizeof (pNewVidPnPresentPathInfo->ContentTransformation.ScalingSupport)); 1148 pNewVidPnPresentPathInfo->ContentTransformation.ScalingSupport.Identity = 1; 1149 pNewVidPnPresentPathInfo->ContentTransformation.ScalingSupport.Centered = 0; 1150 pNewVidPnPresentPathInfo->ContentTransformation.ScalingSupport.Stretched = 0; 1151 pNewVidPnPresentPathInfo->ContentTransformation.Rotation = D3DKMDT_VPPR_IDENTITY; 1152 pNewVidPnPresentPathInfo->ContentTransformation.RotationSupport.Identity = 1; 1153 pNewVidPnPresentPathInfo->ContentTransformation.RotationSupport.Rotate180 = 0; 1154 pNewVidPnPresentPathInfo->ContentTransformation.RotationSupport.Rotate270 = 0; 1155 pNewVidPnPresentPathInfo->ContentTransformation.RotationSupport.Rotate90 = 0; 1156 pNewVidPnPresentPathInfo->VisibleFromActiveTLOffset.cx = 0; 1157 pNewVidPnPresentPathInfo->VisibleFromActiveTLOffset.cy = 0; 1158 pNewVidPnPresentPathInfo->VisibleFromActiveBROffset.cx = 0; 1159 pNewVidPnPresentPathInfo->VisibleFromActiveBROffset.cy = 0; 1160 pNewVidPnPresentPathInfo->VidPnTargetColorBasis = D3DKMDT_CB_SRGB; /* @todo: how does it matters? */ 1161 pNewVidPnPresentPathInfo->VidPnTargetColorCoeffDynamicRanges.FirstChannel = 8; 1162 pNewVidPnPresentPathInfo->VidPnTargetColorCoeffDynamicRanges.SecondChannel = 8; 1163 pNewVidPnPresentPathInfo->VidPnTargetColorCoeffDynamicRanges.ThirdChannel = 8; 1164 pNewVidPnPresentPathInfo->VidPnTargetColorCoeffDynamicRanges.FourthChannel = 0; 1165 pNewVidPnPresentPathInfo->Content = D3DKMDT_VPPC_GRAPHICS; 1166 pNewVidPnPresentPathInfo->CopyProtection.CopyProtectionType = D3DKMDT_VPPMT_UNINITIALIZED; 1167 // pNewVidPnPresentPathInfo->CopyProtection.CopyProtectionType = D3DKMDT_VPPMT_NOPROTECTION; 1168 pNewVidPnPresentPathInfo->CopyProtection.APSTriggerBits = 0; 1169 memset(&pNewVidPnPresentPathInfo->CopyProtection.CopyProtectionSupport, 0, sizeof (pNewVidPnPresentPathInfo->CopyProtection.CopyProtectionSupport)); 1170 // pNewVidPnPresentPathInfo->CopyProtection.CopyProtectionSupport.NoProtection = 1; 1171 memset (&pNewVidPnPresentPathInfo->GammaRamp, 0, sizeof (pNewVidPnPresentPathInfo->GammaRamp)); 1172 // pNewVidPnPresentPathInfo->GammaRamp.Type = D3DDDI_GAMMARAMP_DEFAULT; 1173 // pNewVidPnPresentPathInfo->GammaRamp.DataSize = 0; 1174 Status = pVidPnTopologyInterface->pfnAddPath(hVidPnTopology, pNewVidPnPresentPathInfo); 1175 Assert(Status == STATUS_SUCCESS); 1176 if (Status == STATUS_SUCCESS) 1177 { 1178 if (PreferredSrcModeId != D3DDDI_ID_UNINITIALIZED) 1179 { 1180 Status = pNewVidPnSourceModeSetInterface->pfnPinMode(hNewVidPnSourceModeSet, PreferredSrcModeId); 1181 Assert(Status == STATUS_SUCCESS); 1182 if (Status == STATUS_SUCCESS) 1183 { 1184 Status = pNewVidPnTargetModeSetInterface->pfnPinMode(hNewVidPnTargetModeSet, PreferredTrgModeId); 1185 Assert(Status == STATUS_SUCCESS); 1186 if (Status != STATUS_SUCCESS) 1187 LOGREL(("TRG pfnPinMode failed Status(0x%x)", Status)); 1188 } 1189 else 1190 LOGREL(("SRC pfnPinMode failed Status(0x%x)", Status)); 1191 } 1192 } 1193 else 1194 { 1195 LOGREL(("pfnAddPath failed Status(0x%x)", Status)); 1196 pVidPnTopologyInterface->pfnReleasePathInfo(hVidPnTopology, pNewVidPnPresentPathInfo); 1197 pNewVidPnPresentPathInfo = NULL; 1198 } 1199 } 1200 else 1201 LOGREL(("pfnCreateNewPathInfo failed Status(0x%x)", Status)); 1202 } 1203 else 1204 LOGREL(("pfnGetTopology failed Status(0x%x)", Status)); 1205 } 1206 else 1207 { 1208 LOGREL(("pfnAssignTargetModeSet failed Status(0x%x)", Status)); 1209 pVidPnInterface->pfnReleaseTargetModeSet(hVidPn, hNewVidPnTargetModeSet); 1210 } 1211 } 1212 else 1213 { 1214 LOGREL(("vboxVidPnPopulateTargetModeSetFromLegacy failed Status(0x%x)", Status)); 1215 pVidPnInterface->pfnReleaseTargetModeSet(hVidPn, hNewVidPnTargetModeSet); 1216 } 1217 } 1218 else 1219 LOGREL(("pfnCreateNewTargetModeSet failed Status(0x%x)", Status)); 1220 } 1221 else 1222 { 1223 LOGREL(("pfnAssignSourceModeSet failed Status(0x%x)", Status)); 1224 pVidPnInterface->pfnReleaseSourceModeSet(hVidPn, hNewVidPnSourceModeSet); 1225 } 892 if (!NT_SUCCESS(Status)) 893 { 894 AssertFailed(); 895 return Status; 896 } 897 898 D3DKMDT_VIDEO_PRESENT_SOURCE_MODE_ID sourceModeId = D3DDDI_ID_UNINITIALIZED; 899 900 for (uint32_t i = 0; i < cModes; ++i) 901 { 902 VIDEO_MODE_INFORMATION *pMode = &pModes[i]; 903 D3DKMDT_VIDPN_SOURCE_MODE *pNewVidPnSourceModeInfo; 904 Status = pNewVidPnSourceModeSetInterface->pfnCreateNewModeInfo(hNewVidPnSourceModeSet, &pNewVidPnSourceModeInfo); 905 if (!NT_SUCCESS(Status)) 906 { 907 AssertFailed(); 908 break; 909 } 910 911 Status = vboxVidPnPopulateSourceModeInfoFromLegacy(pNewVidPnSourceModeInfo, pMode); 912 if (NT_SUCCESS(Status)) 913 { 914 if (i == iModeToPin) 915 { 916 sourceModeId = pNewVidPnSourceModeInfo->Id; 917 } 918 Status = pNewVidPnSourceModeSetInterface->pfnAddMode(hNewVidPnSourceModeSet, pNewVidPnSourceModeInfo); 919 if (NT_SUCCESS(Status)) 920 { 921 922 /* success */ 923 continue; 924 } 925 AssertFailed(); 1226 926 } 1227 927 else 1228 928 { 1229 LOGREL(("vboxVidPnPopulateSourceModeSetFromLegacy failed Status(0x%x)", Status)); 1230 pVidPnInterface->pfnReleaseSourceModeSet(hVidPn, hNewVidPnSourceModeSet); 929 AssertFailed(); 930 } 931 932 NTSTATUS tmpStatus = pNewVidPnSourceModeSetInterface->pfnReleaseModeInfo(hNewVidPnSourceModeSet, pNewVidPnSourceModeInfo); 933 Assert(tmpStatus == STATUS_SUCCESS); 934 935 /* we're here because of an error */ 936 Assert(!NT_SUCCESS(Status)); 937 break; 938 } 939 940 if (!NT_SUCCESS(Status)) 941 { 942 AssertFailed(); 943 return Status; 944 } 945 946 if (sourceModeId != D3DDDI_ID_UNINITIALIZED) 947 { 948 if (pModeIdToPin) 949 { 950 *pModeIdToPin = sourceModeId; 951 } 952 Assert(iModeToPin >= 0); 953 if (fDoPin) 954 { 955 Status = pNewVidPnSourceModeSetInterface->pfnPinMode(hNewVidPnSourceModeSet, sourceModeId); 956 if (!NT_SUCCESS(Status)) 957 { 958 AssertFailed(); 959 return Status; 960 } 1231 961 } 1232 962 } 1233 963 else 1234 LOGREL(("pfnCreateNewSourceModeSet failed Status(0x%x)", Status)); 964 { 965 Assert(iModeToPin < 0); 966 } 967 968 Status = pVidPnInterface->pfnAssignSourceModeSet(hVidPn, VidPnSourceId, hNewVidPnSourceModeSet); 969 if (!NT_SUCCESS(Status)) 970 { 971 AssertFailed(); 972 return Status; 973 } 974 975 return Status; 976 } 977 978 static NTSTATUS vboxVidPnCreatePopulateTargetModeInfoFromLegacy(D3DKMDT_HVIDPN hVidPn, const DXGK_VIDPN_INTERFACE* pVidPnInterface, 979 const D3DDDI_VIDEO_PRESENT_TARGET_ID VidPnTargetId, 980 D3DKMDT_2DREGION *pResolutions, uint32_t cResolutions, 981 VIDEO_MODE_INFORMATION *pModeToPin, 982 D3DKMDT_VIDEO_PRESENT_TARGET_MODE_ID *pModeIdToPin, 983 BOOLEAN fDoPin 984 ) 985 { 986 D3DKMDT_HVIDPNTARGETMODESET hNewVidPnTargetModeSet; 987 const DXGK_VIDPNTARGETMODESET_INTERFACE *pNewVidPnTargetModeSetInterface; 988 989 if (pModeIdToPin) 990 *pModeIdToPin = D3DDDI_ID_UNINITIALIZED; 991 992 NTSTATUS Status = pVidPnInterface->pfnCreateNewTargetModeSet(hVidPn, 993 VidPnTargetId, 994 &hNewVidPnTargetModeSet, 995 &pNewVidPnTargetModeSetInterface); 996 if (!NT_SUCCESS(Status)) 997 { 998 AssertFailed(); 999 return Status; 1000 } 1001 1002 D3DKMDT_VIDEO_PRESENT_TARGET_MODE_ID targetModeId = D3DDDI_ID_UNINITIALIZED; 1003 1004 for (uint32_t i = 0; i < cResolutions; ++i) 1005 { 1006 D3DKMDT_2DREGION *pResolution = &pResolutions[i]; 1007 D3DKMDT_VIDPN_TARGET_MODE *pNewVidPnTargetModeInfo; 1008 Status = pNewVidPnTargetModeSetInterface->pfnCreateNewModeInfo(hNewVidPnTargetModeSet, &pNewVidPnTargetModeInfo); 1009 if (!NT_SUCCESS(Status)) 1010 { 1011 AssertFailed(); 1012 break; 1013 } 1014 1015 Status = vboxVidPnPopulateTargetModeInfoFromLegacy(pNewVidPnTargetModeInfo, pResolution); 1016 if (NT_SUCCESS(Status)) 1017 { 1018 if (pModeToPin && pModeToPin->VisScreenWidth == pResolution->cx 1019 && pModeToPin->VisScreenHeight == pResolution->cy) 1020 { 1021 targetModeId = pNewVidPnTargetModeInfo->Id; 1022 } 1023 Status = pNewVidPnTargetModeSetInterface->pfnAddMode(hNewVidPnTargetModeSet, pNewVidPnTargetModeInfo); 1024 if (NT_SUCCESS(Status)) 1025 { 1026 1027 /* success */ 1028 continue; 1029 } 1030 AssertFailed(); 1031 } 1032 else 1033 { 1034 AssertFailed(); 1035 } 1036 1037 NTSTATUS tmpStatus = pNewVidPnTargetModeSetInterface->pfnReleaseModeInfo(hNewVidPnTargetModeSet, pNewVidPnTargetModeInfo); 1038 Assert(tmpStatus == STATUS_SUCCESS); 1039 1040 /* we're here because of an error */ 1041 Assert(!NT_SUCCESS(Status)); 1042 break; 1043 } 1044 1045 if (!NT_SUCCESS(Status)) 1046 { 1047 AssertFailed(); 1048 return Status; 1049 } 1050 1051 if (targetModeId != D3DDDI_ID_UNINITIALIZED) 1052 { 1053 Assert(pModeToPin); 1054 1055 if (pModeIdToPin) 1056 { 1057 *pModeIdToPin = targetModeId; 1058 } 1059 1060 if (fDoPin) 1061 { 1062 Status = pNewVidPnTargetModeSetInterface->pfnPinMode(hNewVidPnTargetModeSet, targetModeId); 1063 if (!NT_SUCCESS(Status)) 1064 { 1065 AssertFailed(); 1066 return Status; 1067 } 1068 } 1069 } 1070 else 1071 { 1072 Assert(!pModeToPin); 1073 } 1074 1075 Status = pVidPnInterface->pfnAssignTargetModeSet(hVidPn, VidPnTargetId, hNewVidPnTargetModeSet); 1076 if (!NT_SUCCESS(Status)) 1077 { 1078 AssertFailed(); 1079 return Status; 1080 } 1081 1082 return Status; 1083 } 1084 1085 NTSTATUS vboxVidPnCreatePopulateVidPnPathFromLegacy(PVBOXMP_DEVEXT pDevExt, D3DKMDT_HVIDPN hVidPn, const DXGK_VIDPN_INTERFACE* pVidPnInterface, 1086 VIDEO_MODE_INFORMATION *pModes, uint32_t cModes, int iModeToPin, 1087 D3DKMDT_2DREGION *pResolutions, uint32_t cResolutions, 1088 const D3DDDI_VIDEO_PRESENT_SOURCE_ID VidPnSourceId, const D3DDDI_VIDEO_PRESENT_TARGET_ID VidPnTargetId) 1089 { 1090 NTSTATUS Status; 1091 1092 Status = vboxVidPnPathAdd(hVidPn, pVidPnInterface, VidPnSourceId, VidPnTargetId); 1093 if (!NT_SUCCESS(Status)) 1094 { 1095 AssertFailed(); 1096 return Status; 1097 } 1098 1099 VIDEO_MODE_INFORMATION *pModeToPin = iModeToPin >= 0 ? &pModes[iModeToPin] : NULL; 1100 Status = vboxVidPnCreatePopulateTargetModeInfoFromLegacy(hVidPn, pVidPnInterface, VidPnTargetId, pResolutions, cResolutions, pModeToPin, NULL, TRUE); 1101 if (!NT_SUCCESS(Status)) 1102 { 1103 AssertFailed(); 1104 return Status; 1105 } 1106 1107 Status = vboxVidPnCreatePopulateSourceModeInfoFromLegacy(hVidPn, pVidPnInterface, VidPnSourceId, pModes, cModes, iModeToPin, NULL, TRUE); 1108 if (!NT_SUCCESS(Status)) 1109 { 1110 AssertFailed(); 1111 return Status; 1112 } 1235 1113 1236 1114 return Status; … … 1367 1245 } 1368 1246 1247 static D3DKMDT_ENUMCOFUNCMODALITY_PIVOT_TYPE vboxVidPnCofuncModalityCurrentPathPivot(CONST DXGKARG_ENUMVIDPNCOFUNCMODALITY* pEnumCofuncModalityArg, 1248 D3DDDI_VIDEO_PRESENT_SOURCE_ID VidPnSourceId, D3DDDI_VIDEO_PRESENT_TARGET_ID VidPnTargetId) 1249 { 1250 switch (pEnumCofuncModalityArg->EnumPivotType) 1251 { 1252 case D3DKMDT_EPT_VIDPNSOURCE: 1253 if (pEnumCofuncModalityArg->EnumPivot.VidPnSourceId == VidPnSourceId) 1254 return D3DKMDT_EPT_VIDPNSOURCE; 1255 if (pEnumCofuncModalityArg->EnumPivot.VidPnSourceId == D3DDDI_ID_ALL) 1256 { 1257 #ifdef DEBUG_misha 1258 AssertFailed(); 1259 #endif 1260 return D3DKMDT_EPT_VIDPNSOURCE; 1261 } 1262 return D3DKMDT_EPT_NOPIVOT; 1263 case D3DKMDT_EPT_VIDPNTARGET: 1264 if (pEnumCofuncModalityArg->EnumPivot.VidPnTargetId == VidPnTargetId) 1265 return D3DKMDT_EPT_VIDPNTARGET; 1266 if (pEnumCofuncModalityArg->EnumPivot.VidPnTargetId == D3DDDI_ID_ALL) 1267 { 1268 #ifdef DEBUG_misha 1269 AssertFailed(); 1270 #endif 1271 return D3DKMDT_EPT_VIDPNTARGET; 1272 } 1273 return D3DKMDT_EPT_NOPIVOT; 1274 case D3DKMDT_EPT_SCALING: 1275 case D3DKMDT_EPT_ROTATION: 1276 case D3DKMDT_EPT_NOPIVOT: 1277 return D3DKMDT_EPT_NOPIVOT; 1278 default: 1279 AssertFailed(); 1280 return D3DKMDT_EPT_NOPIVOT; 1281 } 1282 } 1283 1284 NTSTATUS vboxVidPnHasPinnedTargetMode(D3DKMDT_HVIDPN hVidPn, const DXGK_VIDPN_INTERFACE* pVidPnInterface, 1285 D3DDDI_VIDEO_PRESENT_TARGET_ID VidPnTargetId, BOOLEAN *pfHas) 1286 { 1287 D3DKMDT_HVIDPNTARGETMODESET hCurVidPnTargetModeSet; 1288 const DXGK_VIDPNTARGETMODESET_INTERFACE *pCurVidPnTargetModeSetInterface; 1289 *pfHas = FALSE; 1290 NTSTATUS Status = pVidPnInterface->pfnAcquireTargetModeSet(hVidPn, 1291 VidPnTargetId, 1292 &hCurVidPnTargetModeSet, 1293 &pCurVidPnTargetModeSetInterface); 1294 if (!NT_SUCCESS(Status)) 1295 { 1296 AssertFailed(); 1297 return Status; 1298 } 1299 1300 CONST D3DKMDT_VIDPN_TARGET_MODE* pPinnedVidPnTargetModeInfo; 1301 Status = pCurVidPnTargetModeSetInterface->pfnAcquirePinnedModeInfo(hCurVidPnTargetModeSet, &pPinnedVidPnTargetModeInfo); 1302 if (Status == STATUS_GRAPHICS_MODE_NOT_PINNED) 1303 { 1304 pPinnedVidPnTargetModeInfo = NULL; 1305 Status = STATUS_SUCCESS; 1306 } 1307 else if (!NT_SUCCESS(Status)) 1308 { 1309 LOGREL(("pfnAcquirePinnedModeInfo failed Status(0x%x)", Status)); 1310 AssertFailed(); 1311 } 1312 else 1313 { 1314 Assert(pPinnedVidPnTargetModeInfo); 1315 NTSTATUS tmpStatus = pCurVidPnTargetModeSetInterface->pfnReleaseModeInfo(hCurVidPnTargetModeSet, pPinnedVidPnTargetModeInfo); 1316 Assert(NT_SUCCESS(tmpStatus)); 1317 *pfHas = TRUE; 1318 } 1319 1320 NTSTATUS tmpStatus = pVidPnInterface->pfnReleaseTargetModeSet(hVidPn, hCurVidPnTargetModeSet); 1321 Assert(tmpStatus == STATUS_SUCCESS); 1322 1323 return Status; 1324 } 1325 1326 NTSTATUS vboxVidPnHasPinnedSourceMode(D3DKMDT_HVIDPN hVidPn, const DXGK_VIDPN_INTERFACE* pVidPnInterface, 1327 D3DDDI_VIDEO_PRESENT_SOURCE_ID VidPnSourceId, BOOLEAN *pfHas) 1328 { 1329 D3DKMDT_HVIDPNSOURCEMODESET hCurVidPnSourceModeSet; 1330 const DXGK_VIDPNSOURCEMODESET_INTERFACE *pCurVidPnSourceModeSetInterface; 1331 *pfHas = FALSE; 1332 NTSTATUS Status = pVidPnInterface->pfnAcquireSourceModeSet(hVidPn, 1333 VidPnSourceId, 1334 &hCurVidPnSourceModeSet, 1335 &pCurVidPnSourceModeSetInterface); 1336 if (!NT_SUCCESS(Status)) 1337 { 1338 AssertFailed(); 1339 return Status; 1340 } 1341 1342 CONST D3DKMDT_VIDPN_SOURCE_MODE* pPinnedVidPnSourceModeInfo; 1343 Status = pCurVidPnSourceModeSetInterface->pfnAcquirePinnedModeInfo(hCurVidPnSourceModeSet, &pPinnedVidPnSourceModeInfo); 1344 if (Status == STATUS_GRAPHICS_MODE_NOT_PINNED) 1345 { 1346 pPinnedVidPnSourceModeInfo = NULL; 1347 Status = STATUS_SUCCESS; 1348 } 1349 else if (!NT_SUCCESS(Status)) 1350 { 1351 LOGREL(("pfnAcquirePinnedModeInfo failed Status(0x%x)", Status)); 1352 AssertFailed(); 1353 } 1354 else 1355 { 1356 Assert(pPinnedVidPnSourceModeInfo); 1357 NTSTATUS tmpStatus = pCurVidPnSourceModeSetInterface->pfnReleaseModeInfo(hCurVidPnSourceModeSet, pPinnedVidPnSourceModeInfo); 1358 Assert(NT_SUCCESS(tmpStatus)); 1359 *pfHas = TRUE; 1360 } 1361 1362 NTSTATUS tmpStatus = pVidPnInterface->pfnReleaseSourceModeSet(hVidPn, hCurVidPnSourceModeSet); 1363 Assert(tmpStatus == STATUS_SUCCESS); 1364 1365 return Status; 1366 } 1367 1368 static NTSTATUS vboxVidPnCofuncModalityForPathTarget(PVBOXVIDPNCOFUNCMODALITY pCbContext, 1369 D3DDDI_VIDEO_PRESENT_SOURCE_ID VidPnSourceId, D3DDDI_VIDEO_PRESENT_TARGET_ID VidPnTargetId) 1370 { 1371 PVBOXMP_DEVEXT pDevExt = pCbContext->pDevExt; 1372 D3DKMDT_HVIDPN hVidPn = pCbContext->pEnumCofuncModalityArg->hConstrainingVidPn; 1373 const DXGK_VIDPN_INTERFACE* pVidPnInterface = pCbContext->pVidPnInterface; 1374 PVBOXWDDM_VIDEOMODES_INFO pInfo = &pCbContext->pInfos[VidPnTargetId]; 1375 1376 D3DKMDT_HVIDPNTARGETMODESET hNewVidPnTargetModeSet = NULL; 1377 const DXGK_VIDPNTARGETMODESET_INTERFACE *pNewVidPnTargetModeSetInterface; 1378 1379 D3DKMDT_HVIDPNSOURCEMODESET hCurVidPnSourceModeSet; 1380 const DXGK_VIDPNSOURCEMODESET_INTERFACE *pCurVidPnSourceModeSetInterface; 1381 NTSTATUS Status = pVidPnInterface->pfnAcquireSourceModeSet(hVidPn, 1382 VidPnSourceId, 1383 &hCurVidPnSourceModeSet, 1384 &pCurVidPnSourceModeSetInterface); 1385 if (!NT_SUCCESS(Status)) 1386 { 1387 AssertFailed(); 1388 return Status; 1389 } 1390 1391 CONST D3DKMDT_VIDPN_SOURCE_MODE* pPinnedVidPnSourceModeInfo; 1392 Status = pCurVidPnSourceModeSetInterface->pfnAcquirePinnedModeInfo(hCurVidPnSourceModeSet, &pPinnedVidPnSourceModeInfo); 1393 if (Status == STATUS_GRAPHICS_MODE_NOT_PINNED) 1394 { 1395 pPinnedVidPnSourceModeInfo = NULL; 1396 Status = STATUS_SUCCESS; 1397 } 1398 else if (!NT_SUCCESS(Status)) 1399 { 1400 LOGREL(("pfnAcquirePinnedModeInfo failed Status(0x%x)", Status)); 1401 AssertFailed(); 1402 } 1403 else 1404 { 1405 Assert(pPinnedVidPnSourceModeInfo); 1406 } 1407 1408 if (NT_SUCCESS(Status)) 1409 { 1410 Status = pVidPnInterface->pfnCreateNewTargetModeSet(hVidPn, 1411 VidPnTargetId, 1412 &hNewVidPnTargetModeSet, 1413 &pNewVidPnTargetModeSetInterface); 1414 if (NT_SUCCESS(Status)) 1415 { 1416 Assert(hNewVidPnTargetModeSet); 1417 for (uint32_t i = 0; i < pInfo->cResolutions; ++i) 1418 { 1419 D3DKMDT_2DREGION *pResolution = &pInfo->aResolutions[i]; 1420 if (pPinnedVidPnSourceModeInfo) 1421 { 1422 if (pPinnedVidPnSourceModeInfo->Format.Graphics.PrimSurfSize.cx != pResolution->cx 1423 || pPinnedVidPnSourceModeInfo->Format.Graphics.PrimSurfSize.cy != pResolution->cy) 1424 { 1425 continue; 1426 } 1427 } 1428 1429 D3DKMDT_VIDPN_TARGET_MODE *pNewVidPnTargetModeInfo; 1430 Status = pNewVidPnTargetModeSetInterface->pfnCreateNewModeInfo(hNewVidPnTargetModeSet, &pNewVidPnTargetModeInfo); 1431 Assert(Status == STATUS_SUCCESS); 1432 if (NT_SUCCESS(Status)) 1433 { 1434 Status = vboxVidPnPopulateTargetModeInfoFromLegacy(pNewVidPnTargetModeInfo, pResolution); 1435 Assert(Status == STATUS_SUCCESS); 1436 if (NT_SUCCESS(Status)) 1437 { 1438 Status = pNewVidPnTargetModeSetInterface->pfnAddMode(hNewVidPnTargetModeSet, pNewVidPnTargetModeInfo); 1439 Assert(Status == STATUS_SUCCESS); 1440 if (NT_SUCCESS(Status)) 1441 { 1442 /* success */ 1443 continue; 1444 } 1445 } 1446 1447 NTSTATUS tmpStatus = pNewVidPnTargetModeSetInterface->pfnReleaseModeInfo(hNewVidPnTargetModeSet, pNewVidPnTargetModeInfo); 1448 Assert(tmpStatus == STATUS_SUCCESS); 1449 } 1450 /* we're here because of an error */ 1451 Assert(!NT_SUCCESS(Status)); 1452 break; 1453 } 1454 } 1455 else 1456 { 1457 AssertFailed(); 1458 } 1459 } 1460 else 1461 { 1462 AssertFailed(); 1463 } 1464 1465 if (pPinnedVidPnSourceModeInfo) 1466 { 1467 NTSTATUS tmpStatus = pCurVidPnSourceModeSetInterface->pfnReleaseModeInfo(hCurVidPnSourceModeSet, pPinnedVidPnSourceModeInfo); 1468 Assert(tmpStatus == STATUS_SUCCESS); 1469 } 1470 1471 NTSTATUS tmpStatus = pVidPnInterface->pfnReleaseSourceModeSet(hVidPn, hCurVidPnSourceModeSet); 1472 Assert(tmpStatus == STATUS_SUCCESS); 1473 1474 if (NT_SUCCESS(Status)) 1475 { 1476 Assert(hNewVidPnTargetModeSet); 1477 Status = pVidPnInterface->pfnAssignTargetModeSet(hVidPn, VidPnTargetId, hNewVidPnTargetModeSet); 1478 if (!NT_SUCCESS(Status)) 1479 { 1480 AssertFailed(); 1481 tmpStatus = pVidPnInterface->pfnReleaseTargetModeSet(hVidPn, hNewVidPnTargetModeSet); 1482 Assert(tmpStatus == STATUS_SUCCESS); 1483 } 1484 } 1485 1486 return Status; 1487 } 1488 1489 static NTSTATUS vboxVidPnCofuncModalityForPathSource(PVBOXVIDPNCOFUNCMODALITY pCbContext, 1490 D3DDDI_VIDEO_PRESENT_SOURCE_ID VidPnSourceId, D3DDDI_VIDEO_PRESENT_TARGET_ID VidPnTargetId) 1491 { 1492 PVBOXMP_DEVEXT pDevExt = pCbContext->pDevExt; 1493 D3DKMDT_HVIDPN hVidPn = pCbContext->pEnumCofuncModalityArg->hConstrainingVidPn; 1494 const DXGK_VIDPN_INTERFACE* pVidPnInterface = pCbContext->pVidPnInterface; 1495 PVBOXWDDM_VIDEOMODES_INFO pInfo = &pCbContext->pInfos[VidPnTargetId]; 1496 D3DKMDT_HVIDPNSOURCEMODESET hNewVidPnSourceModeSet = NULL; 1497 const DXGK_VIDPNSOURCEMODESET_INTERFACE *pNewVidPnSourceModeSetInterface; 1498 1499 D3DKMDT_HVIDPNTARGETMODESET hCurVidPnTargetModeSet; 1500 const DXGK_VIDPNTARGETMODESET_INTERFACE *pCurVidPnTargetModeSetInterface; 1501 NTSTATUS Status = pVidPnInterface->pfnAcquireTargetModeSet(hVidPn, 1502 VidPnTargetId, 1503 &hCurVidPnTargetModeSet, 1504 &pCurVidPnTargetModeSetInterface); 1505 if (!NT_SUCCESS(Status)) 1506 { 1507 AssertFailed(); 1508 return Status; 1509 } 1510 1511 CONST D3DKMDT_VIDPN_TARGET_MODE* pPinnedVidPnTargetModeInfo; 1512 Status = pCurVidPnTargetModeSetInterface->pfnAcquirePinnedModeInfo(hCurVidPnTargetModeSet, &pPinnedVidPnTargetModeInfo); 1513 if (Status == STATUS_GRAPHICS_MODE_NOT_PINNED) 1514 { 1515 pPinnedVidPnTargetModeInfo = NULL; 1516 Status = STATUS_SUCCESS; 1517 } 1518 else if (!NT_SUCCESS(Status)) 1519 { 1520 LOGREL(("pfnAcquirePinnedModeInfo failed Status(0x%x)", Status)); 1521 AssertFailed(); 1522 } 1523 else 1524 { 1525 Assert(pPinnedVidPnTargetModeInfo); 1526 } 1527 1528 if (NT_SUCCESS(Status)) 1529 { 1530 NTSTATUS Status = pVidPnInterface->pfnCreateNewSourceModeSet(hVidPn, 1531 VidPnSourceId, 1532 &hNewVidPnSourceModeSet, 1533 &pNewVidPnSourceModeSetInterface); 1534 if (NT_SUCCESS(Status)) 1535 { 1536 Assert(hNewVidPnSourceModeSet); 1537 for (uint32_t i = 0; i < pInfo->cModes; ++i) 1538 { 1539 VIDEO_MODE_INFORMATION *pMode = &pInfo->aModes[i]; 1540 if (pPinnedVidPnTargetModeInfo) 1541 { 1542 if (pPinnedVidPnTargetModeInfo->VideoSignalInfo.ActiveSize.cx != pMode->VisScreenWidth 1543 || pPinnedVidPnTargetModeInfo->VideoSignalInfo.ActiveSize.cy != pMode->VisScreenHeight) 1544 { 1545 continue; 1546 } 1547 } 1548 1549 D3DKMDT_VIDPN_SOURCE_MODE *pNewVidPnSourceModeInfo; 1550 Status = pNewVidPnSourceModeSetInterface->pfnCreateNewModeInfo(hNewVidPnSourceModeSet, &pNewVidPnSourceModeInfo); 1551 Assert(Status == STATUS_SUCCESS); 1552 if (NT_SUCCESS(Status)) 1553 { 1554 Status = vboxVidPnPopulateSourceModeInfoFromLegacy(pNewVidPnSourceModeInfo, pMode); 1555 Assert(Status == STATUS_SUCCESS); 1556 if (NT_SUCCESS(Status)) 1557 { 1558 Status = pNewVidPnSourceModeSetInterface->pfnAddMode(hNewVidPnSourceModeSet, pNewVidPnSourceModeInfo); 1559 Assert(Status == STATUS_SUCCESS); 1560 if (NT_SUCCESS(Status)) 1561 { 1562 /* success */ 1563 continue; 1564 } 1565 } 1566 1567 NTSTATUS tmpStatus = pNewVidPnSourceModeSetInterface->pfnReleaseModeInfo(hNewVidPnSourceModeSet, pNewVidPnSourceModeInfo); 1568 Assert(tmpStatus == STATUS_SUCCESS); 1569 } 1570 /* we're here because of an error */ 1571 Assert(!NT_SUCCESS(Status)); 1572 break; 1573 } 1574 } 1575 else 1576 { 1577 AssertFailed(); 1578 } 1579 } 1580 else 1581 { 1582 AssertFailed(); 1583 } 1584 1585 if (pPinnedVidPnTargetModeInfo) 1586 { 1587 NTSTATUS tmpStatus = pCurVidPnTargetModeSetInterface->pfnReleaseModeInfo(hCurVidPnTargetModeSet, pPinnedVidPnTargetModeInfo); 1588 Assert(tmpStatus == STATUS_SUCCESS); 1589 } 1590 1591 NTSTATUS tmpStatus = pVidPnInterface->pfnReleaseTargetModeSet(hVidPn, hCurVidPnTargetModeSet); 1592 Assert(tmpStatus == STATUS_SUCCESS); 1593 1594 if (NT_SUCCESS(Status)) 1595 { 1596 Assert(hNewVidPnSourceModeSet); 1597 Status = pVidPnInterface->pfnAssignSourceModeSet(hVidPn, VidPnSourceId, hNewVidPnSourceModeSet); 1598 if (!NT_SUCCESS(Status)) 1599 { 1600 AssertFailed(); 1601 tmpStatus = pVidPnInterface->pfnReleaseSourceModeSet(hVidPn, hNewVidPnSourceModeSet); 1602 Assert(tmpStatus == STATUS_SUCCESS); 1603 } 1604 } 1605 1606 return Status; 1607 } 1608 1369 1609 NTSTATUS vboxVidPnCofuncModalityForPath(PVBOXVIDPNCOFUNCMODALITY pCbContext, 1370 D3DDDI_VIDEO_PRESENT_SOURCE_ID VidPnSourceId, D3DDDI_VIDEO_PRESENT_TARGET_ID VidPnTargetId, 1371 BOOLEAN bModesAllowed) 1610 D3DDDI_VIDEO_PRESENT_SOURCE_ID VidPnSourceId, D3DDDI_VIDEO_PRESENT_TARGET_ID VidPnTargetId) 1372 1611 { 1373 1612 PVBOXMP_DEVEXT pDevExt = pCbContext->pDevExt; 1374 D3DKMDT_HVIDPN h DesiredVidPn = pCbContext->pEnumCofuncModalityArg->hConstrainingVidPn;1613 D3DKMDT_HVIDPN hVidPn = pCbContext->pEnumCofuncModalityArg->hConstrainingVidPn; 1375 1614 const DXGK_VIDPN_INTERFACE* pVidPnInterface = pCbContext->pVidPnInterface; 1376 1615 NTSTATUS Status = STATUS_SUCCESS; 1377 1616 pCbContext->Status = STATUS_SUCCESS; 1378 1617 PVBOXWDDM_VIDEOMODES_INFO pInfo = &pCbContext->pInfos[VidPnTargetId]; 1379 BOOLEAN bConversionSupported = bModesAllowed; 1380 1381 D3DKMDT_HVIDPNSOURCEMODESET hCurVidPnSourceModeSet; 1382 const DXGK_VIDPNSOURCEMODESET_INTERFACE *pCurVidPnSourceModeSetInterface; 1383 1384 Status = pVidPnInterface->pfnAcquireSourceModeSet(hDesiredVidPn, 1385 VidPnSourceId, 1386 &hCurVidPnSourceModeSet, 1387 &pCurVidPnSourceModeSetInterface); 1388 Assert(Status == STATUS_SUCCESS); 1389 if (Status == STATUS_SUCCESS) 1390 { 1391 CONST D3DKMDT_VIDPN_SOURCE_MODE* pPinnedVidPnSourceModeInfo; 1392 Status = pCurVidPnSourceModeSetInterface->pfnAcquirePinnedModeInfo(hCurVidPnSourceModeSet, &pPinnedVidPnSourceModeInfo); 1393 Assert(Status == STATUS_SUCCESS || Status == STATUS_GRAPHICS_MODE_NOT_PINNED); 1394 if (Status == STATUS_GRAPHICS_MODE_NOT_PINNED) 1395 { 1396 pPinnedVidPnSourceModeInfo = NULL; 1397 Status = STATUS_SUCCESS; 1398 } 1399 else if (Status != STATUS_SUCCESS) 1400 LOGREL(("pfnAcquirePinnedModeInfo failed Status(0x%x)", Status)); 1401 1402 D3DKMDT_HVIDPNTARGETMODESET hCurVidPnTargetModeSet; 1403 const DXGK_VIDPNTARGETMODESET_INTERFACE *pCurVidPnTargetModeSetInterface; 1404 Status = pVidPnInterface->pfnAcquireTargetModeSet(hDesiredVidPn, 1405 VidPnTargetId, 1406 &hCurVidPnTargetModeSet, 1407 &pCurVidPnTargetModeSetInterface); 1408 Assert(Status == STATUS_SUCCESS); 1409 if (Status == STATUS_SUCCESS) 1410 { 1411 CONST D3DKMDT_VIDPN_TARGET_MODE* pPinnedVidPnTargetModeInfo; 1412 Status = pCurVidPnTargetModeSetInterface->pfnAcquirePinnedModeInfo(hCurVidPnTargetModeSet, &pPinnedVidPnTargetModeInfo); 1413 Assert(Status == STATUS_SUCCESS || Status == STATUS_GRAPHICS_MODE_NOT_PINNED); 1414 if (Status == STATUS_GRAPHICS_MODE_NOT_PINNED) 1415 { 1416 pPinnedVidPnTargetModeInfo = NULL; 1417 Status = STATUS_SUCCESS; 1418 } 1419 else if (Status != STATUS_SUCCESS) 1420 LOGREL(("pfnAcquirePinnedModeInfo failed Status(0x%x)", Status)); 1421 1422 bool bSrcPinned = pPinnedVidPnSourceModeInfo 1423 || (pCbContext->pEnumCofuncModalityArg->EnumPivotType == D3DKMDT_EPT_VIDPNSOURCE 1424 && (pCbContext->pEnumCofuncModalityArg->EnumPivot.VidPnSourceId == VidPnSourceId 1425 || pCbContext->pEnumCofuncModalityArg->EnumPivot.VidPnSourceId == D3DDDI_ID_ALL)); 1426 bool bTgtPinned = pPinnedVidPnTargetModeInfo 1427 || (pCbContext->pEnumCofuncModalityArg->EnumPivotType == D3DKMDT_EPT_VIDPNTARGET 1428 && (pCbContext->pEnumCofuncModalityArg->EnumPivot.VidPnTargetId == VidPnTargetId 1429 || pCbContext->pEnumCofuncModalityArg->EnumPivot.VidPnTargetId == D3DDDI_ID_ALL)); 1430 if (bSrcPinned) 1431 { 1432 if (!bTgtPinned) 1433 { 1434 #if 1 1435 uint32_t cResolutions = bConversionSupported ? pInfo->cResolutions : 0; 1436 Status = vboxVidPnCreatePopulateTargetModeSetFromLegacy(pDevExt, hDesiredVidPn, pVidPnInterface, 1437 VidPnTargetId, 1438 pInfo->aResolutions, 1439 cResolutions, 1440 NULL, 1441 0, /* flags */ 1442 NULL); 1443 Assert(Status == STATUS_SUCCESS); 1444 #else 1445 /* adjust target mode set relative to source mode set */ 1446 /* 1. get list of resolutions for source and for target 1447 * 2. if they do not match create and populate a new set */ 1448 SIZE_T cTgtModes; 1449 SIZE_T cSrcModes; 1450 Status = pCurVidPnTargetModeSetInterface->pfnGetNumModes(hCurVidPnTargetModeSet, &cTgtModes); 1451 Assert(Status == STATUS_SUCCESS); 1452 if (Status == STATUS_SUCCESS) 1453 { 1454 Status = pCurVidPnSourceModeSetInterface->pfnGetNumModes(hCurVidPnSourceModeSet, &cSrcModes); 1455 Assert(Status == STATUS_SUCCESS); 1456 if (Status == STATUS_SUCCESS) 1457 { 1458 D3DKMDT_2DREGION *pSrcResolutions = cSrcModes ? (D3DKMDT_2DREGION*)vboxWddmMemAlloc(cSrcModes * sizeof (pSrcResolutions[0])) : NULL; 1459 Assert(pSrcResolutions || !cSrcModes); 1460 if (pSrcResolutions || !cSrcModes) 1461 { 1462 VBOXVIDPNPOPRESOLUTIONENUM Info = {0}; 1463 if (cSrcModes) 1464 { 1465 Info.pResolutions = pSrcResolutions; 1466 Info.cResolutions = cSrcModes; 1467 Status = vboxVidPnEnumSourceModes(hCurVidPnSourceModeSet, pCurVidPnSourceModeSetInterface, 1468 vboxVidPnPopulateResolutionsFromSourceModeSetEnum, &Info); 1469 Assert(Status == STATUS_SUCCESS); 1470 } 1471 if (Status == STATUS_SUCCESS) 1472 { 1473 Assert(Info.Status == STATUS_SUCCESS); 1474 if (Info.Status == STATUS_SUCCESS) 1475 { 1476 D3DKMDT_2DREGION *pTgtResolutions = cTgtModes ? (D3DKMDT_2DREGION*)vboxWddmMemAlloc(cTgtModes * sizeof (pTgtResolutions[0])) : NULL; 1477 Assert(pTgtResolutions || !cTgtModes); 1478 if (pTgtResolutions || !cTgtModes) 1479 { 1480 int cSrcResolutions = Info.cResultResolutions; 1481 memset(&Info, 0, sizeof (Info)); 1482 if (cTgtModes) 1483 { 1484 Info.pResolutions = pTgtResolutions; 1485 Info.cResolutions = cTgtModes; 1486 Status = vboxVidPnEnumTargetModes(hCurVidPnTargetModeSet, pCurVidPnTargetModeSetInterface, 1487 vboxVidPnPopulateResolutionsFromTargetModeSetEnum, &Info); 1488 Assert(Status == STATUS_SUCCESS); 1489 } 1490 if (Status == STATUS_SUCCESS) 1491 { 1492 Assert(Info.Status == STATUS_SUCCESS); 1493 if (Info.Status == STATUS_SUCCESS) 1494 { 1495 bool bNeedSet; 1496 Assert(cTgtModes == Info.cResultResolutions); 1497 if (cSrcResolutions == Info.cResultResolutions) 1498 { 1499 /* need to check all modes */ 1500 bNeedSet = !vboxWddmVideoResolutionsMatch(pSrcResolutions, pTgtResolutions, cSrcResolutions); 1501 } 1502 else 1503 { 1504 bNeedSet = true; 1505 } 1506 1507 if (bNeedSet) 1508 { 1509 Status = vboxVidPnCreatePopulateTargetModeSetFromLegacy(pDevExt, hDesiredVidPn, pVidPnInterface, 1510 VidPnTargetId, 1511 pSrcResolutions, 1512 cSrcResolutions, 1513 NULL, 1514 0, /* flags */ 1515 NULL); 1516 Assert(Status == STATUS_SUCCESS); 1517 } 1518 } 1519 else 1520 { 1521 Status = Info.Status; 1522 } 1523 } 1524 1525 if (pTgtResolutions) 1526 vboxWddmMemFree(pTgtResolutions); 1527 } 1528 else 1529 { 1530 Status = STATUS_NO_MEMORY; 1531 } 1532 } 1533 else 1534 { 1535 Status = Info.Status; 1536 } 1537 } 1538 if (pSrcResolutions) 1539 vboxWddmMemFree(pSrcResolutions); 1540 } 1541 else 1542 { 1543 Status = STATUS_NO_MEMORY; 1544 } 1545 } 1546 } 1547 #endif 1548 } 1549 } 1550 else if (bTgtPinned) 1551 { 1552 #if 1 1553 uint32_t cModes = bConversionSupported ? pInfo->cModes : 0; 1554 Status = Status = vboxVidPnCreatePopulateSourceModeSetFromLegacy(pDevExt, hDesiredVidPn, pVidPnInterface, 1555 VidPnSourceId, 1556 pInfo->aModes, cModes, -1, NULL); 1557 Assert(Status == STATUS_SUCCESS); 1558 #else 1559 /* adjust source mode set relative to target mode set */ 1560 /* 1. get list of modes for target resolutions 1561 * 2. get list of modes for sources 1562 * 3. if modes do not match create and populate new set */ 1563 SIZE_T cTgtModes; 1564 SIZE_T cSrcModes; 1565 Status = pCurVidPnTargetModeSetInterface->pfnGetNumModes(hCurVidPnTargetModeSet, &cTgtModes); 1566 Assert(Status == STATUS_SUCCESS); 1567 if (Status == STATUS_SUCCESS) 1568 { 1569 Status = pCurVidPnSourceModeSetInterface->pfnGetNumModes(hCurVidPnSourceModeSet, &cSrcModes); 1570 Assert(Status == STATUS_SUCCESS); 1571 if (Status == STATUS_SUCCESS) 1572 { 1573 VIDEO_MODE_INFORMATION *pSrcModes = cSrcModes ? (VIDEO_MODE_INFORMATION*)vboxWddmMemAlloc(cSrcModes * sizeof (pSrcModes[0])) : NULL; 1574 Assert(pSrcModes || !cSrcModes); 1575 if (pSrcModes || !cSrcModes) 1576 { 1577 VBOXVIDPNPOPMODETARGETENUM Info = {0}; 1578 if (cSrcModes) 1579 { 1580 Info.Base.pModes = pSrcModes; 1581 Info.Base.cModes = cSrcModes; 1582 Status = vboxVidPnEnumSourceModes(hCurVidPnSourceModeSet, pCurVidPnSourceModeSetInterface, 1583 vboxVidPnPopulateModesFromSourceModeSetEnum, &Info.Base); 1584 Assert(Status == STATUS_SUCCESS); 1585 } 1586 if (Status == STATUS_SUCCESS) 1587 { 1588 Assert(Info.Base.Status == STATUS_SUCCESS); 1589 if (Info.Base.Status == STATUS_SUCCESS) 1590 { 1591 VIDEO_MODE_INFORMATION *pTgtModes = cTgtModes ? (VIDEO_MODE_INFORMATION*)vboxWddmMemAlloc(pInfo->cModes * sizeof (pTgtModes[0])) : NULL; 1592 Assert(pTgtModes || !cTgtModes); 1593 if (pTgtModes || !cTgtModes) 1594 { 1595 int cSrcResultModes = Info.Base.cModes; 1596 Assert(cSrcResultModes == cSrcModes); 1597 memset(&Info, 0, sizeof (Info)); 1598 if (cTgtModes) 1599 { 1600 Info.Base.pModes = pTgtModes; 1601 Info.Base.cModes = pInfo->cModes; 1602 Info.pSuperset = pInfo->aModes; 1603 Info.cSuperset = pInfo->cModes; 1604 Status = vboxVidPnEnumTargetModes(hCurVidPnTargetModeSet, pCurVidPnTargetModeSetInterface, 1605 vboxVidPnPopulateModesFromTargetModeSetEnum, &Info); 1606 Assert(Status == STATUS_SUCCESS); 1607 } 1608 if (Status == STATUS_SUCCESS) 1609 { 1610 Assert(Info.Base.Status == STATUS_SUCCESS); 1611 if (Info.Base.Status == STATUS_SUCCESS) 1612 { 1613 bool bNeedSet; 1614 Assert((int)cTgtModes <= Info.Base.cResultModes); 1615 if (cSrcResultModes == Info.Base.cResultModes) 1616 { 1617 /* need to check all modes */ 1618 bNeedSet = !vboxWddmVideoModesMatch(pSrcModes, pTgtModes, cSrcResultModes); 1619 } 1620 else 1621 { 1622 bNeedSet = true; 1623 } 1624 1625 if (bNeedSet) 1626 { 1627 Status = Status = vboxVidPnCreatePopulateSourceModeSetFromLegacy(pDevExt, hDesiredVidPn, pVidPnInterface, 1628 VidPnSourceId, 1629 pTgtModes, Info.Base.cResultModes, -1, NULL); 1630 Assert(Status == STATUS_SUCCESS); 1631 } 1632 } 1633 else 1634 { 1635 Status = Info.Base.Status; 1636 } 1637 } 1638 1639 if (pTgtModes) 1640 vboxWddmMemFree(pTgtModes); 1641 } 1642 else 1643 { 1644 Status = STATUS_NO_MEMORY; 1645 } 1646 } 1647 else 1648 { 1649 Status = Info.Base.Status; 1650 } 1651 } 1652 if (pSrcModes) 1653 vboxWddmMemFree(pSrcModes); 1654 } 1655 else 1656 { 1657 Status = STATUS_NO_MEMORY; 1658 } 1659 } 1660 } 1661 #endif 1662 } 1663 else 1664 { 1665 #if 1 1666 uint32_t cModes = bConversionSupported ? pInfo->cModes : 0; 1667 Status = Status = vboxVidPnCreatePopulateSourceModeSetFromLegacy(pDevExt, hDesiredVidPn, pVidPnInterface, 1668 VidPnSourceId, 1669 pInfo->aModes, cModes, -1, NULL); 1670 Assert(Status == STATUS_SUCCESS); 1671 1672 uint32_t cResolutions = bConversionSupported ? pInfo->cResolutions : 0; 1673 Status = vboxVidPnCreatePopulateTargetModeSetFromLegacy(pDevExt, hDesiredVidPn, pVidPnInterface, 1674 VidPnTargetId, 1675 pInfo->aResolutions, 1676 cResolutions, 1677 NULL, 1678 0, 1679 NULL); 1680 Assert(Status == STATUS_SUCCESS); 1681 #else 1682 /* neither Source nor Target are pinned */ 1683 /* 1. get list of target resolutions 1684 * 2. if resolutions do not match with the complete list we have build - create and populate new 1685 * 3. get list of modes for sources 1686 * 4. if modes do not match with the complete list we have - create and populate a new set */ 1687 SIZE_T cTgtModes; 1688 SIZE_T cSrcModes; 1689 Status = pCurVidPnSourceModeSetInterface->pfnGetNumModes(hCurVidPnSourceModeSet, &cSrcModes); 1690 Assert(Status == STATUS_SUCCESS); 1691 if (Status == STATUS_SUCCESS) 1692 { 1693 bool bNeedSet = false; 1694 uint32_t cModes = bConversionSupported ? pInfo->cModes : 0; 1695 if (cSrcModes != cModes) 1696 { 1697 bNeedSet = true; 1698 } 1699 else 1700 { 1701 VIDEO_MODE_INFORMATION *pSrcModes = cSrcModes ? (VIDEO_MODE_INFORMATION*)vboxWddmMemAlloc(cSrcModes * sizeof (pSrcModes[0])) : NULL; 1702 Assert(pSrcModes || !cSrcModes); 1703 if (pSrcModes || !cSrcModes) 1704 { 1705 VBOXVIDPNPOPMODETARGETENUM Info = {0}; 1706 if (cSrcModes) 1707 { 1708 Info.Base.pModes = pSrcModes; 1709 Info.Base.cModes = cSrcModes; 1710 Status = vboxVidPnEnumSourceModes(hCurVidPnSourceModeSet, pCurVidPnSourceModeSetInterface, 1711 vboxVidPnPopulateModesFromSourceModeSetEnum, &Info.Base); 1712 Assert(Status == STATUS_SUCCESS); 1713 } 1714 if (Status == STATUS_SUCCESS) 1715 { 1716 Assert(Info.Base.Status == STATUS_SUCCESS); 1717 if (Info.Base.Status == STATUS_SUCCESS) 1718 { 1719 Assert(cSrcModes == Info.Base.cResultModes); 1720 if (cSrcModes == Info.Base.cResultModes) 1721 { 1722 /* need to check all modes */ 1723 bNeedSet = !vboxWddmVideoModesMatch(pSrcModes, pInfo->aModes, cModes); 1724 } 1725 else 1726 { 1727 bNeedSet = true; 1728 } 1729 } 1730 } 1731 if (pSrcModes) 1732 vboxWddmMemFree(pSrcModes); 1733 } 1734 else 1735 { 1736 Status = STATUS_NO_MEMORY; 1737 } 1738 } 1739 1740 if (Status == STATUS_SUCCESS && bNeedSet) 1741 { 1742 Status = Status = vboxVidPnCreatePopulateSourceModeSetFromLegacy(pDevExt, hDesiredVidPn, pVidPnInterface, 1743 VidPnSourceId, 1744 pInfo->aModes, cModes, -1, NULL); 1745 Assert(Status == STATUS_SUCCESS); 1746 } 1747 1748 if (Status == STATUS_SUCCESS) 1749 { 1750 Status = pCurVidPnTargetModeSetInterface->pfnGetNumModes(hCurVidPnTargetModeSet, &cTgtModes); 1751 Assert(Status == STATUS_SUCCESS); 1752 if (Status == STATUS_SUCCESS) 1753 { 1754 bool bNeedSet = false; 1755 uint32_t cResolutions = bConversionSupported ? pInfo->cResolutions : 0; 1756 if (cTgtModes == cResolutions) 1757 { 1758 D3DKMDT_2DREGION *pTgtResolutions = cTgtModes ? (D3DKMDT_2DREGION*)vboxWddmMemAlloc(cTgtModes * sizeof (pTgtResolutions[0])) : NULL; 1759 Assert(pTgtResolutions || !cTgtModes); 1760 if (pTgtResolutions || !cTgtModes) 1761 { 1762 VBOXVIDPNPOPRESOLUTIONENUM Info = {0}; 1763 if (cTgtModes) 1764 { 1765 Info.pResolutions = pTgtResolutions; 1766 Info.cResolutions = cTgtModes; 1767 Status = vboxVidPnEnumTargetModes(hCurVidPnTargetModeSet, pCurVidPnTargetModeSetInterface, 1768 vboxVidPnPopulateResolutionsFromTargetModeSetEnum, &Info); 1769 Assert(Status == STATUS_SUCCESS); 1770 } 1771 if (Status == STATUS_SUCCESS) 1772 { 1773 Assert(Info.Status == STATUS_SUCCESS); 1774 if (Info.Status == STATUS_SUCCESS) 1775 { 1776 Assert(cTgtModes == Info.cResultResolutions); 1777 if (Info.cResultResolutions == cResolutions) 1778 { 1779 /* need to check all modes */ 1780 bNeedSet = !vboxWddmVideoResolutionsMatch(pInfo->aResolutions, pTgtResolutions, cResolutions); 1781 } 1782 else 1783 { 1784 bNeedSet = true; 1785 } 1786 } 1787 else 1788 { 1789 Status = Info.Status; 1790 } 1791 } 1792 1793 if (pTgtResolutions) 1794 vboxWddmMemFree(pTgtResolutions); 1795 } 1796 else 1797 { 1798 Status = STATUS_NO_MEMORY; 1799 } 1800 } 1801 else 1802 { 1803 bNeedSet = true; 1804 } 1805 1806 if (Status == STATUS_SUCCESS && bNeedSet) 1807 { 1808 Status = vboxVidPnCreatePopulateTargetModeSetFromLegacy(pDevExt, hDesiredVidPn, pVidPnInterface, 1809 VidPnTargetId, 1810 pInfo->aResolutions, 1811 cResolutions, 1812 NULL, 1813 0, /* flags */ 1814 NULL); 1815 Assert(Status == STATUS_SUCCESS); 1816 } 1817 } 1818 } 1819 } 1820 #endif 1821 } 1822 1823 if (pPinnedVidPnTargetModeInfo) 1824 { 1825 pCurVidPnTargetModeSetInterface->pfnReleaseModeInfo(hCurVidPnTargetModeSet, pPinnedVidPnTargetModeInfo); 1826 } 1827 pVidPnInterface->pfnReleaseTargetModeSet(hDesiredVidPn, hCurVidPnTargetModeSet); 1828 } 1829 else 1830 LOGREL(("pfnAcquireTargetModeSet failed Status(0x%x)", Status)); 1831 1832 if (pPinnedVidPnSourceModeInfo) 1833 { 1834 if (Status == STATUS_SUCCESS) 1835 { 1836 D3DDDI_MULTISAMPLINGMETHOD Msm; 1837 Msm.NumSamples = 1; 1838 Msm.NumQualityLevels = 0; 1839 1840 Status = pVidPnInterface->pfnAssignMultisamplingMethodSet(hDesiredVidPn, VidPnSourceId, 1, &Msm); 1841 Assert(Status == STATUS_SUCCESS); 1842 } 1843 1844 pCurVidPnSourceModeSetInterface->pfnReleaseModeInfo(hCurVidPnSourceModeSet, pPinnedVidPnSourceModeInfo); 1845 } 1846 pVidPnInterface->pfnReleaseSourceModeSet(hDesiredVidPn, hCurVidPnSourceModeSet); 1847 } 1848 else 1849 LOGREL(("pfnAcquireSourceModeSet failed Status(0x%x)", Status)); 1850 1851 Assert(Status == STATUS_SUCCESS); 1618 1619 D3DKMDT_ENUMCOFUNCMODALITY_PIVOT_TYPE enmPivot = vboxVidPnCofuncModalityCurrentPathPivot(pCbContext->pEnumCofuncModalityArg, VidPnSourceId, VidPnTargetId); 1620 BOOLEAN fHasPinnedMode = FALSE; 1621 Status = vboxVidPnHasPinnedTargetMode(hVidPn, pVidPnInterface, VidPnTargetId, &fHasPinnedMode); 1622 if (!NT_SUCCESS(Status)) 1623 { 1624 AssertFailed(); 1625 return Status; 1626 } 1627 1628 BOOLEAN fNeedUpdate = enmPivot != D3DKMDT_EPT_VIDPNTARGET && !fHasPinnedMode; 1629 if (fNeedUpdate) 1630 { 1631 Status = vboxVidPnCofuncModalityForPathTarget(pCbContext, VidPnSourceId, VidPnTargetId); 1632 } 1633 1634 if (NT_SUCCESS(Status)) 1635 { 1636 fHasPinnedMode = FALSE; 1637 Status = vboxVidPnHasPinnedSourceMode(hVidPn, pVidPnInterface, VidPnSourceId, &fHasPinnedMode); 1638 if (!NT_SUCCESS(Status)) 1639 { 1640 AssertFailed(); 1641 return Status; 1642 } 1643 1644 fNeedUpdate = enmPivot != D3DKMDT_EPT_VIDPNSOURCE && !fHasPinnedMode; 1645 if (fNeedUpdate) 1646 { 1647 Status = vboxVidPnCofuncModalityForPathSource(pCbContext, VidPnSourceId, VidPnTargetId); 1648 } 1649 } 1650 1852 1651 return Status; 1853 1854 1652 } 1855 1653 … … 1858 1656 { 1859 1657 PVBOXVIDPNCOFUNCMODALITY pCbContext = (PVBOXVIDPNCOFUNCMODALITY)pContext; 1860 bool bConversionSupported = 1861 ( 1862 pNewVidPnPresentPathInfo->ContentTransformation.Scaling == D3DKMDT_VPPS_UNINITIALIZED 1863 || pNewVidPnPresentPathInfo->ContentTransformation.Scaling == D3DKMDT_VPPS_IDENTITY 1864 || pNewVidPnPresentPathInfo->ContentTransformation.Scaling == D3DKMDT_VPPS_UNPINNED 1865 || pNewVidPnPresentPathInfo->ContentTransformation.Scaling == D3DKMDT_VPPS_NOTSPECIFIED 1866 ) 1867 && ( 1868 pNewVidPnPresentPathInfo->ContentTransformation.Rotation == D3DKMDT_VPPR_UNINITIALIZED 1869 || pNewVidPnPresentPathInfo->ContentTransformation.Rotation == D3DKMDT_VPPR_IDENTITY 1870 || pNewVidPnPresentPathInfo->ContentTransformation.Rotation == D3DKMDT_VPPR_UNPINNED 1871 || pNewVidPnPresentPathInfo->ContentTransformation.Rotation == D3DKMDT_VPPR_NOTSPECIFIED 1872 ) 1873 && (pNewVidPnPresentPathInfo->VidPnSourceId == pNewVidPnPresentPathInfo->VidPnTargetId); 1874 1875 NTSTATUS Status = vboxVidPnCofuncModalityForPath(pCbContext, 1876 pNewVidPnPresentPathInfo->VidPnSourceId, pNewVidPnPresentPathInfo->VidPnTargetId, bConversionSupported); 1877 1878 pVidPnTopologyInterface->pfnReleasePathInfo(hVidPnTopology, pNewVidPnPresentPathInfo); 1879 1880 pCbContext->Status = Status; 1881 Assert(Status == STATUS_SUCCESS); 1882 return Status == STATUS_SUCCESS; 1883 } 1884 1885 DECLCALLBACK(BOOLEAN) vboxVidPnCofuncModalityCheckPathsSupportedEnum(D3DKMDT_HVIDPNTOPOLOGY hVidPnTopology, const DXGK_VIDPNTOPOLOGY_INTERFACE* pVidPnTopologyInterface, 1886 const D3DKMDT_VIDPN_PRESENT_PATH *pNewVidPnPresentPathInfo, PVOID pContext) 1887 { 1888 PVBOXVIDPNCOFUNCMODALITY pCbContext = (PVBOXVIDPNCOFUNCMODALITY)pContext; 1889 bool bConversionSupported = 1890 ( 1891 pNewVidPnPresentPathInfo->ContentTransformation.Scaling == D3DKMDT_VPPS_UNINITIALIZED 1892 || pNewVidPnPresentPathInfo->ContentTransformation.Scaling == D3DKMDT_VPPS_IDENTITY 1893 || pNewVidPnPresentPathInfo->ContentTransformation.Scaling == D3DKMDT_VPPS_UNPINNED 1894 || pNewVidPnPresentPathInfo->ContentTransformation.Scaling == D3DKMDT_VPPS_NOTSPECIFIED 1895 ) 1896 && ( 1897 pNewVidPnPresentPathInfo->ContentTransformation.Rotation == D3DKMDT_VPPR_UNINITIALIZED 1898 || pNewVidPnPresentPathInfo->ContentTransformation.Rotation == D3DKMDT_VPPR_IDENTITY 1899 || pNewVidPnPresentPathInfo->ContentTransformation.Rotation == D3DKMDT_VPPR_UNPINNED 1900 || pNewVidPnPresentPathInfo->ContentTransformation.Rotation == D3DKMDT_VPPR_NOTSPECIFIED 1901 ) 1902 && (pNewVidPnPresentPathInfo->VidPnSourceId == pNewVidPnPresentPathInfo->VidPnTargetId); 1903 1904 NTSTATUS Status = vboxVidPnCofuncModalityForPath(pCbContext, 1905 pNewVidPnPresentPathInfo->VidPnSourceId, pNewVidPnPresentPathInfo->VidPnTargetId, bConversionSupported); 1658 D3DKMDT_VIDPN_PRESENT_PATH AdjustedPath = {}; 1659 NTSTATUS Status = STATUS_SUCCESS; 1660 bool bUpdatePath = false; 1661 AdjustedPath.VidPnSourceId = pNewVidPnPresentPathInfo->VidPnSourceId; 1662 AdjustedPath.VidPnTargetId = pNewVidPnPresentPathInfo->VidPnTargetId; 1663 AdjustedPath.ContentTransformation = pNewVidPnPresentPathInfo->ContentTransformation; 1664 AdjustedPath.CopyProtection = pNewVidPnPresentPathInfo->CopyProtection; 1665 1666 if (pNewVidPnPresentPathInfo->ContentTransformation.Scaling == D3DKMDT_VPPS_UNPINNED) 1667 { 1668 AdjustedPath.ContentTransformation.ScalingSupport.Identity = TRUE; 1669 bUpdatePath = true; 1670 } 1671 1672 if (pNewVidPnPresentPathInfo->ContentTransformation.Rotation == D3DKMDT_VPPR_UNPINNED) 1673 { 1674 AdjustedPath.ContentTransformation.RotationSupport.Identity = TRUE; 1675 bUpdatePath = true; 1676 } 1677 1678 if (bUpdatePath) 1679 { 1680 Status = pVidPnTopologyInterface->pfnUpdatePathSupportInfo(hVidPnTopology, &AdjustedPath); 1681 Assert(Status == STATUS_SUCCESS); 1682 } 1683 1684 Status = vboxVidPnCofuncModalityForPath(pCbContext, pNewVidPnPresentPathInfo->VidPnSourceId, pNewVidPnPresentPathInfo->VidPnTargetId); 1906 1685 1907 1686 pVidPnTopologyInterface->pfnReleasePathInfo(hVidPnTopology, pNewVidPnPresentPathInfo); -
trunk/src/VBox/Additions/WINNT/Graphics/Video/mp/wddm/VBoxMPVidPn.h
r36867 r37188 122 122 BOOLEAN bPreferred); 123 123 124 NTSTATUS vboxVidPnCreatePopulateVidPn FromLegacy(PVBOXMP_DEVEXT pDevExt, D3DKMDT_HVIDPN hVidPn, const DXGK_VIDPN_INTERFACE* pVidPnInterface,124 NTSTATUS vboxVidPnCreatePopulateVidPnPathFromLegacy(PVBOXMP_DEVEXT pDevExt, D3DKMDT_HVIDPN hVidPn, const DXGK_VIDPN_INTERFACE* pVidPnInterface, 125 125 VIDEO_MODE_INFORMATION *pModes, uint32_t cModes, int iPreferredMode, 126 126 D3DKMDT_2DREGION *pResolutions, uint32_t cResolutions, 127 const D3DDDI_VIDEO_PRESENT_SOURCE_ID srcId, const D3DDDI_VIDEO_PRESENT_TARGET_ID tgtId);127 const D3DDDI_VIDEO_PRESENT_SOURCE_ID VidPnSourceId, const D3DDDI_VIDEO_PRESENT_TARGET_ID VidPnTargetId); 128 128 129 129 NTSTATUS vboxVidPnCheckAddMonitorModes(PVBOXMP_DEVEXT pDevExt, … … 131 131 D3DKMDT_2DREGION *pResolutions, uint32_t cResolutions, int32_t iPreferred); 132 132 133 NTSTATUS vboxVidPnCofuncModalityForPath(PVBOXVIDPNCOFUNCMODALITY pCbContext, 134 D3DDDI_VIDEO_PRESENT_SOURCE_ID VidPnSourceId, D3DDDI_VIDEO_PRESENT_TARGET_ID VidPnTargetId, 135 BOOLEAN bModesAllowed); 133 NTSTATUS vboxVidPnCofuncModalityForPath(PVBOXVIDPNCOFUNCMODALITY pCbContext, D3DDDI_VIDEO_PRESENT_SOURCE_ID VidPnSourceId, D3DDDI_VIDEO_PRESENT_TARGET_ID VidPnTargetId); 136 134 137 135 void vboxVidPnDumpVidPn(const char * pPrefix, PVBOXMP_DEVEXT pDevExt, D3DKMDT_HVIDPN hVidPn, const DXGK_VIDPN_INTERFACE* pVidPnInterface, const char * pSuffix); -
trunk/src/VBox/Additions/WINNT/Graphics/Video/mp/wddm/VBoxMPWddm.cpp
r36867 r37188 3504 3504 vboxVDbgBreakFv(); 3505 3505 3506 NTSTATUS Status = STATUS_SUCCESS; 3507 BOOLEAN bSupported = TRUE; 3508 #if 1 3509 /* always report it as supported and let DxgkDdiEnumVidPnCofuncModality deal with support info */ 3510 #else 3506 3511 PVBOXMP_DEVEXT pContext = (PVBOXMP_DEVEXT)hAdapter; 3507 BOOLEAN bSupported = TRUE;3508 3512 const DXGK_VIDPN_INTERFACE* pVidPnInterface = NULL; 3509 NTSTATUSStatus = pContext->u.primary.DxgkInterface.DxgkCbQueryVidPnInterface(pIsSupportedVidPnArg->hDesiredVidPn, DXGK_VIDPN_INTERFACE_VERSION_V1, &pVidPnInterface);3513 Status = pContext->u.primary.DxgkInterface.DxgkCbQueryVidPnInterface(pIsSupportedVidPnArg->hDesiredVidPn, DXGK_VIDPN_INTERFACE_VERSION_V1, &pVidPnInterface); 3510 3514 if (Status == STATUS_SUCCESS) 3511 3515 { … … 3599 3603 LOGREL(("DxgkCbQueryVidPnInterface failed Status(0x%x)")); 3600 3604 } 3605 #endif /* if 0 */ 3606 3601 3607 pIsSupportedVidPnArg->IsVidPnSupported = bSupported; 3602 3608 … … 3685 3691 Assert(cActualResModes); 3686 3692 3687 Status = vboxVidPnCreatePopulateVidPn FromLegacy(pDevExt, pRecommendFunctionalVidPnArg->hRecommendedFunctionalVidPn, pVidPnInterface,3693 Status = vboxVidPnCreatePopulateVidPnPathFromLegacy(pDevExt, pRecommendFunctionalVidPnArg->hRecommendedFunctionalVidPn, pVidPnInterface, 3688 3694 pResModes, cActualResModes, iPreferableResMode, 3689 3695 &Resolution, 1 /* cResolutions */, … … 3751 3757 CbContext.pInfos = VBoxWddmGetAllVideoModesInfos(pDevExt); 3752 3758 3753 #if 13759 #if 0 3754 3760 for (int i = 0; i < VBoxCommonFromDeviceExt(pDevExt)->cDisplays; ++i) 3755 3761 {
Note:
See TracChangeset
for help on using the changeset viewer.