VirtualBox

Changeset 19817 in vbox


Ignore:
Timestamp:
May 19, 2009 12:16:28 PM (16 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
47467
Message:

IFramebuffer cleanup next part:

  • removed obsolete internal framebuffer
  • removed IFramebuffer::setupInternalFramebuffer(), IFramebuffer::lockFramebuffer(), IFramebuffer::unlockFramebuffer(), IFramebuffer::registerExternalFramebuffer()
  • removed unused finished parameter of IFramebuffer::NotifyUpdate()
Location:
trunk/src/VBox
Files:
2 deleted
25 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VBoxBFE/DisplayImpl.cpp

    r19300 r19817  
    9393    mcbVbvaPartial = 0;
    9494
    95     RTSemEventMultiCreate(&mUpdateSem);
    96 
    97     // reset the event sems
    98     RTSemEventMultiReset(mUpdateSem);
    99 
    10095    // by default, we have an internal Framebuffer which is
    10196    // NULL, i.e. a black hole for no display output
     97    mFramebuffer = NULL;
     98    mFramebufferOpened = false;
     99
     100    mu32ResizeStatus = ResizeStatus_Void;
     101}
     102
     103VMDisplay::~VMDisplay()
     104{
    102105    mFramebuffer = 0;
    103     mInternalFramebuffer = true;
    104     mFramebufferOpened = false;
    105 
    106     mu32ResizeStatus = ResizeStatus_Void;
    107 }
    108 
    109 VMDisplay::~VMDisplay()
    110 {
    111     mFramebuffer = 0;
    112     RTSemEventMultiDestroy(mUpdateSem);
    113106}
    114107
     
    201194
    202195    // this is only valid for external framebuffers
    203     if (mInternalFramebuffer)
     196    if (!mFramebuffer)
    204197        return E_FAIL;
    205198
     
    259252    }
    260253
    261     // special processing for the internal Framebuffer
    262     if (mInternalFramebuffer)
    263     {
    264         mFramebuffer->Unlock();
    265     }
    266     else
    267     {
    268         // callback into the Framebuffer to notify it
    269         BOOL finished;
    270 
    271         RTSemEventMultiReset(mUpdateSem);
    272 
    273         mFramebuffer->NotifyUpdate(x, y, w, h, &finished);
    274         mFramebuffer->Unlock();
    275 
    276         if (!finished)
    277         {
    278             // the Framebuffer needs more time to process
    279             // the event so we have to halt the VM until it's done
    280             RTSemEventMultiWait(mUpdateSem, RT_INDEFINITE_WAIT);
    281         }
    282     }
     254    mFramebuffer->NotifyUpdate(x, y, w, h);
     255    mFramebuffer->Unlock();
    283256}
    284257
     
    336309 * @param Framebuffer external Framebuffer object
    337310 */
    338 STDMETHODIMP VMDisplay::RegisterExternalFramebuffer(Framebuffer *Framebuffer)
     311STDMETHODIMP VMDisplay::SetFramebuffer(unsigned iScreenID, Framebuffer *Framebuffer)
    339312{
    340313    if (!Framebuffer)
     
    343316    // free current Framebuffer (if there is any)
    344317    mFramebuffer = 0;
    345     mInternalFramebuffer = false;
    346318    mFramebuffer = Framebuffer;
    347319    updateDisplayData();
  • trunk/src/VBox/Frontends/VBoxBFE/DisplayImpl.h

    r8155 r19817  
    5555    uint32_t getBitsPerPixel();
    5656
    57     STDMETHODIMP RegisterExternalFramebuffer(Framebuffer *Framebuffer);
     57    STDMETHODIMP SetFramebuffer(unsigned iScreenID, Framebuffer *Framebuffer);
    5858    STDMETHODIMP InvalidateAndUpdate();
    5959    STDMETHODIMP ResizeCompleted();
     
    8484
    8585    Framebuffer *mFramebuffer;
    86     bool mInternalFramebuffer, mFramebufferOpened;
     86    bool mFramebufferOpened;
    8787
    8888    ULONG mSupportedAccelOps;
    89     RTSEMEVENTMULTI mUpdateSem;
    9089
    9190    struct _VBVAMEMORY *mpVbvaMemory;
  • trunk/src/VBox/Frontends/VBoxBFE/Framebuffer.h

    r19798 r19817  
    4444    virtual HRESULT getBitsPerPixel(ULONG *bitsPerPixel) = 0;
    4545    virtual HRESULT getLineSize(ULONG *lineSize) = 0;
    46     virtual HRESULT NotifyUpdate(ULONG x, ULONG y,
    47                             ULONG w, ULONG h, BOOL *finished) = 0;
     46    virtual HRESULT NotifyUpdate(ULONG x, ULONG y, ULONG w, ULONG h) = 0;
    4847    virtual HRESULT RequestResize(ULONG w, ULONG h, BOOL *finished) = 0;
    4948
  • trunk/src/VBox/Frontends/VBoxBFE/SDLFramebuffer.cpp

    r19798 r19817  
    228228 */
    229229HRESULT SDLFramebuffer::NotifyUpdate(ULONG x, ULONG y,
    230                                      ULONG w, ULONG h, BOOL *finished)
     230                                     ULONG w, ULONG h)
    231231{
    232232    LogFlow(("SDLFramebuffer::NotifyUpdate: x = %d, y = %d, w = %d, h = %d\n",
     
    258258#endif /* !VBOXBFE_WITH_X11 */
    259259
    260     /*
    261      * The Display thread can continue as we will lock the framebuffer
    262      * from the SDL thread when we get to actually doing the update.
    263      */
    264     if (finished)
    265         *finished = TRUE;
    266260    return S_OK;
    267261}
  • trunk/src/VBox/Frontends/VBoxBFE/SDLFramebuffer.h

    r19798 r19817  
    5050    virtual HRESULT getBitsPerPixel(ULONG *bitsPerPixel);
    5151    virtual HRESULT getLineSize(ULONG *lineSize);
    52     virtual HRESULT NotifyUpdate(ULONG x, ULONG y,
    53                             ULONG w, ULONG h, BOOL *finished);
     52    virtual HRESULT NotifyUpdate(ULONG x, ULONG y, ULONG w, ULONG h);
    5453    virtual HRESULT RequestResize(ULONG w, ULONG h, BOOL *finished);
    5554    virtual HRESULT GetVisibleRegion(BYTE *aRectangles, ULONG aCount, ULONG *aCountCopied);
  • trunk/src/VBox/Frontends/VBoxBFE/VBoxBFE.cpp

    r19300 r19817  
    803803    if (!gConsole->initialized())
    804804        goto leave;
    805     gDisplay->RegisterExternalFramebuffer(gFramebuffer);
     805    gDisplay->SetFramebuffer(0, gFramebuffer);
    806806
    807807    /* start with something in the titlebar */
  • trunk/src/VBox/Frontends/VBoxFB/Framebuffer.cpp

    r8155 r19817  
    187187
    188188NS_IMETHODIMP VBoxDirectFB::NotifyUpdate(uint32_t x, uint32_t y,
    189                                          uint32_t w, uint32_t h, PRBool *finished)
     189                                         uint32_t w, uint32_t h)
    190190{
    191191    // we only need to take action if we have a memory framebuffer
     
    209209            DFBCHECK(surface->StretchBlit(surface, fbInternalSurface,
    210210                                          &blitRectangle, &hostRectangle));
    211         } else
     211        }
     212        else
    212213        {
    213214            DFBCHECK(surface->Blit(surface, fbInternalSurface, &blitRectangle,
     
    216217        }
    217218    }
    218     if (finished)
    219         *finished = true;
    220219    return NS_OK;
    221220}
  • trunk/src/VBox/Frontends/VBoxFB/Framebuffer.h

    r8155 r19817  
    4444    NS_IMETHOD GetUsesGuestVRAM(BOOL *usesGuestVRAM);
    4545    NS_IMETHOD NotifyUpdate(uint32_t x, uint32_t y,
    46                            uint32_t w, uint32_t h, PRBool *finished);
     46                            uint32_t w, uint32_t h);
    4747    NS_IMETHOD RequestResize(ULONG aScreenId, ULONG pixelFormat, uint32_t vram,
    4848                             uint32_t bitsPerPixel, uint32_t bytesPerLine,
  • trunk/src/VBox/Frontends/VBoxFB/VBoxFB.cpp

    r13835 r19817  
    342342    // register our framebuffer
    343343    frameBuffer = new VBoxDirectFB(dfb, surface);
    344     display->RegisterExternalFramebuffer(frameBuffer);
     344    display->SetFramebuffer(VBOX_VIDEO_PRIMARY_SCREEN, frameBuffer);
    345345
    346346    /**
  • trunk/src/VBox/Frontends/VBoxHeadless/VBoxHeadless.cpp

    r19239 r19817  
    4646#include <iprt/env.h>
    4747#include <VBox/err.h>
     48#include <VBox/VBoxVideo.h>
    4849
    4950#ifdef VBOX_FFMPEG
     
    744745                Log2(("VBoxHeadless: Registering framebuffer\n"));
    745746                pFramebuffer->AddRef();
    746                 display->RegisterExternalFramebuffer(pFramebuffer);
     747                display->SetFramebuffer(VBOX_VIDEO_PRIMARY_SCREEN, pFramebuffer);
    747748            }
    748749            if (!RT_SUCCESS(rrc) || (rcc != S_OK))
  • trunk/src/VBox/Frontends/VBoxHeadless/VideoCapture/FFmpegFB.cpp

    r19798 r19817  
    142142        {
    143143            /* Dummy update to make sure we get all the frame (timing). */
    144             BOOL dummy;
    145             NotifyUpdate(0, 0, 0, 0, &dummy);
     144            NotifyUpdate(0, 0, 0, 0);
    146145            /* Write the last pending frame before exiting */
    147146            int rc = do_rgb_to_yuv_conversion();
     
    431430 * @param w        width of the area which has been updated
    432431 * @param h        height of the area which has been updated
    433  * @param finished
    434  */
    435 STDMETHODIMP FFmpegFB::NotifyUpdate(ULONG x, ULONG y, ULONG w, ULONG h,
    436                                     BOOL *finished)
     432 */
     433STDMETHODIMP FFmpegFB::NotifyUpdate(ULONG x, ULONG y, ULONG w, ULONG h)
    437434{
    438435    int rc;
     
    442439              (unsigned long) x,  (unsigned long) y,  (unsigned long) w,
    443440               (unsigned long) h));
    444     if (!finished)
    445         return E_POINTER;
    446     /* For now we will do things synchronously */
    447     *finished = true;
     441
    448442    /* We always leave at least one frame update pending, which we
    449443       process when the time until the next frame has elapsed. */
  • trunk/src/VBox/Frontends/VBoxHeadless/VideoCapture/FFmpegFB.h

    r19798 r19817  
    100100    STDMETHOD(COMGETTER(WinId)) (ULONG64 *winId);
    101101
    102     STDMETHOD(NotifyUpdate)(ULONG x, ULONG y,
    103                             ULONG w, ULONG h, BOOL *finished);
     102    STDMETHOD(NotifyUpdate)(ULONG x, ULONG y, ULONG w, ULONG h);
    104103    STDMETHOD(RequestResize)(ULONG aScreenId, ULONG pixelFormat, BYTE *vram,
    105104                             ULONG bitsPerPixel, ULONG bytesPerLine,
  • trunk/src/VBox/Frontends/VBoxSDL/Framebuffer.cpp

    r19798 r19817  
    408408 */
    409409STDMETHODIMP VBoxSDLFB::NotifyUpdate(ULONG x, ULONG y,
    410                                      ULONG w, ULONG h, BOOL *finished)
     410                                     ULONG w, ULONG h)
    411411{
    412412    /*
     
    434434#endif /* !VBOXSDL_WITH_X11 */
    435435
    436     /*
    437      * The Display thread can continue as we will lock the framebuffer
    438      * from the SDL thread when we get to actually doing the update.
    439      */
    440     if (finished)
    441         *finished = TRUE;
    442436    return S_OK;
    443437}
     
    14541448 */
    14551449STDMETHODIMP VBoxSDLFBOverlay::NotifyUpdate(ULONG x, ULONG y,
    1456                             ULONG w, ULONG h, BOOL *finished)
    1457 {
    1458     return mParent->NotifyUpdate(x + mOverlayX, y + mOverlayY, w, h, finished);
     1450                            ULONG w, ULONG h)
     1451{
     1452    return mParent->NotifyUpdate(x + mOverlayX, y + mOverlayY, w, h);
    14591453}
    14601454
  • trunk/src/VBox/Frontends/VBoxSDL/Framebuffer.h

    r19798 r19817  
    101101    STDMETHOD(COMGETTER(WinId)) (uint64_t *winId);
    102102
    103     STDMETHOD(NotifyUpdate)(ULONG x, ULONG y,
    104                             ULONG w, ULONG h, BOOL *finished);
     103    STDMETHOD(NotifyUpdate)(ULONG x, ULONG y, ULONG w, ULONG h);
    105104    STDMETHOD(RequestResize)(ULONG aScreenId, ULONG pixelFormat, BYTE *vram,
    106105                             ULONG bitsPerPixel, ULONG bytesPerLine,
     
    268267    STDMETHOD(Unlock)();
    269268    STDMETHOD(Move)(ULONG x, ULONG y);
    270     STDMETHOD(NotifyUpdate)(ULONG x, ULONG y,
    271                             ULONG w, ULONG h, BOOL *finished);
     269    STDMETHOD(NotifyUpdate)(ULONG x, ULONG y, ULONG w, ULONG h);
    272270    STDMETHOD(RequestResize)(ULONG aScreenId, ULONG pixelFormat, ULONG vram,
    273271                             ULONG bitsPerPixel, ULONG bytesPerLine,
  • trunk/src/VBox/Frontends/VBoxSDL/VBoxSDL.cpp

    r19579 r19817  
    5959#include <VBox/log.h>
    6060#include <VBox/version.h>
     61#include <VBox/VBoxVideo.h>
    6162
    6263#include <iprt/alloca.h>
     
    20372038
    20382039    // register our framebuffer
    2039     rc = gDisplay->RegisterExternalFramebuffer(gpFrameBuffer);
     2040    rc = gDisplay->SetFramebuffer(VBOX_VIDEO_PRIMARY_SCREEN, gpFrameBuffer);
    20402041    if (rc != S_OK)
    20412042    {
     
    28852886    LogFlow(("Releasing mouse, keyboard, vrdpserver, display, console...\n"));
    28862887    if (gDisplay)
    2887         gDisplay->SetupInternalFramebuffer(0);
     2888        gDisplay->SetFramebuffer(VBOX_VIDEO_PRIMARY_SCREEN, NULL);
    28882889    gMouse = NULL;
    28892890    gKeyboard = NULL;
  • trunk/src/VBox/Frontends/VirtualBox/include/VBoxFrameBuffer.h

    r19798 r19817  
    273273
    274274    STDMETHOD(NotifyUpdate) (ULONG aX, ULONG aY,
    275                              ULONG aW, ULONG aH,
    276                              BOOL *aFinished);
     275                             ULONG aW, ULONG aH);
    277276
    278277    ulong pixelFormat() { return mPixelFormat; }
     
    308307
    309308    STDMETHOD(NotifyUpdate) (ULONG aX, ULONG aY,
    310                              ULONG aW, ULONG aH,
    311                              BOOL *aFinished);
     309                             ULONG aW, ULONG aH);
    312310
    313311    uchar *address()
     
    364362
    365363    STDMETHOD(NotifyUpdate) (ULONG aX, ULONG aY,
    366                              ULONG aW, ULONG aH,
    367                              BOOL *aFinished);
     364                             ULONG aW, ULONG aH);
    368365
    369366    uchar *address() { return (uchar *) mSurfaceDesc.lpSurface; }
     
    422419
    423420    STDMETHOD (NotifyUpdate) (ULONG aX, ULONG aY,
    424                               ULONG aW, ULONG aH,
    425                               BOOL *aFinished);
     421                              ULONG aW, ULONG aH);
    426422    STDMETHOD (SetVisibleRegion) (BYTE *aRectangles, ULONG aCount);
    427423
  • trunk/src/VBox/Frontends/VirtualBox/src/VBoxConsoleView.cpp

    r19684 r19817  
    2020 * additional information or have any questions.
    2121 */
     22
     23#include <VBox/VBoxVideo.h>
    2224
    2325#include "VBoxConsoleView.h"
     
    876878    {
    877879        mFrameBuf->AddRef();
    878         display.RegisterExternalFramebuffer (CFramebuffer (mFrameBuf));
     880        display.SetFramebuffer (VBOX_VIDEO_PRIMARY_SCREEN, CFramebuffer (mFrameBuf));
    879881    }
    880882
     
    950952        CDisplay display = mConsole.GetDisplay();
    951953        Assert (!display.isNull());
    952         display.SetupInternalFramebuffer (0);
     954        display.SetFramebuffer (VBOX_VIDEO_PRIMARY_SCREEN, CFramebuffer(NULL));
    953955        /* release the reference */
    954956        mFrameBuf->Release();
  • trunk/src/VBox/Frontends/VirtualBox/src/VBoxFBDDRAW.cpp

    r10149 r19817  
    229229/** @note This method is called on EMT from under this object's lock */
    230230STDMETHODIMP VBoxDDRAWFrameBuffer::NotifyUpdate (ULONG aX, ULONG aY,
    231                                                  ULONG aW, ULONG aH,
    232                                                  BOOL *aFinished)
     231                                                 ULONG aW, ULONG aH)
    233232{
    234233    LOGDDRAW(("DDRAW: NotifyUpdate %d,%d %dx%d\n", aX, aY, aW, aH));
     
    243242        drawRect (aX, aY, aW, aH);
    244243    }
    245 
    246     *aFinished = TRUE;
    247244
    248245    return S_OK;
  • trunk/src/VBox/Frontends/VirtualBox/src/VBoxFBQuartz2D.cpp

    r17201 r19817  
    6464/** @note This method is called on EMT from under this object's lock */
    6565STDMETHODIMP VBoxQuartz2DFrameBuffer::NotifyUpdate (ULONG aX, ULONG aY,
    66                                                  ULONG aW, ULONG aH,
    67                                                  BOOL *aFinished)
     66                                                 ULONG aW, ULONG aH)
    6867{
    6968/*    Log (("Quartz2D: NotifyUpdate %d,%d %dx%d\n", aX, aY, aW, aH));*/
     
    7170    QApplication::postEvent (mView,
    7271                             new VBoxRepaintEvent (aX, aY, aW, aH));
    73     /* the update has been finished, return TRUE */
    74     *aFinished = TRUE;
    75 
    7672    return S_OK;
    7773}
  • trunk/src/VBox/Frontends/VirtualBox/src/VBoxFrameBuffer.cpp

    r19798 r19817  
    282282/** @note This method is called on EMT from under this object's lock */
    283283STDMETHODIMP VBoxQImageFrameBuffer::NotifyUpdate (ULONG aX, ULONG aY,
    284                                                   ULONG aW, ULONG aH,
    285                                                   BOOL *aFinished)
     284                                                  ULONG aW, ULONG aH)
    286285{
    287286    /* We're not on the GUI thread and update() isn't thread safe in
     
    292291                             new VBoxRepaintEvent (aX, aY, aW, aH));
    293292
    294     /* The update has been finished, return TRUE */
    295     *aFinished = TRUE;
    296293    return S_OK;
    297294}
     
    465462/** @note This method is called on EMT from under this object's lock */
    466463STDMETHODIMP VBoxSDLFrameBuffer::NotifyUpdate (ULONG aX, ULONG aY,
    467                                                ULONG aW, ULONG aH,
    468                                                BOOL *aFinished)
     464                                               ULONG aW, ULONG aH)
    469465{
    470466#if !defined (Q_WS_WIN) && !defined (Q_WS_PM)
     
    480476                               aW, aH);
    481477#endif
    482     /* the update has been finished, return TRUE */
    483     *aFinished = TRUE;
    484478    return S_OK;
    485479}
  • trunk/src/VBox/Main/DisplayImpl.cpp

    r19798 r19817  
    2323
    2424#include "DisplayImpl.h"
    25 #include "FramebufferImpl.h"
    2625#include "ConsoleImpl.h"
    2726#include "ConsoleVRDPServer.h"
     
    8685    mpVMMDev = NULL;
    8786    mfVMMDevInited = false;
    88     RTSemEventMultiCreate(&mUpdateSem);
    8987
    9088    mLastAddress = NULL;
     
    124122    unconst (mParent) = aParent;
    125123
    126     /* reset the event sems */
    127     RTSemEventMultiReset (mUpdateSem);
    128 
    129124    // by default, we have an internal framebuffer which is
    130125    // NULL, i.e. a black hole for no display output
    131     mInternalFramebuffer = true;
    132126    mFramebufferOpened = false;
    133     mSupportedAccelOps = 0;
    134127
    135128    ULONG ul;
     
    185178    for (ul = 0; ul < mcMonitors; ul++)
    186179        maFramebuffers[ul].pFramebuffer = NULL;
    187 
    188     RTSemEventMultiDestroy (mUpdateSem);
    189180
    190181    if (mParent)
     
    507498    pFramebuffer->Lock();
    508499
    509     /* special processing for the internal framebuffer */
    510     if (mInternalFramebuffer)
    511     {
    512         pFramebuffer->Unlock();
    513     } else
    514     {
    515         /* callback into the framebuffer to notify it */
    516         BOOL finished = FALSE;
    517 
    518         RTSemEventMultiReset(mUpdateSem);
    519 
    520         checkCoordBounds (&x, &y, &w, &h, mpDrv->Connector.cx, mpDrv->Connector.cy);
    521 
    522         if (w == 0 || h == 0)
    523         {
    524             /* Nothing to be updated. */
    525             finished = TRUE;
    526         }
    527         else
    528         {
    529             pFramebuffer->NotifyUpdate(x, y, w, h, &finished);
    530         }
    531 
    532         if (!finished)
    533         {
    534             /*
    535              *  the framebuffer needs more time to process
    536              *  the event so we have to halt the VM until it's done
    537              */
    538             pFramebuffer->Unlock();
    539             RTSemEventMultiWait(mUpdateSem, RT_INDEFINITE_WAIT);
    540         } else
    541         {
    542             pFramebuffer->Unlock();
    543         }
    544 
    545         if (!mfVideoAccelEnabled)
    546         {
    547             /* When VBVA is enabled, the VRDP server is informed in the VideoAccelFlush.
    548              * Inform the server here only if VBVA is disabled.
    549              */
    550             if (maFramebuffers[uScreenId].u32ResizeStatus == ResizeStatus_Void)
    551             {
    552                 mParent->consoleVRDPServer()->SendUpdateBitmap(uScreenId, x, y, w, h);
    553             }
    554         }
    555     }
    556     return;
     500    checkCoordBounds (&x, &y, &w, &h, mpDrv->Connector.cx, mpDrv->Connector.cy);
     501
     502    if (w != 0 && h != 0)
     503        pFramebuffer->NotifyUpdate(x, y, w, h);
     504
     505    pFramebuffer->Unlock();
     506
     507    if (!mfVideoAccelEnabled)
     508    {
     509        /* When VBVA is enabled, the VRDP server is informed in the VideoAccelFlush.
     510         * Inform the server here only if VBVA is disabled.
     511         */
     512        if (maFramebuffers[uScreenId].u32ResizeStatus == ResizeStatus_Void)
     513            mParent->consoleVRDPServer()->SendUpdateBitmap(uScreenId, x, y, w, h);
     514    }
    557515}
    558516
     
    13441302/////////////////////////////////////////////////////////////////////////////
    13451303
    1346 STDMETHODIMP Display::SetupInternalFramebuffer (ULONG depth)
     1304STDMETHODIMP Display::SetFramebuffer (ULONG aScreenId,
     1305    IFramebuffer *aFramebuffer)
    13471306{
    13481307    LogFlowFunc (("\n"));
     1308
     1309    if (aFramebuffer != NULL)
     1310        CheckComArgOutPointerValid(aFramebuffer);
    13491311
    13501312    AutoCaller autoCaller (this);
     
    13531315    AutoWriteLock alock (this);
    13541316
    1355     /*
    1356      *  Create an internal framebuffer only if depth is not zero. Otherwise, we
    1357      *  reset back to the "black hole" state as it was at Display construction.
    1358      */
    1359     ComPtr <IFramebuffer> frameBuf;
    1360     if (depth)
    1361     {
    1362         ComObjPtr <InternalFramebuffer> internal;
    1363         internal.createObject();
    1364         internal->init (640, 480, depth);
    1365         frameBuf = internal; // query interface
    1366     }
    1367 
    13681317    Console::SafeVMPtrQuiet pVM (mParent);
    13691318    if (pVM.isOk())
    13701319    {
    1371         /* Must leave the lock here because the changeFramebuffer will also obtain it. */
     1320        /* Must leave the lock here because the changeFramebuffer will
     1321         * also obtain it. */
    13721322        alock.leave ();
    13731323
     
    13751325        PVMREQ pReq = NULL;
    13761326        int vrc = VMR3ReqCall (pVM, VMCPUID_ANY, &pReq, RT_INDEFINITE_WAIT,
    1377                                (PFNRT) changeFramebuffer, 4,
    1378                                this, static_cast <IFramebuffer *> (frameBuf),
    1379                                true /* aInternal */, VBOX_VIDEO_PRIMARY_SCREEN);
     1327            (PFNRT) changeFramebuffer, 3, this, aFramebuffer, aScreenId);
    13801328        if (RT_SUCCESS (vrc))
    13811329            vrc = pReq->iStatus;
     
    13891337    {
    13901338        /* No VM is created (VM is powered off), do a direct call */
    1391         int vrc = changeFramebuffer (this, frameBuf, true /* aInternal */, VBOX_VIDEO_PRIMARY_SCREEN);
    1392         ComAssertRCRet (vrc, E_FAIL);
    1393     }
    1394 
    1395     return S_OK;
    1396 }
    1397 
    1398 STDMETHODIMP Display::LockFramebuffer (BYTE **address)
    1399 {
    1400     CheckComArgOutPointerValid(address);
    1401 
    1402     AutoCaller autoCaller (this);
    1403     CheckComRCReturnRC (autoCaller.rc());
    1404 
    1405     AutoWriteLock alock (this);
    1406 
    1407     /* only allowed for internal framebuffers */
    1408     if (mInternalFramebuffer && !mFramebufferOpened
    1409         && !maFramebuffers[VBOX_VIDEO_PRIMARY_SCREEN].pFramebuffer.isNull())
    1410     {
    1411         CHECK_CONSOLE_DRV (mpDrv);
    1412 
    1413         maFramebuffers[VBOX_VIDEO_PRIMARY_SCREEN].pFramebuffer->Lock();
    1414         mFramebufferOpened = true;
    1415         *address = mpDrv->Connector.pu8Data;
    1416         return S_OK;
    1417     }
    1418 
    1419     return setError (VBOX_E_NOT_SUPPORTED,
    1420         tr ("Framebuffer locking is allowed only for the internal framebuffer"));
    1421 }
    1422 
    1423 STDMETHODIMP Display::UnlockFramebuffer()
    1424 {
    1425     AutoCaller autoCaller (this);
    1426     CheckComRCReturnRC (autoCaller.rc());
    1427 
    1428     AutoWriteLock alock (this);
    1429 
    1430     if (mFramebufferOpened)
    1431     {
    1432         CHECK_CONSOLE_DRV (mpDrv);
    1433 
    1434         maFramebuffers[VBOX_VIDEO_PRIMARY_SCREEN].pFramebuffer->Unlock();
    1435         mFramebufferOpened = false;
    1436         return S_OK;
    1437     }
    1438 
    1439     return setError (VBOX_E_NOT_SUPPORTED,
    1440         tr ("Framebuffer locking is allowed only for the internal framebuffer"));
    1441 }
    1442 
    1443 STDMETHODIMP Display::RegisterExternalFramebuffer (IFramebuffer *frameBuf)
    1444 {
    1445     LogFlowFunc (("\n"));
    1446 
    1447     CheckComArgNotNull(frameBuf);
    1448 
    1449     AutoCaller autoCaller (this);
    1450     CheckComRCReturnRC (autoCaller.rc());
    1451 
    1452     AutoWriteLock alock (this);
    1453 
    1454     Console::SafeVMPtrQuiet pVM (mParent);
    1455     if (pVM.isOk())
    1456     {
    1457         /* Must leave the lock here because the changeFramebuffer will
    1458          * also obtain it. */
    1459         alock.leave ();
    1460 
    1461         /* send request to the EMT thread */
    1462         PVMREQ pReq = NULL;
    1463         int vrc = VMR3ReqCall (pVM, VMCPUID_ANY, &pReq, RT_INDEFINITE_WAIT,
    1464             (PFNRT) changeFramebuffer, 4, this, frameBuf, false /* aInternal */,
    1465             VBOX_VIDEO_PRIMARY_SCREEN);
    1466         if (RT_SUCCESS (vrc))
    1467             vrc = pReq->iStatus;
    1468         VMR3ReqFree (pReq);
    1469 
    1470         alock.enter ();
    1471 
    1472         ComAssertRCRet (vrc, E_FAIL);
    1473     }
    1474     else
    1475     {
    1476         /* No VM is created (VM is powered off), do a direct call */
    1477         int vrc = changeFramebuffer (this, frameBuf, false /* aInternal */,
    1478             VBOX_VIDEO_PRIMARY_SCREEN);
    1479         ComAssertRCRet (vrc, E_FAIL);
    1480     }
    1481 
    1482     return S_OK;
    1483 }
    1484 
    1485 STDMETHODIMP Display::SetFramebuffer (ULONG aScreenId,
    1486     IFramebuffer *aFramebuffer)
    1487 {
    1488     LogFlowFunc (("\n"));
    1489 
    1490     CheckComArgOutPointerValid(aFramebuffer);
    1491 
    1492     AutoCaller autoCaller (this);
    1493     CheckComRCReturnRC (autoCaller.rc());
    1494 
    1495     AutoWriteLock alock (this);
    1496 
    1497     Console::SafeVMPtrQuiet pVM (mParent);
    1498     if (pVM.isOk())
    1499     {
    1500         /* Must leave the lock here because the changeFramebuffer will
    1501          * also obtain it. */
    1502         alock.leave ();
    1503 
    1504         /* send request to the EMT thread */
    1505         PVMREQ pReq = NULL;
    1506         int vrc = VMR3ReqCall (pVM, VMCPUID_ANY, &pReq, RT_INDEFINITE_WAIT,
    1507             (PFNRT) changeFramebuffer, 4, this, aFramebuffer, false /* aInternal */,
    1508             aScreenId);
    1509         if (RT_SUCCESS (vrc))
    1510             vrc = pReq->iStatus;
    1511         VMR3ReqFree (pReq);
    1512 
    1513         alock.enter ();
    1514 
    1515         ComAssertRCRet (vrc, E_FAIL);
    1516     }
    1517     else
    1518     {
    1519         /* No VM is created (VM is powered off), do a direct call */
    1520         int vrc = changeFramebuffer (this, aFramebuffer, false /* aInternal */,
    1521             aScreenId);
     1339        int vrc = changeFramebuffer (this, aFramebuffer, aScreenId);
    15221340        ComAssertRCRet (vrc, E_FAIL);
    15231341    }
     
    18231641
    18241642    /* this is only valid for external framebuffers */
    1825     if (mInternalFramebuffer)
     1643    if (maFramebuffers[aScreenId].pFramebuffer == NULL)
    18261644        return setError (VBOX_E_NOT_SUPPORTED,
    18271645            tr ("Resize completed notification is valid only "
     
    18591677
    18601678    /* this is only valid for external framebuffers */
    1861     if (mInternalFramebuffer)
     1679    if (maFramebuffers[VBOX_VIDEO_PRIMARY_SCREEN].pFramebuffer == NULL)
    18621680        return setError (VBOX_E_NOT_SUPPORTED,
    18631681            tr ("Resize completed notification is valid only "
    18641682                "for external framebuffers"));
    1865 
    1866     maFramebuffers[VBOX_VIDEO_PRIMARY_SCREEN].pFramebuffer->Lock();
    1867     /* signal our semaphore */
    1868     RTSemEventMultiSignal(mUpdateSem);
    1869     maFramebuffers[VBOX_VIDEO_PRIMARY_SCREEN].pFramebuffer->Unlock();
    18701683
    18711684    return S_OK;
     
    19721785/* static */
    19731786DECLCALLBACK(int) Display::changeFramebuffer (Display *that, IFramebuffer *aFB,
    1974                                               bool aInternal, unsigned uScreenId)
     1787                                              unsigned uScreenId)
    19751788{
    19761789    LogFlowFunc (("uScreenId = %d\n", uScreenId));
    19771790
    19781791    AssertReturn (that, VERR_INVALID_PARAMETER);
    1979     AssertReturn (aFB || aInternal, VERR_INVALID_PARAMETER);
    19801792    AssertReturn (uScreenId < that->mcMonitors, VERR_INVALID_PARAMETER);
    19811793
     
    19871799    DISPLAYFBINFO *pDisplayFBInfo = &that->maFramebuffers[uScreenId];
    19881800    pDisplayFBInfo->pFramebuffer = aFB;
    1989 
    1990     that->mInternalFramebuffer = aInternal;
    1991     that->mSupportedAccelOps = 0;
    19921801
    19931802    that->mParent->consoleVRDPServer()->SendResize ();
  • trunk/src/VBox/Main/Makefile.kmk

    r19134 r19817  
    570570        MouseImpl.cpp \
    571571        DisplayImpl.cpp \
    572         FramebufferImpl.cpp \
    573572        MachineDebuggerImpl.cpp \
    574573        VBoxDriversRegister.cpp \
  • trunk/src/VBox/Main/idl/VirtualBox.xidl

    r19798 r19817  
    1027610276  <interface
    1027710277     name="IFramebuffer" extends="$unknown"
    10278      uuid="3ce29e6d-835a-4283-8ee0-eb9971b81d81"
     10278     uuid="faaf4c24-d534-4171-8781-c15d2b9fe8c3"
    1027910279     wsmap="suppress"
    1028010280     >
     
    1038510385      <param name="width" type="unsigned long" dir="in"/>
    1038610386      <param name="height" type="unsigned long" dir="in"/>
    10387       <param name="finished" type="boolean" dir="return"/>
    1038810387    </method>
    1038910388
     
    1066310662      </desc>
    1066410663    </attribute>
    10665 
    10666     <method name="setupInternalFramebuffer">
    10667       <desc>
    10668         Prepares an internally managed frame buffer.
    10669       </desc>
    10670       <param name="depth" type="unsigned long" dir="in"/>
    10671     </method>
    10672 
    10673     <method name="lockFramebuffer">
    10674       <desc>
    10675         Requests access to the internal frame buffer.
    10676 
    10677         <result name="VBOX_E_NOT_SUPPORTED">
    10678           Attempt to lock a non-internal frame buffer.
    10679         </result>
    10680 
    10681       </desc>
    10682       <param name="address" type="octet" mod="ptr" dir="return"/>
    10683     </method>
    10684 
    10685     <method name="unlockFramebuffer">
    10686       <desc>
    10687         Releases access to the internal frame buffer.
    10688 
    10689         <result name="VBOX_E_NOT_SUPPORTED">
    10690           Attempt to unlock a non-internal frame buffer.
    10691         </result>
    10692 
    10693       </desc>
    10694     </method>
    10695 
    10696     <method name="registerExternalFramebuffer">
    10697       <desc>
    10698         Registers an external frame buffer.
    10699       </desc>
    10700       <param name="framebuffer" type="IFramebuffer" dir="in"/>
    10701     </method>
    1070210664
    1070310665    <method name="setFramebuffer">
  • trunk/src/VBox/Main/include/DisplayImpl.h

    r19239 r19817  
    232232
    233233    // IDisplay methods
    234     STDMETHOD(SetupInternalFramebuffer)(ULONG depth);
    235     STDMETHOD(LockFramebuffer)(BYTE **address);
    236     STDMETHOD(UnlockFramebuffer)();
    237     STDMETHOD(RegisterExternalFramebuffer)(IFramebuffer *frameBuf);
    238234    STDMETHOD(SetFramebuffer)(ULONG aScreenId, IFramebuffer *aFramebuffer);
    239235    STDMETHOD(GetFramebuffer)(ULONG aScreenId, IFramebuffer **aFramebuffer, LONG *aXOrigin, LONG *aYOrigin);
     
    256252
    257253    static DECLCALLBACK(int) changeFramebuffer (Display *that, IFramebuffer *aFB,
    258                                                 bool aInternal, unsigned uScreenId);
     254                                                unsigned uScreenId);
    259255
    260256    static DECLCALLBACK(void*) drvQueryInterface(PPDMIBASE pInterface, PDMINTERFACE enmInterface);
     
    277273    /** Set after the first attempt to find the VMM Device. */
    278274    bool                    mfVMMDevInited;
    279     bool mInternalFramebuffer;
    280275
    281276    unsigned mcMonitors;
     
    283278
    284279    bool mFramebufferOpened;
    285     /** bitmask of acceleration operations supported by current framebuffer */
    286     ULONG mSupportedAccelOps;
    287     RTSEMEVENTMULTI mUpdateSem;
    288280
    289281    /* arguments of the last handleDisplayResize() call */
  • trunk/src/VBox/Main/xpcom/module.cpp

    r17684 r19817  
    4141#include "RemoteUSBDeviceImpl.h"
    4242#include "SharedFolderImpl.h"
    43 #include "FramebufferImpl.h"
    4443#include "ProgressImpl.h"
    4544#include "NetworkAdapterImpl.h"
     
    6362NS_DECL_CLASSINFO(MachineDebugger)
    6463NS_IMPL_THREADSAFE_ISUPPORTS1_CI(MachineDebugger, IMachineDebugger)
    65 NS_DECL_CLASSINFO(InternalFramebuffer)
    66 NS_IMPL_THREADSAFE_ISUPPORTS1_CI(InternalFramebuffer, IFramebuffer)
    6764NS_DECL_CLASSINFO(Progress)
    6865NS_IMPL_THREADSAFE_ISUPPORTS1_CI(Progress, IProgress)
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