Changeset 107829 in vbox for trunk/src/VBox/Devices
- Timestamp:
- Jan 16, 2025 7:21:04 PM (3 weeks ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Graphics/DevVGA-SVGA-cmd.cpp
r106953 r107829 7251 7251 Log(("SVGA_CMD_UPDATE %d,%d %dx%d\n", pCmd->x, pCmd->y, pCmd->width, pCmd->height)); 7252 7252 7253 /** @todo Multiple screens? */ 7254 VMSVGASCREENOBJECT *pScreen = vmsvgaR3GetScreenObject(pThisCC, 0); 7255 if (!pScreen) /* Can happen if screen is not defined (aScreens[idScreen].fDefined == false) yet. */ 7256 return; 7257 7258 vmsvgaR3UpdateScreen(pThisCC, pScreen, pCmd->x, pCmd->y, pCmd->width, pCmd->height); 7253 /* These conditions are too strict but prevent any further integer overflow */ 7254 ASSERT_GUEST_RETURN_VOID(pCmd->x < pThis->svga.u32MaxWidth); 7255 ASSERT_GUEST_RETURN_VOID(pCmd->y < pThis->svga.u32MaxHeight); 7256 ASSERT_GUEST_RETURN_VOID(pCmd->width < pThis->svga.u32MaxWidth); 7257 ASSERT_GUEST_RETURN_VOID(pCmd->height < pThis->svga.u32MaxHeight); 7258 RT_UNTRUSTED_VALIDATED_FENCE(); 7259 7260 for (uint32_t idScreen = 0; idScreen < (uint32_t)RT_ELEMENTS(pSvgaR3State->aScreens); idScreen++) 7261 { 7262 VMSVGASCREENOBJECT *pScreen = vmsvgaR3GetScreenObject(pThisCC, idScreen); 7263 if (!pScreen) /* Can happen if screen is not defined (aScreens[idScreen].fDefined == false) yet. */ 7264 continue; 7265 7266 /* Clip updated Rect to the screen dimensions. */ 7267 SVGASignedRect screenRect; 7268 screenRect.left = pScreen->xOrigin; 7269 screenRect.top = pScreen->yOrigin; 7270 screenRect.right = pScreen->xOrigin + pScreen->cWidth; 7271 screenRect.bottom = pScreen->yOrigin + pScreen->cHeight; 7272 7273 SVGASignedRect clipRect; 7274 clipRect.left = (int32)pCmd->x; 7275 clipRect.top = (int32)pCmd->y; 7276 clipRect.right = (int32)(pCmd->x + pCmd->width); 7277 clipRect.bottom = (int32)(pCmd->y + pCmd->height); 7278 vmsvgaR3ClipRect(&screenRect, &clipRect); 7279 7280 if (clipRect.left == clipRect.right || clipRect.top == clipRect.bottom) 7281 continue; 7282 7283 vmsvgaR3UpdateScreen(pThisCC, pScreen, 7284 clipRect.left - screenRect.left, 7285 clipRect.top - screenRect.top, 7286 clipRect.right - clipRect.left, 7287 clipRect.bottom - clipRect.top); 7288 } 7259 7289 } 7260 7290 … … 7263 7293 void vmsvgaR3CmdUpdateVerbose(PVGASTATE pThis, PVGASTATECC pThisCC, SVGAFifoCmdUpdateVerbose const *pCmd) 7264 7294 { 7265 RT_NOREF(pThis);7266 7295 PVMSVGAR3STATE const pSvgaR3State = pThisCC->svga.pSvgaR3State; 7267 7296 … … 7269 7298 Log(("SVGA_CMD_UPDATE_VERBOSE %d,%d %dx%d reason %#x\n", pCmd->x, pCmd->y, pCmd->width, pCmd->height, pCmd->reason)); 7270 7299 7271 /** @todo Multiple screens? */ 7272 VMSVGASCREENOBJECT *pScreen = vmsvgaR3GetScreenObject(pThisCC, 0); 7273 if (!pScreen) /* Can happen if screen is not defined (aScreens[idScreen].fDefined == false) yet. */ 7274 return; 7275 7276 vmsvgaR3UpdateScreen(pThisCC, pScreen, pCmd->x, pCmd->y, pCmd->width, pCmd->height); 7300 /* Just like SVGA_CMD_UPDATE, but also provides a per-rectangle 'reason' value */ 7301 vmsvgaR3CmdUpdate(pThis, pThisCC, (SVGAFifoCmdUpdate const *)pCmd); 7277 7302 } 7278 7303
Note:
See TracChangeset
for help on using the changeset viewer.