Changeset 33714 in vbox for trunk/src/VBox/Additions/WINNT/Graphics/Display
- Timestamp:
- Nov 2, 2010 11:36:10 PM (14 years ago)
- Location:
- trunk/src/VBox/Additions/WINNT/Graphics/Display/wddm
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Additions/WINNT/Graphics/Display/wddm/VBoxCrHgsmi.cpp
r33684 r33714 4 4 #include "VBoxUhgsmiKmt.h" 5 5 6 static VBOXDISPKMT_CALLBACKS g_VBoxCrHgsmiKmtCallbacks; 7 static int g_bVBoxKmtCallbacksInited = 0; 8 9 #ifdef VBOX_CRHGSMI_WITH_D3DDEV 6 10 static VBOXCRHGSMI_CALLBACKS g_VBoxCrHgsmiCallbacks; 7 11 static HMODULE g_hVBoxCrHgsmiProvider = NULL; 8 12 static uint32_t g_cVBoxCrHgsmiProvider = 0; 9 13 10 static VBOXDISPKMT_CALLBACKS g_VBoxCrHgsmiKmtCallbacks;11 14 12 15 typedef VBOXWDDMDISP_DECL(int) FNVBOXDISPCRHGSMI_INIT(PVBOXCRHGSMI_CALLBACKS pCallbacks); … … 25 28 VBOXCRHGSMI_DECL(int) VBoxCrHgsmiInit(PVBOXCRHGSMI_CALLBACKS pCallbacks) 26 29 { 27 static int bKmtCallbacksInited = 0; 28 if (!bKmtCallbacksInited) 30 if (!g_bVBoxKmtCallbacksInited) 29 31 { 30 32 HRESULT hr = vboxDispKmtCallbacksInit(&g_VBoxCrHgsmiKmtCallbacks); 31 33 Assert(hr == S_OK); 32 34 if (hr == S_OK) 33 bKmtCallbacksInited = 1;35 g_bVBoxKmtCallbacksInited = 1; 34 36 else 35 bKmtCallbacksInited = -1;36 } 37 38 Assert( bKmtCallbacksInited);39 if ( bKmtCallbacksInited < 0)37 g_bVBoxKmtCallbacksInited = -1; 38 } 39 40 Assert(g_bVBoxKmtCallbacksInited); 41 if (g_bVBoxKmtCallbacksInited < 0) 40 42 { 41 43 Assert(0); … … 135 137 return NULL; 136 138 } 139 #else 140 VBOXCRHGSMI_DECL(int) VBoxCrHgsmiInit() 141 { 142 if (!g_bVBoxKmtCallbacksInited) 143 { 144 HRESULT hr = vboxDispKmtCallbacksInit(&g_VBoxCrHgsmiKmtCallbacks); 145 Assert(hr == S_OK); 146 if (hr == S_OK) 147 g_bVBoxKmtCallbacksInited = 1; 148 else 149 g_bVBoxKmtCallbacksInited = -1; 150 } 151 152 Assert(g_bVBoxKmtCallbacksInited); 153 if (g_bVBoxKmtCallbacksInited < 0) 154 { 155 Assert(0); 156 return VERR_NOT_SUPPORTED; 157 } 158 159 return VINF_SUCCESS; 160 } 161 162 VBOXCRHGSMI_DECL(PVBOXUHGSMI) VBoxCrHgsmiCreate() 163 { 164 PVBOXUHGSMI_PRIVATE_KMT pHgsmiGL = (PVBOXUHGSMI_PRIVATE_KMT)RTMemAllocZ(sizeof (*pHgsmiGL)); 165 if (pHgsmiGL) 166 { 167 #if 0 168 HRESULT hr = vboxUhgsmiKmtCreate(pHgsmiGL, TRUE /* bD3D tmp for injection thread*/); 169 #else 170 HRESULT hr = vboxUhgsmiKmtEscCreate(pHgsmiGL, TRUE /* bD3D tmp for injection thread*/); 171 #endif 172 Assert(hr == S_OK); 173 if (hr == S_OK) 174 { 175 return &pHgsmiGL->BasePrivate.Base; 176 } 177 RTMemFree(pHgsmiGL); 178 } 179 180 return NULL; 181 } 182 183 VBOXCRHGSMI_DECL(void) VBoxCrHgsmiDestroy(PVBOXUHGSMI pHgsmi) 184 { 185 PVBOXUHGSMI_PRIVATE_KMT pHgsmiGL = VBOXUHGSMIKMT_GET(pHgsmi); 186 HRESULT hr = vboxUhgsmiKmtDestroy(pHgsmiGL); 187 Assert(hr == S_OK); 188 if (hr == S_OK) 189 { 190 RTMemFree(pHgsmiGL); 191 } 192 } 193 #endif 137 194 138 195 VBOXCRHGSMI_DECL(int) VBoxCrHgsmiTerm() 139 196 { 140 Assert(0);141 197 #if 0 142 198 PVBOXUHGSMI_PRIVATE_KMT pHgsmiGL = gt_pHgsmiGL; … … 151 207 g_pfnVBoxDispCrHgsmiTerm(); 152 208 #endif 209 if (g_bVBoxKmtCallbacksInited > 0) 210 { 211 vboxDispKmtCallbacksTerm(&g_VBoxCrHgsmiKmtCallbacks); 212 } 153 213 return VINF_SUCCESS; 154 214 } -
trunk/src/VBox/Additions/WINNT/Graphics/Display/wddm/VBoxDispD3D.cpp
r33684 r33714 740 740 #ifdef VBOX_WITH_CRHGSMI 741 741 static __declspec(thread) PVBOXUHGSMI_PRIVATE_BASE gt_pHgsmi = NULL; 742 #endif743 742 744 743 VBOXWDDMDISP_DECL(int) VBoxDispCrHgsmiInit(PVBOXCRHGSMI_CALLBACKS pCallbacks) … … 786 785 } 787 786 788 #ifdef VBOX_WITH_CRHGSMI789 787 static HRESULT vboxUhgsmiGlobalRetain() 790 788 { … … 876 874 #define VBOXDISPCRHGSMI_SCOPE_SET_DEV(_pDev) do {} while(0) 877 875 #define VBOXDISPCRHGSMI_SCOPE_SET_GLOBAL() do {} while(0) 876 877 VBOXWDDMDISP_DECL(int) VBoxDispCrHgsmiInit(void*) 878 { 879 return VERR_NOT_IMPLEMENTED; 880 } 881 882 VBOXWDDMDISP_DECL(int) VBoxDispCrHgsmiTerm() 883 { 884 return VERR_NOT_IMPLEMENTED; 885 } 886 887 VBOXWDDMDISP_DECL(void*) VBoxDispCrHgsmiQueryClient() 888 { 889 return NULL; 890 } 878 891 #endif 879 892 -
trunk/src/VBox/Additions/WINNT/Graphics/Display/wddm/VBoxUhgsmiBase.h
r33241 r33714 32 32 { 33 33 VBOXUHGSMI Base; 34 #ifdef VBOX_CRHGSMI_WITH_D3DDEV 34 35 HVBOXCRHGSMI_CLIENT hClient; 36 #endif 35 37 } VBOXUHGSMI_PRIVATE_BASE, *PVBOXUHGSMI_PRIVATE_BASE; 36 38 -
trunk/src/VBox/Additions/WINNT/Graphics/Display/wddm/VBoxUhgsmiKmt.cpp
r33684 r33714 437 437 pHgsmi->BasePrivate.Base.pfnBufferCreate = vboxUhgsmiKmtBufferCreate; 438 438 pHgsmi->BasePrivate.Base.pfnBufferSubmitAsynch = vboxUhgsmiKmtBufferSubmitAsynch; 439 #ifdef VBOX_CRHGSMI_WITH_D3DDEV 439 440 pHgsmi->BasePrivate.hClient = NULL; 441 #endif 440 442 return vboxUhgsmiKmtEngineCreate(pHgsmi, bD3D); 441 443 } … … 445 447 pHgsmi->BasePrivate.Base.pfnBufferCreate = vboxUhgsmiKmtEscBufferCreate; 446 448 pHgsmi->BasePrivate.Base.pfnBufferSubmitAsynch = vboxUhgsmiKmtEscBufferSubmitAsynch; 449 #ifdef VBOX_CRHGSMI_WITH_D3DDEV 447 450 pHgsmi->BasePrivate.hClient = NULL; 451 #endif 448 452 return vboxUhgsmiKmtEngineCreate(pHgsmi, bD3D); 449 453 }
Note:
See TracChangeset
for help on using the changeset viewer.