VirtualBox

Ignore:
Timestamp:
Jun 3, 2009 9:16:39 AM (16 years ago)
Author:
vboxsync
Message:

Main/Display: Fixes for multiple screens. Don't update the screen while at least one framebuffer is resized. Call pfnUpdateDisplay() only once.

File:
1 edited

Legend:

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

    r20021 r20224  
    571571    pFramebuffer->Lock();
    572572
    573     checkCoordBounds (&x, &y, &w, &h, mpDrv->Connector.cx, mpDrv->Connector.cy);
     573    if (uScreenId == VBOX_VIDEO_PRIMARY_SCREEN)
     574        checkCoordBounds (&x, &y, &w, &h, mpDrv->Connector.cx, mpDrv->Connector.cy);
     575    else
     576        checkCoordBounds (&x, &y, &w, &h, maFramebuffers[uScreenId].w,
     577                                          maFramebuffers[uScreenId].h);
    574578
    575579    if (w != 0 && h != 0)
     
    673677        //@todo pfnUpdateDisplayRect must take the vram offset parameter for the framebuffer
    674678        prgn->pPort->pfnUpdateDisplayRect (prgn->pPort, phdr->x, phdr->y, phdr->w, phdr->h);
    675         prgn->pDisplay->handleDisplayUpdate (phdr->x, phdr->y, phdr->w, phdr->h);
     679        prgn->pDisplay->handleDisplayUpdate (phdr->x + pFBInfo->xOrigin,
     680                                             phdr->y + pFBInfo->yOrigin, phdr->w, phdr->h);
    676681    }
    677682
     
    690695        //@todo pfnUpdateDisplayRect must take the vram offset parameter for the framebuffer
    691696        prgn->pPort->pfnUpdateDisplayRect (prgn->pPort, pFBInfo->dirtyRect.xLeft, pFBInfo->dirtyRect.yTop, w, h);
    692         prgn->pDisplay->handleDisplayUpdate (pFBInfo->dirtyRect.xLeft, pFBInfo->dirtyRect.yTop, w, h);
     697        prgn->pDisplay->handleDisplayUpdate (pFBInfo->dirtyRect.xLeft + pFBInfo->xOrigin,
     698                                             pFBInfo->dirtyRect.yTop + pFBInfo->yOrigin, w, h);
    693699    }
    694700}
     
    19481954
    19491955    Display *pDisplay = pDrv->pDisplay;
    1950 
     1956    bool fNoUpdate = false; /* Do not update the display if any of the framebuffers is being resized. */
    19511957    unsigned uScreenId;
     1958
    19521959    for (uScreenId = 0; uScreenId < pDisplay->mcMonitors; uScreenId++)
    19531960    {
     
    19621969        {
    19631970            LogFlowFunc (("ResizeStatus_UpdateDisplayData %d\n", uScreenId));
     1971            fNoUpdate = true; /* Always set it here, because pfnUpdateDisplayAll can cause a new resize. */
    19641972            /* The framebuffer was resized and display data need to be updated. */
    19651973            pDisplay->handleResizeCompletedEMT ();
     
    19761984                    pDrv->pUpPort->pfnUpdateDisplayAll(pDrv->pUpPort);
    19771985            }
    1978             /* Ignore the refresh for the screen to replay the logic. */
    1979             continue;
    19801986        }
    19811987        else if (u32ResizeStatus == ResizeStatus_InProgress)
     
    19831989            /* The framebuffer is being resized. Do not call the VGA device back. Immediately return. */
    19841990            LogFlowFunc (("ResizeStatus_InProcess\n"));
     1991            fNoUpdate = true;
    19851992            continue;
    19861993        }
    1987 
    1988         if (pFBInfo->pFramebuffer.isNull())
    1989         {
    1990             /*
    1991              *  Do nothing in the "black hole" mode to avoid copying guest
    1992              *  video memory to the frame buffer
     1994    }
     1995
     1996    if (!fNoUpdate)
     1997    {
     1998        if (pDisplay->mfPendingVideoAccelEnable)
     1999        {
     2000            /* Acceleration was enabled while machine was not yet running
     2001             * due to restoring from saved state. Update entire display and
     2002             * actually enable acceleration.
    19932003             */
     2004            Assert(pDisplay->mpPendingVbvaMemory);
     2005
     2006            /* Acceleration can not be yet enabled.*/
     2007            Assert(pDisplay->mpVbvaMemory == NULL);
     2008            Assert(!pDisplay->mfVideoAccelEnabled);
     2009
     2010            if (pDisplay->mfMachineRunning)
     2011            {
     2012                pDisplay->VideoAccelEnable (pDisplay->mfPendingVideoAccelEnable,
     2013                                            pDisplay->mpPendingVbvaMemory);
     2014
     2015                /* Reset the pending state. */
     2016                pDisplay->mfPendingVideoAccelEnable = false;
     2017                pDisplay->mpPendingVbvaMemory = NULL;
     2018            }
    19942019        }
    19952020        else
    19962021        {
    1997             if (pDisplay->mfPendingVideoAccelEnable)
     2022            Assert(pDisplay->mpPendingVbvaMemory == NULL);
     2023
     2024            if (pDisplay->mfVideoAccelEnabled)
    19982025            {
    1999                 /* Acceleration was enabled while machine was not yet running
    2000                  * due to restoring from saved state. Update entire display and
    2001                  * actually enable acceleration.
    2002                  */
    2003                 Assert(pDisplay->mpPendingVbvaMemory);
    2004 
    2005                 /* Acceleration can not be yet enabled.*/
    2006                 Assert(pDisplay->mpVbvaMemory == NULL);
    2007                 Assert(!pDisplay->mfVideoAccelEnabled);
    2008 
    2009                 if (pDisplay->mfMachineRunning)
    2010                 {
    2011                     pDisplay->VideoAccelEnable (pDisplay->mfPendingVideoAccelEnable,
    2012                                                 pDisplay->mpPendingVbvaMemory);
    2013 
    2014                     /* Reset the pending state. */
    2015                     pDisplay->mfPendingVideoAccelEnable = false;
    2016                     pDisplay->mpPendingVbvaMemory = NULL;
    2017                 }
     2026                Assert(pDisplay->mpVbvaMemory);
     2027                pDisplay->VideoAccelFlush ();
    20182028            }
    20192029            else
    20202030            {
    2021                 Assert(pDisplay->mpPendingVbvaMemory == NULL);
    2022 
    2023                 if (pDisplay->mfVideoAccelEnabled)
    2024                 {
    2025                     Assert(pDisplay->mpVbvaMemory);
    2026                     pDisplay->VideoAccelFlush ();
    2027                 }
    2028                 else
     2031                DISPLAYFBINFO *pFBInfo = &pDisplay->maFramebuffers[VBOX_VIDEO_PRIMARY_SCREEN];
     2032                if (!pFBInfo->pFramebuffer.isNull())
    20292033                {
    20302034                    Assert(pDrv->Connector.pu8Data);
     2035                    Assert(pFBInfo->u32ResizeStatus == ResizeStatus_Void);
    20312036                    pDrv->pUpPort->pfnUpdateDisplay(pDrv->pUpPort);
    20322037                }
    20332038            }
     2039
    20342040            /* Inform the VRDP server that the current display update sequence is
    20352041             * completed. At this moment the framebuffer memory contains a definite
     
    20382044             * fullscreen updates for new clients.
    20392045             */
    2040             if (pFBInfo->u32ResizeStatus == ResizeStatus_Void)
     2046            for (uScreenId = 0; uScreenId < pDisplay->mcMonitors; uScreenId++)
    20412047            {
    2042                 Assert (pDisplay->mParent && pDisplay->mParent->consoleVRDPServer());
    2043                 pDisplay->mParent->consoleVRDPServer()->SendUpdate (uScreenId, NULL, 0);
     2048                DISPLAYFBINFO *pFBInfo = &pDisplay->maFramebuffers[uScreenId];
     2049
     2050                if (!pFBInfo->pFramebuffer.isNull() && pFBInfo->u32ResizeStatus == ResizeStatus_Void)
     2051                {
     2052                    Assert (pDisplay->mParent && pDisplay->mParent->consoleVRDPServer());
     2053                    pDisplay->mParent->consoleVRDPServer()->SendUpdate (uScreenId, NULL, 0);
     2054                }
    20442055            }
    20452056        }
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