VirtualBox

Changeset 45940 in vbox


Ignore:
Timestamp:
May 7, 2013 8:16:31 PM (12 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
85580
Message:

crOpenGL->Fe/Qt notification mechanism

Location:
trunk
Files:
18 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/VBox/VBoxVideo3D.h

    r44529 r45940  
    134134    } while (0)
    135135
     136
     137/* host 3D->Fe[/Qt] notification mechanism defines */
     138#define VBOX3D_NOTIFY_EVENT_TYPE_VISIBLE_WINDOW 1
     139
    136140#endif /* #ifndef ___VBox_VBoxVideo3D_h */
  • trunk/src/VBox/Frontends/VBoxFB/Framebuffer.cpp

    r44528 r45940  
    353353}
    354354
     355NS_IMETHODIMP VBoxDirectFB::Notify3DEvent(PRUint32 type, PRUint8 *reserved)
     356{
     357    return NS_ERROR_NOT_IMPLEMENTED;
     358}
     359
    355360int VBoxDirectFB::createSurface(uint32_t w, uint32_t h)
    356361{
  • trunk/src/VBox/Frontends/VBoxFB/Framebuffer.h

    r44528 r45940  
    5353    NS_IMETHOD ProcessVHWACommand(PRUint8 *pCommand);
    5454
     55    NS_IMETHOD Notify3DEvent(PRUint32 type, PRUint8 *reserved);
    5556private:
    5657    int createSurface(uint32_t w, uint32_t h);
  • trunk/src/VBox/Frontends/VBoxHeadless/Framebuffer.cpp

    r33591 r45940  
    294294    return E_NOTIMPL;
    295295}
     296
     297STDMETHODIMP VRDPFramebuffer::Notify3DEvent(ULONG uType, BYTE *pReserved)
     298{
     299    return E_NOTIMPL;
     300}
  • trunk/src/VBox/Frontends/VBoxHeadless/Framebuffer.h

    r44529 r45940  
    7070    STDMETHOD(ProcessVHWACommand)(BYTE *pCommand);
    7171
     72    STDMETHOD(Notify3DEvent)(ULONG uType, BYTE *pReserved);
    7273private:
    7374    /* If the format is Opaque, then internal memory buffer is used.
  • trunk/src/VBox/Frontends/VBoxHeadless/NullFramebuffer.h

    r44529 r45940  
    206206    }
    207207
     208    STDMETHOD(Notify3DEvent)(ULONG uType, BYTE *pReserved)
     209    {
     210        return E_NOTIMPL;
     211    }
     212
    208213private:
    209214    /** Guest framebuffer pixel format */
  • trunk/src/VBox/Frontends/VBoxSDL/Framebuffer.cpp

    r42852 r45940  
    622622    return E_NOTIMPL;
    623623}
     624
     625STDMETHODIMP VBoxSDLFB::Notify3DEvent(ULONG uType, BYTE *pReserved)
     626{
     627    return E_NOTIMPL;
     628}
     629
    624630//
    625631// Internal public methods
  • trunk/src/VBox/Frontends/VBoxSDL/Framebuffer.h

    r44528 r45940  
    9595
    9696    STDMETHOD(ProcessVHWACommand)(BYTE *pCommand);
     97
     98    STDMETHOD(Notify3DEvent)(ULONG uType, BYTE *pReserved);
    9799
    98100    // internal public methods
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIFrameBuffer.cpp

    r45580 r45940  
    2727# include "UIMessageCenter.h"
    2828# include "VBoxGlobal.h"
     29
     30# include <VBox/VBoxVideo3D.h>
    2931
    3032#endif /* !VBOX_WITH_PRECOMPILED_HEADERS */
     
    261263}
    262264
     265STDMETHODIMP UIFrameBuffer::Notify3DEvent(ULONG uType, BYTE *pReserved)
     266{
     267    switch (uType)
     268    {
     269        case VBOX3D_NOTIFY_EVENT_TYPE_VISIBLE_WINDOW:
     270            if (pReserved)
     271                return E_INVALIDARG;
     272
     273            /* @todo: submit asynchronous event to GUI thread */
     274            return E_NOTIMPL;
     275        default:
     276            return E_INVALIDARG;
     277    }
     278}
     279
    263280#ifdef VBOX_WITH_VIDEOHWACCEL
    264281void UIFrameBuffer::doProcessVHWACommand(QEvent *pEvent)
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIFrameBuffer.h

    r44528 r45940  
    180180    STDMETHOD(ProcessVHWACommand)(BYTE *pCommand);
    181181
     182    STDMETHOD(Notify3DEvent)(ULONG uType, BYTE *pReserved);
     183
    182184    ulong width() { return m_width; }
    183185    ulong height() { return m_height; }
  • trunk/src/VBox/GuestHost/OpenGL/include/cr_server.h

    r45577 r45940  
    124124
    125125typedef DECLCALLBACKPTR(void, PFNCR_SERVER_RPW_DATA) (const struct CR_SERVER_RPW_ENTRY* pEntry, void *pvEntryTexData);
     126
     127typedef DECLCALLBACKPTR(void, PFNCRSERVERNOTIFYEVENT) (int32_t screenId, uint32_t uEvent, void*pvData);
    126128
    127129typedef struct CR_SERVER_RPW_ENTRY
     
    524526    GLboolean             bWindowsInitiallyHidden;
    525527
     528    uint32_t              NotifyEventMap[(CR_MAX_GUEST_MONITORS + 31)/32];
     529    uint32_t              cDisableEvent;
     530    PFNCRSERVERNOTIFYEVENT pfnNotifyEventCB;
     531
    526532    /* @todo: should we use just one blitter?
    527533     * we use two currently because the drawable attribs can differ*/
     
    565571extern DECLEXPORT(int32_t) crVBoxServerSetScreenViewport(int sIndex, int32_t x, int32_t y, uint32_t w, uint32_t h);
    566572
     573extern DECLEXPORT(void) crServerVBoxSetNotifyEventCB(PFNCRSERVERNOTIFYEVENT pfnCb);
     574
    567575#ifdef VBOX_WITH_CRHGSMI
    568576/* We moved all CrHgsmi command processing to crserverlib to keep the logic of dealing with CrHgsmi commands in one place.
  • trunk/src/VBox/HostServices/SharedOpenGL/crserver/crservice.cpp

    r45148 r45940  
    244244    return rc;
    245245}
     246
     247static DECLCALLBACK(void) svcNotifyEventCB(int32_t screenId, uint32_t uEvent, void*pvData)
     248{
     249    ComPtr<IDisplay> pDisplay;
     250    ComPtr<IFramebuffer> pFramebuffer;
     251    LONG xo, yo;
     252    LONG64 winId = 0;
     253    ULONG monitorCount, i, w, h;
     254
     255    if (!g_pConsole)
     256    {
     257        crWarning("Console not defined!");
     258        return;
     259    }
     260
     261    CHECK_ERROR2_STMT(g_pConsole, COMGETTER(Display)(pDisplay.asOutParam()), return);
     262
     263    CHECK_ERROR2_STMT(pDisplay, GetFramebuffer(screenId, pFramebuffer.asOutParam(), &xo, &yo), return);
     264
     265    if (!pFramebuffer)
     266        return;
     267
     268    CHECK_ERROR2_STMT(pFramebuffer, Notify3DEvent(VBOX3D_NOTIFY_EVENT_TYPE_VISIBLE_WINDOW, NULL), return);
     269}
     270
    246271
    247272static DECLCALLBACK(int) svcUnload (void *)
     
    12811306
    12821307            rc = svcPresentFBOInit();
     1308
     1309            crServerVBoxSetNotifyEventCB(svcNotifyEventCB);
    12831310        }
    12841311    }
  • trunk/src/VBox/HostServices/SharedOpenGL/crserverlib/server.h

    r45386 r45940  
    129129void crServerCheckMuralGeometry(CRMuralInfo *mural);
    130130GLboolean crServerSupportRedirMuralFBO(void);
     131
     132void crVBoxServerNotifyEvent(int32_t idScreen);
    131133
    132134#define CR_SERVER_REDIR_F_NONE     0x00
  • trunk/src/VBox/HostServices/SharedOpenGL/crserverlib/server_config.c

    r45577 r45940  
    5858    cr_server.bUseOutputRedirect = GL_FALSE;
    5959    cr_server.bWindowsInitiallyHidden = GL_FALSE;
     60
     61    memset(cr_server.NotifyEventMap, 0, sizeof (cr_server.NotifyEventMap));
     62    cr_server.cDisableEvent = 0;
     63    cr_server.pfnNotifyEventCB = NULL;
    6064}
    6165
  • trunk/src/VBox/HostServices/SharedOpenGL/crserverlib/server_main.c

    r45635 r45940  
    25742574#define MAPPED(screen) ((screen).winID != 0)
    25752575
     2576extern DECLEXPORT(void) crServerVBoxSetNotifyEventCB(PFNCRSERVERNOTIFYEVENT pfnCb)
     2577{
     2578    cr_server.pfnNotifyEventCB = pfnCb;
     2579}
     2580
     2581void crVBoxServerNotifyEvent(int32_t idScreen)
     2582{
     2583    /* this is something unexpected, but just in case */
     2584    if (idScreen >= cr_server.screenCount)
     2585    {
     2586        crWarning("invalid screen id %d", idScreen);
     2587        return;
     2588    }
     2589
     2590    if (!cr_server.cDisableEvent)
     2591        cr_server.pfnNotifyEventCB(idScreen, VBOX3D_NOTIFY_EVENT_TYPE_VISIBLE_WINDOW, NULL);
     2592    else
     2593        ASMBitSet(cr_server.NotifyEventMap, idScreen);
     2594}
     2595
    25762596static void crVBoxServerReparentMuralCB(unsigned long key, void *data1, void *data2)
    25772597{
     
    25862606
    25872607        renderspuReparentWindow(pMI->spuWindow);
     2608
     2609        if (pMI->bVisible && (pMI->fPresentMode & CR_SERVER_REDIR_F_DISPLAY))
     2610            crVBoxServerNotifyEvent(pMI->screenId);
    25882611
    25892612        crServerVBoxCompositionDisableLeave(pMI, GL_FALSE);
     
    27222745    uint32_t cRects;
    27232746    const RTRECT *pRects;
    2724     int rc;
     2747    int rc = VINF_SUCCESS;
    27252748
    27262749    fForcePresent = crServerVBoxCompositionPresentNeeded(pMI);
  • trunk/src/VBox/HostServices/SharedOpenGL/crserverlib/server_muralfbo.c

    r45920 r45940  
    193193        renderspuReparentWindow(mural->spuWindow);
    194194        renderspuSetWindowId(cr_server.screen[0].winID);
     195
     196        if (mural->bVisible && (mural->fPresentMode & CR_SERVER_REDIR_F_DISPLAY))
     197            crVBoxServerNotifyEvent(mural->screenId);
    195198    }
    196199
     
    349352        {
    350353            if  (mural->bVisible)
     354            {
    351355                cr_server.head_spu->dispatch_table.WindowShow(mural->spuWindow, GL_TRUE);
     356                crVBoxServerNotifyEvent(mural->screenId);
     357            }
    352358            mural->fPresentMode |= CR_SERVER_REDIR_F_DISPLAY;
    353359        }
     
    748754DECLEXPORT(void) crServerVBoxCompositionSetEnableStateGlobal(GLboolean fEnable)
    749755{
     756    if (!fEnable)
     757        ++cr_server.cDisableEvent;
     758
    750759    crHashtableWalk(cr_server.muralTable, crServerVBoxCompositionSetEnableStateGlobalCB, (void*)fEnable);
    751760
    752761    crHashtableWalk(cr_server.dummyMuralTable, crServerVBoxCompositionSetEnableStateGlobalCB, (void*)fEnable);
     762
     763    if (fEnable)
     764    {
     765        --cr_server.cDisableEvent;
     766        CRASSERT(cr_server.cDisableEvent < UINT32_MAX/2);
     767        if(!cr_server.cDisableEvent)
     768        {
     769            int i;
     770            for (i = 0; i < cr_server.screenCount; ++i)
     771            {
     772                if (!ASMBitTest(cr_server.NotifyEventMap, i))
     773                    continue;
     774
     775                cr_server.pfnNotifyEventCB(i, VBOX3D_NOTIFY_EVENT_TYPE_VISIBLE_WINDOW, NULL);
     776
     777                ASMBitClear(cr_server.NotifyEventMap, i);
     778            }
     779        }
     780    }
    753781}
    754782
     
    907935        cr_serverCtxSwitchPostprocess(&CtxSwitch);
    908936
     937#if 1
    909938        if (RT_SUCCESS(rc))
    910939        {
     
    916945            }
    917946        }
    918 
     947#endif
    919948        return;
    920949    }
  • trunk/src/VBox/HostServices/SharedOpenGL/crserverlib/server_window.c

    r45636 r45940  
    807807    {
    808808        cr_server.head_spu->dispatch_table.WindowShow(mural->spuWindow, state);
    809     }
    810 
    811     mural->bVisible = state;
     809
     810        if (state)
     811            crVBoxServerNotifyEvent(mural->screenId);
     812    }
     813
     814    mural->bVisible = !!state;
    812815}
    813816
  • trunk/src/VBox/Main/idl/VirtualBox.xidl

    r45926 r45940  
    1427614276  <interface
    1427714277    name="IFramebuffer" extends="$unknown"
    14278     uuid="b7ed347a-5765-40a0-ae1c-f543eb4ddeaf"
     14278    uuid="e3f122c0-adab-4fc9-a8dc-da112fb48428"
    1427914279    wsmap="suppress"
    1428014280    >
     
    1459814598      <param name="command" type="octet" mod="ptr" dir="in">
    1459914599        <desc>Pointer to VBOXVHWACMD containing the command to execute.</desc>
     14600      </param>
     14601    </method>
     14602
     14603    <method name="notify3DEvent">
     14604      <desc>
     14605        Notifies framebuffer about 3D backend event.
     14606      </desc>
     14607
     14608      <param name="type" type="unsigned long" dir="in">
     14609        <desc>event type. Currently only VBOX3D_NOTIFY_EVENT_TYPE_VISIBLE_WINDOW is supported.</desc>
     14610      </param>
     14611      <param name="reserved" type="octet" mod="ptr" dir="in">
     14612        <desc>Reserved for future use, must be NULL.</desc>
    1460014613      </param>
    1460114614    </method>
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