VirtualBox

Changeset 16185 in vbox for trunk


Ignore:
Timestamp:
Jan 22, 2009 5:34:15 PM (16 years ago)
Author:
vboxsync
Message:

handleDisplayResize postpones the resize if framebuffer is being resized (fixed xTracker #3489).

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

Legend:

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

    r16181 r16185  
    158158
    159159        memset (&maFramebuffers[ul].dirtyRect, 0 , sizeof (maFramebuffers[ul].dirtyRect));
     160        memset (&maFramebuffers[ul].pendingResize, 0 , sizeof (maFramebuffers[ul].pendingResize));
    160161    }
    161162
     
    295296    bool f = ASMAtomicCmpXchgU32 (&maFramebuffers[uScreenId].u32ResizeStatus,
    296297                                  ResizeStatus_InProgress, ResizeStatus_Void);
    297     AssertReleaseMsg(f, ("s = %d, id = %d, f = %d\n", maFramebuffers[uScreenId].u32ResizeStatus, uScreenId, f));NOREF(f);
     298    if (!f)
     299    {
     300        /* This could be a result of the screenshot taking call Display::TakeScreenShot:
     301         * if the framebuffer is processing the resize request and GUI calls the TakeScreenShot
     302         * and the guest has reprogrammed the virtual VGA devices again so a new resize is required.
     303         *
     304         * Save the resize information and return.
     305         *
     306         * Note: the resize information is only accessed on EMT so no serialization is required.
     307         */
     308        LogRel (("Display::handleDisplayResize(): Warning: resize postponed.\n"));
     309
     310        maFramebuffers[uScreenId].pendingResize.fPending    = true;
     311        maFramebuffers[uScreenId].pendingResize.pixelFormat = pixelFormat;
     312        maFramebuffers[uScreenId].pendingResize.pvVRAM      = pvVRAM;
     313        maFramebuffers[uScreenId].pendingResize.bpp         = bpp;
     314        maFramebuffers[uScreenId].pendingResize.cbLine      = cbLine;
     315        maFramebuffers[uScreenId].pendingResize.w           = w;
     316        maFramebuffers[uScreenId].pendingResize.h           = h;
     317       
     318        return VINF_SUCCESS;
     319    }
    298320
    299321    /* The framebuffer is locked in the state.
     
    319341    AssertRelease(f);NOREF(f);
    320342
     343    AssertRelease(!maFramebuffers[uScreenId].pendingResize.fPending);
     344
    321345    /* The method also unlocks the framebuffer. */
    322346    handleResizeCompletedEMT();
     
    346370        {
    347371            /* This is not the display that has completed resizing. */
     372            continue;
     373        }
     374
     375        /* Check whether a resize is pending for this framebuffer. */
     376        if (pFBInfo->pendingResize.fPending)
     377        {
     378            /* Reset the condition, call the display resize with saved data and continue.
     379             *
     380             * Note: handleDisplayResize can call handleResizeCompletedEMT back,
     381             *       but infinite recursion is not possible, because when the handleResizeCompletedEMT
     382             *       is called, the pFBInfo->pendingResize.fPending is equal to false.
     383             */
     384            pFBInfo->pendingResize.fPending = false;
     385            handleDisplayResize (uScreenId, pFBInfo->pendingResize.bpp, pFBInfo->pendingResize.pvVRAM,
     386                                 pFBInfo->pendingResize.cbLine, pFBInfo->pendingResize.w, pFBInfo->pendingResize.h);
    348387            continue;
    349388        }
  • trunk/src/VBox/Main/include/DisplayImpl.h

    r15051 r16185  
    7070    } dirtyRect;
    7171
     72    struct {
     73        bool fPending;
     74        ULONG pixelFormat;
     75        void *pvVRAM;
     76        uint32_t bpp;
     77        uint32_t cbLine;
     78        int w;
     79        int h;
     80    } pendingResize;
     81
    7282} DISPLAYFBINFO;
    7383
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