VirtualBox

Changeset 24890 in vbox for trunk/src


Ignore:
Timestamp:
Nov 24, 2009 11:28:44 AM (15 years ago)
Author:
vboxsync
Message:

DisplayImpl: VBVA lock (incomplete, xTracker 4463).

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

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Main/DisplayImpl.cpp

    r24539 r24890  
    103103    mLastHeight = 0;
    104104
     105#ifdef VBOX_WITH_OLD_VBVA_LOCK
     106    int rc = RTCritSectInit (&mVBVALock);
     107    AssertRC (rc);
     108#endif /* VBOX_WITH_OLD_VBVA_LOCK */
     109
    105110    return S_OK;
    106111}
     
    109114{
    110115    uninit();
     116
     117#ifdef VBOX_WITH_OLD_VBVA_LOCK
     118    if (RTCritSectIsInitialized (&mVBVALock))
     119    {
     120        RTCritSectDelete (&mVBVALock);
     121        memset (&mVBVALock, 0, sizeof (mVBVALock));
     122    }
     123#endif /* VBOX_WITH_OLD_VBVA_LOCK */
    111124}
    112125
     
    965978 *  @thread EMT
    966979 */
     980#ifdef VBOX_WITH_OLD_VBVA_LOCK
     981/*
     982 * Always runs under VBVA or DevVGA lock.
     983 * Safe to use VBVA vars and take the framebuffer lock.
     984 */
     985#endif /* VBOX_WITH_OLD_VBVA_LOCK */
    967986void Display::handleDisplayUpdate (int x, int y, int w, int h)
    968987{
     
    11651184 * @thread EMT
    11661185 */
     1186#ifdef VBOX_WITH_OLD_VBVA_LOCK
    11671187int Display::VideoAccelEnable (bool fEnable, VBVAMEMORY *pVbvaMemory)
     1188{
     1189    int rc;
     1190    RTCritSectEnter(&mVBVALock);
     1191    rc = videoAccelEnable (fEnable, pVbvaMemory);
     1192    RTCritSectLeave(&mVBVALock);
     1193    return rc;
     1194}
     1195#endif /* VBOX_WITH_OLD_VBVA_LOCK */
     1196
     1197#ifdef VBOX_WITH_OLD_VBVA_LOCK
     1198int Display::videoAccelEnable (bool fEnable, VBVAMEMORY *pVbvaMemory)
     1199#else
     1200int Display::VideoAccelEnable (bool fEnable, VBVAMEMORY *pVbvaMemory)
     1201#endif /* !VBOX_WITH_OLD_VBVA_LOCK */
    11681202{
    11691203    int rc = VINF_SUCCESS;
     
    12181252    {
    12191253        /* Process any pending orders and empty the VBVA ring buffer. */
     1254#ifdef VBOX_WITH_OLD_VBVA_LOCK
     1255        videoAccelFlush ();
     1256#else
    12201257        VideoAccelFlush ();
     1258#endif /* !VBOX_WITH_OLD_VBVA_LOCK */
    12211259    }
    12221260
     
    15951633 * @thread EMT
    15961634 */
     1635#ifdef VBOX_WITH_OLD_VBVA_LOCK
    15971636void Display::VideoAccelFlush (void)
     1637{
     1638    RTCritSectEnter(&mVBVALock);
     1639    videoAccelFlush();
     1640    RTCritSectLeave(&mVBVALock);
     1641}
     1642#endif /* VBOX_WITH_OLD_VBVA_LOCK */
     1643
     1644#ifdef VBOX_WITH_OLD_VBVA_LOCK
     1645/* Under VBVA lock. DevVGA is not taken. */
     1646void Display::videoAccelFlush (void)
     1647#else
     1648void Display::VideoAccelFlush (void)
     1649#endif /* !VBOX_WITH_OLD_VBVA_LOCK */
    15981650{
    15991651#ifdef DEBUG_sunlover_2
     
    16231675    /* Process the ring buffer */
    16241676    unsigned uScreenId;
     1677#ifndef VBOX_WITH_OLD_VBVA_LOCK
    16251678    for (uScreenId = 0; uScreenId < mcMonitors; uScreenId++)
    16261679    {
     
    16301683        }
    16311684    }
     1685#endif /* !VBOX_WITH_OLD_VBVA_LOCK */
    16321686
    16331687    /* Initialize dirty rectangles accumulator. */
     
    16471701
    16481702            /* Disable VBVA on those processing errors. */
     1703#ifdef VBOX_WITH_OLD_VBVA_LOCK
     1704            videoAccelEnable (false, NULL);
     1705#else
    16491706            VideoAccelEnable (false, NULL);
     1707#endif /* !VBOX_WITH_OLD_VBVA_LOCK */
    16501708
    16511709            break;
     
    17101768    for (uScreenId = 0; uScreenId < mcMonitors; uScreenId++)
    17111769    {
     1770#ifndef VBOX_WITH_OLD_VBVA_LOCK
    17121771        if (!maFramebuffers[uScreenId].pFramebuffer.isNull())
    17131772        {
    17141773            maFramebuffers[uScreenId].pFramebuffer->Unlock ();
    17151774        }
     1775#endif /* !VBOX_WITH_OLD_VBVA_LOCK */
    17161776
    17171777        if (maFramebuffers[uScreenId].u32ResizeStatus == ResizeStatus_Void)
     
    25992659
    26002660    /* Disable VBVA mode in any case. The guest driver reenables VBVA mode if necessary. */
     2661#ifdef VBOX_WITH_OLD_VBVA_LOCK
     2662    /* This is called under DevVGA lock. Postpone disabling VBVA. */
     2663    /* @todo vbva */
     2664#else
    26012665    pDrv->pDisplay->VideoAccelEnable (false, NULL);
     2666#endif /* !VBOX_WITH_OLD_VBVA_LOCK */
    26022667}
    26032668
  • trunk/src/VBox/Main/Makefile.kmk

    r24694 r24890  
    552552        $(if $(VBOX_WITH_EHCI),VBOX_WITH_EHCI,)
    553553endif
     554ifdef VBOX_WITH_OLD_VBVA_LOCK
     555VBoxC_DEFS += VBOX_WITH_OLD_VBVA_LOCK
     556endif
    554557ifdef VBOX_WITH_HGSMI
    555558VBoxC_DEFS += VBOX_WITH_HGSMI
  • trunk/src/VBox/Main/include/DisplayImpl.h

    r24457 r24890  
    339339
    340340    void handleResizeCompletedEMT (void);
     341
     342#ifdef VBOX_WITH_OLD_VBVA_LOCK
     343    RTCRITSECT mVBVALock;
     344
     345    /* Functions run under VBVA lock. */
     346    int videoAccelEnable (bool fEnable, VBVAMEMORY *pVbvaMemory);
     347    void videoAccelFlush (void);
     348#endif /* VBOX_WITH_OLD_VBVA_LOCK */
    341349};
    342350
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