VirtualBox

Changeset 77958 in vbox


Ignore:
Timestamp:
Mar 29, 2019 8:57:32 PM (6 years ago)
Author:
vboxsync
Message:

VMSVGA: Refined pitch lock handling, also reset FIFO on VM reset. See bugref:9424

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Devices/Graphics/DevVGA-SVGA.cpp

    r77954 r77958  
    14781478    uint32_t uFifoPitchLock = pFIFO[SVGA_FIFO_PITCHLOCK];
    14791479    uint32_t uRegPitchLock  = pThis->svga.u32PitchLock;
     1480    uint32_t uFifoMin       = pFIFO[SVGA_FIFO_MIN];
     1481
     1482    /* The SVGA_FIFO_PITCHLOCK register is only valid if SVGA_FIFO_MIN points past
     1483     * it. If SVGA_FIFO_MIN is small, there may well be data at the SVGA_FIFO_PITCHLOCK
     1484     * location but it has a different meaning.
     1485     */
     1486    if ((uFifoMin / sizeof(uint32_t)) <= SVGA_FIFO_PITCHLOCK)
     1487        uFifoPitchLock = 0;
    14801488
    14811489    /* Sanitize values. */
     
    14871495    /* Prefer the register value to the FIFO value.*/
    14881496    if (uRegPitchLock)
    1489         pThis->svga.cbScanline = pThis->svga.u32PitchLock;
     1497        pThis->svga.cbScanline = uRegPitchLock;
    14901498    else if (uFifoPitchLock)
    14911499        pThis->svga.cbScanline = uFifoPitchLock;
    14921500    else
    14931501        pThis->svga.cbScanline = pThis->svga.uWidth * (RT_ALIGN(pThis->svga.uBpp, 8) / 8);
     1502
     1503    if ((uFifoMin / sizeof(uint32_t)) <= SVGA_FIFO_PITCHLOCK)
     1504        pThis->svga.u32PitchLock = pThis->svga.cbScanline;
    14941505}
    14951506#endif
     
    16121623            for (uint32_t idScreen = 0; idScreen < pThis->cMonitors; ++idScreen)
    16131624                pThis->pDrv->pfnVBVADisable(pThis->pDrv, idScreen);
     1625
     1626            /* Clear the pitch lock. */
     1627            pThis->svga.u32PitchLock = 0;
    16141628        }
    16151629#else  /* !IN_RING3 */
     
    54745488    pHlp->pfnPrintf(pHlp, "FIFO external cmd:  %#x\n", pThis->svga.u8FIFOExtCommand);
    54755489    pHlp->pfnPrintf(pHlp, "FIFO extcmd wakeup: %u\n", pThis->svga.fFifoExtCommandWakeup);
     5490    pHlp->pfnPrintf(pHlp, "FIFO min/max:       %u/%u\n", pFIFO[SVGA_FIFO_MIN], pFIFO[SVGA_FIFO_MAX]);
    54765491    pHlp->pfnPrintf(pHlp, "Busy:               %#x\n", pThis->svga.fBusy);
    54775492    pHlp->pfnPrintf(pHlp, "Traces:             %RTbool (effective: %RTbool)\n", pThis->svga.fTraces, pThis->svga.fVRAMTracking);
     
    58755890# endif
    58765891
     5892    /* Clear the FIFO so that there's no leftover junk. */
     5893    RT_BZERO(pThis->svga.pFIFOR3, pThis->svga.cbFIFO);
     5894
    58775895    /* Setup FIFO capabilities. */
    58785896    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;
     
    58865904
    58875905    /* Invalidate current settings. */
    5888     pThis->svga.uWidth     = VMSVGA_VAL_UNINITIALIZED;
    5889     pThis->svga.uHeight    = VMSVGA_VAL_UNINITIALIZED;
    5890     pThis->svga.uBpp       = VMSVGA_VAL_UNINITIALIZED;
    5891     pThis->svga.cbScanline = 0;
     5906    pThis->svga.uWidth       = VMSVGA_VAL_UNINITIALIZED;
     5907    pThis->svga.uHeight      = VMSVGA_VAL_UNINITIALIZED;
     5908    pThis->svga.uBpp         = VMSVGA_VAL_UNINITIALIZED;
     5909    pThis->svga.cbScanline   = 0;
     5910    pThis->svga.u32PitchLock = 0;
    58925911
    58935912    return rc;
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