Changeset 40897 in vbox
- Timestamp:
- Apr 12, 2012 6:16:40 PM (13 years ago)
- Location:
- trunk/src/VBox/Additions/WINNT/Graphics/Video/mp
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Additions/WINNT/Graphics/Video/mp/Makefile.kmk
r40483 r40897 87 87 endif 88 88 VBoxVideoWddm_DEFS += LOG_TO_BACKDOOR 89 VBoxVideoWddm_INCS += ../../../include .. . ../../../../common/VBoxGuestLib 89 VBoxVideoWddm_INCS += ../../../include .. . ../../../../common/VBoxGuestLib $(VBOX_PATH_CROGL_INCLUDE) 90 90 VBoxVideoWddm_LDFLAGS.x86 += /Entry:DriverEntry@8 91 91 VBoxVideoWddm_LDFLAGS.amd64 += /Entry:DriverEntry -
trunk/src/VBox/Additions/WINNT/Graphics/Video/mp/common/VBoxMPDevExt.h
r40747 r40897 105 105 volatile BOOLEAN fRenderToShadowDisabled; 106 106 107 HVBOXCRCTL hCrCtl; 108 uint32_t cCrCtlRefs; 107 VBOXMP_CRCTLCON CrCtlCon; 109 108 110 109 VBOXWDDM_GLOBAL_POINTER_INFO PointerInfo; -
trunk/src/VBox/Additions/WINNT/Graphics/Video/mp/wddm/VBoxMPCr.cpp
r40483 r40897 20 20 #include "VBoxMPCr.h" 21 21 22 #include <cr_protocol.h> 23 22 24 #include <VBox/HostServices/VBoxCrOpenGLSvc.h> 23 25 24 static int vboxMpCrCtlAddRef( struct _VBOXMP_DEVEXT *pDevExt)25 { 26 if (p DevExt->cCrCtlRefs++)26 static int vboxMpCrCtlAddRef(PVBOXMP_CRCTLCON pCrCtlCon) 27 { 28 if (pCrCtlCon->cCrCtlRefs++) 27 29 return VINF_ALREADY_INITIALIZED; 28 30 29 int rc = vboxCrCtlCreate(&p DevExt->hCrCtl);30 if (RT_SUCCESS(rc)) 31 { 32 Assert(p DevExt->hCrCtl);31 int rc = vboxCrCtlCreate(&pCrCtlCon->hCrCtl); 32 if (RT_SUCCESS(rc)) 33 { 34 Assert(pCrCtlCon->hCrCtl); 33 35 return VINF_SUCCESS; 34 36 } … … 36 38 WARN(("vboxCrCtlCreate failed, rc (%d)", rc)); 37 39 38 --p DevExt->cCrCtlRefs;39 return rc; 40 } 41 42 static int vboxMpCrCtlRelease( struct _VBOXMP_DEVEXT *pDevExt)43 { 44 Assert(p DevExt->cCrCtlRefs);45 if (--p DevExt->cCrCtlRefs)46 { 47 return VINF_SUCCESS; 48 } 49 50 int rc = vboxCrCtlDestroy(p DevExt->hCrCtl);51 if (RT_SUCCESS(rc)) 52 { 53 p DevExt->hCrCtl = NULL;40 --pCrCtlCon->cCrCtlRefs; 41 return rc; 42 } 43 44 static int vboxMpCrCtlRelease(PVBOXMP_CRCTLCON pCrCtlCon) 45 { 46 Assert(pCrCtlCon->cCrCtlRefs); 47 if (--pCrCtlCon->cCrCtlRefs) 48 { 49 return VINF_SUCCESS; 50 } 51 52 int rc = vboxCrCtlDestroy(pCrCtlCon->hCrCtl); 53 if (RT_SUCCESS(rc)) 54 { 55 pCrCtlCon->hCrCtl = NULL; 54 56 return VINF_SUCCESS; 55 57 } … … 57 59 WARN(("vboxCrCtlDestroy failed, rc (%d)", rc)); 58 60 59 ++p DevExt->cCrCtlRefs;60 return rc; 61 } 62 63 static int vboxMpCrCtlConSetVersion( struct _VBOXMP_DEVEXT *pDevExt, uint32_t u32ClientID, uint32_t vMajor, uint32_t vMinor)61 ++pCrCtlCon->cCrCtlRefs; 62 return rc; 63 } 64 65 static int vboxMpCrCtlConSetVersion(PVBOXMP_CRCTLCON pCrCtlCon, uint32_t u32ClientID, uint32_t vMajor, uint32_t vMinor) 64 66 { 65 67 CRVBOXHGCMSETVERSION parms; … … 76 78 parms.vMinor.u.value32 = vMinor; 77 79 78 rc = vboxCrCtlConCall(p DevExt->hCrCtl, &parms.hdr, sizeof (parms));80 rc = vboxCrCtlConCall(pCrCtlCon->hCrCtl, &parms.hdr, sizeof (parms)); 79 81 if (RT_FAILURE(rc)) 80 82 { … … 91 93 } 92 94 93 static int vboxMpCrCtlConSetPID( struct _VBOXMP_DEVEXT *pDevExt, uint32_t u32ClientID)95 static int vboxMpCrCtlConSetPID(PVBOXMP_CRCTLCON pCrCtlCon, uint32_t u32ClientID) 94 96 { 95 97 CRVBOXHGCMSETPID parms; … … 106 108 Assert(parms.u64PID.u.value64); 107 109 108 rc = vboxCrCtlConCall(p DevExt->hCrCtl, &parms.hdr, sizeof (parms));110 rc = vboxCrCtlConCall(pCrCtlCon->hCrCtl, &parms.hdr, sizeof (parms)); 109 111 if (RT_FAILURE(rc)) 110 112 { … … 121 123 } 122 124 123 int VBoxMpCrCtlConConnect( struct _VBOXMP_DEVEXT *pDevExt,125 int VBoxMpCrCtlConConnect(PVBOXMP_CRCTLCON pCrCtlCon, 124 126 uint32_t crVersionMajor, uint32_t crVersionMinor, 125 127 uint32_t *pu32ClientID) 126 128 { 127 129 uint32_t u32ClientID; 128 int rc = vboxMpCrCtlAddRef(p DevExt);129 if (RT_SUCCESS(rc)) 130 { 131 rc = vboxCrCtlConConnect(p DevExt->hCrCtl, &u32ClientID);130 int rc = vboxMpCrCtlAddRef(pCrCtlCon); 131 if (RT_SUCCESS(rc)) 132 { 133 rc = vboxCrCtlConConnect(pCrCtlCon->hCrCtl, &u32ClientID); 132 134 if (RT_SUCCESS(rc)) 133 135 { 134 rc = vboxMpCrCtlConSetVersion(p DevExt, u32ClientID, crVersionMajor, crVersionMinor);136 rc = vboxMpCrCtlConSetVersion(pCrCtlCon, u32ClientID, crVersionMajor, crVersionMinor); 135 137 if (RT_SUCCESS(rc)) 136 138 { 137 rc = vboxMpCrCtlConSetPID(p DevExt, u32ClientID);139 rc = vboxMpCrCtlConSetPID(pCrCtlCon, u32ClientID); 138 140 if (RT_SUCCESS(rc)) 139 141 { … … 150 152 WARN(("vboxMpCrCtlConSetVersion failed, rc (%d)", rc)); 151 153 } 152 vboxCrCtlConDisconnect(p DevExt->hCrCtl, u32ClientID);154 vboxCrCtlConDisconnect(pCrCtlCon->hCrCtl, u32ClientID); 153 155 } 154 156 else … … 156 158 WARN(("vboxCrCtlConConnect failed, rc (%d)", rc)); 157 159 } 158 vboxMpCrCtlRelease(p DevExt);160 vboxMpCrCtlRelease(pCrCtlCon); 159 161 } 160 162 else … … 168 170 } 169 171 170 int VBoxMpCrCtlConDisconnect( struct _VBOXMP_DEVEXT *pDevExt, uint32_t u32ClientID)171 { 172 int rc = vboxCrCtlConDisconnect(p DevExt->hCrCtl, u32ClientID);173 if (RT_SUCCESS(rc)) 174 { 175 vboxMpCrCtlRelease(p DevExt);172 int VBoxMpCrCtlConDisconnect(PVBOXMP_CRCTLCON pCrCtlCon, uint32_t u32ClientID) 173 { 174 int rc = vboxCrCtlConDisconnect(pCrCtlCon->hCrCtl, u32ClientID); 175 if (RT_SUCCESS(rc)) 176 { 177 vboxMpCrCtlRelease(pCrCtlCon); 176 178 return VINF_SUCCESS; 177 179 } … … 183 185 } 184 186 185 int VBoxMpCrCtlConCall( struct _VBOXMP_DEVEXT *pDevExt, VBoxGuestHGCMCallInfo *pData, uint32_t cbData)186 { 187 int rc = vboxCrCtlConCall(p DevExt->hCrCtl, pData, cbData);187 int VBoxMpCrCtlConCall(PVBOXMP_CRCTLCON pCrCtlCon, VBoxGuestHGCMCallInfo *pData, uint32_t cbData) 188 { 189 int rc = vboxCrCtlConCall(pCrCtlCon->hCrCtl, pData, cbData); 188 190 if (RT_SUCCESS(rc)) 189 191 return VINF_SUCCESS; … … 193 195 } 194 196 195 int VBoxMpCrCtlConCallUserData( struct _VBOXMP_DEVEXT *pDevExt, VBoxGuestHGCMCallInfo *pData, uint32_t cbData)196 { 197 int rc = vboxCrCtlConCallUserData(p DevExt->hCrCtl, pData, cbData);197 int VBoxMpCrCtlConCallUserData(PVBOXMP_CRCTLCON pCrCtlCon, VBoxGuestHGCMCallInfo *pData, uint32_t cbData) 198 { 199 int rc = vboxCrCtlConCallUserData(pCrCtlCon->hCrCtl, pData, cbData); 198 200 if (RT_SUCCESS(rc)) 199 201 return VINF_SUCCESS; … … 202 204 return rc; 203 205 } 206 207 bool VBoxMpCrCtlConIs3DSupported() 208 { 209 VBOXMP_CRCTLCON CrCtlCon = {0}; 210 uint32_t u32ClientID = 0; 211 int rc = VBoxMpCrCtlConConnect(&CrCtlCon, CR_PROTOCOL_VERSION_MAJOR, CR_PROTOCOL_VERSION_MINOR, &u32ClientID); 212 if (RT_FAILURE(rc)) 213 { 214 LOGREL(("VBoxMpCrCtlConConnect failed with rc(%d), 3D not supported!")); 215 return false; 216 } 217 218 rc = VBoxMpCrCtlConDisconnect(&CrCtlCon, u32ClientID); 219 if (RT_FAILURE(rc)) 220 WARN(("VBoxMpCrCtlConDisconnect failed, ignoring..")); 221 222 return true; 223 } -
trunk/src/VBox/Additions/WINNT/Graphics/Video/mp/wddm/VBoxMPCr.h
r40483 r40897 22 22 #include <VBoxGuestR0LibCrOgl.h> 23 23 24 int VBoxMpCrCtlConConnect(struct _VBOXMP_DEVEXT *pDevExt, 24 typedef struct VBOXMP_CRCTLCON 25 { 26 HVBOXCRCTL hCrCtl; 27 uint32_t cCrCtlRefs; 28 } VBOXMP_CRCTLCON, *PVBOXMP_CRCTLCON; 29 30 bool VBoxMpCrCtlConIs3DSupported(); 31 32 int VBoxMpCrCtlConConnect(PVBOXMP_CRCTLCON pCrCtlCon, 25 33 uint32_t crVersionMajor, uint32_t crVersionMinor, 26 34 uint32_t *pu32ClientID); 27 int VBoxMpCrCtlConDisconnect( struct _VBOXMP_DEVEXT *pDevExt, uint32_t u32ClientID);28 int VBoxMpCrCtlConCall( struct _VBOXMP_DEVEXT *pDevExt, struct VBoxGuestHGCMCallInfo *pData, uint32_t cbData);29 int VBoxMpCrCtlConCallUserData( struct _VBOXMP_DEVEXT *pDevExt, struct VBoxGuestHGCMCallInfo *pData, uint32_t cbData);35 int VBoxMpCrCtlConDisconnect(PVBOXMP_CRCTLCON pCrCtlCon, uint32_t u32ClientID); 36 int VBoxMpCrCtlConCall(PVBOXMP_CRCTLCON pCrCtlCon, struct VBoxGuestHGCMCallInfo *pData, uint32_t cbData); 37 int VBoxMpCrCtlConCallUserData(PVBOXMP_CRCTLCON pCrCtlCon, struct VBoxGuestHGCMCallInfo *pData, uint32_t cbData); 30 38 31 39 #endif /* #ifndef ___VBoxMPCr_h__ */ -
trunk/src/VBox/Additions/WINNT/Graphics/Video/mp/wddm/VBoxMPWddm.cpp
r40842 r40897 974 974 } 975 975 976 976 977 /* driver callbacks */ 977 978 NTSTATUS DxgkDdiAddDevice( … … 1062 1063 if (Status == STATUS_SUCCESS) 1063 1064 { 1064 /* Initialize VBoxGuest library, which is used for requests which go through VMMDev. */1065 VbglInit ();1066 1067 1065 /* Guest supports only HGSMI, the old VBVA via VMMDev is not supported. 1068 1066 * The host will however support both old and new interface to keep compatibility … … 1108 1106 LOGREL(("HGSMI failed to initialize, returning err")); 1109 1107 1110 VbglTerminate();1111 1108 /* @todo: report a better status */ 1112 1109 Status = STATUS_UNSUCCESSFUL; … … 1165 1162 if (RT_SUCCESS(rc)) 1166 1163 { 1167 VbglTerminate();1168 1169 1164 vboxWddmVGuidFree(pDevExt); 1170 1165 … … 1653 1648 1654 1649 vboxVDbgBreakFv(); 1650 1651 VbglTerminate(); 1655 1652 1656 1653 VBoxWddmVrTerm(); … … 1860 1857 if (pCreateDevice->Flags.SystemDevice) 1861 1858 pDevice->enmType = VBOXWDDM_DEVICE_TYPE_SYSTEM; 1862 // else1863 // {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 // }1867 1859 1868 1860 pDevice->pAdapter = pDevExt; … … 3863 3855 /* this is true due to the above condition */ 3864 3856 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)); 3866 3858 if (RT_SUCCESS(rc)) 3867 3859 Status = STATUS_SUCCESS; … … 5840 5832 if (pInfo->crVersionMajor || pInfo->crVersionMinor) 5841 5833 { 5842 rc = VBoxMpCrCtlConConnect( pDevExt,5834 rc = VBoxMpCrCtlConConnect(&pDevExt->CrCtlCon, 5843 5835 pInfo->crVersionMajor, pInfo->crVersionMinor, 5844 5836 &pContext->u32CrConClientID); … … 5874 5866 if (pInfo->crVersionMajor || pInfo->crVersionMinor) 5875 5867 { 5876 rc = VBoxMpCrCtlConConnect( pDevExt,5868 rc = VBoxMpCrCtlConConnect(&pDevExt->CrCtlCon, 5877 5869 pInfo->crVersionMajor, pInfo->crVersionMinor, 5878 5870 &pContext->u32CrConClientID); … … 5952 5944 if (pContext->u32CrConClientID) 5953 5945 { 5954 VBoxMpCrCtlConDisconnect( pDevExt, pContext->u32CrConClientID);5946 VBoxMpCrCtlConDisconnect(&pDevExt->CrCtlCon, pContext->u32CrConClientID); 5955 5947 } 5956 5948 break; … … 6038 6030 vboxVDbgBreakFv(); 6039 6031 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 6049 6032 #ifdef DEBUG_misha 6050 6033 RTLogGroupSettings(0, "+default.e.l.f.l2.l3"); … … 6053 6036 LOGREL(("Built %s %s", __DATE__, __TIME__)); 6054 6037 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 6064 6038 if (! ARGUMENT_PRESENT(DriverObject) || 6065 6039 ! ARGUMENT_PRESENT(RegistryPath)) … … 6068 6042 } 6069 6043 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.