VirtualBox

Ignore:
Timestamp:
Aug 28, 2019 9:00:02 PM (5 years ago)
Author:
vboxsync
Message:

WDDM: removed obsolete swapchain related code. bugref:9529

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  
    357357    VBOXWDDM_RECTS_INFO RectsInfo;
    358358} VBOXVIDEOCM_CMD_RECTS, *PVBOXVIDEOCM_CMD_RECTS;
    359 
    360 typedef struct VBOXVIDEOCM_CMD_RECTS_INTERNAL
    361 {
    362     union
    363     {
    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_HDR
    372 {
    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))
    379359
    380360typedef struct VBOXWDDM_GETVBOXVIDEOCMCMD_HDR
  • trunk/src/VBox/Additions/WINNT/Graphics/Video/disp/wddm/VBoxDispD3D.h

    r80372 r80488  
    2929
    3030#define VBOXWDDMDISP_MAX_VERTEX_STREAMS 16
    31 #define VBOXWDDMDISP_MAX_SWAPCHAIN_SIZE 16
    3231#define VBOXWDDMDISP_MAX_TEX_SAMPLERS 16
    3332#define VBOXWDDMDISP_TOTAL_SAMPLERS VBOXWDDMDISP_MAX_TEX_SAMPLERS + 5
     
    141140} VBOXWDDMDISP_RENDERTGT, *PVBOXWDDMDISP_RENDERTGT;
    142141
    143 #define VBOXWDDMDISP_INDEX_UNDEFINED (~0U)
    144 typedef struct VBOXWDDMDISP_SWAPCHAIN_FLAGS
    145 {
    146     union
    147     {
    148         struct
    149         {
    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_SWAPCHAIN
    160 {
    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_FB
    166     IDirect3DSurface9 *pRenderTargetFbCopy;
    167     BOOL bRTFbCopyUpToDate;
    168 #endif
    169     IDirect3DSwapChain9 *pSwapChainIf;
    170     /* a read-only hWnd we receive from wine
    171      * 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 
    179142typedef struct VBOXWDDMDISP_DEVICE *PVBOXWDDMDISP_DEVICE;
    180143typedef HRESULT FNVBOXWDDMCREATEDIRECT3DDEVICE(PVBOXWDDMDISP_DEVICE pDevice);
     
    191154    PFNVBOXWDDMCREATESHAREDPRIMARY pfnCreateSharedPrimary;
    192155    IDirect3DDevice9 *pDevice9If;
    193     RTLISTANCHOR SwapchainList;
    194156    UINT u32IfVersion;
    195157    UINT uRtVersion;
     
    272234    VBOXWDDM_DIRTYREGION DirtyRegion; /* <- dirty region to notify host about */
    273235    VBOXWDDM_SURFACE_DESC SurfDesc;
    274     PVBOXWDDMDISP_SWAPCHAIN pSwapchain;
    275236#ifdef VBOX_WITH_MESA3D
    276237    uint32_t hostID;
     
    313274#define VBOXDISP_CUBEMAP_INDEX_TO_LEVEL(pRc, idx) ((idx)%VBOXDISP_CUBEMAP_LEVELS_COUNT(pRc))
    314275
    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 
    346276void vboxWddmResourceInit(PVBOXWDDMDISP_RESOURCE pRc, UINT cAllocs);
    347277
  • trunk/src/VBox/Additions/WINNT/Graphics/Video/disp/wddm/VBoxDispDbg.cpp

    r80372 r80488  
    107107PVBOXWDDMDISP_DEVICE g_VBoxVDbgInternalDevice = NULL;
    108108PVBOXWDDMDISP_RESOURCE g_VBoxVDbgInternalRc = NULL;
    109 
    110 DWORD g_VBoxVDbgCfgCreateSwapchainOnDdiOnce = 0;
    111109
    112110VOID vboxVDbgDoPrintDmlCmd(const char* pszDesc, const char* pszCmd)
     
    302300    Info.pRect = pRect;
    303301    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();
    334302}
    335303
     
    607575    BOOL bPrimary = pRc->RcDesc.fFlags.Primary;
    608576    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     }
    615577    vboxVDbgPrint(("%s d3dWidth(%d), width(%d), height(%d), format(%d), usage(%s), %s", pPrefix,
    616578            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  
    8181extern struct VBOXWDDMDISP_DEVICE *g_VBoxVDbgInternalDevice;
    8282extern struct VBOXWDDMDISP_RESOURCE *g_VBoxVDbgInternalRc;
    83 
    84 extern DWORD g_VBoxVDbgCfgCreateSwapchainOnDdiOnce;
    8583
    8684#endif
     
    237235VOID vboxVDbgDoDumpLockUnlockSurfTex(const char * pPrefix, const VBOXWDDMDISP_ALLOCATION *pAlloc, const char * pSuffix, DWORD fFlags);
    238236VOID 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);
    241237VOID vboxVDbgDoDumpSamplers(const char * pPrefix, struct VBOXWDDMDISP_DEVICE *pDevice, const char * pSuffix, DWORD fFlags);
    242238
     
    483479        VBOXVDBG_DUMP_STRETCH_RECT(Blt, "<==", _pSrcAlloc, _pSrcSurf, _pSrcRect, _pDstAlloc, _pDstSurf, _pDstRect)
    484480
    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 
    491481#define VBOXVDBG_IS_SKIP_DWM_WND_UPDATE(_pSrcRc, _pSrcRect, _pDstRc, _pDstPoint) ( \
    492482            g_VBoxVDbgFSkipCheckTexBltDwmWndUpdate \
     
    555545        VBOXVDBG_CHECK_STRETCH_RECT(Blt, _opBlt, _pSrcAlloc, _pSrcSurf, _pSrcRect, _pDstAlloc, _pDstSurf, _pDstRect)
    556546
    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 
    560547#define VBOXVDBG_DUMP_SYNC_RT(_pBbSurf) do { \
    561548        if (VBOXVDBG_IS_DUMP_ALLOWED(RtSynch)) \
    562549        { \
    563550            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             } \
    591551        } \
    592552    } while (0)
     
    617577        } \
    618578    } 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)
    630579
    631580#else
     
    641590#define VBOXVDBG_DUMP_LOCK_ST(_pData) do { } while (0)
    642591#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)
    645592#define VBOXVDBG_BREAK_SHARED(_pRc) do { } while (0)
    646593#define VBOXVDBG_BREAK_SHARED_DEV(_pDevice) do { } while (0)
     
    650597#define VBOXVDBG_CHECK_TEXBLT(_opTexBlt, _pSrcRc, _pSrcRect, _pDstRc, _pDstPoint) do { _opTexBlt; } while (0)
    651598#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)
    654599#endif
    655600
  • trunk/src/VBox/Additions/WINNT/Graphics/Video/disp/wddm/VBoxDispMpInternal.h

    r76563 r80488  
    2424#include <iprt/win/windows.h>
    2525
    26 #if 0
    27 HRESULT vboxDispMpInternalInit();
    28 HRESULT vboxDispMpInternalTerm();
    29 HRESULT vboxDispMpInternalCancel(struct VBOXWDDMDISP_CONTEXT *pContext, struct VBOXWDDMDISP_SWAPCHAIN *pSwapchain);
    30 #endif
    31 
    3226#endif /* !GA_INCLUDED_SRC_WINNT_Graphics_Video_disp_wddm_VBoxDispMpInternal_h */
  • trunk/src/VBox/Additions/WINNT/Graphics/Video/mp/common/VBoxMPDevExt.h

    r80483 r80488  
    134134   VBOXVDMADDI_NODE aNodes[VBOXWDDM_NUM_NODES];
    135135   LIST_ENTRY DpcCmdQueue;
    136    LIST_ENTRY SwapchainList3D;
    137136   /* mutex for context list operations */
    138137   KSPIN_LOCK ContextLock;
  • trunk/src/VBox/Additions/WINNT/Graphics/Video/mp/wddm/VBoxMPTypes.h

    r80487 r80488  
    109109    uint32_t hostID;
    110110    uint32_t cHostIDRefs;
    111     struct VBOXWDDM_SWAPCHAIN *pSwapchain;
    112111} VBOXWDDM_ALLOC_DATA, *PVBOXWDDM_ALLOC_DATA;
    113112
     
    165164typedef struct VBOXWDDM_ALLOCATION
    166165{
    167     LIST_ENTRY SwapchainEntry;
    168166    VBOXWDDM_ALLOC_TYPE enmType;
    169167    D3DDDI_RESOURCEFLAGS fRcFlags;
  • trunk/src/VBox/Additions/WINNT/Graphics/Video/mp/wddm/VBoxMPWddm.cpp

    r80487 r80488  
    11111111                    vboxVideoCmInit(&pDevExt->CmMgr);
    11121112                    vboxVideoCmInit(&pDevExt->SeamlessCtxMgr);
    1113                     InitializeListHead(&pDevExt->SwapchainList3D);
    11141113                    pDevExt->cContexts3D = 0;
    11151114                    pDevExt->cContexts2D = 0;
     
    46984697    SrcAllocData.Addr.pvMem = pPresentDisplayOnly->pSource;
    46994698    SrcAllocData.hostID = 0;
    4700     SrcAllocData.pSwapchain = NULL;
    47014699
    47024700    RECT UpdateRect;
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette