Changeset 34345 in vbox
- Timestamp:
- Nov 24, 2010 10:06:02 PM (14 years ago)
- Location:
- trunk/src/VBox/Additions
- Files:
-
- 13 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Additions/WINNT/Graphics/Display/wddm/VBoxDispCm.cpp
r33929 r34345 224 224 Assert(hr == S_OK || hr == S_FALSE); 225 225 if (hr == S_OK || hr != S_FALSE) 226 { 226 227 return hr; 228 } 227 229 228 230 pSession->bQueryMp = false; … … 257 259 return vboxDispCmSessionCmdGet(&g_pVBoxCmMgr.Session, pCmd, cbCmd, dwMilliseconds); 258 260 } 261 262 void vboxDispCmLog(LPCSTR pszMsg) 263 { 264 PVBOXDISPCM_SESSION pSession = &g_pVBoxCmMgr.Session; 265 266 EnterCriticalSection(&pSession->CritSect); 267 /* use any context for identifying the kernel CmSession. We're using the first one */ 268 PVBOXWDDMDISP_CONTEXT pContext = RTListNodeGetFirst(&pSession->CtxList, VBOXWDDMDISP_CONTEXT, ListNode); 269 Assert(pContext); 270 if (pContext) 271 { 272 PVBOXWDDMDISP_DEVICE pDevice = pContext->pDevice; 273 Assert(pDevice); 274 vboxVDbgMpPrint((pDevice, pszMsg)); 275 } 276 LeaveCriticalSection(&pSession->CritSect); 277 } -
trunk/src/VBox/Additions/WINNT/Graphics/Display/wddm/VBoxDispCm.h
r30465 r34345 27 27 HRESULT vboxDispCmCmdGet(PVBOXDISPIFESCAPE_GETVBOXVIDEOCMCMD pCmd, uint32_t cbCmd, DWORD dwMilliseconds); 28 28 29 void vboxDispCmLog(LPCSTR pszMsg); 30 29 31 #endif /* #ifdef ___VBoxDispCm_h___ */ -
trunk/src/VBox/Additions/WINNT/Graphics/Display/wddm/VBoxDispD3D.cpp
r34014 r34345 3596 3596 Assert(hr == S_OK); 3597 3597 3598 // vboxVDbgMpPrint ((pDevice, __FUNCTION__": DrawPrimitiveUP\n"));3598 // vboxVDbgMpPrintF((pDevice, __FUNCTION__": DrawPrimitiveUP\n")); 3599 3599 } 3600 3600 else … … 3631 3631 Assert(hr == S_OK); 3632 3632 3633 // vboxVDbgMpPrint ((pDevice, __FUNCTION__": DrawPrimitive\n"));3633 // vboxVDbgMpPrintF((pDevice, __FUNCTION__": DrawPrimitive\n")); 3634 3634 #if 0 3635 3635 IDirect3DVertexDeclaration9* pDecl; … … 3997 3997 if (pDevice->aStreamSource[stream]->LockInfo.cLocks) 3998 3998 { 3999 // vboxVDbgMpPrint ((pDevice, __FUNCTION__": DrawPrimitiveUP\n"));3999 // vboxVDbgMpPrintF((pDevice, __FUNCTION__": DrawPrimitiveUP\n")); 4000 4000 4001 4001 Assert(pLock->fFlags.MightDrawFromLocked && (pLock->fFlags.Discard || pLock->fFlags.NoOverwrite)); … … 4009 4009 else 4010 4010 { 4011 // vboxVDbgMpPrint ((pDevice, __FUNCTION__": DrawPrimitive\n"));4011 // vboxVDbgMpPrintF((pDevice, __FUNCTION__": DrawPrimitive\n")); 4012 4012 4013 4013 hr = pDevice9If->DrawPrimitive(pData->PrimitiveType, pData->FirstVertexOffset/pDevice->StreamSourceInfo[stream].uiStride, pData->PrimitiveCount); … … 8143 8143 if (pPrefix) 8144 8144 { 8145 vboxVDbgMpPrint ((pDevice, "%s", pPrefix));8145 vboxVDbgMpPrintF((pDevice, "%s", pPrefix)); 8146 8146 } 8147 8147 … … 8161 8161 // Assert(bpp == pAlloc->SurfDesc.bpp); 8162 8162 // Assert(pAlloc->SurfDesc.pitch == Lr.Pitch); 8163 vboxVDbgMpPrint ((pDevice, "<?dml?><exec cmd=\"!vbvdbg.ms 0x%p 0n%d 0n%d 0n%d 0n%d\">surface info</exec>\n",8163 vboxVDbgMpPrintF((pDevice, "<?dml?><exec cmd=\"!vbvdbg.ms 0x%p 0n%d 0n%d 0n%d 0n%d\">surface info</exec>\n", 8164 8164 Lr.pBits, pAlloc->D3DWidth, pAlloc->SurfDesc.height, bpp, Lr.Pitch)); 8165 8165 if (pRect) 8166 8166 { 8167 vboxVDbgMpPrint ((pDevice, "<?dml?><exec cmd=\"!vbvdbg.ms 0x%p 0n%d 0n%d 0n%d 0n%d\">rect info</exec>\n",8167 vboxVDbgMpPrintF((pDevice, "<?dml?><exec cmd=\"!vbvdbg.ms 0x%p 0n%d 0n%d 0n%d 0n%d\">rect info</exec>\n", 8168 8168 ((uint8_t*)Lr.pBits) + (pRect->top * Lr.Pitch) + ((pRect->left * bpp) >> 3), 8169 8169 pRect->right - pRect->left, pRect->bottom - pRect->top, bpp, Lr.Pitch)); … … 8176 8176 if (pSuffix) 8177 8177 { 8178 vboxVDbgMpPrint ((pDevice, "%s\n", pSuffix));8178 vboxVDbgMpPrintF((pDevice, "%s\n", pSuffix)); 8179 8179 } 8180 8180 } … … 8184 8184 if (pPrefix) 8185 8185 { 8186 vboxVDbgMpPrint ((pDevice, "%s", pPrefix));8186 vboxVDbgMpPrintF((pDevice, "%s", pPrefix)); 8187 8187 } 8188 8188 … … 8213 8213 // Assert(bpp == pAlloc->SurfDesc.bpp); 8214 8214 // Assert(pAlloc->SurfDesc.pitch == Lr.Pitch); 8215 vboxVDbgMpPrint ((pDevice, "<?dml?><exec cmd=\"!vbvdbg.ms 0x%p 0n%d 0n%d 0n%d 0n%d\">surface info</exec>\n",8215 vboxVDbgMpPrintF((pDevice, "<?dml?><exec cmd=\"!vbvdbg.ms 0x%p 0n%d 0n%d 0n%d 0n%d\">surface info</exec>\n", 8216 8216 LockData.pData, pAlloc->D3DWidth, pAlloc->SurfDesc.height, bpp, pAlloc->SurfDesc.pitch)); 8217 8217 if (pRect) 8218 8218 { 8219 vboxVDbgMpPrint ((pDevice, "<?dml?><exec cmd=\"!vbvdbg.ms 0x%p 0n%d 0n%d 0n%d 0n%d\">rect info</exec>\n",8219 vboxVDbgMpPrintF((pDevice, "<?dml?><exec cmd=\"!vbvdbg.ms 0x%p 0n%d 0n%d 0n%d 0n%d\">rect info</exec>\n", 8220 8220 ((uint8_t*)LockData.pData) + (pRect->top * pAlloc->SurfDesc.pitch) + ((pRect->left * bpp) >> 3), 8221 8221 pRect->right - pRect->left, pRect->bottom - pRect->top, bpp, pAlloc->SurfDesc.pitch)); … … 8233 8233 if (pSuffix) 8234 8234 { 8235 vboxVDbgMpPrint ((pDevice, "%s\n", pSuffix));8235 vboxVDbgMpPrintF((pDevice, "%s\n", pSuffix)); 8236 8236 } 8237 8237 } … … 8242 8242 if (pPrefix) 8243 8243 { 8244 vboxVDbgMpPrint ((pDevice, "%s", pPrefix));8244 vboxVDbgMpPrintF((pDevice, "%s", pPrefix)); 8245 8245 } 8246 8246 … … 8272 8272 // Assert(bpp == pAlloc->SurfDesc.bpp); 8273 8273 // Assert(pAlloc->SurfDesc.pitch == Lr.Pitch); 8274 vboxVDbgMpPrint ((pDevice, "<?dml?><exec cmd=\"!vbvdbg.ms 0x%p 0n%d 0n%d 0n%d 0n%d\">surface info</exec>\n",8274 vboxVDbgMpPrintF((pDevice, "<?dml?><exec cmd=\"!vbvdbg.ms 0x%p 0n%d 0n%d 0n%d 0n%d\">surface info</exec>\n", 8275 8275 Lr.pBits, pAlloc->D3DWidth, pAlloc->SurfDesc.height, bpp, Lr.Pitch)); 8276 8276 if (pRect) 8277 8277 { 8278 vboxVDbgMpPrint ((pDevice, "<?dml?><exec cmd=\"!vbvdbg.ms 0x%p 0n%d 0n%d 0n%d 0n%d\">rect info</exec>\n",8278 vboxVDbgMpPrintF((pDevice, "<?dml?><exec cmd=\"!vbvdbg.ms 0x%p 0n%d 0n%d 0n%d 0n%d\">rect info</exec>\n", 8279 8279 ((uint8_t*)Lr.pBits) + (pRect->top * Lr.Pitch) + ((pRect->left * bpp) >> 3), 8280 8280 pRect->right - pRect->left, pRect->bottom - pRect->top, bpp, Lr.Pitch)); … … 8287 8287 if (pSuffix) 8288 8288 { 8289 vboxVDbgMpPrint ((pDevice, "%s\n", pSuffix));8289 vboxVDbgMpPrintF((pDevice, "%s\n", pSuffix)); 8290 8290 } 8291 8291 … … 8307 8307 { 8308 8308 UINT bpp = vboxWddmCalcBitsPerPixel((D3DDDIFORMAT)Desc.Format); 8309 vboxVDbgMpPrint ((pDevice, "<?dml?><exec cmd=\"!vbvdbg.ms 0x%p 0n%d 0n%d 0n%d 0n%d\">surface info</exec>\n",8309 vboxVDbgMpPrintF((pDevice, "<?dml?><exec cmd=\"!vbvdbg.ms 0x%p 0n%d 0n%d 0n%d 0n%d\">surface info</exec>\n", 8310 8310 Lr.pBits, Desc.Width, Desc.Height, bpp, Lr.Pitch)); 8311 8311 … … 8328 8328 PVBOXWDDMDISP_SWAPCHAIN pSwapchain = vboxWddmSwapchainForAlloc(pAlloc); 8329 8329 Assert(pSwapchain); 8330 bFrontBuf = (vboxWddmSwapchainGet Bb(pSwapchain)->pAlloc == pAlloc);8330 bFrontBuf = (vboxWddmSwapchainGetFb(pSwapchain)->pAlloc == pAlloc); 8331 8331 } 8332 8332 vboxVDbgDoMpPrintF(pDevice, "%s D3DWidth(%d), width(%d), height(%d), format(%d), usage(%s), %s", pPrefix, -
trunk/src/VBox/Additions/WINNT/Graphics/Display/wddm/VBoxDispD3DCmn.h
r33416 r34345 70 70 #ifdef VBOXWDDMDISP_DEBUG_PRINT 71 71 VOID vboxVDbgDoMpPrintF(const PVBOXWDDMDISP_DEVICE pDevice, LPCSTR szString, ...); 72 VOID vboxVDbgDoMpPrint(const PVBOXWDDMDISP_DEVICE pDevice, LPCSTR szString); 72 73 VOID vboxVDbgDoPrint(LPCSTR szString, ...); 73 74 #endif … … 95 96 #define vboxVDbgPrintR vboxVDbgPrint 96 97 #define vboxVDbgMpPrint(_m) \ 98 do { \ 99 vboxVDbgDoMpPrint _m ; \ 100 } while (0) 101 #define vboxVDbgMpPrintF(_m) \ 97 102 do { \ 98 103 vboxVDbgDoMpPrintF _m ; \ … … 129 134 #else 130 135 #define vboxVDbgMpPrint(_m) do {} while (0) 136 #define vboxVDbgMpPrintF(_m) do {} while (0) 131 137 #define vboxVDbgMpPrintRect(_m) do {} while (0) 132 138 #define vboxVDbgMpPrintAlloc(_m) do {} while (0) -
trunk/src/VBox/Additions/WINNT/Graphics/Display/wddm/VBoxDispMp.cpp
r33117 r34345 154 154 } 155 155 156 static DECLCALLBACK(void) vboxDispMpLog(LPCSTR pszMsg) 157 { 158 vboxDispCmLog(pszMsg); 159 } 160 156 161 VBOXDISPMP_DECL(HRESULT) VBoxDispMpGetCallbacks(uint32_t u32Version, PVBOXDISPMP_CALLBACKS pCallbacks) 157 162 { … … 163 168 pCallbacks->pfnDisableEvents = vboxDispMpDisableEvents; 164 169 pCallbacks->pfnGetRegions = vboxDispMpGetRegions; 170 pCallbacks->pfnLog = vboxDispMpLog; 165 171 return S_OK; 166 172 } -
trunk/src/VBox/Additions/WINNT/Graphics/Display/wddm/VBoxDispMp.h
r30483 r34345 40 40 typedef FNVBOXDISPMP_GETREGIONS *PFNVBOXDISPMP_GETREGIONS; 41 41 42 typedef DECLCALLBACK(void) FNVBOXDISPMP_LOG(LPCSTR pszMsg); 43 typedef FNVBOXDISPMP_LOG *PFNVBOXDISPMP_LOG; 44 45 42 46 typedef struct VBOXDISPMP_CALLBACKS 43 47 { … … 50 54 */ 51 55 PFNVBOXDISPMP_GETREGIONS pfnGetRegions; 56 57 PFNVBOXDISPMP_LOG pfnLog; 52 58 } VBOXDISPMP_CALLBACKS, *PVBOXDISPMP_CALLBACKS; 53 59 … … 63 69 # endif 64 70 65 #define VBOXDISPMP_IFVERSION 171 #define VBOXDISPMP_IFVERSION 2 66 72 #define VBOXDISPMP_VERSION (VBOXVIDEOIF_VERSION | (VBOXDISPMP_IFVERSION < 16)) 67 73 /** -
trunk/src/VBox/Additions/WINNT/Graphics/Display/wddm/VBoxUhgsmiKmt.cpp
r33931 r34345 419 419 if (hr == S_OK) 420 420 { 421 hr = vboxDispKmtCreateContext(&pHgsmi->Device, &pHgsmi->Context, bD3D); 421 hr = vboxDispKmtCreateContext(&pHgsmi->Device, &pHgsmi->Context, 422 bD3D ? VBOXWDDM_CONTEXT_TYPE_CUSTOM_UHGSMI_3D : VBOXWDDM_CONTEXT_TYPE_CUSTOM_UHGSMI_GL, 423 NULL, 0); 422 424 Assert(hr == S_OK); 423 425 if (hr == S_OK) … … 696 698 } 697 699 698 HRESULT vboxDispKmtCreateContext(PVBOXDISPKMT_DEVICE pDevice, PVBOXDISPKMT_CONTEXT pContext, BOOL bD3D) 700 HRESULT vboxDispKmtCreateContext(PVBOXDISPKMT_DEVICE pDevice, PVBOXDISPKMT_CONTEXT pContext, 701 VBOXWDDM_CONTEXT_TYPE enmType, HANDLE hEvent, uint64_t u64UmInfo) 699 702 { 700 703 VBOXWDDM_CREATECONTEXT_INFO Info = {0}; 701 704 Info.u32IfVersion = 9; 702 Info.enmType = bD3D ? VBOXWDDM_CONTEXT_TYPE_CUSTOM_UHGSMI_3D : VBOXWDDM_CONTEXT_TYPE_CUSTOM_UHGSMI_GL; 705 Info.enmType = enmType; 706 Info.hUmEvent = (uint64_t)hEvent; 707 Info.u64UmInfo = u64UmInfo; 703 708 D3DKMT_CREATECONTEXT ContextData = {0}; 704 709 ContextData.hDevice = pDevice->hDevice; … … 707 712 ContextData.pPrivateDriverData = &Info; 708 713 ContextData.PrivateDriverDataSize = sizeof (Info); 709 ContextData.ClientHint = bD3D ? D3DKMT_CLIENTHINT_DX9 : D3DKMT_CLIENTHINT_OPENGL;714 ContextData.ClientHint = enmType == VBOXWDDM_CONTEXT_TYPE_CUSTOM_UHGSMI_GL ? D3DKMT_CLIENTHINT_OPENGL : D3DKMT_CLIENTHINT_DX9; 710 715 NTSTATUS Status = pDevice->pAdapter->pCallbacks->pfnD3DKMTCreateContext(&ContextData); 711 716 Assert(!Status); -
trunk/src/VBox/Additions/WINNT/Graphics/Display/wddm/VBoxUhgsmiKmt.h
r33929 r34345 96 96 HRESULT vboxDispKmtCreateDevice(PVBOXDISPKMT_ADAPTER pAdapter, PVBOXDISPKMT_DEVICE pDevice); 97 97 HRESULT vboxDispKmtDestroyDevice(PVBOXDISPKMT_DEVICE pDevice); 98 HRESULT vboxDispKmtCreateContext(PVBOXDISPKMT_DEVICE pDevice, PVBOXDISPKMT_CONTEXT pContext, BOOL bD3D); 98 HRESULT vboxDispKmtCreateContext(PVBOXDISPKMT_DEVICE pDevice, PVBOXDISPKMT_CONTEXT pContext, 99 VBOXWDDM_CONTEXT_TYPE enmType, HANDLE hEvent, uint64_t u64UmInfo); 99 100 HRESULT vboxDispKmtDestroyContext(PVBOXDISPKMT_CONTEXT pContext); 100 101 -
trunk/src/VBox/Additions/WINNT/Graphics/Miniport/wddm/VBoxVideoIf.h
r33530 r34345 30 30 31 31 /* One would increase this whenever definitions in this file are changed */ 32 #define VBOXVIDEOIF_VERSION 732 #define VBOXVIDEOIF_VERSION 8 33 33 34 34 /* create allocation func */ … … 214 214 VBOXWDDM_CONTEXT_TYPE_CUSTOM_2D, 215 215 VBOXWDDM_CONTEXT_TYPE_CUSTOM_UHGSMI_3D, 216 VBOXWDDM_CONTEXT_TYPE_CUSTOM_UHGSMI_GL 216 VBOXWDDM_CONTEXT_TYPE_CUSTOM_UHGSMI_GL, 217 VBOXWDDM_CONTEXT_TYPE_CUSTOM_SESSION 217 218 } VBOXWDDM_CONTEXT_TYPE; 218 219 … … 246 247 /* adds hidden regions */ 247 248 UINT bAddHiddenRects : 1; 248 UINT Reserved : 29; 249 /* hide entire window */ 250 UINT bHide : 1; 251 /* reserved */ 252 UINT Reserved : 28; 249 253 }; 250 254 uint32_t Value; -
trunk/src/VBox/Additions/WINNT/Graphics/Miniport/wddm/VBoxVideoMisc.cpp
r34130 r34345 204 204 Assert(cRefs < UINT32_MAX/2); 205 205 if (!cRefs) 206 { 207 Assert(pSwapchain->pContext); 208 if (pSwapchain->pContext) 209 { 210 NTSTATUS tmpStatus = vboxVdmaPostHideSwapchain(pSwapchain); 211 Assert(tmpStatus == STATUS_SUCCESS); 212 } 206 213 vboxWddmMemFree(pSwapchain); 214 } 207 215 } 208 216 … … 313 321 Assert(pTst == pSwapchain); 314 322 RemoveEntryList(&pSwapchain->DevExtListEntry); 315 pSwapchain->pContext = NULL;323 // pSwapchain->pContext = NULL; 316 324 pSwapchain->hSwapchainKm = NULL; 317 325 if (pSwapchain->pLastReportedRects) -
trunk/src/VBox/Additions/WINNT/Graphics/Miniport/wddm/VBoxVideoVdma.cpp
r34079 r34345 305 305 } 306 306 return true; 307 } 308 309 NTSTATUS vboxVdmaPostHideSwapchain(PVBOXWDDM_SWAPCHAIN pSwapchain) 310 { 311 Assert(KeGetCurrentIrql() < DISPATCH_LEVEL); 312 uint32_t cbCmdInternal = VBOXVIDEOCM_CMD_RECTS_INTERNAL_SIZE4CRECTS(0); 313 PVBOXVIDEOCM_CMD_RECTS_INTERNAL pCmdInternal = 314 (PVBOXVIDEOCM_CMD_RECTS_INTERNAL)vboxVideoCmCmdCreate(&pSwapchain->pContext->CmContext, cbCmdInternal); 315 Assert(pCmdInternal); 316 if (pCmdInternal) 317 { 318 pCmdInternal->hSwapchainUm = pSwapchain->hSwapchainUm; 319 pCmdInternal->Cmd.fFlags.Value = 0; 320 pCmdInternal->Cmd.fFlags.bAddHiddenRects = 1; 321 pCmdInternal->Cmd.fFlags.bHide = 1; 322 pCmdInternal->Cmd.RectsInfo.cRects = 0; 323 vboxVideoCmCmdSubmit(pCmdInternal, VBOXVIDEOCM_SUBMITSIZE_DEFAULT); 324 return STATUS_SUCCESS; 325 } 326 return STATUS_NO_MEMORY; 307 327 } 308 328 … … 914 934 Assert(Status == STATUS_SUCCESS); 915 935 } break; 936 case VBOXVDMAPIPE_CMD_TYPE_RECTSINFO: 937 { 938 PVBOXVDMAPIPE_CMD_RECTSINFO pRects = (PVBOXVDMAPIPE_CMD_RECTSINFO)pDr; 939 Status = vboxVdmaGgDirtyRectsProcess(pRects->pDevExt, pRects->pContext, pRects->pSwapchain, &pRects->ContextsRects); 940 Assert(Status == STATUS_SUCCESS); 941 vboxVdmaGgCmdDestroy(pDr); 942 break; 943 } 916 944 default: 917 945 AssertBreakpoint(); -
trunk/src/VBox/Additions/WINNT/Graphics/Miniport/wddm/VBoxVideoVdma.h
r33530 r34345 178 178 { 179 179 VBOXVDMAPIPE_CMD_DR Hdr; 180 VBOXVDMADDI_CMD DdiCmd; 180 PDEVICE_EXTENSION pDevExt; 181 PVBOXWDDM_CONTEXT pContext; 181 182 struct VBOXWDDM_SWAPCHAIN *pSwapchain; 182 183 VBOXVDMAPIPE_RECTS ContextsRects; … … 302 303 void vboxVdmaGgCmdDestroy(PVBOXVDMAPIPE_CMD_DR pDr); 303 304 305 NTSTATUS vboxVdmaPostHideSwapchain(PVBOXWDDM_SWAPCHAIN pSwapchain); 306 304 307 #define VBOXVDMAPIPE_CMD_DR_FROM_DDI_CMD(_pCmd) ((PVBOXVDMAPIPE_CMD_DR)(((uint8_t*)(_pCmd)) - RT_OFFSETOF(VBOXVDMAPIPE_CMD_DR, DdiCmd))) 305 308 DECLCALLBACK(VOID) vboxVdmaGgDdiCmdDestroy(PDEVICE_EXTENSION pDevExt, PVBOXVDMADDI_CMD pCmd, PVOID pvContext); -
trunk/src/VBox/Additions/common/crOpenGL/load.c
r34297 r34345 790 790 } 791 791 } 792 else if (!pRegions->pRegions->fFlags.bHide) 793 { 794 Assert(pRegions->pRegions->fFlags.bAddHiddenRects); 795 hNewRgn = stubMakeRegionFromRects(pRegions->pRegions, 0); 796 } 792 797 else 793 798 { 794 hNewRgn = stubMakeRegionFromRects(pRegions->pRegions, 0); 799 Assert(pRegions->pRegions->fFlags.bAddHiddenRects); 800 hNewRgn = CreateRectRgn(pWindow->x, pWindow->y, pWindow->x + pWindow->width, pWindow->y + pWindow->height); 795 801 } 796 802
Note:
See TracChangeset
for help on using the changeset viewer.