Changeset 105182 in vbox
- Timestamp:
- Jul 8, 2024 11:44:04 AM (5 months ago)
- Location:
- trunk/src/VBox/Devices/Graphics
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Graphics/DevVGA-SVGA-cmd.cpp
r104853 r105182 1940 1940 pScreen->cbPitch = pCmd->width * 4; 1941 1941 pScreen->cBpp = 32; 1942 pScreen->cDpi = pCmd->dpi; 1943 1944 /* The screen bitmap must be deallocated after 'vmsvgaR3ChangeMode'. */ 1945 void *pvOldScreenBitmap = pScreen->pvScreenBitmap; 1946 pScreen->pvScreenBitmap = 0; 1942 1947 1943 1948 if (RT_LIKELY(pThis->svga.f3DEnabled)) … … 1952 1957 pThis->svga.fGFBRegisters = false; 1953 1958 vmsvgaR3ChangeMode(pThis, pThisCC); 1959 1960 RTMemFree(pvOldScreenBitmap); 1954 1961 } 1955 1962 } … … 7699 7706 VMSVGASCREENOBJECT *pScreen = &pSvgaR3State->aScreens[idScreen]; 7700 7707 Assert(pScreen->idScreen == idScreen); 7708 pScreen->cDpi = 0; /* SVGAFifoCmdDefineScreen does not support dpi. */ 7709 7710 /* SVGAFifoCmdDefineScreen uses the guest VRAM. The screen bitmap must be deallocated after 'vmsvgaR3ChangeMode'. */ 7711 void *pvOldScreenBitmap = pScreen->pvScreenBitmap; 7712 pScreen->pvScreenBitmap = 0; 7713 7701 7714 pScreen->fDefined = true; 7702 7715 pScreen->fModified = true; … … 7721 7734 } 7722 7735 7723 pThis->svga.fGFBRegisters = false;7724 vmsvgaR3ChangeMode(pThis, pThisCC);7725 7726 7736 #ifdef VBOX_WITH_VMSVGA3D 7727 7737 if (RT_LIKELY(pThis->svga.f3DEnabled)) 7728 7738 vmsvga3dDefineScreen(pThis, pThisCC, pScreen); 7729 7739 #endif 7740 7741 pThis->svga.fGFBRegisters = false; 7742 vmsvgaR3ChangeMode(pThis, pThisCC); 7743 7744 RTMemFree(pvOldScreenBitmap); 7730 7745 } 7731 7746 -
trunk/src/VBox/Devices/Graphics/DevVGA-SVGA.cpp
r104907 r105182 1683 1683 VMSVGASCREENOBJECT *pScreen = &pSVGAState->aScreens[0]; 1684 1684 Assert(pScreen->idScreen == 0); 1685 1686 if ( pScreen->cWidth == VMSVGA_VAL_UNINITIALIZED 1687 || pScreen->cHeight == VMSVGA_VAL_UNINITIALIZED 1688 || pScreen->cBpp == VMSVGA_VAL_UNINITIALIZED) 1689 { 1690 /* Do not apply the change if the guest has not finished updating registers. 1691 * This is necessary in order to make a full mode change, including freeing 1692 * pvScreenBitmap buffers for screen 0 if necessary. 1693 */ 1694 return VINF_SUCCESS; 1695 } 1696 1697 /* Remember screen bitmap buffers to be freed. */ 1698 void * apvOldScreenBitmap[RT_ELEMENTS(pSVGAState->aScreens)]; 1699 RT_ZERO(apvOldScreenBitmap); 1700 1685 1701 pScreen->fDefined = true; 1686 1702 pScreen->fModified = true; … … 1693 1709 pScreen->cHeight = pThis->svga.uHeight; 1694 1710 pScreen->cBpp = pThis->svga.uBpp; 1711 pScreen->cDpi = 0; /* GFB mode does not support dpi. */ 1712 /* GFB mode uses the guest VRAM. The screen bitmap must be deallocated after 'vmsvgaR3VBVAResize'. */ 1713 apvOldScreenBitmap[0] = pScreen->pvScreenBitmap; 1714 /* Set pvScreenBitmap to zero because if it is not, then vmsvgaR3VBVAResize uses it as VRAM address. */ 1715 pScreen->pvScreenBitmap = 0; 1695 1716 1696 1717 for (unsigned iScreen = 1; iScreen < RT_ELEMENTS(pSVGAState->aScreens); ++iScreen) … … 1702 1723 pScreen->fModified = true; 1703 1724 pScreen->fDefined = false; 1704 } 1705 } 1725 1726 #ifdef VBOX_WITH_VMSVGA3D 1727 if (RT_LIKELY(pThis->svga.f3DEnabled)) 1728 vmsvga3dDestroyScreen(pThisCC, pScreen); 1729 #endif 1730 apvOldScreenBitmap[iScreen] = pScreen->pvScreenBitmap; 1731 pScreen->pvScreenBitmap = 0; 1732 } 1733 } 1734 1735 vmsvgaR3VBVAResize(pThis, pThisCC); 1736 1737 /* Deallocate screen bitmaps for all screens because GFB mode uses the guest VRAM. */ 1738 for (unsigned iScreen = 0; iScreen < RT_ELEMENTS(apvOldScreenBitmap); ++iScreen) 1739 RTMemFree(apvOldScreenBitmap[iScreen]); 1706 1740 } 1707 1741 else … … 1714 1748 pThis->svga.uHeight = VMSVGA_VAL_UNINITIALIZED; 1715 1749 pThis->svga.uBpp = pThis->svga.uHostBpp; 1716 } 1717 1718 vmsvgaR3VBVAResize(pThis, pThisCC);1750 1751 vmsvgaR3VBVAResize(pThis, pThisCC); 1752 } 1719 1753 1720 1754 /* Last stuff. For the VGA device screenshot. */
Note:
See TracChangeset
for help on using the changeset viewer.