VirtualBox

Changeset 76789 in vbox


Ignore:
Timestamp:
Jan 12, 2019 10:53:42 AM (6 years ago)
Author:
vboxsync
Message:

DevVGA-SVGA.cpp: support for blanking

File:
1 edited

Legend:

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

    r76635 r76789  
    38023802                         pCmd->screen.backingStore.ptr.gmrId, pCmd->screen.backingStore.ptr.offset, pCmd->screen.backingStore.pitch));
    38033803
    3804                 AssertBreak(pCmd->screen.id < RT_ELEMENTS(pThis->svga.pSvgaR3State->aScreens));
     3804                uint32_t const idScreen = pCmd->screen.id;
     3805                AssertBreak(idScreen < RT_ELEMENTS(pThis->svga.pSvgaR3State->aScreens));
    38053806
    38063807                uint32_t const uWidth = pCmd->screen.size.width;
    3807                 AssertBreak(0 < uWidth && uWidth <= pThis->svga.u32MaxWidth);
     3808                AssertBreak(uWidth <= pThis->svga.u32MaxWidth);
    38083809
    38093810                uint32_t const uHeight = pCmd->screen.size.height;
    3810                 AssertBreak(0 < uHeight && uHeight <= pThis->svga.u32MaxHeight);
     3811                AssertBreak(uHeight <= pThis->svga.u32MaxHeight);
    38113812
    38123813                uint32_t const cbWidth = uWidth * ((32 + 7) / 8); /** @todo 32? */
    38133814                uint32_t const cbPitch = pCmd->screen.backingStore.pitch ? pCmd->screen.backingStore.pitch : cbWidth;
    3814                 AssertBreak(0 < cbWidth && cbWidth <= cbPitch);
     3815                AssertBreak(cbWidth <= cbPitch);
    38153816
    38163817                uint32_t const uScreenOffset = pCmd->screen.backingStore.ptr.offset;
     
    38183819
    38193820                uint32_t const cbVram = pThis->vram_size - uScreenOffset;
    3820                 AssertBreak(uHeight <= cbVram / cbPitch);
     3821                /* If we have a not zero pitch, then height can't exceed the available VRAM. */
     3822                AssertBreak(   (uHeight == 0 && cbPitch == 0)
     3823                            || (cbPitch > 0 && uHeight <= cbVram / cbPitch));
    38213824                RT_UNTRUSTED_VALIDATED_FENCE();
    38223825
    3823                 VMSVGASCREENOBJECT *pScreen = &pThis->svga.pSvgaR3State->aScreens[pCmd->screen.id];
     3826                VMSVGASCREENOBJECT *pScreen = &pThis->svga.pSvgaR3State->aScreens[idScreen];
     3827
     3828                bool const fBlank = RT_BOOL(pCmd->screen.flags & (SVGA_SCREEN_DEACTIVATE | SVGA_SCREEN_BLANKING));
     3829
    38243830                pScreen->fDefined  = true;
    38253831                pScreen->fModified = true;
    38263832                pScreen->fuScreen  = pCmd->screen.flags;
    3827                 pScreen->idScreen  = pCmd->screen.id;
    3828                 pScreen->xOrigin   = pCmd->screen.root.x;
    3829                 pScreen->yOrigin   = pCmd->screen.root.y;
    3830                 pScreen->cWidth    = uWidth;
    3831                 pScreen->cHeight   = uHeight;
    3832                 pScreen->offVRAM   = uScreenOffset;
    3833                 pScreen->cbPitch   = cbPitch;
    3834                 pScreen->cBpp      = 32;
     3833                pScreen->idScreen  = idScreen;
     3834                if (!fBlank)
     3835                {
     3836                    AssertBreak(uWidth > 0 && uHeight > 0);
     3837
     3838                    pScreen->xOrigin = pCmd->screen.root.x;
     3839                    pScreen->yOrigin = pCmd->screen.root.y;
     3840                    pScreen->cWidth  = uWidth;
     3841                    pScreen->cHeight = uHeight;
     3842                    pScreen->offVRAM = uScreenOffset;
     3843                    pScreen->cbPitch = cbPitch;
     3844                    pScreen->cBpp    = 32;
     3845                }
     3846                else
     3847                {
     3848                    /* Keep old values. */
     3849                }
    38353850
    38363851                pThis->svga.fGFBRegisters = false;
     
    38463861
    38473862                Log(("vmsvgaFIFOLoop: SVGA_CMD_DESTROY_SCREEN id=%x\n", pCmd->screenId));
    3848                 AssertBreak(pCmd->screenId < RT_ELEMENTS(pThis->svga.pSvgaR3State->aScreens));
     3863
     3864                uint32_t const idScreen = pCmd->screenId;
     3865                AssertBreak(idScreen < RT_ELEMENTS(pThis->svga.pSvgaR3State->aScreens));
    38493866                RT_UNTRUSTED_VALIDATED_FENCE();
    38503867
    3851                 VMSVGASCREENOBJECT *pScreen = &pThis->svga.pSvgaR3State->aScreens[pCmd->screenId];
     3868                VMSVGASCREENOBJECT *pScreen = &pThis->svga.pSvgaR3State->aScreens[idScreen];
    38523869                pScreen->fModified = true;
    38533870                pScreen->fDefined  = false;
     3871                pScreen->idScreen  = idScreen;
    38543872
    38553873                vmsvgaChangeMode(pThis);
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