Changeset 33306 in vbox for trunk/src/VBox/Additions/WINNT/Graphics/Display
- Timestamp:
- Oct 21, 2010 12:52:37 PM (14 years ago)
- svn:sync-xref-src-repo-rev:
- 66877
- Location:
- trunk/src/VBox/Additions/WINNT/Graphics/Display/wddm
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Additions/WINNT/Graphics/Display/wddm/VBoxCrHgsmi.cpp
r33241 r33306 8 8 static uint32_t g_cVBoxCrHgsmiProvider = 0; 9 9 10 static VBOXDISPKMT_CALLBACKS g_VBoxCrHgsmiKmtCallbacks; 11 10 12 typedef VBOXWDDMDISP_DECL(int) FNVBOXDISPCRHGSMI_INIT(PVBOXCRHGSMI_CALLBACKS pCallbacks); 11 13 typedef FNVBOXDISPCRHGSMI_INIT *PFNVBOXDISPCRHGSMI_INIT; … … 23 25 VBOXCRHGSMI_DECL(int) VBoxCrHgsmiInit(PVBOXCRHGSMI_CALLBACKS pCallbacks) 24 26 { 27 static int bKmtCallbacksInited = 0; 28 if (!bKmtCallbacksInited) 29 { 30 HRESULT hr = vboxDispKmtCallbacksInit(&g_VBoxCrHgsmiKmtCallbacks); 31 Assert(hr == S_OK); 32 if (hr == S_OK) 33 bKmtCallbacksInited = 1; 34 else 35 bKmtCallbacksInited = -1; 36 } 37 38 Assert(bKmtCallbacksInited); 39 if (bKmtCallbacksInited < 0) 40 { 41 Assert(0); 42 return VERR_NOT_SUPPORTED; 43 } 44 25 45 g_VBoxCrHgsmiCallbacks = *pCallbacks; 26 46 if (!g_hVBoxCrHgsmiProvider) … … 77 97 { 78 98 hClient = g_pfnVBoxDispCrHgsmiQueryClient(); 79 #ifdef DEBUG_misha80 Assert(hClient);81 #endif99 //#ifdef DEBUG_misha 100 // Assert(hClient); 101 //#endif 82 102 if (hClient) 83 103 return hClient; … … 125 145 } 126 146 147 VBOXCRHGSMI_DECL(void) VBoxCrHgsmiLog(char * szString) 148 { 149 VBOXDISPKMT_ADAPTER Adapter; 150 HRESULT hr = vboxDispKmtOpenAdapter(&g_VBoxCrHgsmiKmtCallbacks, &Adapter); 151 Assert(hr == S_OK); 152 if (hr == S_OK) 153 { 154 uint32_t cbString = (uint32_t)strlen(szString) + 1; 155 uint32_t cbCmd = RT_OFFSETOF(VBOXDISPIFESCAPE_DBGPRINT, aStringBuf[cbString]); 156 PVBOXDISPIFESCAPE_DBGPRINT pCmd = (PVBOXDISPIFESCAPE_DBGPRINT)RTMemAllocZ(cbCmd); 157 Assert(pCmd); 158 if (pCmd) 159 { 160 pCmd->EscapeHdr.escapeCode = VBOXESC_DBGPRINT; 161 memcpy(pCmd->aStringBuf, szString, cbString); 162 163 D3DKMT_ESCAPE EscapeData = {0}; 164 EscapeData.hAdapter = Adapter.hAdapter; 165 //EscapeData.hDevice = NULL; 166 EscapeData.Type = D3DKMT_ESCAPE_DRIVERPRIVATE; 167 // EscapeData.Flags.HardwareAccess = 1; 168 EscapeData.pPrivateDriverData = pCmd; 169 EscapeData.PrivateDriverDataSize = cbCmd; 170 //EscapeData.hContext = NULL; 171 172 int Status = g_VBoxCrHgsmiKmtCallbacks.pfnD3DKMTEscape(&EscapeData); 173 Assert(!Status); 174 175 RTMemFree(pCmd); 176 } 177 hr = vboxDispKmtCloseAdapter(&Adapter); 178 Assert(hr == S_OK); 179 } 180 } 127 181 128 182 ///* to be used by injection thread and by ogl ICD driver for hgsmi initialization*/ -
trunk/src/VBox/Additions/WINNT/Graphics/Display/wddm/VBoxDispD3D.cpp
r33281 r33306 1699 1699 pSwapchain->pRenderTargetFbCopy->Release(); 1700 1700 pSwapchain->pRenderTargetFbCopy = NULL; 1701 pSwapchain->bRTFbCopyUpToDate = FALSE; 1701 1702 #endif 1702 1703 pSwapchain->pSwapChainIf->Release(); … … 2358 2359 pSwapchain->pSwapChainIf = pNewIf; 2359 2360 #ifndef VBOXWDDM_WITH_VISIBLE_FB 2361 pSwapchain->bRTFbCopyUpToDate = FALSE; 2360 2362 if (!pSwapchain->pRenderTargetFbCopy) 2361 2363 { … … 2462 2464 if (hr == S_OK) 2463 2465 { 2466 pSwapchain->bRTFbCopyUpToDate = FALSE; 2464 2467 vboxWddmSwapchainFlip(pSwapchain); 2465 2468 Assert(pSwapchain->fFlags.Value == 0); … … 6355 6358 pSrcSurfIf = pSrcSwapchain->pRenderTargetFbCopy; 6356 6359 Assert(pSrcSurfIf); 6357 hr = pSrcSwapchain->pSwapChainIf->GetFrontBufferData(pSrcSurfIf); 6358 Assert(hr == S_OK); 6359 if (hr == S_OK) 6360 if (!pSrcSwapchain->bRTFbCopyUpToDate) 6360 6361 { 6361 /* do pSrcSurfIf->AddRef since we do a Release in the following if (hr == S_OK) branch */ 6362 hr = pSrcSwapchain->pSwapChainIf->GetFrontBufferData(pSrcSurfIf); 6363 Assert(hr == S_OK); 6364 if (hr == S_OK) 6365 { 6366 /* do pSrcSurfIf->AddRef since we do a Release in the following if (hr == S_OK) branch */ 6367 pSrcSwapchain->bRTFbCopyUpToDate = TRUE; 6368 pSrcSurfIf->AddRef(); 6369 } 6370 } 6371 else 6372 { 6362 6373 pSrcSurfIf->AddRef(); 6363 6374 } -
trunk/src/VBox/Additions/WINNT/Graphics/Display/wddm/VBoxDispD3D.h
r33171 r33306 139 139 #ifndef VBOXWDDM_WITH_VISIBLE_FB 140 140 IDirect3DSurface9 *pRenderTargetFbCopy; 141 BOOL bRTFbCopyUpToDate; 141 142 #endif 142 143 IDirect3DSwapChain9 *pSwapChainIf;
Note:
See TracChangeset
for help on using the changeset viewer.