VirtualBox

Changeset 42501 in vbox for trunk/src/VBox


Ignore:
Timestamp:
Aug 1, 2012 10:48:53 AM (13 years ago)
Author:
vboxsync
Message:

followup for r79662, sigh

Location:
trunk/src/VBox/Additions/WINNT/Graphics/Video
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Additions/WINNT/Graphics/Video/disp/Makefile.kmk

    r42314 r42501  
    107107VBoxDispD3D_INCS     = \
    108108        ../../../include \
    109         ..
     109        .. \
     110        $(VBOX_PATH_CROGL_INCLUDE)
    110111VBoxDispD3D_SOURCES  = \
    111112        wddm/VBoxDispD3D.cpp \
     
    118119        wddm/VBoxDispDbg.cpp \
    119120        wddm/VBoxDispD3D.rc \
    120         wddm/VBoxDispD3D.def \
    121 #ifdef VBOX_WITH_CRHGSMI
    122 #VBoxDispD3D_SOURCES += \
    123 #    wddm/VBoxUhgsmiDisp.cpp \
    124 #    wddm/VBoxUhgsmiKmt.cpp
    125 #VBoxDispD3D_DEFS   += VBOX_WITH_CRHGSMI
    126 #endif
     121        wddm/VBoxDispD3D.def
     122ifdef VBOX_WITH_CRHGSMI
     123VBoxDispD3D_DEFS   += VBOX_WITH_CRHGSMI
     124endif
    127125VBoxDispD3D_LIBS     = \
    128126        $(VBOX_LIB_IPRT_GUEST_R3) \
    129127        $(VBOX_LIB_VBGL_R3) \
    130128        Psapi.lib \
    131         $(VBOX_PATH_ADDITIONS_LIB)/VBoxDispMpLogger$(VBOX_SUFF_LIB)
     129        $(VBOX_PATH_ADDITIONS_LIB)/VBoxDispMpLogger$(VBOX_SUFF_LIB) \
     130        $(VBOX_PATH_ADDITIONS_LIB)/VBoxCrHgsmi$(VBOX_SUFF_LIB)
    132131
    133132#
     
    141140        $(VBOX_LIB_VBGL_R3_X86) \
    142141        Psapi.lib \
    143         $(VBOX_PATH_ADDITIONS_LIB)/VBoxDispMpLogger-x86$(VBOX_SUFF_LIB)
     142        $(VBOX_PATH_ADDITIONS_LIB)/VBoxDispMpLogger-x86$(VBOX_SUFF_LIB) \
     143        $(VBOX_PATH_ADDITIONS_LIB)/VBoxCrHgsmi-x86$(VBOX_SUFF_LIB)
    144144VBoxDispD3D-x86_DEFS = $(VBoxDispD3D_DEFS) VBOX_WDDM_WOW64
    145145
     
    151151VBoxCrHgsmi_TEMPLATE    = VBOXGUESTR3LIB
    152152VBoxCrHgsmi_SDKS        = ReorderCompilerIncs $(VBOX_WINDDK_GST_WLH)
    153 VBoxCrHgsmi_DEFS        = UNICODE _UNICODE VBOX_WITH_CRHGSMI IN_VBOXCRHGSMI VBOX_WITH_WDDM VBOX_WITH_VDMA VBOX_WITH_HGCM
    154 VBoxCrHgsmi_INCS        = ../../../include ..
     153#use same defines as VBoxDispD3D to ensure structure definitions match
     154VBoxCrHgsmi_DEFS        = $(subst VBOXWDDMDISP,IN_VBOXCRHGSMI,$(VBoxDispD3D_DEFS))
     155VBoxCrHgsmi_INCS        = ../../../include .. $(VBOX_PATH_CROGL_INCLUDE)
    155156VBoxCrHgsmi_SOURCES     = \
    156157        wddm/VBoxCrHgsmi.cpp \
    157158        wddm/VBoxDispKmt.cpp \
    158159        wddm/VBoxDispDbg.cpp \
    159         wddm/VBoxUhgsmiKmt.cpp
     160        wddm/VBoxUhgsmiKmt.cpp \
     161        wddm/VBoxUhgsmiBase.cpp \
     162        wddm/VBoxUhgsmiDisp.cpp
    160163
    161164#
  • trunk/src/VBox/Additions/WINNT/Graphics/Video/disp/wddm/VBoxDispD3D.cpp

    r41858 r42501  
    806806
    807807
    808 #ifdef VBOX_WITH_CRHGSMI
    809 /* cr hgsmi */
    810 static VBOXCRHGSMI_CALLBACKS g_VBoxCrHgsmiCallbacks = {0};
    811 #define VBOXUHGSMIKMT_PERTHREAD
    812 #ifdef VBOXUHGSMIKMT_PERTHREAD
    813 #define VBOXUHGSMIKMT_VAR(_type) __declspec(thread) _type
    814 #else
    815 #define VBOXUHGSMIKMT_VAR(_type) _type
    816 #endif
    817 static VBOXUHGSMIKMT_VAR(VBOXUHGSMI_PRIVATE_KMT) g_VBoxUhgsmiKmt;
    818 static VBOXUHGSMIKMT_VAR(uint32_t) g_cVBoxUhgsmiKmtRefs = 0;
    819 #endif
    820 
    821 #ifdef VBOX_WITH_CRHGSMI
    822 static __declspec(thread) PVBOXUHGSMI_PRIVATE_BASE gt_pHgsmi = NULL;
    823 
    824 VBOXWDDMDISP_DECL(int) VBoxDispCrHgsmiInit(PVBOXCRHGSMI_CALLBACKS pCallbacks)
    825 {
    826 #ifdef VBOX_WITH_CRHGSMI
    827     vboxDispLock(); /* the lock is needed here only to ensure callbacks are not initialized & used concurrently
    828                      * @todo: make a separate call used to init the per-thread info and make the VBoxDispCrHgsmiInit be called only once */
    829     g_VBoxCrHgsmiCallbacks = *pCallbacks;
    830     PVBOXUHGSMI_PRIVATE_BASE pHgsmi = gt_pHgsmi;
    831 #ifdef DEBUG_misha
    832     Assert(pHgsmi);
    833 #endif
    834     if (pHgsmi)
    835     {
    836         if (!pHgsmi->hClient)
    837         {
    838             pHgsmi->hClient = g_VBoxCrHgsmiCallbacks.pfnClientCreate(&pHgsmi->Base);
    839             Assert(pHgsmi->hClient);
    840         }
    841     }
    842     vboxDispUnlock();
    843 #endif
    844     return VINF_SUCCESS;
    845 }
    846 
    847 VBOXWDDMDISP_DECL(int) VBoxDispCrHgsmiTerm()
    848 {
    849     return VINF_SUCCESS;
    850 }
    851 
    852 VBOXWDDMDISP_DECL(HVBOXCRHGSMI_CLIENT) VBoxDispCrHgsmiQueryClient()
    853 {
    854 #ifdef VBOX_WITH_CRHGSMI
    855     PVBOXUHGSMI_PRIVATE_BASE pHgsmi = gt_pHgsmi;
    856 #ifdef DEBUG_misha
    857     Assert(pHgsmi);
    858 #endif
    859     if (pHgsmi)
    860     {
    861         Assert(pHgsmi->hClient);
    862         return pHgsmi->hClient;
    863     }
    864 #endif
    865     return NULL;
    866 }
    867 
    868 static HRESULT vboxUhgsmiGlobalRetain()
    869 {
    870     HRESULT hr = S_OK;
    871     vboxDispLock();
    872     if (!g_cVBoxUhgsmiKmtRefs)
    873     {
    874         hr = vboxUhgsmiKmtCreate(&g_VBoxUhgsmiKmt, TRUE);
    875         Assert(hr == S_OK);
    876         /* can not do it here because callbacks may not be set yet
    877          * @todo: need to call the cr lib from here to get the callbacks
    878          * rather than making the cr lib call us */
    879 //        if (hr == S_OK)
    880 //        {
    881 //            g_VBoxUhgsmiKmt.BasePrivate.hClient = g_VBoxCrHgsmiCallbacks.pfnClientCreate(&g_VBoxUhgsmiKmt.BasePrivate.Base);
    882 //            Assert(g_VBoxUhgsmiKmt.BasePrivate.hClient);
    883 //        }
    884     }
    885 
    886     if (hr == S_OK)
    887     {
    888         ++g_cVBoxUhgsmiKmtRefs;
    889     }
    890     vboxDispUnlock();
    891 
    892     return hr;
    893 }
    894 
    895 static HRESULT vboxUhgsmiGlobalRelease()
    896 {
    897     HRESULT hr = S_OK;
    898     vboxDispLock();
    899     --g_cVBoxUhgsmiKmtRefs;
    900     if (!g_cVBoxUhgsmiKmtRefs)
    901     {
    902         if (g_VBoxUhgsmiKmt.BasePrivate.hClient)
    903             g_VBoxCrHgsmiCallbacks.pfnClientDestroy(g_VBoxUhgsmiKmt.BasePrivate.hClient);
    904         hr = vboxUhgsmiKmtDestroy(&g_VBoxUhgsmiKmt);
    905         Assert(hr == S_OK);
    906     }
    907     vboxDispUnlock();
    908     return hr;
    909 }
    910 
    911 DECLINLINE(void) vboxDispCrHgsmiClientSet(PVBOXUHGSMI_PRIVATE_BASE pHgsmi)
    912 {
    913     gt_pHgsmi = pHgsmi;
    914 }
    915 
    916 DECLINLINE(void) vboxDispCrHgsmiClientClear()
    917 {
    918     gt_pHgsmi = NULL;
    919 }
    920 
    921 HRESULT vboxUhgsmiGlobalSetCurrent()
    922 {
    923     HRESULT hr = vboxUhgsmiGlobalRetain();
    924     Assert(hr == S_OK);
    925     if (hr == S_OK)
    926         vboxDispCrHgsmiClientSet(&g_VBoxUhgsmiKmt.BasePrivate);
    927     return hr;
    928 }
    929 
    930 HRESULT vboxUhgsmiGlobalClearCurrent()
    931 {
    932     vboxUhgsmiGlobalRelease();
    933     vboxDispCrHgsmiClientClear();
    934     return S_OK;
    935 }
    936 
    937 class VBoxDispCrHgsmiScope
    938 {
    939 public:
    940     VBoxDispCrHgsmiScope(PVBOXUHGSMI_PRIVATE_BASE pHgsmi)
    941     {
    942         vboxDispCrHgsmiClientSet(pHgsmi);
    943     }
    944 
    945     ~VBoxDispCrHgsmiScope()
    946     {
    947         vboxDispCrHgsmiClientClear();
    948     }
    949 private:
    950 };
    951 
    952 #define VBOXDISPCRHGSMI_SCOPE_SET_DEV(_pDev) VBoxDispCrHgsmiScope __vboxCrHgsmiScope(&(_pDev)->Uhgsmi.BasePrivate)
    953 #define VBOXDISPCRHGSMI_SCOPE_SET_GLOBAL() VBoxDispCrHgsmiScope __vboxCrHgsmiScope(&g_VBoxUhgsmiKmt.BasePrivate)
    954 #else
    955808#define VBOXDISPCRHGSMI_SCOPE_SET_DEV(_pDev) do {} while(0)
    956809#define VBOXDISPCRHGSMI_SCOPE_SET_GLOBAL() do {} while(0)
    957810
    958 VBOXWDDMDISP_DECL(int) VBoxDispCrHgsmiInit(void*)
    959 {
    960     return VERR_NOT_IMPLEMENTED;
    961 }
    962 
    963 VBOXWDDMDISP_DECL(int) VBoxDispCrHgsmiTerm()
    964 {
    965     return VERR_NOT_IMPLEMENTED;
    966 }
    967 
    968 VBOXWDDMDISP_DECL(void*) VBoxDispCrHgsmiQueryClient()
    969 {
    970     return NULL;
    971 }
    972 #endif
    973811
    974812typedef struct VBOXWDDMDISP_NSCADD
     
    26382476    if (!bReuseSwapchain)
    26392477    {
    2640         D3DPRESENT_PARAMETERS Params;
    2641         vboxWddmSwapchainFillParams(pSwapchain, &Params);
     2478        VBOXWINEEX_D3DPRESENT_PARAMETERS Params;
     2479        vboxWddmSwapchainFillParams(pSwapchain, &Params.Base);
     2480        Params.pHgsmi = NULL;
    26422481
    26432482        if (hr == S_OK)
     
    26452484            DWORD fFlags = D3DCREATE_HARDWARE_VERTEXPROCESSING;
    26462485
    2647             Params.hDeviceWindow = NULL;
     2486            Params.Base.hDeviceWindow = NULL;
    26482487                        /* @todo: it seems there should be a way to detect this correctly since
    26492488                         * our vboxWddmDDevSetDisplayMode will be called in case we are using full-screen */
    2650             Params.Windowed = TRUE;
     2489            Params.Base.Windowed = TRUE;
    26512490            //            params.EnableAutoDepthStencil = FALSE;
    26522491            //            params.AutoDepthStencilFormat = D3DFMT_UNKNOWN;
     
    26562495            if (!pDevice->pDevice9If)
    26572496            {
    2658                 hr = pAdapter->pD3D9If->CreateDevice(D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, NULL, fFlags, &Params, &pDevice9If);
     2497                Params.pHgsmi = &pDevice->Uhgsmi.BasePrivate.Base;
     2498                hr = pAdapter->pD3D9If->CreateDevice(D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, NULL, fFlags, &Params.Base, &pDevice9If);
    26592499                Assert(hr == S_OK);
    26602500                if (hr == S_OK)
    26612501                {
    2662                     Assert(Params.hDeviceWindow);
    2663                     pSwapchain->hWnd = Params.hDeviceWindow;
     2502                    Assert(Params.Base.hDeviceWindow);
     2503                    pSwapchain->hWnd = Params.Base.hDeviceWindow;
    26642504                    pDevice->pDevice9If = pDevice9If;
    26652505                    hr = pDevice9If->GetSwapChain(0, &pNewIf);
     
    26912531                /* re-use swapchain window
    26922532                 * this will invalidate the previusly used swapchain */
    2693                 Params.hDeviceWindow = pSwapchain->hWnd;
    2694 
    2695                 hr = pDevice->pDevice9If->CreateAdditionalSwapChain(&Params, &pNewIf);
     2533                Params.Base.hDeviceWindow = pSwapchain->hWnd;
     2534
     2535                hr = pDevice->pDevice9If->CreateAdditionalSwapChain(&Params.Base, &pNewIf);
    26962536                Assert(hr == S_OK);
    26972537                if (hr == S_OK)
    26982538                {
    2699                     Assert(Params.hDeviceWindow);
    2700                     pSwapchain->hWnd = Params.hDeviceWindow;
     2539                    Assert(Params.Base.hDeviceWindow);
     2540                    pSwapchain->hWnd = Params.Base.hDeviceWindow;
    27012541                    Assert(pNewIf);
    27022542                }
     
    67896629        vboxWddmSwapchainDestroyAll(pDevice);
    67906630    }
    6791 
    6792 #ifdef VBOX_WITH_CRHGSMI
    6793     vboxDispLock();
    6794     if (pDevice->Uhgsmi.BasePrivate.hClient)
    6795         g_VBoxCrHgsmiCallbacks.pfnClientDestroy(pDevice->Uhgsmi.BasePrivate.hClient);
    6796     vboxDispUnlock();
    6797 #endif
    67986631
    67996632    HRESULT hr = vboxDispCmCtxDestroy(pDevice, &pDevice->DefaultContext);
     
    74437276                    && !pCreateData->PatchLocationListSize)
    74447277            {
    7445 #ifdef VBOX_WITH_CRHGSMI
    7446                 hr = vboxUhgsmiD3DInit(&pDevice->Uhgsmi, pDevice);
    7447                 Assert(hr == S_OK);
    7448                 if (hr == S_OK)
    7449 #endif
    74507278                {
    74517279                    VBOXDISPCRHGSMI_SCOPE_SET_DEV(pDevice);
     
    75377365        pAdapter->pD3D9If->Release();
    75387366        VBoxDispD3DClose(&pAdapter->D3D);
    7539 
    7540 #ifdef VBOX_WITH_CRHGSMI
    7541         vboxUhgsmiGlobalRelease();
    7542 #endif
    75437367    }
    75447368
     
    76687492            do
    76697493            {
    7670 #ifdef VBOX_WITH_CRHGSMI
    7671                 hr = vboxUhgsmiGlobalRetain();
    7672                 Assert(hr == S_OK);
    7673                 if (hr == S_OK)
    7674 #endif
    76757494                {
    76767495                    VBOXDISPCRHGSMI_SCOPE_SET_GLOBAL();
     
    77097528                    else
    77107529                        vboxVDbgPrintR((__FUNCTION__": VBoxDispD3DOpen failed, hr (%d)\n", hr));
    7711 #ifdef VBOX_WITH_CRHGSMI
    7712                     vboxUhgsmiGlobalRelease();
    7713 #endif
     7530
    77147531                }
    77157532            } while (0);
  • trunk/src/VBox/Additions/WINNT/Graphics/Video/disp/wddm/VBoxDispD3D64.def

    r36867 r42501  
    2020        OpenAdapter
    2121        VBoxDispMpGetCallbacks
    22     VBoxDispCrHgsmiInit
    23     VBoxDispCrHgsmiTerm
    24     VBoxDispCrHgsmiQueryClient
  • trunk/src/VBox/Additions/WINNT/Graphics/Video/disp/wddm/VBoxUhgsmiDisp.h

    r36867 r42501  
    2929} VBOXUHGSMI_PRIVATE_D3D, *PVBOXUHGSMI_PRIVATE_D3D;
    3030
    31 HRESULT vboxUhgsmiD3DInit(PVBOXUHGSMI_PRIVATE_D3D pHgsmi, struct VBOXWDDMDISP_DEVICE *pDevice);
     31#if 0
     32void vboxUhgsmiD3DInit(PVBOXUHGSMI_PRIVATE_D3D pHgsmi, struct VBOXWDDMDISP_DEVICE *pDevice);
     33#endif
    3234
    33 
     35void vboxUhgsmiD3DEscInit(PVBOXUHGSMI_PRIVATE_D3D pHgsmi, struct VBOXWDDMDISP_DEVICE *pDevice);
    3436
    3537#endif /* #ifndef ___VBoxUhgsmiDisp_h__ */
  • trunk/src/VBox/Additions/WINNT/Graphics/Video/mp/wddm/VBoxMPWddm.cpp

    r42232 r42501  
    39243924            case VBOXESC_UHGSMI_SUBMIT:
    39253925            {
    3926                 /* submit UHGSMI command */
     3926                /* submit VBOXUHGSMI command */
    39273927                PVBOXWDDM_CONTEXT pContext = (PVBOXWDDM_CONTEXT)pEscape->hContext;
    39283928                PVBOXDISPIFESCAPE_UHGSMI_SUBMIT pSubmit = (PVBOXDISPIFESCAPE_UHGSMI_SUBMIT)pEscapeHdr;
     
    39433943            case VBOXESC_UHGSMI_ALLOCATE:
    39443944            {
    3945                 /* allocate UHGSMI buffer */
     3945                /* allocate VBOXUHGSMI buffer */
    39463946                PVBOXWDDM_CONTEXT pContext = (PVBOXWDDM_CONTEXT)pEscape->hContext;
    39473947                PVBOXDISPIFESCAPE_UHGSMI_ALLOCATE pAlocate = (PVBOXDISPIFESCAPE_UHGSMI_ALLOCATE)pEscapeHdr;
     
    39603960            case VBOXESC_UHGSMI_DEALLOCATE:
    39613961            {
    3962                 /* deallocate UHGSMI buffer */
     3962                /* deallocate VBOXUHGSMI buffer */
    39633963                PVBOXWDDM_CONTEXT pContext = (PVBOXWDDM_CONTEXT)pEscape->hContext;
    39643964                PVBOXDISPIFESCAPE_UHGSMI_DEALLOCATE pDealocate = (PVBOXDISPIFESCAPE_UHGSMI_DEALLOCATE)pEscapeHdr;
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