VirtualBox

Changeset 71196 in vbox for trunk/src/VBox


Ignore:
Timestamp:
Mar 5, 2018 10:38:29 AM (7 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
121101
Message:

WDDM: use Win8 DDK for VBoxVideoWddm, replace preprocessor ifdefs (VBOX_WDDM_WIN8) with Windows version checks.

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  
    6868 SYSMODS += VBoxVideoWddm
    6969 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
    7273 VBoxVideoWddm_DEFS       += VBOX_WDDM_MINIPORT VBOX_WITH_WDDM VBOX_WITH_HGCM
    7374 ifdef VBOX_WITH_VIDEOHWACCEL
     
    151152 endif
    152153
    153  VBoxVideoWddm_LIBS.x86   = \
    154         $(PATH_SDK_$(VBOX_WINDDK_GST_WLH)_LIB)/BufferOverflowK.lib
    155  #VBoxVideoWddm_LIBS.x86   += \
    156  #      $(PATH_SDK_$(VBOX_WINDDK_GST_WLH)_LIB)/exsup.lib
    157154 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 \
    161159        $(VBOX_LIB_VBGL_R0) \
    162160        $(VBOX_LIB_IPRT_GUEST_R0) \
     
    170168  VBoxVideoW8_EXTENDS    = VBoxVideoWddm
    171169  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
    174171  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)
    185173 endif # VBOX_WITH_WDDM_W8
    186174
  • trunk/src/VBox/Additions/WINNT/Graphics/Video/mp/common/VBoxMPDevExt.h

    r69500 r71196  
    3131
    3232#ifdef VBOX_WDDM_MINIPORT
    33 # ifdef VBOX_WDDM_WIN8
    3433extern DWORD g_VBoxDisplayOnly;
    35 # endif
    3634# include "wddm/VBoxMPTypes.h"
    3735#endif
  • trunk/src/VBox/Additions/WINNT/Graphics/Video/mp/common/VBoxMPUtils.cpp

    r70873 r71196  
    2828 * windbg seems to have some issues when there is a lot ( >32) of sw breakpoints defined
    2929 * to simplify things we just insert breaks for the case of intensive debugging WDDM driver*/
    30 #ifndef VBOX_WDDM_WIN8
    3130int g_bVBoxVDbgBreakF = 0;
    3231int g_bVBoxVDbgBreakFv = 0;
    33 #else
    34 int g_bVBoxVDbgBreakF = 0;
    35 int g_bVBoxVDbgBreakFv = 0;
    36 #endif
    3732#endif
    3833
  • trunk/src/VBox/Additions/WINNT/Graphics/Video/mp/common/VBoxMPVidModes.cpp

    r69500 r71196  
    279279    ULONG vramSize = vboxWddmVramCpuVisibleSegmentSize(pExt);
    280280    vramSize /= pExt->u.primary.commonInfo.cDisplays;
    281 # ifdef VBOX_WDDM_WIN8
    282281    if (!g_VBoxDisplayOnly)
    283 # endif
    284282    {
    285283        /* at least two surfaces will be needed: primary & shadow */
     
    607605    ULONG vramSize = vboxWddmVramCpuVisibleSegmentSize(pExt);
    608606    vramSize /= pExt->u.primary.commonInfo.cDisplays;
    609 # ifdef VBOX_WDDM_WIN8
    610607    if (!g_VBoxDisplayOnly)
    611 # endif
    612608    {
    613609        /* at least two surfaces will be needed: primary & shadow */
  • trunk/src/VBox/Additions/WINNT/Graphics/Video/mp/wddm/VBoxMPMisc.cpp

    r69500 r71196  
    20252025        {
    20262026            memset(&notify, 0, sizeof(DXGKARGCB_NOTIFY_INTERRUPT_DATA));
    2027 #ifdef VBOX_WDDM_WIN8
    20282027            notify.InterruptType = g_VBoxDisplayOnly?
    20292028                                       DXGK_INTERRUPT_DISPLAYONLY_VSYNC:
    20302029                                       DXGK_INTERRUPT_CRTC_VSYNC;
    2031 #else
    2032             notify.InterruptType = DXGK_INTERRUPT_CRTC_VSYNC;
    2033 #endif
    20342030            notify.CrtcVsync.VidPnTargetId = i;
    20352031            pDevExt->u.primary.DxgkInterface.DxgkCbNotifyInterrupt(pDevExt->u.primary.DxgkInterface.DeviceHandle, &notify);
     
    20902086    return STATUS_SUCCESS;
    20912087}
    2092 
    2093 #ifdef VBOX_WDDM_WIN8
    20942088
    20952089void vboxWddmDiInitDefault(DXGK_DISPLAY_INFORMATION *pInfo, PHYSICAL_ADDRESS PhAddr, D3DDDI_VIDEO_PRESENT_SOURCE_ID VidPnSourceId)
     
    21372131}
    21382132
    2139 #endif /* VBOX_WDDM_WIN8 */
    2140 
  • trunk/src/VBox/Additions/WINNT/Graphics/Video/mp/wddm/VBoxMPMisc.h

    r69500 r71196  
    182182NTSTATUS VBoxWddmSlTerm(PVBOXMP_DEVEXT pDevExt);
    183183
    184 #ifdef VBOX_WDDM_WIN8
    185184void vboxWddmDiInitDefault(DXGK_DISPLAY_INFORMATION *pInfo, PHYSICAL_ADDRESS PhAddr, D3DDDI_VIDEO_PRESENT_SOURCE_ID VidPnSourceId);
    186185void vboxWddmDiToAllocData(PVBOXMP_DEVEXT pDevExt, const DXGK_DISPLAY_INFORMATION *pInfo, struct VBOXWDDM_ALLOC_DATA *pAllocData);
    187186void vboxWddmDmSetupDefaultVramLocation(PVBOXMP_DEVEXT pDevExt, D3DDDI_VIDEO_PRESENT_SOURCE_ID ModifiedVidPnSourceId, struct VBOXWDDM_SOURCE *paSources);
    188 #endif
    189187
    190188#endif /* #ifndef ___VBoxMPMisc_h__ */
  • trunk/src/VBox/Additions/WINNT/Graphics/Video/mp/wddm/VBoxMPVModes.cpp

    r69500 r71196  
    221221    ULONG vramSize = vboxWddmVramCpuVisibleSegmentSize(pExt);
    222222    vramSize /= pExt->u.primary.commonInfo.cDisplays;
    223 # ifdef VBOX_WDDM_WIN8
    224223    if (!g_VBoxDisplayOnly)
    225 # endif
    226224    {
    227225        /* at least two surfaces will be needed: primary & shadow */
  • trunk/src/VBox/Additions/WINNT/Graphics/Video/mp/wddm/VBoxMPVidPn.cpp

    r69500 r71196  
    22602260            pSource->AllocData.SurfDesc.cbSize = pVidPnSourceModeInfo->Format.Graphics.Stride * pVidPnSourceModeInfo->Format.Graphics.PrimSurfSize.cy;
    22612261        }
    2262 #ifdef VBOX_WDDM_WIN8
     2262
    22632263        if (g_VBoxDisplayOnly)
    22642264        {
    22652265            vboxWddmDmSetupDefaultVramLocation(pDevExt, VidPnSourceId, paSources);
    22662266        }
    2267 #endif
    22682267    }
    22692268    else
     
    22742273    }
    22752274
    2276 #ifdef VBOX_WDDM_WIN8
    22772275    Assert(!g_VBoxDisplayOnly || !pAllocation);
    22782276    if (!g_VBoxDisplayOnly)
    2279 #endif
    22802277    {
    22812278        vboxWddmAssignPrimary(pSource, pAllocation, VidPnSourceId);
  • trunk/src/VBox/Additions/WINNT/Graphics/Video/mp/wddm/VBoxMPWddm.cpp

    r69500 r71196  
    4141
    4242DWORD g_VBoxLogUm = 0;
    43 #ifdef VBOX_WDDM_WIN8
     43
     44/* Whether the driver is display-only (no 3D) for Windows 8 or newer guests. */
    4445DWORD g_VBoxDisplayOnly = 0;
    45 #endif
    4646
    4747#define VBOXWDDM_MEMTAG 'MDBV'
    4848PVOID vboxWddmMemAlloc(IN SIZE_T cbSize)
    4949{
    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;
    5551    return ExAllocatePoolWithTag(enmPoolType, cbSize, VBOXWDDM_MEMTAG);
    5652}
     
    12801276
    12811277                    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)
    12871280                    {
    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))
    12931285                        {
    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                            }
    12961312                        }
    12971313                        else
    12981314                        {
    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));
    13131316                        }
    13141317                    }
    1315                     else
    1316                     {
    1317                         WARN(("DxgkCbAcquirePostDisplayOwnership failed, Status 0x%x", Status));
    1318                     }
    1319 #endif
    13201318
    13211319                    VBoxWddmVModesInit(pDevExt);
     
    22012199        {
    22022200            DXGK_DRIVERCAPS *pCaps = (DXGK_DRIVERCAPS*)pQueryAdapterInfo->pOutputData;
    2203 
    2204 #ifdef VBOX_WDDM_WIN8
    22052201            memset(pCaps, 0, sizeof (*pCaps));
    2206 #endif
     2202
    22072203            pCaps->HighestAcceptableAddress.LowPart = ~0UL;
    22082204#ifdef RT_ARCH_AMD64
     
    22152211            pCaps->MaxPointerHeight = VBOXWDDM_C_POINTER_MAX_HEIGHT;
    22162212            pCaps->PointerCaps.Value = 3; /* Monochrome , Color*/ /* MaskedColor == Value | 4, disable for now */
    2217 #ifdef VBOX_WDDM_WIN8
    22182213            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;
    22262220#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            }
    22562249            else
    22572250            {
    22582251                pCaps->WDDMVersion = DXGKDDI_WDDMv1_2;
    22592252            }
    2260 #endif
    22612253            break;
    22622254        }
    22632255        case DXGKQAITYPE_QUERYSEGMENT:
    22642256        {
    2265 #ifdef VBOX_WDDM_WIN8
    22662257            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;
    22722262# 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            }
    23162305            else
    23172306            {
     
    23192308                Status = STATUS_NOT_SUPPORTED;
    23202309            }
    2321 #endif
    23222310
    23232311            break;
    23242312        }
    23252313        case DXGKQAITYPE_UMDRIVERPRIVATE:
    2326 #ifdef VBOX_WDDM_WIN8
    23272314            if (!g_VBoxDisplayOnly)
    2328 #endif
    23292315            {
    23302316                if (pQueryAdapterInfo->OutputDataSize == sizeof (VBOXWDDM_QI))
     
    23502336                }
    23512337            }
    2352 #ifdef VBOX_WDDM_WIN8
    23532338            else
    23542339            {
     
    23562341                Status = STATUS_NOT_SUPPORTED;
    23572342            }
    2358 #endif
    23592343            break;
    2360 #ifdef VBOX_WDDM_WIN8
     2344
    23612345        case DXGKQAITYPE_QUERYSEGMENT3:
    23622346            LOGREL(("DXGKQAITYPE_QUERYSEGMENT3 treating as unsupported!"));
    23632347            Status = STATUS_NOT_SUPPORTED;
    23642348            break;
    2365 #endif
     2349
    23662350        default:
    23672351            WARN(("unsupported Type (%d)", pQueryAdapterInfo->Type));
     
    53145298    }
    53155299
    5316 #ifdef VBOX_WDDM_WIN8
    53175300    if (g_VBoxDisplayOnly && !pAllocation)
    53185301    {
     
    53235306    }
    53245307    else
    5325 #endif
    5326     {
    5327 #ifdef VBOX_WDDM_WIN8
     5308    {
    53285309        Assert(!g_VBoxDisplayOnly);
    5329 #endif
    53305310        vboxWddmAddrSetVram(&pSource->AllocData.Addr, pSetVidPnSourceAddress->PrimarySegment,
    53315311                                                    pSetVidPnSourceAddress->PrimaryAddress.QuadPart);
     
    55935573    switch (InterruptType)
    55945574    {
    5595 #ifdef VBOX_WDDM_WIN8
    55965575        case DXGK_INTERRUPT_DISPLAYONLY_VSYNC:
    5597 #endif
    55985576        case DXGK_INTERRUPT_CRTC_VSYNC:
    55995577        {
     
    72037181    return STATUS_SUCCESS;
    72047182}
    7205 
    7206 #ifdef VBOX_WDDM_WIN8
    72077183
    72087184static NTSTATUS APIENTRY DxgkDdiQueryVidPnHWCapability(
     
    74817457    return Status;
    74827458}
    7483 #endif
    74847459
    74857460static NTSTATUS vboxWddmInitFullGraphicsDriver(IN PDRIVER_OBJECT pDriverObject, IN PUNICODE_STRING pRegistryPath, BOOLEAN fCmdVbva)
     
    74947469
    74957470    // 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;
    74977475
    74987476    DriverInitializationData.DxgkDdiAddDevice = DxgkDdiAddDevice;
     
    75957573#endif
    75967574
    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",
    75997577            VBOX_VERSION_MAJOR, VBOX_VERSION_MINOR, VBOX_VERSION_BUILD, VBOX_SVN_REV,
    76007578            (sizeof (void*) << 3), __DATE__, __TIME__));
    7601 #else
    7602     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 #endif
    76067579
    76077580    if (   !ARGUMENT_PRESENT(DriverObject)
     
    76567629#endif
    76577630        {
    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                }
    76687648            }
    76697649            else
    76707650            {
    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        }
    76897660
    76907661        if (NT_SUCCESS(Status))
     
    76957666#endif
    76967667            {
    7697 #ifdef VBOX_WDDM_WIN8
    76987668                if (g_VBoxDisplayOnly)
    76997669                {
     
    77017671                }
    77027672                else
    7703 #endif
    77047673                {
    77057674                    Status = vboxWddmInitFullGraphicsDriver(DriverObject, RegistryPath,
     
    77147683                if (NT_SUCCESS(Status))
    77157684                    return Status;
     7685
    77167686#ifdef VBOX_WITH_CROGL
    77177687                VBoxVrTerm();
  • trunk/src/VBox/Additions/WINNT/Graphics/Video/mp/wddm/VBoxMPWddm.h

    r69500 r71196  
    201201#endif
    202202
    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)
    208204
    209205# define VBOXWDDM_IS_FB_ALLOCATION(_pDevExt, _pAlloc) ((_pAlloc)->bAssigned)
Note: See TracChangeset for help on using the changeset viewer.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette