VirtualBox

Ignore:
Timestamp:
Oct 25, 2010 12:30:19 PM (14 years ago)
Author:
vboxsync
Message:

wddm/3d: fix black regions on Aero start for Win7

Location:
trunk/src/VBox/Additions/WINNT/Graphics/Display/wddm
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Additions/WINNT/Graphics/Display/wddm/VBoxDispD3D.cpp

    r33367 r33416  
    21092109                    if (pvSwapchain != pSwapchain->pSwapChainIf)
    21102110                    {
    2111                         Assert(0);
    2112                         if (iBb == (~0))
    2113                         {
    2114                             pD3D9Surf->Release();
    2115                             hr = pSwapchain->pSwapChainIf->GetBackBuffer(0, D3DBACKBUFFER_TYPE_MONO, &pD3D9Surf);
    2116                             Assert(hr == S_OK);
    2117                         }
     2111                        Assert(iBb != (~0));
     2112//                        Assert(0);
     2113#if 0 //def DEBUG_misha
     2114                        vboxVDbgDumpAllocSurfData((pDevice, "Synch Src:\n", pAlloc, pD3D9OldSurf, NULL, "\n"));
     2115                        vboxVDbgDumpAllocData((pDevice, "Synch ALLOC:\n", pAlloc, NULL, "\n"));
     2116#endif
    21182117                        hr = pDevice->pDevice9If->StretchRect(pD3D9OldSurf, NULL, pD3D9Surf, NULL, D3DTEXF_NONE);
    21192118                        Assert(hr == S_OK);
    2120                         if (iBb == (~0))
     2119#if 0 //def DEBUG_misha
     2120                        vboxVDbgDumpAllocSurfData((pDevice, "Synch Dst:\n", pAlloc, pD3D9Surf, NULL, "\n"));
     2121#endif
     2122                        if (pSwapchain->cRTs == 1)
    21212123                        {
    2122                             pD3D9Surf->Release();
     2124                            /* synch bb and fb */
    21232125                            hr = pSwapchain->pSwapChainIf->Present(NULL, NULL, NULL, NULL, 0);
    21242126                            Assert(hr == S_OK);
    2125                             hr = pSwapchain->pSwapChainIf->GetBackBuffer(~0, D3DBACKBUFFER_TYPE_MONO, &pD3D9Surf);
    2126                             Assert(hr == S_OK);
     2127                            if (hr == S_OK)
     2128                            {
     2129                                pD3D9Surf->Release();
     2130                                hr = pSwapchain->pSwapChainIf->GetBackBuffer(0, D3DBACKBUFFER_TYPE_MONO, &pD3D9Surf);
     2131                                Assert(hr == S_OK);
     2132                                if (hr == S_OK)
     2133                                {
     2134                                    hr = pDevice->pDevice9If->StretchRect(pD3D9OldSurf, NULL, pD3D9Surf, NULL, D3DTEXF_NONE);
     2135                                    Assert(hr == S_OK);
     2136                                }
     2137                            }
    21272138                        }
    21282139                    }
     
    22092220        {
    22102221            if (OldParams.BackBufferCount == Params.BackBufferCount
    2211                     && OldParams.SwapEffect == Params.SwapEffect)
     2222//                    && OldParams.SwapEffect == Params.SwapEffect
     2223                    )
    22122224            {
    22132225                bReuseSwapchain = TRUE;
     
    79547966bool g_VDbgTstDumpOnSys2VidSameSizeEnable = false;
    79557967
    7956 VOID vboxVDbgDoDumpSurfData(const PVBOXWDDMDISP_DEVICE pDevice, const char * pPrefix, const PVBOXWDDMDISP_RESOURCE pRc, uint32_t iAlloc, const RECT *pRect, IDirect3DSurface9 *pSurf, const char* pSuffix)
     7968VOID vboxVDbgDoDumpAllocSurfData(const PVBOXWDDMDISP_DEVICE pDevice, const char * pPrefix, PVBOXWDDMDISP_ALLOCATION pAlloc, IDirect3DSurface9 *pSurf, const RECT *pRect, const char* pSuffix)
    79577969{
    79587970    if (pPrefix)
     
    79607972        vboxVDbgMpPrint((pDevice, "%s", pPrefix));
    79617973    }
    7962 
    7963     Assert(pRc->cAllocations > iAlloc);
    7964     PVBOXWDDMDISP_ALLOCATION pAlloc = &pRc->aAllocations[iAlloc];
    7965 
    7966     vboxVDbgMpPrintAlloc((pDevice, "allocation info:\n", pRc, iAlloc, "\n"));
    79677974
    79687975    D3DLOCKED_RECT Lr;
     
    79747981    }
    79757982
    7976     BOOL bReleaseSurf = false;
    7977     if (!pSurf)
    7978     {
    7979         HRESULT tmpHr = vboxWddmSurfGet(pRc, iAlloc, &pSurf);
    7980         Assert(tmpHr == S_OK);
    7981         bReleaseSurf = TRUE;
    7982     }
    79837983    HRESULT srcHr = pSurf->LockRect(&Lr, NULL, D3DLOCK_READONLY);
    79847984    Assert(srcHr == S_OK);
     
    80058005        vboxVDbgMpPrint((pDevice, "%s\n", pSuffix));
    80068006    }
     8007}
     8008
     8009VOID vboxVDbgDoDumpAllocData(const PVBOXWDDMDISP_DEVICE pDevice, const char * pPrefix, PVBOXWDDMDISP_ALLOCATION pAlloc, const RECT *pRect, const char* pSuffix)
     8010{
     8011    if (pPrefix)
     8012    {
     8013        vboxVDbgMpPrint((pDevice, "%s", pPrefix));
     8014    }
     8015
     8016    if (pRect)
     8017    {
     8018        Assert(pRect->right > pRect->left);
     8019        Assert(pRect->bottom > pRect->top);
     8020        vboxVDbgMpPrintRect((pDevice, "rect: ", pRect, "\n"));
     8021    }
     8022
     8023    Assert(pAlloc->hAllocation);
     8024
     8025    D3DDDICB_LOCK LockData;
     8026    LockData.hAllocation = pAlloc->hAllocation;
     8027    LockData.PrivateDriverData = 0;
     8028    LockData.NumPages = 0;
     8029    LockData.pPages = NULL;
     8030    LockData.pData = NULL; /* out */
     8031    LockData.Flags.Value = 0;
     8032    LockData.Flags.LockEntire =1;
     8033    LockData.Flags.ReadOnly = 1;
     8034
     8035    HRESULT hr = pDevice->RtCallbacks.pfnLockCb(pDevice->hDevice, &LockData);
     8036    Assert(hr == S_OK);
     8037    if (hr == S_OK)
     8038    {
     8039        UINT bpp = vboxWddmCalcBitsPerPixel(pAlloc->SurfDesc.format);
     8040//        Assert(bpp == pAlloc->SurfDesc.bpp);
     8041//        Assert(pAlloc->SurfDesc.pitch == Lr.Pitch);
     8042        vboxVDbgMpPrint((pDevice, "<?dml?><exec cmd=\"!vbvdbg.ms 0x%p 0n%d 0n%d 0n%d 0n%d\">surface info</exec>\n",
     8043                LockData.pData, pAlloc->D3DWidth, pAlloc->SurfDesc.height, bpp, pAlloc->SurfDesc.pitch));
     8044        if (pRect)
     8045        {
     8046            vboxVDbgMpPrint((pDevice, "<?dml?><exec cmd=\"!vbvdbg.ms 0x%p 0n%d 0n%d 0n%d 0n%d\">rect info</exec>\n",
     8047                    ((uint8_t*)LockData.pData) + (pRect->top * pAlloc->SurfDesc.pitch) + ((pRect->left * bpp) >> 3),
     8048                    pRect->right - pRect->left, pRect->bottom - pRect->top, bpp, pAlloc->SurfDesc.pitch));
     8049        }
     8050        Assert(0);
     8051
     8052        D3DDDICB_UNLOCK DdiUnlock;
     8053
     8054        DdiUnlock.NumAllocations = 1;
     8055        DdiUnlock.phAllocations = &pAlloc->hAllocation;
     8056
     8057        hr = pDevice->RtCallbacks.pfnUnlockCb(pDevice->hDevice, &DdiUnlock);
     8058        Assert(hr == S_OK);
     8059    }
     8060    if (pSuffix)
     8061    {
     8062        vboxVDbgMpPrint((pDevice, "%s\n", pSuffix));
     8063    }
     8064}
     8065
     8066
     8067VOID vboxVDbgDoDumpSurfData(const PVBOXWDDMDISP_DEVICE pDevice, const char * pPrefix, const PVBOXWDDMDISP_RESOURCE pRc, uint32_t iAlloc, const RECT *pRect, IDirect3DSurface9 *pSurf, const char* pSuffix)
     8068{
     8069    if (pPrefix)
     8070    {
     8071        vboxVDbgMpPrint((pDevice, "%s", pPrefix));
     8072    }
     8073
     8074    Assert(pRc->cAllocations > iAlloc);
     8075    PVBOXWDDMDISP_ALLOCATION pAlloc = &pRc->aAllocations[iAlloc];
     8076
     8077    vboxVDbgMpPrintAlloc((pDevice, "allocation info:\n", pRc, iAlloc, "\n"));
     8078
     8079    D3DLOCKED_RECT Lr;
     8080    if (pRect)
     8081    {
     8082        Assert(pRect->right > pRect->left);
     8083        Assert(pRect->bottom > pRect->top);
     8084        vboxVDbgMpPrintRect((pDevice, "rect: ", pRect, "\n"));
     8085    }
     8086
     8087    BOOL bReleaseSurf = false;
     8088    if (!pSurf)
     8089    {
     8090        HRESULT tmpHr = vboxWddmSurfGet(pRc, iAlloc, &pSurf);
     8091        Assert(tmpHr == S_OK);
     8092        bReleaseSurf = TRUE;
     8093    }
     8094    HRESULT srcHr = pSurf->LockRect(&Lr, NULL, D3DLOCK_READONLY);
     8095    Assert(srcHr == S_OK);
     8096    if (srcHr == S_OK)
     8097    {
     8098        UINT bpp = vboxWddmCalcBitsPerPixel(pAlloc->SurfDesc.format);
     8099//        Assert(bpp == pAlloc->SurfDesc.bpp);
     8100//        Assert(pAlloc->SurfDesc.pitch == Lr.Pitch);
     8101        vboxVDbgMpPrint((pDevice, "<?dml?><exec cmd=\"!vbvdbg.ms 0x%p 0n%d 0n%d 0n%d 0n%d\">surface info</exec>\n",
     8102                Lr.pBits, pAlloc->D3DWidth, pAlloc->SurfDesc.height, bpp, Lr.Pitch));
     8103        if (pRect)
     8104        {
     8105            vboxVDbgMpPrint((pDevice, "<?dml?><exec cmd=\"!vbvdbg.ms 0x%p 0n%d 0n%d 0n%d 0n%d\">rect info</exec>\n",
     8106                    ((uint8_t*)Lr.pBits) + (pRect->top * Lr.Pitch) + ((pRect->left * bpp) >> 3),
     8107                    pRect->right - pRect->left, pRect->bottom - pRect->top, bpp, Lr.Pitch));
     8108        }
     8109        Assert(0);
     8110
     8111        srcHr = pSurf->UnlockRect();
     8112        Assert(srcHr == S_OK);
     8113    }
     8114    if (pSuffix)
     8115    {
     8116        vboxVDbgMpPrint((pDevice, "%s\n", pSuffix));
     8117    }
    80078118
    80088119    if (bReleaseSurf)
  • trunk/src/VBox/Additions/WINNT/Graphics/Display/wddm/VBoxDispD3DCmn.h

    r33241 r33416  
    8282extern bool g_VDbgTstDumpOnSys2VidSameSizeEnable;
    8383
     84VOID vboxVDbgDoDumpAllocData(const PVBOXWDDMDISP_DEVICE pDevice, const char * pPrefix, PVBOXWDDMDISP_ALLOCATION pAlloc, const RECT *pRect, const char* pSuffix);
     85VOID vboxVDbgDoDumpAllocSurfData(const PVBOXWDDMDISP_DEVICE pDevice, const char * pPrefix, PVBOXWDDMDISP_ALLOCATION pAlloc, IDirect3DSurface9 *pSurf, const RECT *pRect, const char* pSuffix);
    8486VOID vboxVDbgDoDumpSurfData(const PVBOXWDDMDISP_DEVICE pDevice, const char * pPrefix, const PVBOXWDDMDISP_RESOURCE pRc, uint32_t iAlloc, const RECT *pRect, IDirect3DSurface9 *pSurf, const char* pSuffix);
    8587void vboxVDbgDoMpPrintRect(const PVBOXWDDMDISP_DEVICE pDevice, const char * pPrefix, const RECT *pRect, const char * pSuffix);
     
    109111        vboxVDbgDoDumpSurfData _m ; \
    110112    } while (0)
     113#define vboxVDbgDumpAllocSurfData(_m) \
     114    do { \
     115        vboxVDbgDoDumpAllocSurfData _m ; \
     116    } while (0)
     117#define vboxVDbgDumpAllocData(_m) \
     118    do { \
     119        vboxVDbgDoDumpAllocData _m ; \
     120    } while (0)
    111121#else
    112122#define vboxVDbgDumpSurfData(_m) do {} while (0)
     
    122132#define vboxVDbgMpPrintAlloc(_m) do {} while (0)
    123133#define vboxVDbgDumpSurfData(_m) do {} while (0)
     134#define vboxVDbgDumpAllocSurfData(_m) do {} while (0)
     135#define vboxVDbgDumpAllocData(_m) do {} while (0)
    124136#define vboxVDbgBreak() do {} while (0)
    125137#define vboxVDbgPrint(_m)  do {} while (0)
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