VirtualBox

Changeset 77370 in vbox for trunk/src/VBox/Main


Ignore:
Timestamp:
Feb 20, 2019 8:04:38 AM (6 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
128917
Message:

Device/Graphics, pdm, Main, Front-ends: infrastructure for host software cursor.
bugref:9376: Complete hardware cursor implementation in VMSVGA.
This change provides the infrastructure for letting front-ends report to the
graphics device that they are able to render a pointer cursor at any location,
not just where the host cursor is, and for the device to ask them to do this.
It also provides mediation in Main/Display between multiple front-ends and the
device, and tells the guest that we can always render the cursor. In a
follow-up change the device is expected to add support for rendering the
cursor itself into the frame-buffer image it provides to the front-end if not
all attached front-ends are capable of rendering it.

Location:
trunk/src/VBox/Main
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Main/idl/VirtualBox.xidl

    r77065 r77370  
    1788217882      </desc>
    1788317883    </const>
     17884
     17885    <const name="RenderCursor" value="0x08">
     17886      <desc>
     17887        This framebuffer implementation can render a pointer cursor itself.  Unless the
     17888        MoveCursor capability is also set the cursor will always be rendered at the
     17889        location of (and usually using) the host pointer.
     17890      </desc>
     17891    </const>
     17892
     17893    <const name="MoveCursor" value="0x10">
     17894      <desc>
     17895        Supports rendering a pointer cursor anywhere within the guest screen.  Implies
     17896        RenderCursor.
     17897      </desc>
     17898    </const>
    1788417899  </enum>
    1788517900
     
    2544725462
    2544825463    <attribute name="hasData" readonly="yes" type="boolean">
    25449       <desc>Event contains valid data (alternative: notification of support)</desc>
     25464      <desc>Event contains valid data.  If not set, switch back to using the host cursor.</desc>
    2545025465    </attribute>
    2545125466    <attribute name="x" readonly="yes" type="unsigned long">
  • trunk/src/VBox/Main/include/DisplayImpl.h

    r77130 r77370  
    193193    int  i_handleQueryVisibleRegion(uint32_t *pcRects, PRTRECT paRects);
    194194
    195     void i_VideoAccelVRDP(bool fEnable);
     195    void i_VRDPConnectionEvent(bool fConnect);
     196    void i_VideoAccelVRDP(bool fEnable, int c);
    196197
    197198    /* Legacy video acceleration requests coming from the VGA refresh timer. */
     
    201202    int  VideoAccelEnableVMMDev(bool fEnable, VBVAMEMORY *pVbvaMemory);
    202203    void VideoAccelFlushVMMDev(void);
     204
     205    void i_UpdateDeviceCursorCapabilities(void);
    203206
    204207#ifdef VBOX_WITH_RECORDING
     
    433436    bool        mfVideoAccelVRDP;
    434437    uint32_t    mfu32SupportedOrders;
    435     int32_t volatile mcVideoAccelVRDPRefs;
     438    /** Number of currently connected VRDP clients. */
     439    int32_t volatile mcVRDPRefs;
    436440
    437441    /** Accelerate3DEnabled = true && GraphicsControllerType == VBoxVGA. */
  • trunk/src/VBox/Main/src-client/ConsoleImpl.cpp

    r77100 r77370  
    14051405
    14061406    NOREF(u32ClientId);
    1407     mDisplay->i_VideoAccelVRDP(true);
     1407    mDisplay->i_VRDPConnectionEvent(true);
    14081408
    14091409#ifdef VBOX_WITH_GUEST_PROPS
     
    14391439    }
    14401440
    1441     mDisplay->i_VideoAccelVRDP(false);
     1441    mDisplay->i_VRDPConnectionEvent(false);
    14421442
    14431443    if (fu32Intercepted & VRDE_CLIENT_INTERCEPT_USB)
  • trunk/src/VBox/Main/src-client/DisplayImpl.cpp

    r77152 r77370  
    125125    mfVideoAccelVRDP = false;
    126126    mfu32SupportedOrders = 0;
    127     mcVideoAccelVRDPRefs = 0;
     127    mcVRDPRefs = 0;
    128128
    129129    mfSeamlessEnabled = false;
     
    13511351}
    13521352
     1353/** Updates the device's view of the host cursor handling capabilities.
     1354 *  Calls into mpDrv->pUpPort. */
     1355void Display::i_UpdateDeviceCursorCapabilities(void)
     1356{
     1357    bool fRenderCursor = true;
     1358    bool fMoveCursor = mcVRDPRefs == 0;
     1359#ifdef VBOX_WITH_RECORDING
     1360    RecordingContext *pCtx = mParent->i_recordingGetContext();
     1361
     1362    if (   pCtx
     1363        && pCtx->IsStarted()
     1364        && pCtx->IsFeatureEnabled(RecordingFeature_Video))
     1365        fRenderCursor = fMoveCursor = false;
     1366    else
     1367#endif /* VBOX_WITH_RECORDING */
     1368    {
     1369        for (unsigned uScreenId = 0; uScreenId < mcMonitors; uScreenId++)
     1370        {
     1371            DISPLAYFBINFO *pFBInfo = &maFramebuffers[uScreenId];
     1372            if (!(pFBInfo->u32Caps & FramebufferCapabilities_RenderCursor))
     1373                fRenderCursor = false;
     1374            if (!(pFBInfo->u32Caps & FramebufferCapabilities_MoveCursor))
     1375                fMoveCursor = false;
     1376        }
     1377    }
     1378    mpDrv->pUpPort->pfnReportHostCursorCapabilities(mpDrv->pUpPort, fRenderCursor, fMoveCursor);
     1379}
     1380
    13531381HRESULT Display::i_reportHostCursorCapabilities(uint32_t fCapabilitiesAdded, uint32_t fCapabilitiesRemoved)
    13541382{
     
    13661394    CHECK_CONSOLE_DRV(mpDrv);
    13671395    alock.release();  /* Release before calling up for lock order reasons. */
    1368     mpDrv->pUpPort->pfnReportHostCursorCapabilities(mpDrv->pUpPort, fCapabilitiesAdded, fCapabilitiesRemoved);
    13691396    mfHostCursorCapabilities = fHostCursorCapabilities;
     1397    i_UpdateDeviceCursorCapabilities();
    13701398    return S_OK;
    13711399}
     
    16251653/* Called always by one VRDP server thread. Can be thread-unsafe.
    16261654 */
    1627 void Display::i_VideoAccelVRDP(bool fEnable)
    1628 {
    1629     LogRelFlowFunc(("fEnable = %d\n", fEnable));
    1630 
     1655void Display::i_VRDPConnectionEvent(bool fConnect)
     1656{
     1657    LogRelFlowFunc(("fConnect = %d\n", fConnect));
     1658
     1659    int c = fConnect?
     1660                ASMAtomicIncS32(&mcVRDPRefs):
     1661                ASMAtomicDecS32(&mcVRDPRefs);
     1662
     1663    i_VideoAccelVRDP(fConnect, c);
     1664    i_UpdateDeviceCursorCapabilities();
     1665}
     1666
     1667
     1668void Display::i_VideoAccelVRDP(bool fEnable, int c)
     1669{
    16311670    VIDEOACCEL *pVideoAccel = &mVideoAccelLegacy;
    1632 
    1633     int c = fEnable?
    1634                 ASMAtomicIncS32(&mcVideoAccelVRDPRefs):
    1635                 ASMAtomicDecS32(&mcVideoAccelVRDPRefs);
    16361671
    16371672    Assert (c >= 0);
     
    24412476    RecordingContext *pCtx = mParent->i_recordingGetContext();
    24422477
     2478    i_UpdateDeviceCursorCapabilities();
    24432479    if (   RT_LIKELY(!maRecordingEnabled[uScreenId])
    24442480        || !pCtx || !pCtx->IsStarted())
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