Changeset 80488 in vbox for trunk/src/VBox/Additions/WINNT/Graphics
- Timestamp:
- Aug 28, 2019 9:00:02 PM (5 years ago)
- Location:
- trunk/src/VBox/Additions/WINNT/Graphics/Video
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Additions/WINNT/Graphics/Video/common/wddm/VBoxMPIf.h
r80435 r80488 357 357 VBOXWDDM_RECTS_INFO RectsInfo; 358 358 } VBOXVIDEOCM_CMD_RECTS, *PVBOXVIDEOCM_CMD_RECTS; 359 360 typedef struct VBOXVIDEOCM_CMD_RECTS_INTERNAL361 {362 union363 {364 VBOXDISP_UMHANDLE hSwapchainUm;365 uint64_t hWnd;366 uint64_t u64Value;367 };368 VBOXVIDEOCM_CMD_RECTS Cmd;369 } VBOXVIDEOCM_CMD_RECTS_INTERNAL, *PVBOXVIDEOCM_CMD_RECTS_INTERNAL;370 371 typedef struct VBOXVIDEOCM_CMD_RECTS_HDR372 {373 VBOXVIDEOCM_CMD_HDR Hdr;374 VBOXVIDEOCM_CMD_RECTS_INTERNAL Data;375 } VBOXVIDEOCM_CMD_RECTS_HDR, *PVBOXVIDEOCM_CMD_RECTS_HDR;376 377 #define VBOXVIDEOCM_CMD_RECTS_INTERNAL_SIZE4CRECTS(_cRects) (RT_UOFFSETOF_DYN(VBOXVIDEOCM_CMD_RECTS_INTERNAL, Cmd.RectsInfo.aRects[(_cRects)]))378 #define VBOXVIDEOCM_CMD_RECTS_INTERNAL_SIZE(_pCmd) (VBOXVIDEOCM_CMD_RECTS_INTERNAL_SIZE4CRECTS((_pCmd)->cRects))379 359 380 360 typedef struct VBOXWDDM_GETVBOXVIDEOCMCMD_HDR -
trunk/src/VBox/Additions/WINNT/Graphics/Video/disp/wddm/VBoxDispD3D.h
r80372 r80488 29 29 30 30 #define VBOXWDDMDISP_MAX_VERTEX_STREAMS 16 31 #define VBOXWDDMDISP_MAX_SWAPCHAIN_SIZE 1632 31 #define VBOXWDDMDISP_MAX_TEX_SAMPLERS 16 33 32 #define VBOXWDDMDISP_TOTAL_SAMPLERS VBOXWDDMDISP_MAX_TEX_SAMPLERS + 5 … … 141 140 } VBOXWDDMDISP_RENDERTGT, *PVBOXWDDMDISP_RENDERTGT; 142 141 143 #define VBOXWDDMDISP_INDEX_UNDEFINED (~0U)144 typedef struct VBOXWDDMDISP_SWAPCHAIN_FLAGS145 {146 union147 {148 struct149 {150 UINT bChanged : 1;151 UINT bRtReportingPresent : 1; /* use VBox extension method for performing present */152 UINT bSwitchReportingPresent : 1; /* switch to use VBox extension method for performing present on next present */153 UINT Reserved : 29;154 };155 uint32_t Value;156 };157 }VBOXWDDMDISP_SWAPCHAIN_FLAGS;158 159 typedef struct VBOXWDDMDISP_SWAPCHAIN160 {161 RTLISTNODE ListEntry;162 UINT iBB; /* Backbuffer index */163 UINT cRTs; /* Number of render targets in the swapchain */164 VBOXWDDMDISP_SWAPCHAIN_FLAGS fFlags;165 #ifndef VBOXWDDM_WITH_VISIBLE_FB166 IDirect3DSurface9 *pRenderTargetFbCopy;167 BOOL bRTFbCopyUpToDate;168 #endif169 IDirect3DSwapChain9 *pSwapChainIf;170 /* a read-only hWnd we receive from wine171 * we use it for visible region notifications only,172 * it MUST NOT be destroyed on swapchain destruction,173 * wine will handle that for us */174 HWND hWnd;175 VBOXDISP_KMHANDLE hSwapchainKm;176 VBOXWDDMDISP_RENDERTGT aRTs[VBOXWDDMDISP_MAX_SWAPCHAIN_SIZE];177 } VBOXWDDMDISP_SWAPCHAIN, *PVBOXWDDMDISP_SWAPCHAIN;178 179 142 typedef struct VBOXWDDMDISP_DEVICE *PVBOXWDDMDISP_DEVICE; 180 143 typedef HRESULT FNVBOXWDDMCREATEDIRECT3DDEVICE(PVBOXWDDMDISP_DEVICE pDevice); … … 191 154 PFNVBOXWDDMCREATESHAREDPRIMARY pfnCreateSharedPrimary; 192 155 IDirect3DDevice9 *pDevice9If; 193 RTLISTANCHOR SwapchainList;194 156 UINT u32IfVersion; 195 157 UINT uRtVersion; … … 272 234 VBOXWDDM_DIRTYREGION DirtyRegion; /* <- dirty region to notify host about */ 273 235 VBOXWDDM_SURFACE_DESC SurfDesc; 274 PVBOXWDDMDISP_SWAPCHAIN pSwapchain;275 236 #ifdef VBOX_WITH_MESA3D 276 237 uint32_t hostID; … … 313 274 #define VBOXDISP_CUBEMAP_INDEX_TO_LEVEL(pRc, idx) ((idx)%VBOXDISP_CUBEMAP_LEVELS_COUNT(pRc)) 314 275 315 DECLINLINE(PVBOXWDDMDISP_SWAPCHAIN) vboxWddmSwapchainForAlloc(PVBOXWDDMDISP_ALLOCATION pAlloc)316 {317 return pAlloc->pSwapchain;318 }319 320 DECLINLINE(UINT) vboxWddmSwapchainIdxFb(PVBOXWDDMDISP_SWAPCHAIN pSwapchain)321 {322 return (pSwapchain->iBB + pSwapchain->cRTs - 1) % pSwapchain->cRTs;323 }324 325 /* if swapchain contains only one surface returns this surface */326 DECLINLINE(PVBOXWDDMDISP_RENDERTGT) vboxWddmSwapchainGetBb(PVBOXWDDMDISP_SWAPCHAIN pSwapchain)327 {328 if (pSwapchain->cRTs)329 {330 Assert(pSwapchain->iBB < pSwapchain->cRTs);331 return &pSwapchain->aRTs[pSwapchain->iBB];332 }333 return NULL;334 }335 336 DECLINLINE(PVBOXWDDMDISP_RENDERTGT) vboxWddmSwapchainGetFb(PVBOXWDDMDISP_SWAPCHAIN pSwapchain)337 {338 if (pSwapchain->cRTs)339 {340 UINT iFb = vboxWddmSwapchainIdxFb(pSwapchain);341 return &pSwapchain->aRTs[iFb];342 }343 return NULL;344 }345 346 276 void vboxWddmResourceInit(PVBOXWDDMDISP_RESOURCE pRc, UINT cAllocs); 347 277 -
trunk/src/VBox/Additions/WINNT/Graphics/Video/disp/wddm/VBoxDispDbg.cpp
r80372 r80488 107 107 PVBOXWDDMDISP_DEVICE g_VBoxVDbgInternalDevice = NULL; 108 108 PVBOXWDDMDISP_RESOURCE g_VBoxVDbgInternalRc = NULL; 109 110 DWORD g_VBoxVDbgCfgCreateSwapchainOnDdiOnce = 0;111 109 112 110 VOID vboxVDbgDoPrintDmlCmd(const char* pszDesc, const char* pszCmd) … … 302 300 Info.pRect = pRect; 303 301 vboxVDbgDoDumpPerform(pPrefix, &Info, pSuffix, vboxVDbgRcRectContentsDumperCb, NULL); 304 }305 306 VOID vboxVDbgDoDumpBb(const char * pPrefix, IDirect3DSwapChain9 *pSwapchainIf, const char * pSuffix, DWORD fFlags)307 {308 IDirect3DSurface9 *pBb = NULL;309 HRESULT hr = pSwapchainIf->GetBackBuffer(0, D3DBACKBUFFER_TYPE_MONO, &pBb);310 Assert(hr == S_OK);311 if (FAILED(hr))312 {313 return;314 }315 316 Assert(pBb);317 vboxVDbgDoDumpRcRect(pPrefix, NULL, pBb, NULL, pSuffix, fFlags);318 pBb->Release();319 }320 321 VOID vboxVDbgDoDumpFb(const char * pPrefix, IDirect3DSwapChain9 *pSwapchainIf, const char * pSuffix, DWORD fFlags)322 {323 IDirect3DSurface9 *pBb = NULL;324 HRESULT hr = pSwapchainIf->GetBackBuffer(~(UINT)0, D3DBACKBUFFER_TYPE_MONO, &pBb);325 Assert(hr == S_OK);326 if (FAILED(hr))327 {328 return;329 }330 331 Assert(pBb);332 vboxVDbgDoDumpRcRect(pPrefix, NULL, pBb, NULL, pSuffix, fFlags);333 pBb->Release();334 302 } 335 303 … … 607 575 BOOL bPrimary = pRc->RcDesc.fFlags.Primary; 608 576 BOOL bFrontBuf = FALSE; 609 if (bPrimary)610 {611 PVBOXWDDMDISP_SWAPCHAIN pSwapchain = vboxWddmSwapchainForAlloc((VBOXWDDMDISP_ALLOCATION *)pAlloc);612 Assert(pSwapchain);613 bFrontBuf = (vboxWddmSwapchainGetFb(pSwapchain)->pAlloc == pAlloc);614 }615 577 vboxVDbgPrint(("%s d3dWidth(%d), width(%d), height(%d), format(%d), usage(%s), %s", pPrefix, 616 578 pAlloc->SurfDesc.d3dWidth, pAlloc->SurfDesc.width, pAlloc->SurfDesc.height, pAlloc->SurfDesc.format, -
trunk/src/VBox/Additions/WINNT/Graphics/Video/disp/wddm/VBoxDispDbg.h
r80372 r80488 81 81 extern struct VBOXWDDMDISP_DEVICE *g_VBoxVDbgInternalDevice; 82 82 extern struct VBOXWDDMDISP_RESOURCE *g_VBoxVDbgInternalRc; 83 84 extern DWORD g_VBoxVDbgCfgCreateSwapchainOnDdiOnce;85 83 86 84 #endif … … 237 235 VOID vboxVDbgDoDumpLockUnlockSurfTex(const char * pPrefix, const VBOXWDDMDISP_ALLOCATION *pAlloc, const char * pSuffix, DWORD fFlags); 238 236 VOID vboxVDbgDoDumpRt(const char * pPrefix, struct VBOXWDDMDISP_DEVICE *pDevice, const char * pSuffix, DWORD fFlags); 239 VOID vboxVDbgDoDumpBb(const char * pPrefix, IDirect3DSwapChain9 *pSwapchainIf, const char * pSuffix, DWORD fFlags);240 VOID vboxVDbgDoDumpFb(const char * pPrefix, IDirect3DSwapChain9 *pSwapchainIf, const char * pSuffix, DWORD fFlags);241 237 VOID vboxVDbgDoDumpSamplers(const char * pPrefix, struct VBOXWDDMDISP_DEVICE *pDevice, const char * pSuffix, DWORD fFlags); 242 238 … … 483 479 VBOXVDBG_DUMP_STRETCH_RECT(Blt, "<==", _pSrcAlloc, _pSrcSurf, _pSrcRect, _pDstAlloc, _pDstSurf, _pDstRect) 484 480 485 #define VBOXVDBG_DUMP_SWAPCHAIN_SYNC_ENTER(_pSrcAlloc, _pSrcSurf, _pSrcRect, _pDstAlloc, _pDstSurf, _pDstRect) \486 VBOXVDBG_DUMP_STRETCH_RECT(ScSync, "==>", _pSrcAlloc, _pSrcSurf, _pSrcRect, _pDstAlloc, _pDstSurf, _pDstRect)487 488 #define VBOXVDBG_DUMP_SWAPCHAIN_SYNC_LEAVE(_pSrcAlloc, _pSrcSurf, _pSrcRect, _pDstAlloc, _pDstSurf, _pDstRect) \489 VBOXVDBG_DUMP_STRETCH_RECT(ScSync, "<==", _pSrcAlloc, _pSrcSurf, _pSrcRect, _pDstAlloc, _pDstSurf, _pDstRect)490 491 481 #define VBOXVDBG_IS_SKIP_DWM_WND_UPDATE(_pSrcRc, _pSrcRect, _pDstRc, _pDstPoint) ( \ 492 482 g_VBoxVDbgFSkipCheckTexBltDwmWndUpdate \ … … 555 545 VBOXVDBG_CHECK_STRETCH_RECT(Blt, _opBlt, _pSrcAlloc, _pSrcSurf, _pSrcRect, _pDstAlloc, _pDstSurf, _pDstRect) 556 546 557 #define VBOXVDBG_CHECK_SWAPCHAIN_SYNC(_op, _pSrcAlloc, _pSrcSurf, _pSrcRect, _pDstAlloc, _pDstSurf, _pDstRect) \558 VBOXVDBG_CHECK_STRETCH_RECT(ScSync, _op, _pSrcAlloc, _pSrcSurf, _pSrcRect, _pDstAlloc, _pDstSurf, _pDstRect)559 560 547 #define VBOXVDBG_DUMP_SYNC_RT(_pBbSurf) do { \ 561 548 if (VBOXVDBG_IS_DUMP_ALLOWED(RtSynch)) \ 562 549 { \ 563 550 vboxVDbgDoDumpRcRect("== "__FUNCTION__" Bb:\n", NULL, (_pBbSurf), NULL, "", VBOXVDBG_DUMP_FLAGS_FOR_TYPE(RtSynch)); \ 564 } \565 } while (0)566 567 #define VBOXVDBG_DUMP_PRESENT_ENTER(_pDevice, _pSwapchain) do { \568 if (VBOXVDBG_IS_DUMP_ALLOWED(PresentEnter)) { \569 if (!(_pSwapchain)->fFlags.bRtReportingPresent) { \570 vboxVDbgDoDumpBb("==>"__FUNCTION__" Bb:\n", (_pSwapchain)->pSwapChainIf, "", VBOXVDBG_DUMP_FLAGS_FOR_TYPE(PresentEnter)); \571 } \572 else { \573 PVBOXWDDMDISP_ALLOCATION pCurBb = vboxWddmSwapchainGetBb((_pSwapchain))->pAlloc; \574 IDirect3DSurface9 *pSurf; \575 HRESULT hr = vboxWddmSwapchainSurfGet(_pDevice, _pSwapchain, pCurBb, &pSurf); \576 Assert(hr == S_OK); \577 vboxVDbgDoDumpRcRect("== "__FUNCTION__" Bb:\n", pCurBb, pSurf, NULL, "", VBOXVDBG_DUMP_FLAGS_FOR_TYPE(PresentEnter)); \578 pSurf->Release(); \579 } \580 } \581 } while (0)582 583 #define VBOXVDBG_DUMP_PRESENT_LEAVE(_pDevice, _pSwapchain) do { \584 if (VBOXVDBG_IS_DUMP_ALLOWED(PresentLeave)) { \585 if (!(_pSwapchain)->fFlags.bRtReportingPresent) { \586 vboxVDbgDoDumpFb("<=="__FUNCTION__" Fb:\n", (_pSwapchain)->pSwapChainIf, "", VBOXVDBG_DUMP_FLAGS_FOR_TYPE(PresentLeave)); \587 } \588 else { \589 vboxVDbgPrint(("PRESENT_LEAVE: unsupported for Rt Reporting mode\n")); \590 } \591 551 } \ 592 552 } while (0) … … 617 577 } \ 618 578 } while (0) 619 620 621 #define VBOXVDBG_CREATE_CHECK_SWAPCHAIN() do { \622 if (g_VBoxVDbgCfgCreateSwapchainOnDdiOnce && g_VBoxVDbgInternalRc) { \623 PVBOXWDDMDISP_SWAPCHAIN pSwapchain; \624 HRESULT hr = vboxWddmSwapchainCreateIfForRc(g_VBoxVDbgInternalDevice, g_VBoxVDbgInternalRc, &pSwapchain); \625 Assert(hr == S_OK); \626 g_VBoxVDbgInternalRc = NULL; \627 g_VBoxVDbgCfgCreateSwapchainOnDdiOnce = 0; \628 } \629 } while (0)630 579 631 580 #else … … 641 590 #define VBOXVDBG_DUMP_LOCK_ST(_pData) do { } while (0) 642 591 #define VBOXVDBG_DUMP_UNLOCK_ST(_pData) do { } while (0) 643 #define VBOXVDBG_DUMP_PRESENT_ENTER(_pDevice, _pSwapchain) do { } while (0)644 #define VBOXVDBG_DUMP_PRESENT_LEAVE(_pDevice, _pSwapchain) do { } while (0)645 592 #define VBOXVDBG_BREAK_SHARED(_pRc) do { } while (0) 646 593 #define VBOXVDBG_BREAK_SHARED_DEV(_pDevice) do { } while (0) … … 650 597 #define VBOXVDBG_CHECK_TEXBLT(_opTexBlt, _pSrcRc, _pSrcRect, _pDstRc, _pDstPoint) do { _opTexBlt; } while (0) 651 598 #define VBOXVDBG_ASSERT_IS_DWM(_bDwm) do { } while (0) 652 #define VBOXVDBG_CHECK_SWAPCHAIN_SYNC(_op, _pSrcAlloc, _pSrcSurf, _pSrcRect, _pDstAlloc, _pDstSurf, _pDstRect) do { _op; } while (0)653 #define VBOXVDBG_CREATE_CHECK_SWAPCHAIN() do { } while (0)654 599 #endif 655 600 -
trunk/src/VBox/Additions/WINNT/Graphics/Video/disp/wddm/VBoxDispMpInternal.h
r76563 r80488 24 24 #include <iprt/win/windows.h> 25 25 26 #if 027 HRESULT vboxDispMpInternalInit();28 HRESULT vboxDispMpInternalTerm();29 HRESULT vboxDispMpInternalCancel(struct VBOXWDDMDISP_CONTEXT *pContext, struct VBOXWDDMDISP_SWAPCHAIN *pSwapchain);30 #endif31 32 26 #endif /* !GA_INCLUDED_SRC_WINNT_Graphics_Video_disp_wddm_VBoxDispMpInternal_h */ -
trunk/src/VBox/Additions/WINNT/Graphics/Video/mp/common/VBoxMPDevExt.h
r80483 r80488 134 134 VBOXVDMADDI_NODE aNodes[VBOXWDDM_NUM_NODES]; 135 135 LIST_ENTRY DpcCmdQueue; 136 LIST_ENTRY SwapchainList3D;137 136 /* mutex for context list operations */ 138 137 KSPIN_LOCK ContextLock; -
trunk/src/VBox/Additions/WINNT/Graphics/Video/mp/wddm/VBoxMPTypes.h
r80487 r80488 109 109 uint32_t hostID; 110 110 uint32_t cHostIDRefs; 111 struct VBOXWDDM_SWAPCHAIN *pSwapchain;112 111 } VBOXWDDM_ALLOC_DATA, *PVBOXWDDM_ALLOC_DATA; 113 112 … … 165 164 typedef struct VBOXWDDM_ALLOCATION 166 165 { 167 LIST_ENTRY SwapchainEntry;168 166 VBOXWDDM_ALLOC_TYPE enmType; 169 167 D3DDDI_RESOURCEFLAGS fRcFlags; -
trunk/src/VBox/Additions/WINNT/Graphics/Video/mp/wddm/VBoxMPWddm.cpp
r80487 r80488 1111 1111 vboxVideoCmInit(&pDevExt->CmMgr); 1112 1112 vboxVideoCmInit(&pDevExt->SeamlessCtxMgr); 1113 InitializeListHead(&pDevExt->SwapchainList3D);1114 1113 pDevExt->cContexts3D = 0; 1115 1114 pDevExt->cContexts2D = 0; … … 4698 4697 SrcAllocData.Addr.pvMem = pPresentDisplayOnly->pSource; 4699 4698 SrcAllocData.hostID = 0; 4700 SrcAllocData.pSwapchain = NULL;4701 4699 4702 4700 RECT UpdateRect;
Note:
See TracChangeset
for help on using the changeset viewer.