Changeset 71196 in vbox for trunk/src/VBox
- Timestamp:
- Mar 5, 2018 10:38:29 AM (7 years ago)
- svn:sync-xref-src-repo-rev:
- 121101
- Location:
- trunk/src/VBox/Additions/WINNT/Graphics/Video/mp
- Files:
-
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Additions/WINNT/Graphics/Video/mp/Makefile.kmk
r69111 r71196 68 68 SYSMODS += VBoxVideoWddm 69 69 VBoxVideoWddm_TEMPLATE = VBOXGUESTR0 70 VBoxVideoWddm_SDKS = ReorderCompilerIncs $(VBOX_WINDDK_GST_WLH) 71 VBoxVideoWddm_DEFS += VBOX_WITH_8BPP_MODES DXGKDDI_INTERFACE_VERSION=0x1053 70 VBoxVideoWddm_SDKS = $(VBOX_WINDDK_GST_W8) 71 # WIN9X_COMPAT_SPINLOCK inlines KeInitializeSpinLock in W8 DDK (Windows 7 or older ntoskrnl does not export it). 72 VBoxVideoWddm_DEFS += VBOX_WITH_8BPP_MODES WIN9X_COMPAT_SPINLOCK 72 73 VBoxVideoWddm_DEFS += VBOX_WDDM_MINIPORT VBOX_WITH_WDDM VBOX_WITH_HGCM 73 74 ifdef VBOX_WITH_VIDEOHWACCEL … … 151 152 endif 152 153 153 VBoxVideoWddm_LIBS.x86 = \154 $(PATH_SDK_$(VBOX_WINDDK_GST_WLH)_LIB)/BufferOverflowK.lib155 #VBoxVideoWddm_LIBS.x86 += \156 # $(PATH_SDK_$(VBOX_WINDDK_GST_WLH)_LIB)/exsup.lib157 154 VBoxVideoWddm_LIBS = \ 158 $(PATH_SDK_$(VBOX_WINDDK_GST_WLH)_LIB)/ntoskrnl.lib \ 159 $(PATH_SDK_$(VBOX_WINDDK_GST_WLH)_LIB)/hal.lib \ 160 $(PATH_SDK_$(VBOX_WINDDK_GST_WLH)_LIB)/displib.lib \ 155 $(PATH_SDK_$(VBOX_WINDDK_GST_W8)_LIB)/BufferOverflowK.lib \ 156 $(PATH_SDK_$(VBOX_WINDDK_GST_W8)_LIB)/ntoskrnl.lib \ 157 $(PATH_SDK_$(VBOX_WINDDK_GST_W8)_LIB)/hal.lib \ 158 $(PATH_SDK_$(VBOX_WINDDK_GST_W8)_LIB)/displib.lib \ 161 159 $(VBOX_LIB_VBGL_R0) \ 162 160 $(VBOX_LIB_IPRT_GUEST_R0) \ … … 170 168 VBoxVideoW8_EXTENDS = VBoxVideoWddm 171 169 VBoxVideoW8_TEMPLATE = VBOXGUESTR0 172 VBoxVideoW8_SDKS = $(VBOX_WINDDK_GST_W8) # No ReorderCompilerIncs here! 173 VBoxVideoW8_DEFS = $(subst DXGKDDI_INTERFACE_VERSION=0x1053,DXGKDDI_INTERFACE_VERSION=0x300E,$(VBoxVideoWddm_DEFS)) VBOX_WDDM_WIN8 170 VBoxVideoW8_DEFS = $(VBoxVideoWddm_DEFS) VBOX_WDDM_WIN8 174 171 VBoxVideoW8_SOURCES = $(subst VBoxMPWddm.rc,VBoxMPW8.rc,$(VBoxVideoWddm_SOURCES)) 175 VBoxVideoW8_LIBS.x86 = $(NO_SUCH_VARIABLE) 176 VBoxVideoW8_LIBS.amd64 = $(NO_SUCH_VARIABLE) 177 VBoxVideoW8_LIBS = \ 178 $(VBOX_LIB_VBGL_R0) \ 179 $(VBOX_LIB_IPRT_GUEST_R0) \ 180 $(VBOX_PATH_ADDITIONS_LIB)/HGSMIGuestR0Lib$(VBOX_SUFF_LIB) \ 181 $(PATH_SDK_$(VBOX_WINDDK_GST_W8)_LIB)/ntoskrnl.lib \ 182 $(PATH_SDK_$(VBOX_WINDDK_GST_W8)_LIB)/hal.lib \ 183 $(PATH_SDK_$(VBOX_WINDDK_GST_W8)_LIB)/displib.lib \ 184 $(PATH_SDK_$(VBOX_WINDDK_GST_W8)_LIB)/BufferOverflowK.lib 172 VBoxVideoW8_LIBS = $(VBoxVideoWddm_LIBS) 185 173 endif # VBOX_WITH_WDDM_W8 186 174 -
trunk/src/VBox/Additions/WINNT/Graphics/Video/mp/common/VBoxMPDevExt.h
r69500 r71196 31 31 32 32 #ifdef VBOX_WDDM_MINIPORT 33 # ifdef VBOX_WDDM_WIN834 33 extern DWORD g_VBoxDisplayOnly; 35 # endif36 34 # include "wddm/VBoxMPTypes.h" 37 35 #endif -
trunk/src/VBox/Additions/WINNT/Graphics/Video/mp/common/VBoxMPUtils.cpp
r70873 r71196 28 28 * windbg seems to have some issues when there is a lot ( >32) of sw breakpoints defined 29 29 * to simplify things we just insert breaks for the case of intensive debugging WDDM driver*/ 30 #ifndef VBOX_WDDM_WIN831 30 int g_bVBoxVDbgBreakF = 0; 32 31 int g_bVBoxVDbgBreakFv = 0; 33 #else34 int g_bVBoxVDbgBreakF = 0;35 int g_bVBoxVDbgBreakFv = 0;36 #endif37 32 #endif 38 33 -
trunk/src/VBox/Additions/WINNT/Graphics/Video/mp/common/VBoxMPVidModes.cpp
r69500 r71196 279 279 ULONG vramSize = vboxWddmVramCpuVisibleSegmentSize(pExt); 280 280 vramSize /= pExt->u.primary.commonInfo.cDisplays; 281 # ifdef VBOX_WDDM_WIN8282 281 if (!g_VBoxDisplayOnly) 283 # endif284 282 { 285 283 /* at least two surfaces will be needed: primary & shadow */ … … 607 605 ULONG vramSize = vboxWddmVramCpuVisibleSegmentSize(pExt); 608 606 vramSize /= pExt->u.primary.commonInfo.cDisplays; 609 # ifdef VBOX_WDDM_WIN8610 607 if (!g_VBoxDisplayOnly) 611 # endif612 608 { 613 609 /* at least two surfaces will be needed: primary & shadow */ -
trunk/src/VBox/Additions/WINNT/Graphics/Video/mp/wddm/VBoxMPMisc.cpp
r69500 r71196 2025 2025 { 2026 2026 memset(¬ify, 0, sizeof(DXGKARGCB_NOTIFY_INTERRUPT_DATA)); 2027 #ifdef VBOX_WDDM_WIN82028 2027 notify.InterruptType = g_VBoxDisplayOnly? 2029 2028 DXGK_INTERRUPT_DISPLAYONLY_VSYNC: 2030 2029 DXGK_INTERRUPT_CRTC_VSYNC; 2031 #else2032 notify.InterruptType = DXGK_INTERRUPT_CRTC_VSYNC;2033 #endif2034 2030 notify.CrtcVsync.VidPnTargetId = i; 2035 2031 pDevExt->u.primary.DxgkInterface.DxgkCbNotifyInterrupt(pDevExt->u.primary.DxgkInterface.DeviceHandle, ¬ify); … … 2090 2086 return STATUS_SUCCESS; 2091 2087 } 2092 2093 #ifdef VBOX_WDDM_WIN82094 2088 2095 2089 void vboxWddmDiInitDefault(DXGK_DISPLAY_INFORMATION *pInfo, PHYSICAL_ADDRESS PhAddr, D3DDDI_VIDEO_PRESENT_SOURCE_ID VidPnSourceId) … … 2137 2131 } 2138 2132 2139 #endif /* VBOX_WDDM_WIN8 */2140 -
trunk/src/VBox/Additions/WINNT/Graphics/Video/mp/wddm/VBoxMPMisc.h
r69500 r71196 182 182 NTSTATUS VBoxWddmSlTerm(PVBOXMP_DEVEXT pDevExt); 183 183 184 #ifdef VBOX_WDDM_WIN8185 184 void vboxWddmDiInitDefault(DXGK_DISPLAY_INFORMATION *pInfo, PHYSICAL_ADDRESS PhAddr, D3DDDI_VIDEO_PRESENT_SOURCE_ID VidPnSourceId); 186 185 void vboxWddmDiToAllocData(PVBOXMP_DEVEXT pDevExt, const DXGK_DISPLAY_INFORMATION *pInfo, struct VBOXWDDM_ALLOC_DATA *pAllocData); 187 186 void vboxWddmDmSetupDefaultVramLocation(PVBOXMP_DEVEXT pDevExt, D3DDDI_VIDEO_PRESENT_SOURCE_ID ModifiedVidPnSourceId, struct VBOXWDDM_SOURCE *paSources); 188 #endif189 187 190 188 #endif /* #ifndef ___VBoxMPMisc_h__ */ -
trunk/src/VBox/Additions/WINNT/Graphics/Video/mp/wddm/VBoxMPVModes.cpp
r69500 r71196 221 221 ULONG vramSize = vboxWddmVramCpuVisibleSegmentSize(pExt); 222 222 vramSize /= pExt->u.primary.commonInfo.cDisplays; 223 # ifdef VBOX_WDDM_WIN8224 223 if (!g_VBoxDisplayOnly) 225 # endif226 224 { 227 225 /* at least two surfaces will be needed: primary & shadow */ -
trunk/src/VBox/Additions/WINNT/Graphics/Video/mp/wddm/VBoxMPVidPn.cpp
r69500 r71196 2260 2260 pSource->AllocData.SurfDesc.cbSize = pVidPnSourceModeInfo->Format.Graphics.Stride * pVidPnSourceModeInfo->Format.Graphics.PrimSurfSize.cy; 2261 2261 } 2262 #ifdef VBOX_WDDM_WIN8 2262 2263 2263 if (g_VBoxDisplayOnly) 2264 2264 { 2265 2265 vboxWddmDmSetupDefaultVramLocation(pDevExt, VidPnSourceId, paSources); 2266 2266 } 2267 #endif2268 2267 } 2269 2268 else … … 2274 2273 } 2275 2274 2276 #ifdef VBOX_WDDM_WIN82277 2275 Assert(!g_VBoxDisplayOnly || !pAllocation); 2278 2276 if (!g_VBoxDisplayOnly) 2279 #endif2280 2277 { 2281 2278 vboxWddmAssignPrimary(pSource, pAllocation, VidPnSourceId); -
trunk/src/VBox/Additions/WINNT/Graphics/Video/mp/wddm/VBoxMPWddm.cpp
r69500 r71196 41 41 42 42 DWORD g_VBoxLogUm = 0; 43 #ifdef VBOX_WDDM_WIN8 43 44 /* Whether the driver is display-only (no 3D) for Windows 8 or newer guests. */ 44 45 DWORD g_VBoxDisplayOnly = 0; 45 #endif46 46 47 47 #define VBOXWDDM_MEMTAG 'MDBV' 48 48 PVOID vboxWddmMemAlloc(IN SIZE_T cbSize) 49 49 { 50 #ifdef VBOX_WDDM_WIN8 51 POOL_TYPE enmPoolType = NonPagedPoolNx; 52 #else 53 POOL_TYPE enmPoolType = NonPagedPool; 54 #endif 50 POOL_TYPE enmPoolType = (VBoxQueryWinVersion() >= WINVERSION_8) ? NonPagedPoolNx : NonPagedPool; 55 51 return ExAllocatePoolWithTag(enmPoolType, cbSize, VBOXWDDM_MEMTAG); 56 52 } … … 1280 1276 1281 1277 Status = STATUS_SUCCESS; 1282 #ifdef VBOX_WDDM_WIN8 1283 DXGK_DISPLAY_INFORMATION DisplayInfo; 1284 Status = pDevExt->u.primary.DxgkInterface.DxgkCbAcquirePostDisplayOwnership(pDevExt->u.primary.DxgkInterface.DeviceHandle, 1285 &DisplayInfo); 1286 if (NT_SUCCESS(Status)) 1278 1279 if (VBoxQueryWinVersion() >= WINVERSION_8) 1287 1280 { 1288 PVBOXWDDM_SOURCE pSource = &pDevExt->aSources[0]; 1289 PHYSICAL_ADDRESS PhAddr; 1290 /* display info may sometimes not be valid, e.g. on from-full-graphics wddm driver update 1291 * ensure we have something meaningful here */ 1292 if (!DisplayInfo.Width) 1281 DXGK_DISPLAY_INFORMATION DisplayInfo; 1282 Status = pDevExt->u.primary.DxgkInterface.DxgkCbAcquirePostDisplayOwnership(pDevExt->u.primary.DxgkInterface.DeviceHandle, 1283 &DisplayInfo); 1284 if (NT_SUCCESS(Status)) 1293 1285 { 1294 PhAddr = VBoxCommonFromDeviceExt(pDevExt)->phVRAM; 1295 vboxWddmDiInitDefault(&DisplayInfo, PhAddr, 0); 1286 PVBOXWDDM_SOURCE pSource = &pDevExt->aSources[0]; 1287 PHYSICAL_ADDRESS PhAddr; 1288 /* display info may sometimes not be valid, e.g. on from-full-graphics wddm driver update 1289 * ensure we have something meaningful here */ 1290 if (!DisplayInfo.Width) 1291 { 1292 PhAddr = VBoxCommonFromDeviceExt(pDevExt)->phVRAM; 1293 vboxWddmDiInitDefault(&DisplayInfo, PhAddr, 0); 1294 } 1295 else 1296 { 1297 PhAddr = DisplayInfo.PhysicAddress; 1298 DisplayInfo.TargetId = 0; 1299 } 1300 1301 vboxWddmDiToAllocData(pDevExt, &DisplayInfo, &pSource->AllocData); 1302 1303 /* init the rest source infos with some default values */ 1304 for (UINT i = 1; i < (UINT)VBoxCommonFromDeviceExt(pDevExt)->cDisplays; ++i) 1305 { 1306 PhAddr.QuadPart += pSource->AllocData.SurfDesc.cbSize; 1307 PhAddr.QuadPart = ROUND_TO_PAGES(PhAddr.QuadPart); 1308 vboxWddmDiInitDefault(&DisplayInfo, PhAddr, i); 1309 pSource = &pDevExt->aSources[i]; 1310 vboxWddmDiToAllocData(pDevExt, &DisplayInfo, &pSource->AllocData); 1311 } 1296 1312 } 1297 1313 else 1298 1314 { 1299 PhAddr = DisplayInfo.PhysicAddress; 1300 DisplayInfo.TargetId = 0; 1301 } 1302 1303 vboxWddmDiToAllocData(pDevExt, &DisplayInfo, &pSource->AllocData); 1304 1305 /* init the rest source infos with some default values */ 1306 for (UINT i = 1; i < (UINT)VBoxCommonFromDeviceExt(pDevExt)->cDisplays; ++i) 1307 { 1308 PhAddr.QuadPart += pSource->AllocData.SurfDesc.cbSize; 1309 PhAddr.QuadPart = ROUND_TO_PAGES(PhAddr.QuadPart); 1310 vboxWddmDiInitDefault(&DisplayInfo, PhAddr, i); 1311 pSource = &pDevExt->aSources[i]; 1312 vboxWddmDiToAllocData(pDevExt, &DisplayInfo, &pSource->AllocData); 1315 WARN(("DxgkCbAcquirePostDisplayOwnership failed, Status 0x%x", Status)); 1313 1316 } 1314 1317 } 1315 else1316 {1317 WARN(("DxgkCbAcquirePostDisplayOwnership failed, Status 0x%x", Status));1318 }1319 #endif1320 1318 1321 1319 VBoxWddmVModesInit(pDevExt); … … 2201 2199 { 2202 2200 DXGK_DRIVERCAPS *pCaps = (DXGK_DRIVERCAPS*)pQueryAdapterInfo->pOutputData; 2203 2204 #ifdef VBOX_WDDM_WIN82205 2201 memset(pCaps, 0, sizeof (*pCaps)); 2206 #endif 2202 2207 2203 pCaps->HighestAcceptableAddress.LowPart = ~0UL; 2208 2204 #ifdef RT_ARCH_AMD64 … … 2215 2211 pCaps->MaxPointerHeight = VBOXWDDM_C_POINTER_MAX_HEIGHT; 2216 2212 pCaps->PointerCaps.Value = 3; /* Monochrome , Color*/ /* MaskedColor == Value | 4, disable for now */ 2217 #ifdef VBOX_WDDM_WIN82218 2213 if (!g_VBoxDisplayOnly) 2219 #endif 2220 { 2221 pCaps->MaxAllocationListSlotId = 16; 2222 pCaps->ApertureSegmentCommitLimit = 0; 2223 pCaps->InterruptMessageNumber = 0; 2224 pCaps->NumberOfSwizzlingRanges = 0; 2225 pCaps->MaxOverlays = 0; 2214 { 2215 pCaps->MaxAllocationListSlotId = 16; 2216 pCaps->ApertureSegmentCommitLimit = 0; 2217 pCaps->InterruptMessageNumber = 0; 2218 pCaps->NumberOfSwizzlingRanges = 0; 2219 pCaps->MaxOverlays = 0; 2226 2220 #ifdef VBOX_WITH_VIDEOHWACCEL 2227 for (int i = 0; i < VBoxCommonFromDeviceExt(pDevExt)->cDisplays; ++i) 2228 { 2229 if ( pDevExt->aSources[i].Vhwa.Settings.fFlags & VBOXVHWA_F_ENABLED) 2230 pCaps->MaxOverlays += pDevExt->aSources[i].Vhwa.Settings.cOverlaysSupported; 2231 } 2232 #endif 2233 pCaps->GammaRampCaps.Value = 0; 2234 pCaps->PresentationCaps.Value = 0; 2235 pCaps->PresentationCaps.NoScreenToScreenBlt = 1; 2236 pCaps->PresentationCaps.NoOverlapScreenBlt = 1; 2237 pCaps->MaxQueuedFlipOnVSync = 0; /* do we need it? */ 2238 pCaps->FlipCaps.Value = 0; 2239 /* ? pCaps->FlipCaps.FlipOnVSyncWithNoWait = 1; */ 2240 pCaps->SchedulingCaps.Value = 0; 2241 /* we might need it for Aero. 2242 * Setting this flag means we support DeviceContext, i.e. 2243 * DxgkDdiCreateContext and DxgkDdiDestroyContext 2244 */ 2245 pCaps->SchedulingCaps.MultiEngineAware = 1; 2246 pCaps->MemoryManagementCaps.Value = 0; 2247 /** @todo this correlates with pCaps->SchedulingCaps.MultiEngineAware */ 2248 pCaps->MemoryManagementCaps.PagingNode = 0; 2249 /** @todo this correlates with pCaps->SchedulingCaps.MultiEngineAware */ 2250 pCaps->GpuEngineTopology.NbAsymetricProcessingNodes = VBOXWDDM_NUM_NODES; 2251 #ifdef VBOX_WDDM_WIN8 2252 pCaps->WDDMVersion = DXGKDDI_WDDMv1; 2253 #endif 2254 } 2255 #ifdef VBOX_WDDM_WIN8 2221 for (int i = 0; i < VBoxCommonFromDeviceExt(pDevExt)->cDisplays; ++i) 2222 { 2223 if ( pDevExt->aSources[i].Vhwa.Settings.fFlags & VBOXVHWA_F_ENABLED) 2224 pCaps->MaxOverlays += pDevExt->aSources[i].Vhwa.Settings.cOverlaysSupported; 2225 } 2226 #endif 2227 pCaps->GammaRampCaps.Value = 0; 2228 pCaps->PresentationCaps.Value = 0; 2229 pCaps->PresentationCaps.NoScreenToScreenBlt = 1; 2230 pCaps->PresentationCaps.NoOverlapScreenBlt = 1; 2231 pCaps->MaxQueuedFlipOnVSync = 0; /* do we need it? */ 2232 pCaps->FlipCaps.Value = 0; 2233 /* ? pCaps->FlipCaps.FlipOnVSyncWithNoWait = 1; */ 2234 pCaps->SchedulingCaps.Value = 0; 2235 /* we might need it for Aero. 2236 * Setting this flag means we support DeviceContext, i.e. 2237 * DxgkDdiCreateContext and DxgkDdiDestroyContext 2238 */ 2239 pCaps->SchedulingCaps.MultiEngineAware = 1; 2240 pCaps->MemoryManagementCaps.Value = 0; 2241 /** @todo this correlates with pCaps->SchedulingCaps.MultiEngineAware */ 2242 pCaps->MemoryManagementCaps.PagingNode = 0; 2243 /** @todo this correlates with pCaps->SchedulingCaps.MultiEngineAware */ 2244 pCaps->GpuEngineTopology.NbAsymetricProcessingNodes = VBOXWDDM_NUM_NODES; 2245 2246 if (VBoxQueryWinVersion() >= WINVERSION_8) 2247 pCaps->WDDMVersion = DXGKDDI_WDDMv1; 2248 } 2256 2249 else 2257 2250 { 2258 2251 pCaps->WDDMVersion = DXGKDDI_WDDMv1_2; 2259 2252 } 2260 #endif2261 2253 break; 2262 2254 } 2263 2255 case DXGKQAITYPE_QUERYSEGMENT: 2264 2256 { 2265 #ifdef VBOX_WDDM_WIN82266 2257 if (!g_VBoxDisplayOnly) 2267 #endif 2268 { 2269 /* no need for DXGK_QUERYSEGMENTIN as it contains AGP aperture info, which (AGP aperture) we do not support 2270 * DXGK_QUERYSEGMENTIN *pQsIn = (DXGK_QUERYSEGMENTIN*)pQueryAdapterInfo->pInputData; */ 2271 DXGK_QUERYSEGMENTOUT *pQsOut = (DXGK_QUERYSEGMENTOUT*)pQueryAdapterInfo->pOutputData; 2258 { 2259 /* no need for DXGK_QUERYSEGMENTIN as it contains AGP aperture info, which (AGP aperture) we do not support 2260 * DXGK_QUERYSEGMENTIN *pQsIn = (DXGK_QUERYSEGMENTIN*)pQueryAdapterInfo->pInputData; */ 2261 DXGK_QUERYSEGMENTOUT *pQsOut = (DXGK_QUERYSEGMENTOUT*)pQueryAdapterInfo->pOutputData; 2272 2262 # define VBOXWDDM_SEGMENTS_COUNT 2 2273 if (!pQsOut->pSegmentDescriptor) 2274 { 2275 /* we are requested to provide the number of segments we support */ 2276 pQsOut->NbSegment = VBOXWDDM_SEGMENTS_COUNT; 2277 } 2278 else if (pQsOut->NbSegment != VBOXWDDM_SEGMENTS_COUNT) 2279 { 2280 WARN(("NbSegment (%d) != 1", pQsOut->NbSegment)); 2281 Status = STATUS_INVALID_PARAMETER; 2282 } 2283 else 2284 { 2285 DXGK_SEGMENTDESCRIPTOR* pDr = pQsOut->pSegmentDescriptor; 2286 /* we are requested to provide segment information */ 2287 pDr->BaseAddress.QuadPart = 0; 2288 pDr->CpuTranslatedAddress = VBoxCommonFromDeviceExt(pDevExt)->phVRAM; 2289 /* make sure the size is page aligned */ 2290 /** @todo need to setup VBVA buffers and adjust the mem size here */ 2291 pDr->Size = vboxWddmVramCpuVisibleSegmentSize(pDevExt); 2292 pDr->NbOfBanks = 0; 2293 pDr->pBankRangeTable = 0; 2294 pDr->CommitLimit = pDr->Size; 2295 pDr->Flags.Value = 0; 2296 pDr->Flags.CpuVisible = 1; 2297 2298 ++pDr; 2299 /* create cpu-invisible segment of the same size */ 2300 pDr->BaseAddress.QuadPart = 0; 2301 pDr->CpuTranslatedAddress.QuadPart = 0; 2302 /* make sure the size is page aligned */ 2303 /** @todo need to setup VBVA buffers and adjust the mem size here */ 2304 pDr->Size = vboxWddmVramCpuInvisibleSegmentSize(pDevExt); 2305 pDr->NbOfBanks = 0; 2306 pDr->pBankRangeTable = 0; 2307 pDr->CommitLimit = pDr->Size; 2308 pDr->Flags.Value = 0; 2309 2310 pQsOut->PagingBufferSegmentId = 0; 2311 pQsOut->PagingBufferSize = PAGE_SIZE; 2312 pQsOut->PagingBufferPrivateDataSize = PAGE_SIZE; 2313 } 2314 } 2315 #ifdef VBOX_WDDM_WIN8 2263 if (!pQsOut->pSegmentDescriptor) 2264 { 2265 /* we are requested to provide the number of segments we support */ 2266 pQsOut->NbSegment = VBOXWDDM_SEGMENTS_COUNT; 2267 } 2268 else if (pQsOut->NbSegment != VBOXWDDM_SEGMENTS_COUNT) 2269 { 2270 WARN(("NbSegment (%d) != 1", pQsOut->NbSegment)); 2271 Status = STATUS_INVALID_PARAMETER; 2272 } 2273 else 2274 { 2275 DXGK_SEGMENTDESCRIPTOR* pDr = pQsOut->pSegmentDescriptor; 2276 /* we are requested to provide segment information */ 2277 pDr->BaseAddress.QuadPart = 0; 2278 pDr->CpuTranslatedAddress = VBoxCommonFromDeviceExt(pDevExt)->phVRAM; 2279 /* make sure the size is page aligned */ 2280 /** @todo need to setup VBVA buffers and adjust the mem size here */ 2281 pDr->Size = vboxWddmVramCpuVisibleSegmentSize(pDevExt); 2282 pDr->NbOfBanks = 0; 2283 pDr->pBankRangeTable = 0; 2284 pDr->CommitLimit = pDr->Size; 2285 pDr->Flags.Value = 0; 2286 pDr->Flags.CpuVisible = 1; 2287 2288 ++pDr; 2289 /* create cpu-invisible segment of the same size */ 2290 pDr->BaseAddress.QuadPart = 0; 2291 pDr->CpuTranslatedAddress.QuadPart = 0; 2292 /* make sure the size is page aligned */ 2293 /** @todo need to setup VBVA buffers and adjust the mem size here */ 2294 pDr->Size = vboxWddmVramCpuInvisibleSegmentSize(pDevExt); 2295 pDr->NbOfBanks = 0; 2296 pDr->pBankRangeTable = 0; 2297 pDr->CommitLimit = pDr->Size; 2298 pDr->Flags.Value = 0; 2299 2300 pQsOut->PagingBufferSegmentId = 0; 2301 pQsOut->PagingBufferSize = PAGE_SIZE; 2302 pQsOut->PagingBufferPrivateDataSize = PAGE_SIZE; 2303 } 2304 } 2316 2305 else 2317 2306 { … … 2319 2308 Status = STATUS_NOT_SUPPORTED; 2320 2309 } 2321 #endif2322 2310 2323 2311 break; 2324 2312 } 2325 2313 case DXGKQAITYPE_UMDRIVERPRIVATE: 2326 #ifdef VBOX_WDDM_WIN82327 2314 if (!g_VBoxDisplayOnly) 2328 #endif2329 2315 { 2330 2316 if (pQueryAdapterInfo->OutputDataSize == sizeof (VBOXWDDM_QI)) … … 2350 2336 } 2351 2337 } 2352 #ifdef VBOX_WDDM_WIN82353 2338 else 2354 2339 { … … 2356 2341 Status = STATUS_NOT_SUPPORTED; 2357 2342 } 2358 #endif2359 2343 break; 2360 #ifdef VBOX_WDDM_WIN8 2344 2361 2345 case DXGKQAITYPE_QUERYSEGMENT3: 2362 2346 LOGREL(("DXGKQAITYPE_QUERYSEGMENT3 treating as unsupported!")); 2363 2347 Status = STATUS_NOT_SUPPORTED; 2364 2348 break; 2365 #endif 2349 2366 2350 default: 2367 2351 WARN(("unsupported Type (%d)", pQueryAdapterInfo->Type)); … … 5314 5298 } 5315 5299 5316 #ifdef VBOX_WDDM_WIN85317 5300 if (g_VBoxDisplayOnly && !pAllocation) 5318 5301 { … … 5323 5306 } 5324 5307 else 5325 #endif 5326 { 5327 #ifdef VBOX_WDDM_WIN8 5308 { 5328 5309 Assert(!g_VBoxDisplayOnly); 5329 #endif5330 5310 vboxWddmAddrSetVram(&pSource->AllocData.Addr, pSetVidPnSourceAddress->PrimarySegment, 5331 5311 pSetVidPnSourceAddress->PrimaryAddress.QuadPart); … … 5593 5573 switch (InterruptType) 5594 5574 { 5595 #ifdef VBOX_WDDM_WIN85596 5575 case DXGK_INTERRUPT_DISPLAYONLY_VSYNC: 5597 #endif5598 5576 case DXGK_INTERRUPT_CRTC_VSYNC: 5599 5577 { … … 7203 7181 return STATUS_SUCCESS; 7204 7182 } 7205 7206 #ifdef VBOX_WDDM_WIN87207 7183 7208 7184 static NTSTATUS APIENTRY DxgkDdiQueryVidPnHWCapability( … … 7481 7457 return Status; 7482 7458 } 7483 #endif7484 7459 7485 7460 static NTSTATUS vboxWddmInitFullGraphicsDriver(IN PDRIVER_OBJECT pDriverObject, IN PUNICODE_STRING pRegistryPath, BOOLEAN fCmdVbva) … … 7494 7469 7495 7470 // Fill in the DriverInitializationData structure and call DxgkInitialize() 7496 DriverInitializationData.Version = DXGKDDI_INTERFACE_VERSION; 7471 if (VBoxQueryWinVersion() >= WINVERSION_8) 7472 DriverInitializationData.Version = DXGKDDI_INTERFACE_VERSION_WIN8; 7473 else 7474 DriverInitializationData.Version = DXGKDDI_INTERFACE_VERSION_VISTA_SP1; 7497 7475 7498 7476 DriverInitializationData.DxgkDdiAddDevice = DxgkDdiAddDevice; … … 7595 7573 #endif 7596 7574 7597 #ifdef VBOX_WDDM_WIN8 7598 LOGREL(("VBox WDDM Driver for Windows 8+ version %d.%d.%dr%d, %d bit; Built %s %s",7575 LOGREL(("VBox WDDM Driver for Windows %s version %d.%d.%dr%d, %d bit; Built %s %s", 7576 VBoxQueryWinVersion() >= WINVERSION_8 ? "8+" : "Vista and 7", 7599 7577 VBOX_VERSION_MAJOR, VBOX_VERSION_MINOR, VBOX_VERSION_BUILD, VBOX_SVN_REV, 7600 7578 (sizeof (void*) << 3), __DATE__, __TIME__)); 7601 #else7602 LOGREL(("VBox WDDM Driver for Windows Vista and 7 version %d.%d.%dr%d, %d bit; Built %s %s",7603 VBOX_VERSION_MAJOR, VBOX_VERSION_MINOR, VBOX_VERSION_BUILD, VBOX_SVN_REV,7604 (sizeof (void*) << 3), __DATE__, __TIME__));7605 #endif7606 7579 7607 7580 if ( !ARGUMENT_PRESENT(DriverObject) … … 7656 7629 #endif 7657 7630 { 7658 #ifdef VBOX_WDDM_WIN8 7659 Assert(f3DRequired); 7660 g_VBoxDisplayOnly = 1; 7661 7662 /* Black list some builds. */ 7663 if (major == 6 && minor == 4 && build == 9841) 7664 { 7665 /* W10 Technical preview crashes with display-only driver. */ 7666 LOGREL(("3D is NOT supported by the host, fallback to the system video driver.")); 7667 Status = STATUS_UNSUCCESSFUL; 7631 /* No 3D support by the host. */ 7632 if (VBoxQueryWinVersion() >= WINVERSION_8) 7633 { 7634 /* Use display only driver for Win8+. */ 7635 g_VBoxDisplayOnly = 1; 7636 7637 /* Black list some builds. */ 7638 if (major == 6 && minor == 4 && build == 9841) 7639 { 7640 /* W10 Technical preview crashes with display-only driver. */ 7641 LOGREL(("3D is NOT supported by the host, fallback to the system video driver.")); 7642 Status = STATUS_UNSUCCESSFUL; 7643 } 7644 else 7645 { 7646 LOGREL(("3D is NOT supported by the host, falling back to display-only mode..")); 7647 } 7668 7648 } 7669 7649 else 7670 7650 { 7671 LOGREL(("3D is NOT supported by the host, falling back to display-only mode..")); 7672 } 7673 #else 7674 if (f3DRequired) 7675 { 7676 LOGREL(("3D is NOT supported by the host, but is required for the current guest version using this driver..")); 7677 Status = STATUS_UNSUCCESSFUL; 7678 } 7679 else 7680 LOGREL(("3D is NOT supported by the host, but is NOT required for the current guest version using this driver, continuing with Disabled 3D..")); 7681 #endif 7682 } 7683 7684 #if 0 //defined(DEBUG_misha) && defined(VBOX_WDDM_WIN8) 7685 /* force g_VBoxDisplayOnly for debugging purposes */ 7686 LOGREL(("Current win8 video driver only supports display-only mode no matter whether or not host 3D is enabled!")); 7687 g_VBoxDisplayOnly = 1; 7688 #endif 7651 if (f3DRequired) 7652 { 7653 LOGREL(("3D is NOT supported by the host, but is required for the current guest version using this driver..")); 7654 Status = STATUS_UNSUCCESSFUL; 7655 } 7656 else 7657 LOGREL(("3D is NOT supported by the host, but is NOT required for the current guest version using this driver, continuing with Disabled 3D..")); 7658 } 7659 } 7689 7660 7690 7661 if (NT_SUCCESS(Status)) … … 7695 7666 #endif 7696 7667 { 7697 #ifdef VBOX_WDDM_WIN87698 7668 if (g_VBoxDisplayOnly) 7699 7669 { … … 7701 7671 } 7702 7672 else 7703 #endif7704 7673 { 7705 7674 Status = vboxWddmInitFullGraphicsDriver(DriverObject, RegistryPath, … … 7714 7683 if (NT_SUCCESS(Status)) 7715 7684 return Status; 7685 7716 7686 #ifdef VBOX_WITH_CROGL 7717 7687 VBoxVrTerm(); -
trunk/src/VBox/Additions/WINNT/Graphics/Video/mp/wddm/VBoxMPWddm.h
r69500 r71196 201 201 #endif 202 202 203 #ifdef VBOX_WDDM_WIN8 204 # define VBOXWDDM_IS_DISPLAYONLY() (g_VBoxDisplayOnly) 205 #else 206 # define VBOXWDDM_IS_DISPLAYONLY() (FALSE) 207 #endif 203 #define VBOXWDDM_IS_DISPLAYONLY() (g_VBoxDisplayOnly) 208 204 209 205 # define VBOXWDDM_IS_FB_ALLOCATION(_pDevExt, _pAlloc) ((_pAlloc)->bAssigned)
Note:
See TracChangeset
for help on using the changeset viewer.