Changeset 33252 in vbox for trunk/src/VBox/Additions/WINNT/Graphics/Miniport
- Timestamp:
- Oct 20, 2010 10:25:22 AM (14 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.cpp
r33226 r33252 895 895 */ 896 896 int iCustomMode; 897 for (iCustomMode = 0; iCustomMode < DeviceExtension->pPrimary->u.primary.cDisplays; iCustomMode++)897 for (iCustomMode = 0; iCustomMode < commonFromDeviceExt(DeviceExtension)->cDisplays; iCustomMode++) 898 898 { 899 899 if (fDisplayChangeRequest && iCustomMode == display) … … 952 952 if (DeviceExtension->CurrentMode == 0) 953 953 #else 954 if (! DeviceExtension->u.primary.cDisplays || !DeviceExtension->aSources[0].pPrimaryAllocation)954 if (!commonFromDeviceExt(DeviceExtension)->cDisplays || !DeviceExtension->aSources[0].pPrimaryAllocation) 955 955 #endif 956 956 { … … 992 992 } 993 993 #else 994 if ( DeviceExtension->u.primary.cDisplays && DeviceExtension->aSources[0].pPrimaryAllocation)994 if (commonFromDeviceExt(DeviceExtension)->cDisplays && DeviceExtension->aSources[0].pPrimaryAllocation) 995 995 { 996 996 if (!xres) … … 1051 1051 if (DeviceExtension->CurrentMode != 0) 1052 1052 #else 1053 if ( DeviceExtension->u.primary.cDisplays && DeviceExtension->aSources[0].pPrimaryAllocation)1053 if (commonFromDeviceExt(DeviceExtension)->cDisplays && DeviceExtension->aSources[0].pPrimaryAllocation) 1054 1054 #endif 1055 1055 #ifndef VBOX_WITH_MULTIMONITOR_FIX … … 1157 1157 if (DeviceExtension->CurrentMode == 0) 1158 1158 #else 1159 if (! DeviceExtension->u.primary.cDisplays || !DeviceExtension->aSources[0].pPrimaryAllocation)1159 if (!commonFromDeviceExt(DeviceExtension)->cDisplays || !DeviceExtension->aSources[0].pPrimaryAllocation) 1160 1160 #endif 1161 1161 { … … 1347 1347 /* Size of a framebuffer. */ 1348 1348 1349 ULONG ulSize = ulAvailable / PrimaryExtension->u.primary.cDisplays;1349 ULONG ulSize = ulAvailable / commonFromDeviceExt(PrimaryExtension)->cDisplays; 1350 1350 1351 1351 /* Align down to 4096 bytes. */ … … 1353 1353 1354 1354 dprintf(("VBoxVideo::VBoxComputeFrameBufferSizes: cbVRAM = 0x%08X, cDisplays = %d, ulSize = 0x%08X, ulSize * cDisplays = 0x%08X, slack = 0x%08X\n", 1355 commonFromDeviceExt(PrimaryExtension)->cbVRAM, PrimaryExtension->u.primary.cDisplays,1356 ulSize, ulSize * PrimaryExtension->u.primary.cDisplays,1357 ulAvailable - ulSize * PrimaryExtension->u.primary.cDisplays));1355 commonFromDeviceExt(PrimaryExtension)->cbVRAM, commonFromDeviceExt(PrimaryExtension)->cDisplays, 1356 ulSize, ulSize * commonFromDeviceExt(PrimaryExtension)->cDisplays, 1357 ulAvailable - ulSize * commonFromDeviceExt(PrimaryExtension)->cDisplays)); 1358 1358 1359 1359 … … 1523 1523 for (iCustomMode = 0; 1524 1524 #ifdef VBOX_WITH_WDDM 1525 iCustomMode < pDevExt->u.primary.cDisplays;1525 iCustomMode < commonFromDeviceExt(pDevExt)->cDisplays; 1526 1526 #else 1527 iCustomMode < pDevExt->pPrimary->u.primary.cDisplays;1527 iCustomMode < commonFromDeviceExt(pDevExt)->cDisplays; 1528 1528 #endif 1529 1529 iCustomMode++) … … 1700 1700 ((PDEVICE_EXTENSION)HwDeviceExtension)->ulFrameBufferSize = 0; 1701 1701 ((PDEVICE_EXTENSION)HwDeviceExtension)->u.primary.ulVbvaEnabled = 0; 1702 ((PDEVICE_EXTENSION)HwDeviceExtension)->u.primary.cDisplays = 1;1703 1702 VBoxVideoCmnMemZero(&((PDEVICE_EXTENSION)HwDeviceExtension)->areaDisplay, sizeof(HGSMIAREA)); 1704 1703 /* Guest supports only HGSMI, the old VBVA via VMMDev is not supported. Old … … 2857 2856 if (ChildEnumInfo->ChildIndex > 0) 2858 2857 { 2859 if ((int)ChildEnumInfo->ChildIndex <= pDevExt->pPrimary->u.primary.cDisplays)2858 if ((int)ChildEnumInfo->ChildIndex <= commonFromDeviceExt(pDevExt)->cDisplays) 2860 2859 { 2861 2860 *VideoChildType = Monitor; -
trunk/src/VBox/Additions/WINNT/Graphics/Miniport/VBoxVideo.h
r33226 r33252 203 203 typedef struct VBOXVIDEO_COMMON 204 204 { 205 int cDisplays; /* Number of displays. */ 206 205 207 ULONG cbVRAM; /* The VRAM size. */ 206 208 … … 214 216 volatile HGSMIHOSTFLAGS * pHostFlags; /* HGSMI host flags */ 215 217 volatile bool bHostCmdProcessing; 216 VBOXVCMNSPIN_LOCK pSynchLock;217 218 218 219 PVOID pvAdapterInformation; /* The pointer to the last 4K of VRAM. … … 268 269 ULONG ulVbvaEnabled; /* Indicates that VBVA mode is enabled. */ 269 270 270 int cDisplays; /* Number of displays. */271 272 271 #ifdef VBOX_WITH_WDDM 273 272 VBOXVDMAINFO Vdma; … … 276 275 # endif 277 276 #endif 277 278 VBOXVCMNSPIN_LOCK pSynchLock; 278 279 279 280 ULONG ulMaxFrameBufferSize; /* The size of the VRAM allocated for the a single framebuffer. */ -
trunk/src/VBox/Additions/WINNT/Graphics/Miniport/VBoxVideoHGSMI.cpp
r33226 r33252 126 126 break; 127 127 } 128 VBOX_HGSMI_LOCK(PrimaryExtension, & commonFromDeviceExt(PrimaryExtension)->pSynchLock, flags, &OldIrql);128 VBOX_HGSMI_LOCK(PrimaryExtension, &PrimaryExtension->u.primary.pSynchLock, flags, &OldIrql); 129 129 if(!(commonFromDeviceExt(PrimaryExtension)->pHostFlags->u32HostFlags & HGSMIHOSTFLAGS_COMMANDS_PENDING)) 130 130 { 131 131 Assert(commonFromDeviceExt(PrimaryExtension)->bHostCmdProcessing); 132 132 commonFromDeviceExt(PrimaryExtension)->bHostCmdProcessing = false; 133 VBOX_HGSMI_UNLOCK(PrimaryExtension, & commonFromDeviceExt(PrimaryExtension)->pSynchLock, flags, OldIrql);133 VBOX_HGSMI_UNLOCK(PrimaryExtension, &PrimaryExtension->u.primary.pSynchLock, flags, OldIrql); 134 134 break; 135 135 } 136 VBOX_HGSMI_UNLOCK(PrimaryExtension, & commonFromDeviceExt(PrimaryExtension)->pSynchLock, flags, OldIrql);136 VBOX_HGSMI_UNLOCK(PrimaryExtension, &PrimaryExtension->u.primary.pSynchLock, flags, OldIrql); 137 137 } 138 138 else … … 140 140 if(!bProcessing) 141 141 { 142 VBOX_HGSMI_LOCK(PrimaryExtension, & commonFromDeviceExt(PrimaryExtension)->pSynchLock, flags, &OldIrql);142 VBOX_HGSMI_LOCK(PrimaryExtension, &PrimaryExtension->u.primary.pSynchLock, flags, &OldIrql); 143 143 if(!(commonFromDeviceExt(PrimaryExtension)->pHostFlags->u32HostFlags & HGSMIHOSTFLAGS_COMMANDS_PENDING) 144 144 || commonFromDeviceExt(PrimaryExtension)->bHostCmdProcessing) 145 145 { 146 VBOX_HGSMI_UNLOCK(PrimaryExtension, & commonFromDeviceExt(PrimaryExtension)->pSynchLock, flags, OldIrql);146 VBOX_HGSMI_UNLOCK(PrimaryExtension, &PrimaryExtension->u.primary.pSynchLock, flags, OldIrql); 147 147 break; 148 148 } 149 149 Assert(!commonFromDeviceExt(PrimaryExtension)->bHostCmdProcessing); 150 150 commonFromDeviceExt(PrimaryExtension)->bHostCmdProcessing = true; 151 VBOX_HGSMI_UNLOCK(PrimaryExtension, & commonFromDeviceExt(PrimaryExtension)->pSynchLock, flags, OldIrql);151 VBOX_HGSMI_UNLOCK(PrimaryExtension, &PrimaryExtension->u.primary.pSynchLock, flags, OldIrql); 152 152 bProcessing = true; 153 153 } … … 366 366 367 367 for (i = 0, Extension = PrimaryExtension; 368 i < PrimaryExtension->u.primary.cDisplays && Extension;368 i < commonFromDeviceExt(PrimaryExtension)->cDisplays && Extension; 369 369 i++, Extension = Extension->pNext) 370 370 { … … 381 381 } 382 382 383 if (i == PrimaryExtension->u.primary.cDisplays && Extension == NULL)383 if (i == commonFromDeviceExt(PrimaryExtension)->cDisplays && Extension == NULL) 384 384 { 385 385 return VINF_SUCCESS; … … 431 431 432 432 433 static int vboxSetupAdapterInfoHGSMI (P DEVICE_EXTENSION PrimaryExtension)433 static int vboxSetupAdapterInfoHGSMI (PVBOXVIDEO_COMMON pCommon) 434 434 { 435 435 dprintf(("VBoxVideo::vboxSetupAdapterInfo\n")); 436 436 437 437 /* setup the flags first to ensure they are initialized by the time the host heap is ready */ 438 int rc = vboxCallChannel( commonFromDeviceExt(PrimaryExtension),438 int rc = vboxCallChannel(pCommon, 439 439 HGSMI_CH_HGSMI, 440 440 HGSMI_CC_HOST_FLAGS_LOCATION, … … 444 444 NULL); 445 445 AssertRC(rc); 446 #ifndef VBOX_WITH_WDDM 447 if (RT_SUCCESS(rc)) 448 { 449 rc = VBoxHGSMISendViewInfo (commonFromDeviceExt(PrimaryExtension), 450 PrimaryExtension->u.primary.cDisplays, 451 vbvaInitInfoDisplay, 452 (void *) PrimaryExtension); 453 AssertRC(rc); 454 } 455 /* in case of WDDM we do not control the framebuffer location, 456 * i.e. it is assigned by Video Memory Manager, 457 * The FB information should be passed to guest from our 458 * DxgkDdiSetVidPnSourceAddress callback */ 459 #endif 460 if (RT_SUCCESS(rc) && commonFromDeviceExt(PrimaryExtension)->fCaps) 446 if (RT_SUCCESS(rc) && pCommon->fCaps) 461 447 { 462 448 /* Inform about caps */ 463 rc = vboxCallVBVA ( commonFromDeviceExt(PrimaryExtension),449 rc = vboxCallVBVA (pCommon, 464 450 VBVA_INFO_CAPS, 465 451 sizeof (VBVACAPS), … … 472 458 { 473 459 /* Report the host heap location. */ 474 rc = vboxCallVBVA ( commonFromDeviceExt(PrimaryExtension),460 rc = vboxCallVBVA (pCommon, 475 461 VBVA_INFO_HEAP, 476 462 sizeof (VBVAINFOHEAP), … … 730 716 memset(commonFromDeviceExt(PrimaryExtension), 0, 731 717 sizeof(*commonFromDeviceExt(PrimaryExtension))); 732 commonFromDeviceExt(PrimaryExtension)->cbVRAM = AdapterMemorySize; 733 commonFromDeviceExt(PrimaryExtension)->fCaps = fCaps; 734 commonFromDeviceExt(PrimaryExtension)->bHGSMI = VBoxHGSMIIsSupported (); 718 commonFromDeviceExt(PrimaryExtension)->cbVRAM = AdapterMemorySize; 719 commonFromDeviceExt(PrimaryExtension)->fCaps = fCaps; 720 commonFromDeviceExt(PrimaryExtension)->cDisplays = 1; 721 commonFromDeviceExt(PrimaryExtension)->bHGSMI = VBoxHGSMIIsSupported (); 735 722 /* Why does this use VBoxVideoCmnMemZero? The MSDN docs say that it should 736 723 * only be used on mapped display adapter memory. Done with memset above. */ … … 851 838 if (commonFromDeviceExt(PrimaryExtension)->bHGSMI) 852 839 { 840 /* Query the configured number of displays. */ 841 ULONG cDisplays = 0; 842 vboxQueryConfHGSMI (commonFromDeviceExt(PrimaryExtension), VBOX_VBVA_CONF32_MONITOR_COUNT, &cDisplays); 843 844 dprintf(("VBoxVideo::VBoxSetupDisplays: cDisplays = %d\n", 845 cDisplays)); 846 847 if (cDisplays == 0 || cDisplays > VBOX_VIDEO_MAX_SCREENS) 848 { 849 /* Host reported some bad value. Continue in the 1 screen mode. */ 850 cDisplays = 1; 851 } 852 commonFromDeviceExt(PrimaryExtension)->cDisplays = cDisplays; 853 } 854 855 if (commonFromDeviceExt(PrimaryExtension)->bHGSMI) 856 { 857 /* Setup the information for the host. */ 858 rc = vboxSetupAdapterInfoHGSMI (commonFromDeviceExt(PrimaryExtension)); 859 860 if (RT_FAILURE (rc)) 861 { 862 commonFromDeviceExt(PrimaryExtension)->bHGSMI = FALSE; 863 } 864 } 865 853 866 #ifndef VBOX_WITH_WDDM 867 /* For WDDM, we simply store the number of monitors as we will deal with 868 * VidPN stuff later */ 869 if (commonFromDeviceExt(PrimaryExtension)->bHGSMI) 870 { 854 871 typedef VP_STATUS (*PFNCREATESECONDARYDISPLAY)(PVOID, PVOID *, ULONG); 855 872 PFNCREATESECONDARYDISPLAY pfnCreateSecondaryDisplay = NULL; … … 864 881 } 865 882 866 if (pfnCreateSecondaryDisplay != NULL) 867 #endif 868 { 869 /* Query the configured number of displays. */ 870 ULONG cDisplays = 0; 871 vboxQueryConfHGSMI (commonFromDeviceExt(PrimaryExtension), VBOX_VBVA_CONF32_MONITOR_COUNT, &cDisplays); 872 873 dprintf(("VBoxVideo::VBoxSetupDisplays: cDisplays = %d\n", 874 cDisplays)); 875 876 if (cDisplays == 0 || cDisplays > VBOX_VIDEO_MAX_SCREENS) 877 { 878 /* Host reported some bad value. Continue in the 1 screen mode. */ 879 cDisplays = 1; 880 } 881 882 #ifndef VBOX_WITH_WDDM 883 if (!pfnCreateSecondaryDisplay) 884 commonFromDeviceExt(PrimaryExtension)->cDisplays = 1; 885 else 886 { 883 887 PDEVICE_EXTENSION pPrev = PrimaryExtension; 884 888 885 889 ULONG iDisplay; 890 ULONG cDisplays = commonFromDeviceExt(PrimaryExtension)->cDisplays; 891 commonFromDeviceExt(PrimaryExtension)->cDisplays = 1; 886 892 for (iDisplay = 1; iDisplay < cDisplays; iDisplay++) 887 893 { … … 909 915 910 916 /* Take the successfully created display into account. */ 911 PrimaryExtension->u.primary.cDisplays++; 912 } 913 #else 914 /* simply store the number of monitors, we will deal with VidPN stuff later */ 915 PrimaryExtension->u.primary.cDisplays = cDisplays; 916 #endif 917 commonFromDeviceExt(PrimaryExtension)->cDisplays++; 918 } 917 919 } 918 920 … … 921 923 } 922 924 923 #ifndef VBOX_WITH_WDDM924 925 /* Now when the number of monitors is known and extensions are created, 925 926 * calculate the layout of framebuffers. 926 927 */ 927 928 VBoxComputeFrameBufferSizes (PrimaryExtension); 928 #endif 929 /* in case of WDDM we do not control the framebuffer location, 930 * i.e. it is assigned by Video Memory Manager, 931 * The FB information should be passed to guest from our 932 * DxgkDdiSetVidPnSourceAddress callback */ 929 933 930 934 if (commonFromDeviceExt(PrimaryExtension)->bHGSMI) 931 935 { 932 /* Setup the information for the host. */ 933 rc = vboxSetupAdapterInfoHGSMI (PrimaryExtension); 936 if (RT_SUCCESS(rc)) 937 { 938 rc = VBoxHGSMISendViewInfo (commonFromDeviceExt(PrimaryExtension), 939 commonFromDeviceExt(PrimaryExtension)->cDisplays, 940 vbvaInitInfoDisplay, 941 (void *) PrimaryExtension); 942 AssertRC(rc); 943 } 934 944 935 945 if (RT_FAILURE (rc)) … … 938 948 } 939 949 } 950 #endif 940 951 941 952 #ifdef VBOX_WITH_WDDM … … 982 993 ulAvailable = offset; 983 994 ulSize = ulAvailable / 2; 984 ulSize /= PrimaryExtension->u.primary.cDisplays;995 ulSize /= commonFromDeviceExt(PrimaryExtension)->cDisplays; 985 996 Assert(ulSize > VBVA_MIN_BUFFER_SIZE); 986 997 if (ulSize > VBVA_MIN_BUFFER_SIZE) … … 1001 1012 Assert(ulSize); 1002 1013 1003 Assert(ulSize * PrimaryExtension->u.primary.cDisplays < ulAvailable);1004 1005 for (int i = PrimaryExtension->u.primary.cDisplays-1; i >= 0; --i)1014 Assert(ulSize * commonFromDeviceExt(PrimaryExtension)->cDisplays < ulAvailable); 1015 1016 for (int i = commonFromDeviceExt(PrimaryExtension)->cDisplays-1; i >= 0; --i) 1006 1017 { 1007 1018 offset -= ulSize; … … 1044 1055 if (commonFromDeviceExt(PrimaryExtension)->bHGSMI) 1045 1056 { 1046 VBoxVideoCmnSpinLockCreate(PrimaryExtension, & commonFromDeviceExt(PrimaryExtension)->pSynchLock);1057 VBoxVideoCmnSpinLockCreate(PrimaryExtension, &PrimaryExtension->u.primary.pSynchLock); 1047 1058 } 1048 1059 … … 1059 1070 VBoxUnmapAdapterMemory(PrimaryExtension, (void**)&PrimaryExtension->pvVisibleVram, vboxWddmVramCpuVisibleSize(PrimaryExtension)); 1060 1071 1061 for (int i = PrimaryExtension->u.primary.cDisplays-1; i >= 0; --i)1072 for (int i = commonFromDeviceExt(PrimaryExtension)->cDisplays-1; i >= 0; --i) 1062 1073 { 1063 1074 rc = vboxVbvaDisable(PrimaryExtension, &PrimaryExtension->aSources[i].Vbva); … … 1304 1315 static int vboxVBVACreateChannelContexts(PDEVICE_EXTENSION PrimaryExtension, VBVA_CHANNELCONTEXTS ** ppContext) 1305 1316 { 1306 #ifndef VBOX_WITH_WDDM 1307 uint32_t cDisplays = (uint32_t)PrimaryExtension->u.primary.cDisplays; 1308 #else 1309 uint32_t cDisplays = (uint32_t)PrimaryExtension->u.primary.cDisplays; 1310 #endif 1317 uint32_t cDisplays = (uint32_t)commonFromDeviceExt(PrimaryExtension)->cDisplays; 1311 1318 const size_t size = RT_OFFSETOF(VBVA_CHANNELCONTEXTS, aContexts[cDisplays]); 1312 1319 VBVA_CHANNELCONTEXTS * pContext = (VBVA_CHANNELCONTEXTS*)VBoxVideoCmnMemAllocNonPaged(PrimaryExtension, size, MEM_TAG); -
trunk/src/VBox/Additions/WINNT/Graphics/Miniport/wddm/VBoxVideoVhwa.cpp
r32989 r33252 353 353 static void vboxVhwaInitSrc(PDEVICE_EXTENSION pDevExt, D3DDDI_VIDEO_PRESENT_SOURCE_ID srcId) 354 354 { 355 Assert(srcId < (D3DDDI_VIDEO_PRESENT_SOURCE_ID) pDevExt->u.primary.cDisplays);355 Assert(srcId < (D3DDDI_VIDEO_PRESENT_SOURCE_ID)commonFromDeviceExt(pDevExt)->cDisplays); 356 356 VBOXVHWA_INFO *pSettings = &pDevExt->aSources[srcId].Vhwa.Settings; 357 357 memset (pSettings, 0, sizeof (VBOXVHWA_INFO)); … … 418 418 void vboxVhwaInit(PDEVICE_EXTENSION pDevExt) 419 419 { 420 for (int i = 0; i < pDevExt->u.primary.cDisplays; ++i)420 for (int i = 0; i < commonFromDeviceExt(pDevExt)->cDisplays; ++i) 421 421 { 422 422 vboxVhwaInitSrc(pDevExt, (D3DDDI_VIDEO_PRESENT_SOURCE_ID)i); … … 428 428 /* we do not allocate/map anything, just issue a Disable command 429 429 * to ensure all pending commands are flushed */ 430 for (int i = 0; i < pDevExt->u.primary.cDisplays; ++i)430 for (int i = 0; i < commonFromDeviceExt(pDevExt)->cDisplays; ++i) 431 431 { 432 432 vboxVhwaDisable(pDevExt, i); … … 680 680 int vboxVhwaHlpGetSurfInfo(PDEVICE_EXTENSION pDevExt, PVBOXWDDM_ALLOCATION pSurf) 681 681 { 682 for (int i = 0; i < pDevExt->u.primary.cDisplays; ++i)682 for (int i = 0; i < commonFromDeviceExt(pDevExt)->cDisplays; ++i) 683 683 { 684 684 PVBOXWDDM_SOURCE pSource = &pDevExt->aSources[i]; … … 720 720 int vboxVhwaHlpCheckInit(PDEVICE_EXTENSION pDevExt, D3DDDI_VIDEO_PRESENT_SOURCE_ID VidPnSourceId) 721 721 { 722 Assert(VidPnSourceId < (D3DDDI_VIDEO_PRESENT_SOURCE_ID) pDevExt->u.primary.cDisplays);723 if (VidPnSourceId >= (D3DDDI_VIDEO_PRESENT_SOURCE_ID) pDevExt->u.primary.cDisplays)722 Assert(VidPnSourceId < (D3DDDI_VIDEO_PRESENT_SOURCE_ID)commonFromDeviceExt(pDevExt)->cDisplays); 723 if (VidPnSourceId >= (D3DDDI_VIDEO_PRESENT_SOURCE_ID)commonFromDeviceExt(pDevExt)->cDisplays) 724 724 return VERR_INVALID_PARAMETER; 725 725 … … 766 766 int vboxVhwaHlpCheckTerm(PDEVICE_EXTENSION pDevExt, D3DDDI_VIDEO_PRESENT_SOURCE_ID VidPnSourceId) 767 767 { 768 Assert(VidPnSourceId < (D3DDDI_VIDEO_PRESENT_SOURCE_ID) pDevExt->u.primary.cDisplays);769 if (VidPnSourceId >= (D3DDDI_VIDEO_PRESENT_SOURCE_ID) pDevExt->u.primary.cDisplays)768 Assert(VidPnSourceId < (D3DDDI_VIDEO_PRESENT_SOURCE_ID)commonFromDeviceExt(pDevExt)->cDisplays); 769 if (VidPnSourceId >= (D3DDDI_VIDEO_PRESENT_SOURCE_ID)commonFromDeviceExt(pDevExt)->cDisplays) 770 770 return VERR_INVALID_PARAMETER; 771 771 -
trunk/src/VBox/Additions/WINNT/Graphics/Miniport/wddm/VBoxVideoVidPn.cpp
r32699 r33252 1558 1558 NTSTATUS vboxVidPnCommitSourceMode(struct _DEVICE_EXTENSION* pDevExt, D3DDDI_VIDEO_PRESENT_SOURCE_ID srcId, CONST D3DKMDT_VIDPN_SOURCE_MODE* pVidPnSourceModeInfo, PVBOXWDDM_ALLOCATION pAllocation) 1559 1559 { 1560 Assert(srcId < (UINT) pDevExt->u.primary.cDisplays);1561 if (srcId < (UINT) pDevExt->u.primary.cDisplays)1560 Assert(srcId < (UINT)commonFromDeviceExt(pDevExt)->cDisplays); 1561 if (srcId < (UINT)commonFromDeviceExt(pDevExt)->cDisplays) 1562 1562 { 1563 1563 PVBOXWDDM_SOURCE pSource = &pDevExt->aSources[srcId]; … … 1565 1565 } 1566 1566 1567 drprintf((__FUNCTION__": invalid srcId (%d), cSources(%d)\n", srcId, pDevExt->u.primary.cDisplays));1567 drprintf((__FUNCTION__": invalid srcId (%d), cSources(%d)\n", srcId, commonFromDeviceExt(pDevExt)->cDisplays)); 1568 1568 return STATUS_INVALID_PARAMETER; 1569 1569 } … … 1580 1580 { 1581 1581 VBOXVIDPNCOMMITTARGETMODE *pInfo = (VBOXVIDPNCOMMITTARGETMODE*)pContext; 1582 Assert(cTgtPaths <= (SIZE_T) pDevExt->u.primary.cDisplays);1582 Assert(cTgtPaths <= (SIZE_T)commonFromDeviceExt(pDevExt)->cDisplays); 1583 1583 D3DKMDT_HVIDPNTARGETMODESET hVidPnTargetModeSet; 1584 1584 CONST DXGK_VIDPNTARGETMODESET_INTERFACE* pVidPnTargetModeSetInterface; -
trunk/src/VBox/Additions/WINNT/Graphics/Miniport/wddm/VBoxVideoWddm.cpp
r33226 r33252 174 174 pView->u32ViewIndex = pAllocation->SurfDesc.VidPnSourceId; 175 175 pView->u32ViewOffset = (uint32_t)offVram; /* we pretend the view is located at the start of each framebuffer */ 176 pView->u32ViewSize = vboxWddmVramCpuVisibleSegmentSize(pDevExt)/ pDevExt->u.primary.cDisplays;176 pView->u32ViewSize = vboxWddmVramCpuVisibleSegmentSize(pDevExt)/commonFromDeviceExt(pDevExt)->cDisplays; 177 177 178 178 pView->u32MaxScreenSize = pView->u32ViewSize; … … 594 594 { 595 595 drprintf(("VBoxVideoWddm: using HGSMI\n")); 596 *NumberOfVideoPresentSources = pContext->u.primary.cDisplays;597 *NumberOfChildren = pContext->u.primary.cDisplays;596 *NumberOfVideoPresentSources = commonFromDeviceExt(pContext)->cDisplays; 597 *NumberOfChildren = commonFromDeviceExt(pContext)->cDisplays; 598 598 dprintf(("VBoxVideoWddm: sources(%d), children(%d)\n", *NumberOfVideoPresentSources, *NumberOfChildren)); 599 599 … … 1024 1024 1025 1025 dfprintf(("==> "__FUNCTION__ ", context(0x%x)\n", MiniportDeviceContext)); 1026 Assert(ChildRelationsSize == ( pDevExt->u.primary.cDisplays + 1)*sizeof(DXGK_CHILD_DESCRIPTOR));1027 for (int i = 0; i < pDevExt->u.primary.cDisplays; ++i)1026 Assert(ChildRelationsSize == (commonFromDeviceExt(pDevExt)->cDisplays + 1)*sizeof(DXGK_CHILD_DESCRIPTOR)); 1027 for (int i = 0; i < commonFromDeviceExt(pDevExt)->cDisplays; ++i) 1028 1028 { 1029 1029 ChildRelations[i].ChildDeviceType = TypeVideoOutput; … … 1217 1217 pCaps->MaxOverlays = 0; 1218 1218 #ifdef VBOX_WITH_VIDEOHWACCEL 1219 for (int i = 0; i < pContext->u.primary.cDisplays; ++i)1219 for (int i = 0; i < commonFromDeviceExt(pContext)->cDisplays; ++i) 1220 1220 { 1221 1221 if ( pContext->aSources[i].Vhwa.Settings.fFlags & VBOXVHWA_F_ENABLED) … … 1306 1306 memset (pQi, 0, sizeof (VBOXWDDM_QI)); 1307 1307 pQi->u32Version = VBOXVIDEOIF_VERSION; 1308 pQi->cInfos = pContext->u.primary.cDisplays;1308 pQi->cInfos = commonFromDeviceExt(pContext)->cDisplays; 1309 1309 #ifdef VBOX_WITH_VIDEOHWACCEL 1310 for (int i = 0; i < pContext->u.primary.cDisplays; ++i)1310 for (int i = 0; i < commonFromDeviceExt(pContext)->cDisplays; ++i) 1311 1311 { 1312 1312 pQi->aInfos[i] = pContext->aSources[i].Vhwa.Settings; … … 1668 1668 { 1669 1669 PVBOXWDDM_RCINFO pRcInfo = (PVBOXWDDM_RCINFO)pCreateAllocation->pPrivateDriverData; 1670 // Assert(pRcInfo->RcDesc.VidPnSourceId < pDevExt->u.primary.cDisplays);1670 // Assert(pRcInfo->RcDesc.VidPnSourceId < commonFromDeviceExt(pDevExt)->cDisplays); 1671 1671 Assert(pRcInfo->cAllocInfos == pCreateAllocation->NumAllocations); 1672 1672 pResource = (PVBOXWDDM_RESOURCE)vboxWddmMemAllocZero(RT_OFFSETOF(VBOXWDDM_RESOURCE, aAllocations[pRcInfo->cAllocInfos])); … … 3294 3294 { 3295 3295 PVBOXDISPIFESCAPE_SCREENLAYOUT pLo = (PVBOXDISPIFESCAPE_SCREENLAYOUT)pEscapeHdr; 3296 Assert(pLo->ScreenLayout.cScreens <= (UINT) pDevExt->u.primary.cDisplays);3296 Assert(pLo->ScreenLayout.cScreens <= (UINT)commonFromDeviceExt(pDevExt)->cDisplays); 3297 3297 for (UINT i = 0; i < pLo->ScreenLayout.cScreens; ++i) 3298 3298 { 3299 3299 PVBOXSCREENLAYOUT_ELEMENT pEl = &pLo->ScreenLayout.aScreens[i]; 3300 Assert(pEl->VidPnSourceId < (UINT) pDevExt->u.primary.cDisplays);3301 if (pEl->VidPnSourceId < (UINT) pDevExt->u.primary.cDisplays)3300 Assert(pEl->VidPnSourceId < (UINT)commonFromDeviceExt(pDevExt)->cDisplays); 3301 if (pEl->VidPnSourceId < (UINT)commonFromDeviceExt(pDevExt)->cDisplays) 3302 3302 { 3303 3303 PVBOXWDDM_SOURCE pSource = &pDevExt->aSources[pEl->VidPnSourceId]; … … 3424 3424 if (Status == STATUS_SUCCESS && bSupported) 3425 3425 { 3426 for (int id = 0; id < pContext->u.primary.cDisplays; ++id)3426 for (int id = 0; id < commonFromDeviceExt(pContext)->cDisplays; ++id) 3427 3427 { 3428 3428 D3DKMDT_HVIDPNSOURCEMODESET hNewVidPnSourceModeSet; … … 3455 3455 if (Status == STATUS_SUCCESS && bSupported) 3456 3456 { 3457 for (int id = 0; id < pContext->u.primary.cDisplays; ++id)3457 for (int id = 0; id < commonFromDeviceExt(pContext)->cDisplays; ++id) 3458 3458 { 3459 3459 D3DKMDT_HVIDPNTARGETMODESET hNewVidPnTargetModeSet; … … 3565 3565 if (Status == STATUS_SUCCESS) 3566 3566 { 3567 for (int i = 0; i < pDevExt->u.primary.cDisplays; ++i)3567 for (int i = 0; i < commonFromDeviceExt(pDevExt)->cDisplays; ++i) 3568 3568 { 3569 3569 Status = vboxVidPnCheckAddMonitorModes(pDevExt, i, D3DKMDT_MCO_DRIVER, &Resolution, 1, 0); … … 3682 3682 NTSTATUS Status = STATUS_SUCCESS; 3683 3683 PDEVICE_EXTENSION pDevExt = (PDEVICE_EXTENSION)hAdapter; 3684 Assert((UINT) pDevExt->u.primary.cDisplays > pSetVidPnSourceAddress->VidPnSourceId);3684 Assert((UINT)commonFromDeviceExt(pDevExt)->cDisplays > pSetVidPnSourceAddress->VidPnSourceId); 3685 3685 3686 3686 PVBOXWDDM_SOURCE pSource = &pDevExt->aSources[pSetVidPnSourceAddress->VidPnSourceId]; … … 3689 3689 Status = STATUS_SUCCESS; 3690 3690 3691 if ((UINT) pDevExt->u.primary.cDisplays > pSetVidPnSourceAddress->VidPnSourceId)3691 if ((UINT)commonFromDeviceExt(pDevExt)->cDisplays > pSetVidPnSourceAddress->VidPnSourceId) 3692 3692 { 3693 3693 PVBOXWDDM_ALLOCATION pAllocation; … … 3741 3741 else 3742 3742 { 3743 drprintf((__FUNCTION__": invalid VidPnSourceId (%d), should be smaller than (%d)\n", pSetVidPnSourceAddress->VidPnSourceId, pDevExt->u.primary.cDisplays));3743 drprintf((__FUNCTION__": invalid VidPnSourceId (%d), should be smaller than (%d)\n", pSetVidPnSourceAddress->VidPnSourceId, commonFromDeviceExt(pDevExt)->cDisplays)); 3744 3744 Status = STATUS_INVALID_PARAMETER; 3745 3745 } … … 3766 3766 NTSTATUS Status = STATUS_SUCCESS; 3767 3767 PDEVICE_EXTENSION pDevExt = (PDEVICE_EXTENSION)hAdapter; 3768 Assert((UINT) pDevExt->u.primary.cDisplays > pSetVidPnSourceVisibility->VidPnSourceId);3768 Assert((UINT)commonFromDeviceExt(pDevExt)->cDisplays > pSetVidPnSourceVisibility->VidPnSourceId); 3769 3769 3770 3770 PVBOXWDDM_SOURCE pSource = &pDevExt->aSources[pSetVidPnSourceVisibility->VidPnSourceId]; … … 3773 3773 Status = STATUS_SUCCESS; 3774 3774 3775 if ((UINT) pDevExt->u.primary.cDisplays > pSetVidPnSourceVisibility->VidPnSourceId)3775 if ((UINT)commonFromDeviceExt(pDevExt)->cDisplays > pSetVidPnSourceVisibility->VidPnSourceId) 3776 3776 { 3777 3777 PVBOXWDDM_ALLOCATION pAllocation = pSource->pPrimaryAllocation; … … 3819 3819 else 3820 3820 { 3821 drprintf((__FUNCTION__": invalid VidPnSourceId (%d), should be smaller than (%d)\n", pSetVidPnSourceVisibility->VidPnSourceId, pDevExt->u.primary.cDisplays));3821 drprintf((__FUNCTION__": invalid VidPnSourceId (%d), should be smaller than (%d)\n", pSetVidPnSourceVisibility->VidPnSourceId, commonFromDeviceExt(pDevExt)->cDisplays)); 3822 3822 Status = STATUS_INVALID_PARAMETER; 3823 3823 } … … 3858 3858 { 3859 3859 /* clear all current primaries */ 3860 for (int i = 0; i < pDevExt->u.primary.cDisplays; ++i)3860 for (int i = 0; i < commonFromDeviceExt(pDevExt)->cDisplays; ++i) 3861 3861 { 3862 3862 vboxWddmAssignPrimary(pDevExt, &pDevExt->aSources[i], NULL, i); … … 4005 4005 PDEVICE_EXTENSION pDevExt = (PDEVICE_EXTENSION)hAdapter; 4006 4006 4007 Assert((UINT) pDevExt->u.primary.cDisplays > pGetScanLine->VidPnTargetId);4007 Assert((UINT)commonFromDeviceExt(pDevExt)->cDisplays > pGetScanLine->VidPnTargetId); 4008 4008 VBOXWDDM_TARGET *pTarget = &pDevExt->aTargets[pGetScanLine->VidPnTargetId]; 4009 4009 Assert(pTarget->HeightTotal); … … 4399 4399 4400 4400 D3DDDI_VIDEO_PRESENT_SOURCE_ID id = pAllocation->SurfDesc.VidPnSourceId; 4401 if (id >= (D3DDDI_VIDEO_PRESENT_SOURCE_ID) pDevExt->u.primary.cDisplays)4401 if (id >= (D3DDDI_VIDEO_PRESENT_SOURCE_ID)commonFromDeviceExt(pDevExt)->cDisplays) 4402 4402 return false; 4403 4403 … … 4968 4968 Assert(pCreateContext->Flags.Value <= 2); /* 2 is a GDI context in Win7 */ 4969 4969 pContext->enmType = VBOXWDDM_CONTEXT_TYPE_SYSTEM; 4970 for (int i = 0; i < pDevExt->u.primary.cDisplays; ++i)4970 for (int i = 0; i < commonFromDeviceExt(pDevExt)->cDisplays; ++i) 4971 4971 { 4972 4972 pDevExt->aSources[i].offVram = VBOXVIDEOOFFSET_VOID;
Note:
See TracChangeset
for help on using the changeset viewer.