- Timestamp:
- Feb 25, 2010 1:18:57 PM (15 years ago)
- Location:
- trunk/src/VBox/Additions/WINNT/Graphics/Miniport
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Additions/WINNT/Graphics/Miniport/VBoxVideo.h
r26770 r26794 167 167 168 168 BOOLEAN bVBoxVideoSupported; /* TRUE if VBoxVideo extensions, including DualView, are supported by the host. */ 169 169 #ifndef VBOXWDDM 170 170 int cDisplays; /* Number of displays. */ 171 171 #endif 172 172 ULONG cbVRAM; /* The VRAM size. */ 173 173 … … 581 581 } 582 582 583 DECLINLINE(VOID) vboxWddmAssignPrimary(PDEVICE_EXTENSION pDevExt, PVBOXWDDM_SOURCE pSource, PVBOXWDDM_ALLOCATION pAllocation, D3DDDI_VIDEO_PRESENT_SOURCE_ID srcId) 584 { 585 if (pSource->pAllocation == pAllocation) 586 return; 587 588 if (pSource->pAllocation) 589 { 590 PVBOXWDDM_ALLOCATION pOldAlloc = pSource->pAllocation; 591 PVBOXWDDM_ALLOCATION_SHAREDPRIMARYSURFACE pOldPrimaryInfo = VBOXWDDM_ALLOCATION_BODY(pOldAlloc, VBOXWDDM_ALLOCATION_SHAREDPRIMARYSURFACE); 592 /* clear the visibility info fo the current primary */ 593 pOldPrimaryInfo->bVisible = FALSE; 594 Assert(pOldPrimaryInfo->VidPnSourceId == srcId); 595 pOldPrimaryInfo->VidPnSourceId = ~0; 596 } 597 598 if (pAllocation) 599 { 600 PVBOXWDDM_ALLOCATION_SHAREDPRIMARYSURFACE pPrimaryInfo = VBOXWDDM_ALLOCATION_BODY(pAllocation, VBOXWDDM_ALLOCATION_SHAREDPRIMARYSURFACE); 601 pPrimaryInfo->bVisible = FALSE; 602 pPrimaryInfo->VidPnSourceId = srcId; 603 } 604 605 pSource->pAllocation = pAllocation; 606 } 607 583 608 #endif 584 609 -
trunk/src/VBox/Additions/WINNT/Graphics/Miniport/VBoxVideoHGSMI.cpp
r26767 r26794 712 712 PrimaryExtension->u.primary.ulVbvaEnabled = 0; 713 713 PrimaryExtension->u.primary.bVBoxVideoSupported = FALSE; 714 #ifndef VBOXWDDM 714 715 PrimaryExtension->u.primary.cDisplays = 1; 716 #endif 715 717 PrimaryExtension->u.primary.cbVRAM = AdapterMemorySize; 716 718 PrimaryExtension->u.primary.cbMiniportHeap = 0; … … 899 901 #else 900 902 /* simply store the number of monitors, we will deal with VidPN stuff later */ 901 PrimaryExtension-> u.primary.cDisplays = cDisplays;903 PrimaryExtension->cSources = cDisplays; 902 904 #endif 903 905 } … … 1175 1177 static int vboxVBVACreateChannelContexts(PDEVICE_EXTENSION PrimaryExtension, VBVA_CHANNELCONTEXTS ** ppContext) 1176 1178 { 1179 #ifndef VBOXWDDM 1177 1180 uint32_t cDisplays = (uint32_t)PrimaryExtension->u.primary.cDisplays; 1181 #else 1182 uint32_t cDisplays = (uint32_t)PrimaryExtension->cSources; 1183 #endif 1178 1184 const size_t size = RT_OFFSETOF(VBVA_CHANNELCONTEXTS, aContexts[cDisplays]); 1179 1185 VBVA_CHANNELCONTEXTS * pContext = (VBVA_CHANNELCONTEXTS*)VBoxVideoCmnMemAllocNonPaged(PrimaryExtension, size, MEM_TAG); -
trunk/src/VBox/Additions/WINNT/Graphics/Miniport/wddm/VBoxVideoVidPn.cpp
r26556 r26794 893 893 return Status; 894 894 } 895 896 NTSTATUS vboxVidPnSetupSourceInfo(struct _DEVICE_EXTENSION* pDevExt, PVBOXWDDM_SOURCE pSource, CONST D3DKMDT_VIDPN_SOURCE_MODE* pVidPnSourceModeInfo, PVBOXWDDM_ALLOCATION pAllocation) 897 { 898 vboxWddmAssignPrimary(pDevExt, pSource, pAllocation, pVidPnSourceModeInfo->Id); 899 return STATUS_SUCCESS; 900 } 901 902 NTSTATUS vboxVidPnCommitSourceMode(struct _DEVICE_EXTENSION* pDevExt, CONST D3DKMDT_VIDPN_SOURCE_MODE* pVidPnSourceModeInfo, PVBOXWDDM_ALLOCATION pAllocation) 903 { 904 Assert(pVidPnSourceModeInfo->Id < pDevExt->cSources); 905 if (pVidPnSourceModeInfo->Id < pDevExt->cSources) 906 { 907 PVBOXWDDM_SOURCE pSource = &pDevExt->aSources[pVidPnSourceModeInfo->Id]; 908 return vboxVidPnSetupSourceInfo(pDevExt, pSource, pVidPnSourceModeInfo, pAllocation); 909 } 910 911 drprintf((__FUNCTION__": invalid mode id (%d), cSources(%d)\n", pVidPnSourceModeInfo->Id, pDevExt->cSources)); 912 return STATUS_INVALID_PARAMETER; 913 } 914 915 NTSTATUS vboxVidPnCommitSourceModeForSrcId(struct _DEVICE_EXTENSION* pDevExt, const D3DKMDT_HVIDPN hDesiredVidPn, const DXGK_VIDPN_INTERFACE* pVidPnInterface, D3DDDI_VIDEO_PRESENT_SOURCE_ID srcId, PVBOXWDDM_ALLOCATION pAllocation) 916 { 917 D3DKMDT_HVIDPNSOURCEMODESET hCurVidPnSourceModeSet; 918 const DXGK_VIDPNSOURCEMODESET_INTERFACE *pCurVidPnSourceModeSetInterface; 919 920 NTSTATUS Status = pVidPnInterface->pfnAcquireSourceModeSet(hDesiredVidPn, 921 srcId, 922 &hCurVidPnSourceModeSet, 923 &pCurVidPnSourceModeSetInterface); 924 Assert(Status == STATUS_SUCCESS); 925 if (Status == STATUS_SUCCESS) 926 { 927 CONST D3DKMDT_VIDPN_SOURCE_MODE* pPinnedVidPnSourceModeInfo; 928 Status = pCurVidPnSourceModeSetInterface->pfnAcquirePinnedModeInfo(hCurVidPnSourceModeSet, &pPinnedVidPnSourceModeInfo); 929 Assert(Status == STATUS_SUCCESS); 930 if (Status == STATUS_SUCCESS) 931 { 932 Assert(pPinnedVidPnSourceModeInfo); 933 if (pPinnedVidPnSourceModeInfo) 934 { 935 Status = vboxVidPnCommitSourceMode(pDevExt, pPinnedVidPnSourceModeInfo, pAllocation); 936 Assert(Status == STATUS_SUCCESS); 937 if (Status != STATUS_SUCCESS) 938 drprintf((__FUNCTION__": vboxVidPnCommitSourceMode failed Status(0x%x)\n", Status)); 939 /* release */ 940 pCurVidPnSourceModeSetInterface->pfnReleaseModeInfo(hCurVidPnSourceModeSet, pPinnedVidPnSourceModeInfo); 941 } 942 else 943 drprintf((__FUNCTION__": no pPinnedVidPnSourceModeInfo available for source id (%d)\n", srcId)); 944 } 945 else 946 drprintf((__FUNCTION__": pfnAcquirePinnedModeInfo failed Status(0x%x)\n", Status)); 947 948 pVidPnInterface->pfnReleaseSourceModeSet(hDesiredVidPn, hCurVidPnSourceModeSet); 949 } 950 else 951 { 952 drprintf((__FUNCTION__": pfnAcquireSourceModeSet failed Status(0x%x)\n", Status)); 953 } 954 955 return Status; 956 } 957 958 DECLCALLBACK(BOOLEAN) vboxVidPnCommitPathEnum(struct _DEVICE_EXTENSION* pDevExt, const D3DKMDT_HVIDPN hDesiredVidPn, const DXGK_VIDPN_INTERFACE* pVidPnInterface, 959 D3DKMDT_HVIDPNTOPOLOGY hVidPnTopology, const DXGK_VIDPNTOPOLOGY_INTERFACE* pVidPnTopologyInterface, 960 const D3DKMDT_VIDPN_PRESENT_PATH *pVidPnPresentPathInfo, PVOID pContext) 961 { 962 NTSTATUS Status = STATUS_SUCCESS; 963 PVBOXVIDPNCOMMIT pCommitInfo = (PVBOXVIDPNCOMMIT)pContext; 964 965 if (pCommitInfo->pCommitVidPnArg->AffectedVidPnSourceId == D3DDDI_ID_ALL 966 || pCommitInfo->pCommitVidPnArg->AffectedVidPnSourceId == pVidPnPresentPathInfo->VidPnSourceId) 967 { 968 Status = vboxVidPnCommitSourceModeForSrcId(pDevExt, hDesiredVidPn, pVidPnInterface, pVidPnPresentPathInfo->VidPnSourceId, (PVBOXWDDM_ALLOCATION)pCommitInfo->pCommitVidPnArg->hPrimaryAllocation); 969 Assert(Status == STATUS_SUCCESS); 970 if (Status != STATUS_SUCCESS) 971 drprintf((__FUNCTION__": vboxVidPnCommitSourceModeForSrcId failed Status(0x%x)\n", Status)); 972 } 973 974 pCommitInfo->Status = Status; 975 pVidPnTopologyInterface->pfnReleasePathInfo(hVidPnTopology, pVidPnPresentPathInfo); 976 return Status == STATUS_SUCCESS; 977 } -
trunk/src/VBox/Additions/WINNT/Graphics/Miniport/wddm/VBoxVideoVidPn.h
r26770 r26794 47 47 uint32_t cResolutions; 48 48 D3DKMDT_2DREGION *pResolutions; 49 }VBOXVIDPNCOFUNCMODALITY, *PVBOXVIDPNCOFUNCMODALITY; 49 } VBOXVIDPNCOFUNCMODALITY, *PVBOXVIDPNCOFUNCMODALITY; 50 51 typedef struct VBOXVIDPNCOMMIT 52 { 53 NTSTATUS Status; 54 CONST DXGKARG_COMMITVIDPN* pCommitVidPnArg; 55 } VBOXVIDPNCOMMIT, *PVBOXVIDPNCOMMIT; 50 56 51 57 /* !!!NOTE: The callback is responsible for releasing the path */ … … 80 86 const D3DKMDT_VIDPN_TARGET_MODE *pNewVidPnTargetModeInfo, PVOID pContext); 81 87 88 DECLCALLBACK(BOOLEAN) vboxVidPnCommitPathEnum(struct _DEVICE_EXTENSION* pDevExt, const D3DKMDT_HVIDPN hDesiredVidPn, const DXGK_VIDPN_INTERFACE* pVidPnInterface, 89 D3DKMDT_HVIDPNTOPOLOGY hVidPnTopology, const DXGK_VIDPNTOPOLOGY_INTERFACE* pVidPnTopologyInterface, 90 const D3DKMDT_VIDPN_PRESENT_PATH *pNewVidPnPresentPathInfo, PVOID pContext); 91 92 NTSTATUS vboxVidPnCommitSourceModeForSrcId(struct _DEVICE_EXTENSION* pDevExt, const D3DKMDT_HVIDPN hDesiredVidPn, const DXGK_VIDPN_INTERFACE* pVidPnInterface, D3DDDI_VIDEO_PRESENT_SOURCE_ID srcId, struct VBOXWDDM_ALLOCATION *pAllocation); 93 82 94 NTSTATUS vboxVidPnEnumPaths(struct _DEVICE_EXTENSION* pDevExt, const D3DKMDT_HVIDPN hDesiredVidPn, const DXGK_VIDPN_INTERFACE* pVidPnInterface, 83 95 D3DKMDT_HVIDPNTOPOLOGY hVidPnTopology, const DXGK_VIDPNTOPOLOGY_INTERFACE* pVidPnTopologyInterface, -
trunk/src/VBox/Additions/WINNT/Graphics/Miniport/wddm/VBoxVideoWddm.cpp
r26770 r26794 141 141 pView->u32ViewIndex = pPrimaryInfo->VidPnSourceId; 142 142 pView->u32ViewOffset = offVram; 143 pView->u32ViewSize = vboxWddmVramReportedSize(pDevExt)/pDevExt-> u.primary.cDisplays;143 pView->u32ViewSize = vboxWddmVramReportedSize(pDevExt)/pDevExt->cSources; 144 144 145 145 pView->u32MaxScreenSize = pView->u32ViewSize; … … 812 812 { 813 813 drprintf(("VBoxVideoWddm: using HGSMI\n")); 814 *NumberOfVideoPresentSources = pContext-> u.primary.cDisplays;815 *NumberOfChildren = pContext-> u.primary.cDisplays;814 *NumberOfVideoPresentSources = pContext->cSources; 815 *NumberOfChildren = pContext->cSources; 816 816 dprintf(("VBoxVideoWddm: sources(%d), children(%d)\n", *NumberOfVideoPresentSources, *NumberOfChildren)); 817 817 } … … 1022 1022 1023 1023 dfprintf(("==> "__FUNCTION__ ", context(0x%x)\n", MiniportDeviceContext)); 1024 for (int i = 0; i < pDevExt->u.primary.cDisplays; ++i) 1024 Assert(ChildRelationsSize == (pDevExt->cSources + 1)*sizeof(DXGK_CHILD_DESCRIPTOR)); 1025 for (UINT i = 0; i < pDevExt->cSources; ++i) 1025 1026 { 1026 1027 ChildRelations[i].ChildDeviceType = TypeVideoOutput; … … 1836 1837 if (Status == STATUS_SUCCESS && bSupported) 1837 1838 { 1838 for ( int id = 0; id < pContext->u.primary.cDisplays; id++)1839 for (UINT id = 0; id < pContext->cSources; ++id) 1839 1840 { 1840 1841 D3DKMDT_HVIDPNSOURCEMODESET hNewVidPnSourceModeSet; … … 1867 1868 if (Status == STATUS_SUCCESS && bSupported) 1868 1869 { 1869 for ( int id = 0; id < pContext->u.primary.cDisplays; id++)1870 for (UINT id = 0; id < pContext->cSources; ++id) 1870 1871 { 1871 1872 D3DKMDT_HVIDPNTARGETMODESET hNewVidPnTargetModeSet; … … 1911 1912 dfprintf(("<== "__FUNCTION__ ", status(0x%x), context(0x%x)\n", Status, hAdapter)); 1912 1913 1913 return S TATUS_SUCCESS;1914 return Status; 1914 1915 } 1915 1916 … … 2161 2162 dfprintf(("<== "__FUNCTION__ ", status(0x%x), context(0x%x)\n", Status, hAdapter)); 2162 2163 2163 return S TATUS_NOT_IMPLEMENTED;2164 return Status; 2164 2165 } 2165 2166 … … 2188 2189 if (pSetVidPnSourceAddress->hAllocation) 2189 2190 { 2190 pSource->pAllocation = (PVBOXWDDM_ALLOCATION)pSetVidPnSourceAddress->hAllocation;2191 2191 pAllocation = (PVBOXWDDM_ALLOCATION)pSetVidPnSourceAddress->hAllocation; 2192 vboxWddmAssignPrimary(pDevExt, pSource, pAllocation, pSetVidPnSourceAddress->VidPnSourceId); 2192 2193 } 2193 2194 else … … 2285 2286 ) 2286 2287 { 2287 2288 return STATUS_NOT_IMPLEMENTED; 2288 dfprintf(("==> "__FUNCTION__ ", context(0x%x)\n", hAdapter)); 2289 2290 PDEVICE_EXTENSION pDevExt = (PDEVICE_EXTENSION)hAdapter; 2291 2292 const DXGK_VIDPN_INTERFACE* pVidPnInterface = NULL; 2293 NTSTATUS Status = pDevExt->u.primary.DxgkInterface.DxgkCbQueryVidPnInterface(pCommitVidPnArg->hFunctionalVidPn, DXGK_VIDPN_INTERFACE_VERSION_V1, &pVidPnInterface); 2294 if (Status == STATUS_SUCCESS) 2295 { 2296 if (pCommitVidPnArg->AffectedVidPnSourceId != D3DDDI_ID_ALL) 2297 { 2298 Status = vboxVidPnCommitSourceModeForSrcId( 2299 pDevExt, 2300 pCommitVidPnArg->hFunctionalVidPn, pVidPnInterface, 2301 pCommitVidPnArg->AffectedVidPnSourceId, (PVBOXWDDM_ALLOCATION)pCommitVidPnArg->hPrimaryAllocation); 2302 Assert(Status == STATUS_SUCCESS); 2303 if (Status != STATUS_SUCCESS) 2304 drprintf((__FUNCTION__ ": vboxVidPnCommitSourceModeForSrcId failed Status(0x%x)\n", Status)); 2305 } 2306 else 2307 { 2308 /* clear all current primaries */ 2309 for (UINT i = 0; i < pDevExt->cSources; ++i) 2310 { 2311 vboxWddmAssignPrimary(pDevExt, &pDevExt->aSources[i], NULL, i); 2312 } 2313 2314 D3DKMDT_HVIDPNTOPOLOGY hVidPnTopology; 2315 const DXGK_VIDPNTOPOLOGY_INTERFACE* pVidPnTopologyInterface; 2316 NTSTATUS Status = pVidPnInterface->pfnGetTopology(pCommitVidPnArg->hFunctionalVidPn, &hVidPnTopology, &pVidPnTopologyInterface); 2317 Assert(Status == STATUS_SUCCESS); 2318 if (Status == STATUS_SUCCESS) 2319 { 2320 VBOXVIDPNCOMMIT CbContext = {0}; 2321 CbContext.pCommitVidPnArg = pCommitVidPnArg; 2322 Status = vboxVidPnEnumPaths(pDevExt, pCommitVidPnArg->hFunctionalVidPn, pVidPnInterface, 2323 hVidPnTopology, pVidPnTopologyInterface, 2324 vboxVidPnCommitPathEnum, &CbContext); 2325 Assert(Status == STATUS_SUCCESS); 2326 if (Status == STATUS_SUCCESS) 2327 { 2328 Status = CbContext.Status; 2329 Assert(Status == STATUS_SUCCESS); 2330 if (Status != STATUS_SUCCESS) 2331 drprintf((__FUNCTION__ ": vboxVidPnAdjustSourcesTargetsCallback failed Status(0x%x)\n", Status)); 2332 } 2333 else 2334 drprintf((__FUNCTION__ ": vboxVidPnEnumPaths failed Status(0x%x)\n", Status)); 2335 } 2336 else 2337 drprintf((__FUNCTION__ ": pfnGetTopology failed Status(0x%x)\n", Status)); 2338 } 2339 } 2340 else 2341 drprintf((__FUNCTION__ ": DxgkCbQueryVidPnInterface failed Status(0x%x)\n", Status)); 2342 2343 dfprintf(("<== "__FUNCTION__ ", status(0x%x), context(0x%x)\n", Status, hAdapter)); 2344 2345 return Status; 2289 2346 } 2290 2347 -
trunk/src/VBox/Additions/WINNT/Graphics/Miniport/wddm/VBoxVideoWddm.h
r26767 r26794 81 81 #define VBOXWDDM_ALLOCATION_HEAD(_pb) ((VBOXWDDM_ALLOCATION*)((uint8_t *)(_pb) - VBOXWDDM_ALLOCATION_HEADSIZE())) 82 82 83 84 85 86 83 87 typedef struct VBOXWDDM_ALLOCATION_SHAREDPRIMARYSURFACE 84 88 {
Note:
See TracChangeset
for help on using the changeset viewer.