VirtualBox

Ignore:
Timestamp:
Oct 21, 2010 12:52:37 PM (14 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
66877
Message:

wddm/3d: scrolling with aero 8x speedup, bugfixing + profiling

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  
    88static uint32_t g_cVBoxCrHgsmiProvider = 0;
    99
     10static VBOXDISPKMT_CALLBACKS g_VBoxCrHgsmiKmtCallbacks;
     11
    1012typedef VBOXWDDMDISP_DECL(int) FNVBOXDISPCRHGSMI_INIT(PVBOXCRHGSMI_CALLBACKS pCallbacks);
    1113typedef FNVBOXDISPCRHGSMI_INIT *PFNVBOXDISPCRHGSMI_INIT;
     
    2325VBOXCRHGSMI_DECL(int) VBoxCrHgsmiInit(PVBOXCRHGSMI_CALLBACKS pCallbacks)
    2426{
     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
    2545    g_VBoxCrHgsmiCallbacks = *pCallbacks;
    2646    if (!g_hVBoxCrHgsmiProvider)
     
    7797    {
    7898        hClient = g_pfnVBoxDispCrHgsmiQueryClient();
    79 #ifdef DEBUG_misha
    80         Assert(hClient);
    81 #endif
     99//#ifdef DEBUG_misha
     100//        Assert(hClient);
     101//#endif
    82102        if (hClient)
    83103            return hClient;
     
    125145}
    126146
     147VBOXCRHGSMI_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}
    127181
    128182///* 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  
    16991699        pSwapchain->pRenderTargetFbCopy->Release();
    17001700        pSwapchain->pRenderTargetFbCopy = NULL;
     1701        pSwapchain->bRTFbCopyUpToDate = FALSE;
    17011702#endif
    17021703        pSwapchain->pSwapChainIf->Release();
     
    23582359        pSwapchain->pSwapChainIf = pNewIf;
    23592360#ifndef VBOXWDDM_WITH_VISIBLE_FB
     2361        pSwapchain->bRTFbCopyUpToDate = FALSE;
    23602362        if (!pSwapchain->pRenderTargetFbCopy)
    23612363        {
     
    24622464    if (hr == S_OK)
    24632465    {
     2466        pSwapchain->bRTFbCopyUpToDate = FALSE;
    24642467        vboxWddmSwapchainFlip(pSwapchain);
    24652468        Assert(pSwapchain->fFlags.Value == 0);
     
    63556358                    pSrcSurfIf = pSrcSwapchain->pRenderTargetFbCopy;
    63566359                    Assert(pSrcSurfIf);
    6357                     hr = pSrcSwapchain->pSwapChainIf->GetFrontBufferData(pSrcSurfIf);
    6358                     Assert(hr == S_OK);
    6359                     if (hr == S_OK)
     6360                    if (!pSrcSwapchain->bRTFbCopyUpToDate)
    63606361                    {
    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                    {
    63626373                        pSrcSurfIf->AddRef();
    63636374                    }
  • trunk/src/VBox/Additions/WINNT/Graphics/Display/wddm/VBoxDispD3D.h

    r33171 r33306  
    139139#ifndef VBOXWDDM_WITH_VISIBLE_FB
    140140    IDirect3DSurface9 *pRenderTargetFbCopy;
     141    BOOL bRTFbCopyUpToDate;
    141142#endif
    142143    IDirect3DSwapChain9 *pSwapChainIf;
Note: See TracChangeset for help on using the changeset viewer.

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