Changeset 77952 in vbox
- Timestamp:
- Mar 29, 2019 3:20:19 PM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Graphics/DevVGA-SVGA.cpp
r77920 r77952 1465 1465 } 1466 1466 } 1467 1468 1469 /** 1470 * Update the scanline pitch in response to the guest changing mode 1471 * width/bpp. 1472 * 1473 * @param pThis VMSVGA State 1474 */ 1475 DECLINLINE(void) vmsvgaUpdatePitch(PVGASTATE pThis) 1476 { 1477 uint32_t RT_UNTRUSTED_VOLATILE_GUEST *pFIFO = pThis->svga.CTX_SUFF(pFIFO); 1478 uint32_t uFifoPitchLock = pFIFO[SVGA_FIFO_PITCHLOCK]; 1479 uint32_t uRegPitchLock = pThis->svga.u32PitchLock; 1480 1481 /* Sanitize values. */ 1482 uFifoPitchLock = (uint16_t)uFifoPitchLock; 1483 uRegPitchLock = (uint16_t)uFifoPitchLock; 1484 1485 /* Prefer the register value to the FIFO value.*/ 1486 if (pThis->svga.u32PitchLock) 1487 pThis->svga.cbScanline = pThis->svga.u32PitchLock; 1488 if (uFifoPitchLock) 1489 pThis->svga.cbScanline = uFifoPitchLock; 1490 else 1491 pThis->svga.cbScanline = pThis->svga.uWidth * (RT_ALIGN(pThis->svga.uBpp, 8) / 8); 1492 } 1467 1493 #endif 1494 1468 1495 1469 1496 /** … … 1593 1620 if (pThis->svga.uWidth != u32) 1594 1621 { 1622 #if defined(IN_RING3) || defined(IN_RING0) 1595 1623 pThis->svga.uWidth = u32; 1596 pThis->svga.cbScanline = pThis->svga.uWidth * (RT_ALIGN(pThis->svga.uBpp, 8) / 8);1624 vmsvgaUpdatePitch(pThis); 1597 1625 if (pThis->svga.fEnabled) 1598 1626 { 1599 1627 ASMAtomicOrU32(&pThis->svga.u32ActionFlags, VMSVGA_ACTION_CHANGEMODE); 1600 1628 } 1629 #else 1630 rc = VINF_IOM_R3_IOPORT_WRITE; 1631 #endif 1601 1632 } 1602 1633 /* else: nop */ … … 1625 1656 if (pThis->svga.uBpp != u32) 1626 1657 { 1658 #if defined(IN_RING3) || defined(IN_RING0) 1627 1659 pThis->svga.uBpp = u32; 1628 pThis->svga.cbScanline = pThis->svga.uWidth * (RT_ALIGN(pThis->svga.uBpp, 8) / 8);1660 vmsvgaUpdatePitch(pThis); 1629 1661 if (pThis->svga.fEnabled) 1630 1662 { 1631 1663 ASMAtomicOrU32(&pThis->svga.u32ActionFlags, VMSVGA_ACTION_CHANGEMODE); 1632 1664 } 1665 #else 1666 rc = VINF_IOM_R3_IOPORT_WRITE; 1667 #endif 1633 1668 } 1634 1669 /* else: nop */ … … 1689 1724 STAM_REL_COUNTER_INC(&pThis->svga.StatRegPitchLockWr); 1690 1725 pThis->svga.u32PitchLock = u32; 1726 /* Should this also update the FIFO pitch lock? Unclear. */ 1691 1727 break; 1692 1728 … … 5427 5463 PVGASTATE pThis = PDMINS_2_DATA(pDevIns, PVGASTATE); 5428 5464 PVMSVGAR3STATE pSVGAState = pThis->svga.pSvgaR3State; 5465 uint32_t RT_UNTRUSTED_VOLATILE_GUEST *pFIFO = pThis->svga.pFIFOR3; 5429 5466 5430 5467 pHlp->pfnPrintf(pHlp, "Extension enabled: %RTbool\n", pThis->svga.fEnabled); … … 5440 5477 pHlp->pfnPrintf(pHlp, "IRQ status: %#x\n", pThis->svga.u32IrqStatus); 5441 5478 pHlp->pfnPrintf(pHlp, "IRQ mask: %#x\n", pThis->svga.u32IrqMask); 5442 pHlp->pfnPrintf(pHlp, "Pitch lock: %#x \n", pThis->svga.u32PitchLock);5479 pHlp->pfnPrintf(pHlp, "Pitch lock: %#x (FIFO:%#x)\n", pThis->svga.u32PitchLock, pFIFO[SVGA_FIFO_PITCHLOCK]); 5443 5480 pHlp->pfnPrintf(pHlp, "Current GMR ID: %#x\n", pThis->svga.u32CurrentGMRId); 5444 5481 pHlp->pfnPrintf(pHlp, "Capabilites reg: %#x\n", pThis->svga.u32RegCaps); … … 5837 5874 5838 5875 /* Setup FIFO capabilities. */ 5839 pThis->svga.pFIFOR3[SVGA_FIFO_CAPABILITIES] = SVGA_FIFO_CAP_FENCE | SVGA_FIFO_CAP_CURSOR_BYPASS_3 | SVGA_FIFO_CAP_GMR2 | SVGA_FIFO_CAP_3D_HWVERSION_REVISED | SVGA_FIFO_CAP_SCREEN_OBJECT_2 | SVGA_FIFO_CAP_RESERVE ;5876 pThis->svga.pFIFOR3[SVGA_FIFO_CAPABILITIES] = SVGA_FIFO_CAP_FENCE | SVGA_FIFO_CAP_CURSOR_BYPASS_3 | SVGA_FIFO_CAP_GMR2 | SVGA_FIFO_CAP_3D_HWVERSION_REVISED | SVGA_FIFO_CAP_SCREEN_OBJECT_2 | SVGA_FIFO_CAP_RESERVE | SVGA_FIFO_CAP_PITCHLOCK; 5840 5877 5841 5878 /* Valid with SVGA_FIFO_CAP_SCREEN_OBJECT_2 */ … … 5966 6003 5967 6004 /* Setup FIFO capabilities. */ 5968 pThis->svga.pFIFOR3[SVGA_FIFO_CAPABILITIES] = SVGA_FIFO_CAP_FENCE | SVGA_FIFO_CAP_CURSOR_BYPASS_3 | SVGA_FIFO_CAP_GMR2 | SVGA_FIFO_CAP_3D_HWVERSION_REVISED | SVGA_FIFO_CAP_SCREEN_OBJECT_2 | SVGA_FIFO_CAP_RESERVE ;6005 pThis->svga.pFIFOR3[SVGA_FIFO_CAPABILITIES] = SVGA_FIFO_CAP_FENCE | SVGA_FIFO_CAP_CURSOR_BYPASS_3 | SVGA_FIFO_CAP_GMR2 | SVGA_FIFO_CAP_3D_HWVERSION_REVISED | SVGA_FIFO_CAP_SCREEN_OBJECT_2 | SVGA_FIFO_CAP_RESERVE | SVGA_FIFO_CAP_PITCHLOCK; 5969 6006 5970 6007 /* Valid with SVGA_FIFO_CAP_SCREEN_OBJECT_2 */
Note:
See TracChangeset
for help on using the changeset viewer.