VirtualBox

Ignore:
Timestamp:
Apr 12, 2012 6:16:40 PM (13 years ago)
Author:
vboxsync
Message:

wddm: disable driver load for win8 if 3D support is unavailable

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Additions/WINNT/Graphics/Video/mp/wddm/VBoxMPWddm.cpp

    r40842 r40897  
    974974}
    975975
     976
    976977/* driver callbacks */
    977978NTSTATUS DxgkDdiAddDevice(
     
    10621063            if (Status == STATUS_SUCCESS)
    10631064            {
    1064                 /* Initialize VBoxGuest library, which is used for requests which go through VMMDev. */
    1065                 VbglInit ();
    1066 
    10671065                /* Guest supports only HGSMI, the old VBVA via VMMDev is not supported.
    10681066                 * The host will however support both old and new interface to keep compatibility
     
    11081106                    LOGREL(("HGSMI failed to initialize, returning err"));
    11091107
    1110                     VbglTerminate();
    11111108                    /* @todo: report a better status */
    11121109                    Status = STATUS_UNSUCCESSFUL;
     
    11651162    if (RT_SUCCESS(rc))
    11661163    {
    1167         VbglTerminate();
    1168 
    11691164        vboxWddmVGuidFree(pDevExt);
    11701165
     
    16531648
    16541649    vboxVDbgBreakFv();
     1650
     1651    VbglTerminate();
    16551652
    16561653    VBoxWddmVrTerm();
     
    18601857    if (pCreateDevice->Flags.SystemDevice)
    18611858        pDevice->enmType = VBOXWDDM_DEVICE_TYPE_SYSTEM;
    1862 //    else
    1863 //    {
    1864 //        AssertBreakpoint(); /* we do not support custom contexts for now */
    1865 //        LOGREL(("we do not support custom devices for now, hAdapter (0x%x)", hAdapter));
    1866 //    }
    18671859
    18681860    pDevice->pAdapter = pDevExt;
     
    38633855                    /* this is true due to the above condition */
    38643856                    Assert(pEscape->PrivateDriverDataSize > RT_OFFSETOF(VBOXDISPIFESCAPE_CRHGSMICTLCON_CALL, CallInfo));
    3865                     int rc = VBoxMpCrCtlConCallUserData(pDevExt, &pCall->CallInfo, pEscape->PrivateDriverDataSize - RT_OFFSETOF(VBOXDISPIFESCAPE_CRHGSMICTLCON_CALL, CallInfo));
     3857                    int rc = VBoxMpCrCtlConCallUserData(&pDevExt->CrCtlCon, &pCall->CallInfo, pEscape->PrivateDriverDataSize - RT_OFFSETOF(VBOXDISPIFESCAPE_CRHGSMICTLCON_CALL, CallInfo));
    38663858                    if (RT_SUCCESS(rc))
    38673859                        Status = STATUS_SUCCESS;
     
    58405832                                    if (pInfo->crVersionMajor || pInfo->crVersionMinor)
    58415833                                    {
    5842                                         rc = VBoxMpCrCtlConConnect(pDevExt,
     5834                                        rc = VBoxMpCrCtlConConnect(&pDevExt->CrCtlCon,
    58435835                                            pInfo->crVersionMajor, pInfo->crVersionMinor,
    58445836                                            &pContext->u32CrConClientID);
     
    58745866                            if (pInfo->crVersionMajor || pInfo->crVersionMinor)
    58755867                            {
    5876                                 rc = VBoxMpCrCtlConConnect(pDevExt,
     5868                                rc = VBoxMpCrCtlConConnect(&pDevExt->CrCtlCon,
    58775869                                    pInfo->crVersionMajor, pInfo->crVersionMinor,
    58785870                                    &pContext->u32CrConClientID);
     
    59525944            if (pContext->u32CrConClientID)
    59535945            {
    5954                 VBoxMpCrCtlConDisconnect(pDevExt, pContext->u32CrConClientID);
     5946                VBoxMpCrCtlConDisconnect(&pDevExt->CrCtlCon, pContext->u32CrConClientID);
    59555947            }
    59565948            break;
     
    60386030    vboxVDbgBreakFv();
    60396031
    6040 /*
    6041     int irc = RTR0Init(0);
    6042     if (RT_FAILURE(irc))
    6043     {
    6044         LOGREL(("VBoxMP::failed to init IPRT (rc=%#x)", irc));
    6045         return ERROR_INVALID_FUNCTION;
    6046     }
    6047 */
    6048 
    60496032#ifdef DEBUG_misha
    60506033    RTLogGroupSettings(0, "+default.e.l.f.l2.l3");
     
    60536036    LOGREL(("Built %s %s", __DATE__, __TIME__));
    60546037
    6055     NTSTATUS Status = VBoxWddmVrInit();
    6056     if (!NT_SUCCESS(Status))
    6057     {
    6058         WARN(("VBoxWddmVrInit failed!"));
    6059         return Status;
    6060     }
    6061 
    6062     DRIVER_INITIALIZATION_DATA DriverInitializationData = {'\0'};
    6063 
    60646038    if (! ARGUMENT_PRESENT(DriverObject) ||
    60656039        ! ARGUMENT_PRESENT(RegistryPath))
     
    60686042    }
    60696043
    6070     // Fill in the DriverInitializationData structure and call DxgkInitialize()
    6071     DriverInitializationData.Version = DXGKDDI_INTERFACE_VERSION;
    6072 
    6073     DriverInitializationData.DxgkDdiAddDevice = DxgkDdiAddDevice;
    6074     DriverInitializationData.DxgkDdiStartDevice = DxgkDdiStartDevice;
    6075     DriverInitializationData.DxgkDdiStopDevice = DxgkDdiStopDevice;
    6076     DriverInitializationData.DxgkDdiRemoveDevice = DxgkDdiRemoveDevice;
    6077     DriverInitializationData.DxgkDdiDispatchIoRequest = DxgkDdiDispatchIoRequest;
    6078     DriverInitializationData.DxgkDdiInterruptRoutine = DxgkDdiInterruptRoutine;
    6079     DriverInitializationData.DxgkDdiDpcRoutine = DxgkDdiDpcRoutine;
    6080     DriverInitializationData.DxgkDdiQueryChildRelations = DxgkDdiQueryChildRelations;
    6081     DriverInitializationData.DxgkDdiQueryChildStatus = DxgkDdiQueryChildStatus;
    6082     DriverInitializationData.DxgkDdiQueryDeviceDescriptor = DxgkDdiQueryDeviceDescriptor;
    6083     DriverInitializationData.DxgkDdiSetPowerState = DxgkDdiSetPowerState;
    6084     DriverInitializationData.DxgkDdiNotifyAcpiEvent = DxgkDdiNotifyAcpiEvent;
    6085     DriverInitializationData.DxgkDdiResetDevice = DxgkDdiResetDevice;
    6086     DriverInitializationData.DxgkDdiUnload = DxgkDdiUnload;
    6087     DriverInitializationData.DxgkDdiQueryInterface = DxgkDdiQueryInterface;
    6088     DriverInitializationData.DxgkDdiControlEtwLogging = DxgkDdiControlEtwLogging;
    6089 
    6090     DriverInitializationData.DxgkDdiQueryAdapterInfo = DxgkDdiQueryAdapterInfo;
    6091     DriverInitializationData.DxgkDdiCreateDevice = DxgkDdiCreateDevice;
    6092     DriverInitializationData.DxgkDdiCreateAllocation = DxgkDdiCreateAllocation;
    6093     DriverInitializationData.DxgkDdiDestroyAllocation = DxgkDdiDestroyAllocation;
    6094     DriverInitializationData.DxgkDdiDescribeAllocation = DxgkDdiDescribeAllocation;
    6095     DriverInitializationData.DxgkDdiGetStandardAllocationDriverData = DxgkDdiGetStandardAllocationDriverData;
    6096     DriverInitializationData.DxgkDdiAcquireSwizzlingRange = DxgkDdiAcquireSwizzlingRange;
    6097     DriverInitializationData.DxgkDdiReleaseSwizzlingRange = DxgkDdiReleaseSwizzlingRange;
    6098     DriverInitializationData.DxgkDdiPatch = DxgkDdiPatch;
    6099     DriverInitializationData.DxgkDdiSubmitCommand = DxgkDdiSubmitCommand;
    6100     DriverInitializationData.DxgkDdiPreemptCommand = DxgkDdiPreemptCommand;
    6101     DriverInitializationData.DxgkDdiBuildPagingBuffer = DxgkDdiBuildPagingBuffer;
    6102     DriverInitializationData.DxgkDdiSetPalette = DxgkDdiSetPalette;
    6103     DriverInitializationData.DxgkDdiSetPointerPosition = DxgkDdiSetPointerPosition;
    6104     DriverInitializationData.DxgkDdiSetPointerShape = DxgkDdiSetPointerShape;
    6105     DriverInitializationData.DxgkDdiResetFromTimeout = DxgkDdiResetFromTimeout;
    6106     DriverInitializationData.DxgkDdiRestartFromTimeout = DxgkDdiRestartFromTimeout;
    6107     DriverInitializationData.DxgkDdiEscape = DxgkDdiEscape;
    6108     DriverInitializationData.DxgkDdiCollectDbgInfo = DxgkDdiCollectDbgInfo;
    6109     DriverInitializationData.DxgkDdiQueryCurrentFence = DxgkDdiQueryCurrentFence;
    6110     DriverInitializationData.DxgkDdiIsSupportedVidPn = DxgkDdiIsSupportedVidPn;
    6111     DriverInitializationData.DxgkDdiRecommendFunctionalVidPn = DxgkDdiRecommendFunctionalVidPn;
    6112     DriverInitializationData.DxgkDdiEnumVidPnCofuncModality = DxgkDdiEnumVidPnCofuncModality;
    6113     DriverInitializationData.DxgkDdiSetVidPnSourceAddress = DxgkDdiSetVidPnSourceAddress;
    6114     DriverInitializationData.DxgkDdiSetVidPnSourceVisibility = DxgkDdiSetVidPnSourceVisibility;
    6115     DriverInitializationData.DxgkDdiCommitVidPn = DxgkDdiCommitVidPn;
    6116     DriverInitializationData.DxgkDdiUpdateActiveVidPnPresentPath = DxgkDdiUpdateActiveVidPnPresentPath;
    6117     DriverInitializationData.DxgkDdiRecommendMonitorModes = DxgkDdiRecommendMonitorModes;
    6118     DriverInitializationData.DxgkDdiRecommendVidPnTopology = DxgkDdiRecommendVidPnTopology;
    6119     DriverInitializationData.DxgkDdiGetScanLine = DxgkDdiGetScanLine;
    6120     DriverInitializationData.DxgkDdiStopCapture = DxgkDdiStopCapture;
    6121     DriverInitializationData.DxgkDdiControlInterrupt = DxgkDdiControlInterrupt;
    6122     DriverInitializationData.DxgkDdiCreateOverlay = DxgkDdiCreateOverlay;
    6123 
    6124     DriverInitializationData.DxgkDdiDestroyDevice = DxgkDdiDestroyDevice;
    6125     DriverInitializationData.DxgkDdiOpenAllocation = DxgkDdiOpenAllocation;
    6126     DriverInitializationData.DxgkDdiCloseAllocation = DxgkDdiCloseAllocation;
    6127     DriverInitializationData.DxgkDdiRender = DxgkDdiRender;
    6128     DriverInitializationData.DxgkDdiPresent = DxgkDdiPresent;
    6129 
    6130     DriverInitializationData.DxgkDdiUpdateOverlay = DxgkDdiUpdateOverlay;
    6131     DriverInitializationData.DxgkDdiFlipOverlay = DxgkDdiFlipOverlay;
    6132     DriverInitializationData.DxgkDdiDestroyOverlay = DxgkDdiDestroyOverlay;
    6133 
    6134     DriverInitializationData.DxgkDdiCreateContext = DxgkDdiCreateContext;
    6135     DriverInitializationData.DxgkDdiDestroyContext = DxgkDdiDestroyContext;
    6136 
    6137     DriverInitializationData.DxgkDdiLinkDevice = NULL; //DxgkDdiLinkDevice;
    6138     DriverInitializationData.DxgkDdiSetDisplayPrivateDriverFormat = DxgkDdiSetDisplayPrivateDriverFormat;
    6139 //#if (DXGKDDI_INTERFACE_VERSION >= DXGKDDI_INTERFACE_VERSION_WIN7)
    6140 //# error port to Win7 DDI
    6141 //    DriverInitializationData.DxgkDdiRenderKm  = DxgkDdiRenderKm;
    6142 //    DriverInitializationData.DxgkDdiRestartFromTimeout  = DxgkDdiRestartFromTimeout;
    6143 //    DriverInitializationData.DxgkDdiSetVidPnSourceVisibility  = DxgkDdiSetVidPnSourceVisibility;
    6144 //    DriverInitializationData.DxgkDdiUpdateActiveVidPnPresentPath  = DxgkDdiUpdateActiveVidPnPresentPath;
    6145 //    DriverInitializationData.DxgkDdiQueryVidPnHWCapability  = DxgkDdiQueryVidPnHWCapability;
    6146 //#endif
    6147 
    6148     return DxgkInitialize(DriverObject,
    6149                           RegistryPath,
    6150                           &DriverInitializationData);
    6151 }
     6044    ULONG major, minor, build;
     6045    BOOLEAN checkedBuild = PsGetVersion(&major, &minor, &build, NULL);
     6046    BOOLEAN f3Drequired = FALSE;
     6047
     6048    LOGREL(("OsVersion( %d, %d, %d )", major, minor, build));
     6049
     6050    NTSTATUS Status = STATUS_SUCCESS;
     6051    /* Initialize VBoxGuest library, which is used for requests which go through VMMDev. */
     6052    int rc = VbglInit();
     6053    if (RT_SUCCESS(rc))
     6054    {
     6055        if (major > 6)
     6056        {
     6057            WARN(("Unknow win version, newer major release, assuming 3D is required"));
     6058            f3Drequired = TRUE;
     6059        }
     6060        else if (major == 6)
     6061        {
     6062            if (minor > 2)
     6063            {
     6064                WARN(("Unknow win version, newer minor release, assuming 3D is required"));
     6065                f3Drequired = TRUE;
     6066            }
     6067            else if (minor == 2)
     6068            {
     6069                LOG(("3D is required!"));
     6070                f3Drequired = TRUE;
     6071            }
     6072            else
     6073            {
     6074                LOG(("3D is NOT required!"));
     6075                f3Drequired = FALSE;
     6076            }
     6077        }
     6078        else
     6079        {
     6080            WARN(("Unsupported OLDER win version, ignore and assume 3D is NOT required"));
     6081            f3Drequired = FALSE;
     6082        }
     6083
     6084        Status = STATUS_SUCCESS;
     6085
     6086        if (f3Drequired)
     6087        {
     6088            LOG(("3D is required, doing the 3D check.."));
     6089            if (!VBoxMpCrCtlConIs3DSupported())
     6090            {
     6091                LOGREL(("3D is NOT supported by the host, but is required for the current guest version.."));
     6092                Status = STATUS_UNSUCCESSFUL;
     6093            }
     6094        }
     6095
     6096        if (NT_SUCCESS(Status))
     6097        {
     6098            Status = VBoxWddmVrInit();
     6099            if (NT_SUCCESS(Status))
     6100            {
     6101                DRIVER_INITIALIZATION_DATA DriverInitializationData = {'\0'};
     6102
     6103                // Fill in the DriverInitializationData structure and call DxgkInitialize()
     6104                DriverInitializationData.Version = DXGKDDI_INTERFACE_VERSION;
     6105
     6106                DriverInitializationData.DxgkDdiAddDevice = DxgkDdiAddDevice;
     6107                DriverInitializationData.DxgkDdiStartDevice = DxgkDdiStartDevice;
     6108                DriverInitializationData.DxgkDdiStopDevice = DxgkDdiStopDevice;
     6109                DriverInitializationData.DxgkDdiRemoveDevice = DxgkDdiRemoveDevice;
     6110                DriverInitializationData.DxgkDdiDispatchIoRequest = DxgkDdiDispatchIoRequest;
     6111                DriverInitializationData.DxgkDdiInterruptRoutine = DxgkDdiInterruptRoutine;
     6112                DriverInitializationData.DxgkDdiDpcRoutine = DxgkDdiDpcRoutine;
     6113                DriverInitializationData.DxgkDdiQueryChildRelations = DxgkDdiQueryChildRelations;
     6114                DriverInitializationData.DxgkDdiQueryChildStatus = DxgkDdiQueryChildStatus;
     6115                DriverInitializationData.DxgkDdiQueryDeviceDescriptor = DxgkDdiQueryDeviceDescriptor;
     6116                DriverInitializationData.DxgkDdiSetPowerState = DxgkDdiSetPowerState;
     6117                DriverInitializationData.DxgkDdiNotifyAcpiEvent = DxgkDdiNotifyAcpiEvent;
     6118                DriverInitializationData.DxgkDdiResetDevice = DxgkDdiResetDevice;
     6119                DriverInitializationData.DxgkDdiUnload = DxgkDdiUnload;
     6120                DriverInitializationData.DxgkDdiQueryInterface = DxgkDdiQueryInterface;
     6121                DriverInitializationData.DxgkDdiControlEtwLogging = DxgkDdiControlEtwLogging;
     6122
     6123                DriverInitializationData.DxgkDdiQueryAdapterInfo = DxgkDdiQueryAdapterInfo;
     6124                DriverInitializationData.DxgkDdiCreateDevice = DxgkDdiCreateDevice;
     6125                DriverInitializationData.DxgkDdiCreateAllocation = DxgkDdiCreateAllocation;
     6126                DriverInitializationData.DxgkDdiDestroyAllocation = DxgkDdiDestroyAllocation;
     6127                DriverInitializationData.DxgkDdiDescribeAllocation = DxgkDdiDescribeAllocation;
     6128                DriverInitializationData.DxgkDdiGetStandardAllocationDriverData = DxgkDdiGetStandardAllocationDriverData;
     6129                DriverInitializationData.DxgkDdiAcquireSwizzlingRange = DxgkDdiAcquireSwizzlingRange;
     6130                DriverInitializationData.DxgkDdiReleaseSwizzlingRange = DxgkDdiReleaseSwizzlingRange;
     6131                DriverInitializationData.DxgkDdiPatch = DxgkDdiPatch;
     6132                DriverInitializationData.DxgkDdiSubmitCommand = DxgkDdiSubmitCommand;
     6133                DriverInitializationData.DxgkDdiPreemptCommand = DxgkDdiPreemptCommand;
     6134                DriverInitializationData.DxgkDdiBuildPagingBuffer = DxgkDdiBuildPagingBuffer;
     6135                DriverInitializationData.DxgkDdiSetPalette = DxgkDdiSetPalette;
     6136                DriverInitializationData.DxgkDdiSetPointerPosition = DxgkDdiSetPointerPosition;
     6137                DriverInitializationData.DxgkDdiSetPointerShape = DxgkDdiSetPointerShape;
     6138                DriverInitializationData.DxgkDdiResetFromTimeout = DxgkDdiResetFromTimeout;
     6139                DriverInitializationData.DxgkDdiRestartFromTimeout = DxgkDdiRestartFromTimeout;
     6140                DriverInitializationData.DxgkDdiEscape = DxgkDdiEscape;
     6141                DriverInitializationData.DxgkDdiCollectDbgInfo = DxgkDdiCollectDbgInfo;
     6142                DriverInitializationData.DxgkDdiQueryCurrentFence = DxgkDdiQueryCurrentFence;
     6143                DriverInitializationData.DxgkDdiIsSupportedVidPn = DxgkDdiIsSupportedVidPn;
     6144                DriverInitializationData.DxgkDdiRecommendFunctionalVidPn = DxgkDdiRecommendFunctionalVidPn;
     6145                DriverInitializationData.DxgkDdiEnumVidPnCofuncModality = DxgkDdiEnumVidPnCofuncModality;
     6146                DriverInitializationData.DxgkDdiSetVidPnSourceAddress = DxgkDdiSetVidPnSourceAddress;
     6147                DriverInitializationData.DxgkDdiSetVidPnSourceVisibility = DxgkDdiSetVidPnSourceVisibility;
     6148                DriverInitializationData.DxgkDdiCommitVidPn = DxgkDdiCommitVidPn;
     6149                DriverInitializationData.DxgkDdiUpdateActiveVidPnPresentPath = DxgkDdiUpdateActiveVidPnPresentPath;
     6150                DriverInitializationData.DxgkDdiRecommendMonitorModes = DxgkDdiRecommendMonitorModes;
     6151                DriverInitializationData.DxgkDdiRecommendVidPnTopology = DxgkDdiRecommendVidPnTopology;
     6152                DriverInitializationData.DxgkDdiGetScanLine = DxgkDdiGetScanLine;
     6153                DriverInitializationData.DxgkDdiStopCapture = DxgkDdiStopCapture;
     6154                DriverInitializationData.DxgkDdiControlInterrupt = DxgkDdiControlInterrupt;
     6155                DriverInitializationData.DxgkDdiCreateOverlay = DxgkDdiCreateOverlay;
     6156
     6157                DriverInitializationData.DxgkDdiDestroyDevice = DxgkDdiDestroyDevice;
     6158                DriverInitializationData.DxgkDdiOpenAllocation = DxgkDdiOpenAllocation;
     6159                DriverInitializationData.DxgkDdiCloseAllocation = DxgkDdiCloseAllocation;
     6160                DriverInitializationData.DxgkDdiRender = DxgkDdiRender;
     6161                DriverInitializationData.DxgkDdiPresent = DxgkDdiPresent;
     6162
     6163                DriverInitializationData.DxgkDdiUpdateOverlay = DxgkDdiUpdateOverlay;
     6164                DriverInitializationData.DxgkDdiFlipOverlay = DxgkDdiFlipOverlay;
     6165                DriverInitializationData.DxgkDdiDestroyOverlay = DxgkDdiDestroyOverlay;
     6166
     6167                DriverInitializationData.DxgkDdiCreateContext = DxgkDdiCreateContext;
     6168                DriverInitializationData.DxgkDdiDestroyContext = DxgkDdiDestroyContext;
     6169
     6170                DriverInitializationData.DxgkDdiLinkDevice = NULL; //DxgkDdiLinkDevice;
     6171                DriverInitializationData.DxgkDdiSetDisplayPrivateDriverFormat = DxgkDdiSetDisplayPrivateDriverFormat;
     6172        //#if (DXGKDDI_INTERFACE_VERSION >= DXGKDDI_INTERFACE_VERSION_WIN7)
     6173        //# error port to Win7 DDI
     6174        //            DriverInitializationData.DxgkDdiRenderKm  = DxgkDdiRenderKm;
     6175        //            DriverInitializationData.DxgkDdiRestartFromTimeout  = DxgkDdiRestartFromTimeout;
     6176        //            DriverInitializationData.DxgkDdiSetVidPnSourceVisibility  = DxgkDdiSetVidPnSourceVisibility;
     6177        //            DriverInitializationData.DxgkDdiUpdateActiveVidPnPresentPath  = DxgkDdiUpdateActiveVidPnPresentPath;
     6178        //            DriverInitializationData.DxgkDdiQueryVidPnHWCapability  = DxgkDdiQueryVidPnHWCapability;
     6179        //#endif
     6180
     6181                Status = DxgkInitialize(DriverObject,
     6182                                      RegistryPath,
     6183                                      &DriverInitializationData);
     6184                if (NT_SUCCESS(Status))
     6185                    return Status;
     6186                VBoxWddmVrTerm();
     6187            }
     6188            else
     6189                WARN(("VBoxWddmVrInit failed, Status(0x%x)", Status));
     6190        }
     6191        else
     6192            LOGREL(("Aborting the video driver load due to 3D support missing"));
     6193
     6194        VbglTerminate();
     6195    }
     6196    else
     6197    {
     6198        WARN(("VbglInit failed, rc(%d)", rc));
     6199        Status = STATUS_UNSUCCESSFUL;
     6200    }
     6201
     6202    AssertRelease(!NT_SUCCESS(Status));
     6203
     6204    PRTLOGGER pLogger = RTLogRelSetDefaultInstance(NULL);
     6205    if (pLogger)
     6206    {
     6207        RTLogDestroy(pLogger);
     6208    }
     6209    pLogger = RTLogSetDefaultInstance(NULL);
     6210    if (pLogger)
     6211    {
     6212        RTLogDestroy(pLogger);
     6213    }
     6214
     6215    return Status;
     6216}
Note: See TracChangeset for help on using the changeset viewer.

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