Changeset 20224 in vbox for trunk/src/VBox/Main/DisplayImpl.cpp
- Timestamp:
- Jun 3, 2009 9:16:39 AM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/DisplayImpl.cpp
r20021 r20224 571 571 pFramebuffer->Lock(); 572 572 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); 574 578 575 579 if (w != 0 && h != 0) … … 673 677 //@todo pfnUpdateDisplayRect must take the vram offset parameter for the framebuffer 674 678 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); 676 681 } 677 682 … … 690 695 //@todo pfnUpdateDisplayRect must take the vram offset parameter for the framebuffer 691 696 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); 693 699 } 694 700 } … … 1948 1954 1949 1955 Display *pDisplay = pDrv->pDisplay; 1950 1956 bool fNoUpdate = false; /* Do not update the display if any of the framebuffers is being resized. */ 1951 1957 unsigned uScreenId; 1958 1952 1959 for (uScreenId = 0; uScreenId < pDisplay->mcMonitors; uScreenId++) 1953 1960 { … … 1962 1969 { 1963 1970 LogFlowFunc (("ResizeStatus_UpdateDisplayData %d\n", uScreenId)); 1971 fNoUpdate = true; /* Always set it here, because pfnUpdateDisplayAll can cause a new resize. */ 1964 1972 /* The framebuffer was resized and display data need to be updated. */ 1965 1973 pDisplay->handleResizeCompletedEMT (); … … 1976 1984 pDrv->pUpPort->pfnUpdateDisplayAll(pDrv->pUpPort); 1977 1985 } 1978 /* Ignore the refresh for the screen to replay the logic. */1979 continue;1980 1986 } 1981 1987 else if (u32ResizeStatus == ResizeStatus_InProgress) … … 1983 1989 /* The framebuffer is being resized. Do not call the VGA device back. Immediately return. */ 1984 1990 LogFlowFunc (("ResizeStatus_InProcess\n")); 1991 fNoUpdate = true; 1985 1992 continue; 1986 1993 } 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. 1993 2003 */ 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 } 1994 2019 } 1995 2020 else 1996 2021 { 1997 if (pDisplay->mfPendingVideoAccelEnable) 2022 Assert(pDisplay->mpPendingVbvaMemory == NULL); 2023 2024 if (pDisplay->mfVideoAccelEnabled) 1998 2025 { 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 (); 2018 2028 } 2019 2029 else 2020 2030 { 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()) 2029 2033 { 2030 2034 Assert(pDrv->Connector.pu8Data); 2035 Assert(pFBInfo->u32ResizeStatus == ResizeStatus_Void); 2031 2036 pDrv->pUpPort->pfnUpdateDisplay(pDrv->pUpPort); 2032 2037 } 2033 2038 } 2039 2034 2040 /* Inform the VRDP server that the current display update sequence is 2035 2041 * completed. At this moment the framebuffer memory contains a definite … … 2038 2044 * fullscreen updates for new clients. 2039 2045 */ 2040 if (pFBInfo->u32ResizeStatus == ResizeStatus_Void)2046 for (uScreenId = 0; uScreenId < pDisplay->mcMonitors; uScreenId++) 2041 2047 { 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 } 2044 2055 } 2045 2056 }
Note:
See TracChangeset
for help on using the changeset viewer.