VirtualBox

Changeset 84740 in vbox


Ignore:
Timestamp:
Jun 9, 2020 3:28:30 PM (5 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
138533
Message:

Main,include: provide a new method for the graphics device to pass notifications to a frontend

Location:
trunk
Files:
6 edited

Legend:

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

    r82968 r84740  
    143143
    144144/* host 3D->Fe[/Qt] notification mechanism defines */
    145 #define VBOX3D_NOTIFY_EVENT_TYPE_TEST_FUNCTIONAL 3
    146 #define VBOX3D_NOTIFY_EVENT_TYPE_3DDATA_VISIBLE  4
    147 #define VBOX3D_NOTIFY_EVENT_TYPE_3DDATA_HIDDEN   5
     145typedef enum
     146{
     147    VBOX3D_NOTIFY_TYPE_TEST_FUNCTIONAL = 3,
     148    VBOX3D_NOTIFY_TYPE_3DDATA_VISIBLE  = 4,
     149    VBOX3D_NOTIFY_TYPE_3DDATA_HIDDEN   = 5,
    148150
     151    VBOX3D_NOTIFY_TYPE_HW_SCREEN_IS_SUPPORTED = 100,
     152    VBOX3D_NOTIFY_TYPE_HW_SCREEN_CREATED      = 101,
     153    VBOX3D_NOTIFY_TYPE_HW_SCREEN_DESTROYED    = 102,
     154    VBOX3D_NOTIFY_TYPE_HW_SCREEN_UPDATE_BEGIN = 103,
     155    VBOX3D_NOTIFY_TYPE_HW_SCREEN_UPDATE_END   = 104,
     156
     157    VBOX3D_NOTIFY_TYPE_32BIT_HACK = 0x7fffffff
     158} VBOX3D_NOTIFY_TYPE;
     159
     160typedef struct VBOX3DNOTIFY
     161{
     162    VBOX3D_NOTIFY_TYPE enmNotification;
     163    int32_t  iDisplay;
     164    uint32_t u32Reserved;
     165    uint32_t cbData;
     166    uint8_t  au8Data[sizeof(uint64_t)];
     167} VBOX3DNOTIFY;
    149168
    150169#endif /* !VBOX_INCLUDED_Graphics_VBoxVideo3D_h */
  • trunk/include/VBox/vmm/pdmifs.h

    r83550 r84740  
    737737/** @} */
    738738
     739/** Pointer to a 3D graphics notification. */
     740typedef struct VBOX3DNOTIFY VBOX3DNOTIFY;
    739741/** Pointer to a 2D graphics acceleration command. */
    740742typedef struct VBOXVHWACMD VBOXVHWACMD;
     
    10261028     */
    10271029    DECLR3CALLBACKMEMBER(void, pfnVBVAReportCursorPosition,(PPDMIDISPLAYCONNECTOR pInterface, uint32_t fFlags, uint32_t uScreen, uint32_t x, uint32_t y));
     1030
     1031    /**
     1032     * Process the graphics device HW Acceleration command.
     1033     *
     1034     * @param   pInterface          Pointer to this interface.
     1035     * @param   p3DNotify           Acceleration Command to be processed.
     1036     * @thread  The graphics device thread: FIFO for the VMSVGA device.
     1037     */
     1038    DECLR3CALLBACKMEMBER(int, pfn3DNotifyProcess,(PPDMIDISPLAYCONNECTOR pInterface,
     1039                                                  VBOX3DNOTIFY *p3DNotify));
    10281040} PDMIDISPLAYCONNECTOR;
    10291041/** PDMIDISPLAYCONNECTOR interface ID. */
    1030 #define PDMIDISPLAYCONNECTOR_IID                "b71dc381-99cc-43de-b459-f1e812e73b65"
     1042#define PDMIDISPLAYCONNECTOR_IID                "cdd562e4-8030-11ea-8d40-bbc8e146c565"
    10311043
    10321044
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIFrameBuffer.cpp

    r84723 r84740  
    10421042    switch (uType)
    10431043    {
    1044         case VBOX3D_NOTIFY_EVENT_TYPE_3DDATA_VISIBLE:
    1045         case VBOX3D_NOTIFY_EVENT_TYPE_3DDATA_HIDDEN:
     1044        case VBOX3D_NOTIFY_TYPE_3DDATA_VISIBLE:
     1045        case VBOX3D_NOTIFY_TYPE_3DDATA_HIDDEN:
    10461046        {
    10471047            /* Notify machine-view with the async-signal
    10481048             * about 3D overlay visibility change: */
    1049             BOOL fVisible = uType == VBOX3D_NOTIFY_EVENT_TYPE_3DDATA_VISIBLE;
     1049            BOOL fVisible = uType == VBOX3D_NOTIFY_TYPE_3DDATA_VISIBLE;
    10501050            LogRel2(("GUI: UIFrameBufferPrivate::Notify3DEvent: Sending to async-handler: "
    1051                      "(VBOX3D_NOTIFY_EVENT_TYPE_3DDATA_%s)\n",
     1051                     "(VBOX3D_NOTIFY_TYPE_3DDATA_%s)\n",
    10521052                     fVisible ? "VISIBLE" : "HIDDEN"));
    10531053            emit sigNotifyAbout3DOverlayVisibilityChange(fVisible);
     
    10601060        }
    10611061
    1062         case VBOX3D_NOTIFY_EVENT_TYPE_TEST_FUNCTIONAL:
     1062        case VBOX3D_NOTIFY_TYPE_TEST_FUNCTIONAL:
    10631063        {
    10641064            HRESULT hr = m_fUnused ? E_FAIL : S_OK;
  • trunk/src/VBox/Main/idl/VirtualBox.xidl

    r84685 r84740  
    1892018920
    1892118921      <param name="type" type="unsigned long" dir="in">
    18922         <desc>event type. Currently only VBOX3D_NOTIFY_EVENT_TYPE_VISIBLE_3DDATA is supported.</desc>
     18922        <desc>event type. VBOX3D_NOTIFY_TYPE_* in VBoxVideo3D.h</desc>
    1892318923      </param>
    1892418924      <param name="data" type="octet" dir="in" safearray="yes">
  • trunk/src/VBox/Main/include/DisplayImpl.h

    r84564 r84740  
    160160    int  i_handleVHWACommandProcess(int enmCmd, bool fGuestCmd, VBOXVHWACMD RT_UNTRUSTED_VOLATILE_GUEST *pCommand);
    161161#endif
     162    int  i_handle3DNotifyProcess(VBOX3DNOTIFY *p3DNotify);
    162163
    163164    int  i_saveVisibleRegion(uint32_t cRect, PRTRECT pRect);
     
    317318                                                          VBOXVHWACMD RT_UNTRUSTED_VOLATILE_GUEST *pCommand);
    318319#endif
     320    static DECLCALLBACK(int)  i_display3DNotifyProcess(PPDMIDISPLAYCONNECTOR pInterface,
     321                                                       VBOX3DNOTIFY *p3DNotify);
    319322
    320323#ifdef VBOX_WITH_HGSMI
  • trunk/src/VBox/Main/src-client/DisplayImpl.cpp

    r83622 r84740  
    4343# include <VBoxVideo.h>
    4444#endif
     45#include <VBoxVideo3D.h>
    4546
    4647#include <VBox/com/array.h>
     
    31413142
    31423143#endif /* VBOX_WITH_VIDEOHWACCEL */
     3144
     3145int Display::i_handle3DNotifyProcess(VBOX3DNOTIFY *p3DNotify)
     3146{
     3147    unsigned const id = (unsigned)p3DNotify->iDisplay;
     3148    if (id >= mcMonitors)
     3149        return VERR_INVALID_PARAMETER;
     3150
     3151    ComPtr<IFramebuffer> pFramebuffer;
     3152    AutoReadLock arlock(this COMMA_LOCKVAL_SRC_POS);
     3153    pFramebuffer = maFramebuffers[id].pFramebuffer;
     3154    arlock.release();
     3155
     3156    int rc = VINF_SUCCESS;
     3157
     3158    if (!pFramebuffer.isNull())
     3159    {
     3160        com::SafeArray<BYTE> data;
     3161        data.initFrom((BYTE *)&p3DNotify->au8Data[0], p3DNotify->cbData);
     3162
     3163        HRESULT hr = pFramebuffer->Notify3DEvent((ULONG)p3DNotify->enmNotification, ComSafeArrayAsInParam(data));
     3164        if (FAILED(hr))
     3165            rc = VERR_NOT_SUPPORTED;
     3166    }
     3167    else
     3168        rc = VERR_NOT_IMPLEMENTED;
     3169
     3170    return rc;
     3171}
     3172
     3173DECLCALLBACK(int) Display::i_display3DNotifyProcess(PPDMIDISPLAYCONNECTOR pInterface,
     3174                                                    VBOX3DNOTIFY *p3DNotify)
     3175{
     3176    PDRVMAINDISPLAY pDrv = PDMIDISPLAYCONNECTOR_2_MAINDISPLAY(pInterface);
     3177    return pDrv->pDisplay->i_handle3DNotifyProcess(p3DNotify);
     3178}
    31433179
    31443180HRESULT Display::notifyScaleFactorChange(ULONG aScreenId, ULONG aScaleFactorWMultiplied, ULONG aScaleFactorHMultiplied)
     
    37223758    pThis->IConnector.pfnVBVAReportCursorPosition = Display::i_displayVBVAReportCursorPosition;
    37233759#endif
     3760    pThis->IConnector.pfn3DNotifyProcess       = Display::i_display3DNotifyProcess;
    37243761
    37253762    /*
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