Changeset 76789 in vbox
- Timestamp:
- Jan 12, 2019 10:53:42 AM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Graphics/DevVGA-SVGA.cpp
r76635 r76789 3802 3802 pCmd->screen.backingStore.ptr.gmrId, pCmd->screen.backingStore.ptr.offset, pCmd->screen.backingStore.pitch)); 3803 3803 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)); 3805 3806 3806 3807 uint32_t const uWidth = pCmd->screen.size.width; 3807 AssertBreak( 0 < uWidth &&uWidth <= pThis->svga.u32MaxWidth);3808 AssertBreak(uWidth <= pThis->svga.u32MaxWidth); 3808 3809 3809 3810 uint32_t const uHeight = pCmd->screen.size.height; 3810 AssertBreak( 0 < uHeight &&uHeight <= pThis->svga.u32MaxHeight);3811 AssertBreak(uHeight <= pThis->svga.u32MaxHeight); 3811 3812 3812 3813 uint32_t const cbWidth = uWidth * ((32 + 7) / 8); /** @todo 32? */ 3813 3814 uint32_t const cbPitch = pCmd->screen.backingStore.pitch ? pCmd->screen.backingStore.pitch : cbWidth; 3814 AssertBreak( 0 < cbWidth &&cbWidth <= cbPitch);3815 AssertBreak(cbWidth <= cbPitch); 3815 3816 3816 3817 uint32_t const uScreenOffset = pCmd->screen.backingStore.ptr.offset; … … 3818 3819 3819 3820 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)); 3821 3824 RT_UNTRUSTED_VALIDATED_FENCE(); 3822 3825 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 3824 3830 pScreen->fDefined = true; 3825 3831 pScreen->fModified = true; 3826 3832 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 } 3835 3850 3836 3851 pThis->svga.fGFBRegisters = false; … … 3846 3861 3847 3862 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)); 3849 3866 RT_UNTRUSTED_VALIDATED_FENCE(); 3850 3867 3851 VMSVGASCREENOBJECT *pScreen = &pThis->svga.pSvgaR3State->aScreens[ pCmd->screenId];3868 VMSVGASCREENOBJECT *pScreen = &pThis->svga.pSvgaR3State->aScreens[idScreen]; 3852 3869 pScreen->fModified = true; 3853 3870 pScreen->fDefined = false; 3871 pScreen->idScreen = idScreen; 3854 3872 3855 3873 vmsvgaChangeMode(pThis);
Note:
See TracChangeset
for help on using the changeset viewer.