Changeset 73197 in vbox
- Timestamp:
- Jul 18, 2018 10:54:12 AM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Graphics/DevVGA-SVGA.cpp
r73194 r73197 3755 3755 case SVGA_CMD_BLIT_GMRFB_TO_SCREEN: 3756 3756 { 3757 uint32_t width, height;3758 3757 SVGAFifoCmdBlitGMRFBToScreen *pCmd; 3759 3758 VMSVGAFIFO_GET_CMD_BUFFER_BREAK(pCmd, SVGAFifoCmdBlitGMRFBToScreen, sizeof(*pCmd)); … … 3770 3769 /* Clip destRect to the screen dimensions. */ 3771 3770 SVGASignedRect screenRect; 3772 screenRect.left = 0;3773 screenRect.top = 0;3774 screenRect.right = pThis->svga.uWidth;3775 screenRect. top= pThis->svga.uHeight;3771 screenRect.left = 0; 3772 screenRect.top = 0; 3773 screenRect.right = pThis->svga.uWidth; 3774 screenRect.bottom = pThis->svga.uHeight; 3776 3775 SVGASignedRect clipRect = pCmd->destRect; 3777 3776 vmsvgaClipRect(&screenRect, &clipRect); 3778 3777 RT_UNTRUSTED_VALIDATED_FENCE(); 3779 3778 3780 width = clipRect.right - clipRect.left;3781 height = clipRect.bottom - clipRect.top;3779 uint32_t const width = clipRect.right - clipRect.left; 3780 uint32_t const height = clipRect.bottom - clipRect.top; 3782 3781 3783 3782 if ( width == 0 … … 3826 3825 3827 3826 /* Note! This can fetch 3d render results as well!! */ 3828 Log(("vmsvgaFIFOLoop: SVGA_CMD_BLIT_SCREEN_TO_GMRFB dest=(%d,%d) src id=%d (%d,%d)(%d,%d)\n", pCmd->destOrigin.x, pCmd->destOrigin.y, pCmd->srcScreenId, pCmd->srcRect.left, pCmd->srcRect.top, pCmd->srcRect.right, pCmd->srcRect.bottom)); 3829 AssertFailed(); 3827 LogFunc(("SVGA_CMD_BLIT_SCREEN_TO_GMRFB dest=(%d,%d) src id=%d (%d,%d)(%d,%d)\n", 3828 pCmd->destOrigin.x, pCmd->destOrigin.y, pCmd->srcScreenId, pCmd->srcRect.left, pCmd->srcRect.top, pCmd->srcRect.right, pCmd->srcRect.bottom)); 3829 3830 /** @todo Support GMRFB.format.s.bitsPerPixel != pThis->svga.uBpp? */ 3831 AssertBreak(pSVGAState->GMRFB.format.s.bitsPerPixel == pThis->svga.uBpp); 3832 /** @todo Multimonitor. */ 3833 AssertBreak(pCmd->srcScreenId == 0); 3834 3835 /* Clip destRect to the screen dimensions. */ 3836 SVGASignedRect screenRect; 3837 screenRect.left = 0; 3838 screenRect.top = 0; 3839 screenRect.right = pThis->svga.uWidth; 3840 screenRect.bottom = pThis->svga.uHeight; 3841 SVGASignedRect clipRect = pCmd->srcRect; 3842 vmsvgaClipRect(&screenRect, &clipRect); 3843 RT_UNTRUSTED_VALIDATED_FENCE(); 3844 3845 uint32_t const width = clipRect.right - clipRect.left; 3846 uint32_t const height = clipRect.bottom - clipRect.top; 3847 3848 if ( width == 0 3849 || height == 0) 3850 break; /* Nothing to do. */ 3851 3852 int32_t const dstx = pCmd->destOrigin.x + (clipRect.left - pCmd->srcRect.left); 3853 int32_t const dsty = pCmd->destOrigin.y + (clipRect.top - pCmd->srcRect.top); 3854 3855 /* Copy the defined by GMRFB image to the screen 0 VRAM area. 3856 * Prepare parameters for vmsvgaGMRTransfer. 3857 */ 3858 AssertBreak(pThis->svga.uScreenOffset < pThis->vram_size); /* Paranoia. Ensured by SVGA_CMD_DEFINE_SCREEN. */ 3859 3860 /* Source: host buffer which describes the screen 0 VRAM. 3861 * Important are pbHstBuf and cbHstBuf. offHst and cbHstPitch are verified by vmsvgaGMRTransfer. 3862 */ 3863 uint8_t * const pbHstBuf = (uint8_t *)pThis->CTX_SUFF(vram_ptr) + pThis->svga.uScreenOffset; 3864 uint32_t cbHstBuf = pThis->svga.cbScanline * pThis->svga.uHeight; 3865 if (cbHstBuf > pThis->vram_size - pThis->svga.uScreenOffset) 3866 cbHstBuf = pThis->vram_size - pThis->svga.uScreenOffset; /* Paranoia. */ 3867 uint32_t const offHst = (clipRect.left * RT_ALIGN(pThis->svga.uBpp, 8)) / 8 3868 + pThis->svga.cbScanline * clipRect.top; 3869 int32_t const cbHstPitch = pThis->svga.cbScanline; 3870 3871 /* Destination: GMRFB. vmsvgaGMRTransfer ensures that no memory outside the GMR is read. */ 3872 SVGAGuestPtr const gstPtr = pSVGAState->GMRFB.ptr; 3873 uint32_t const offGst = (dstx * RT_ALIGN(pSVGAState->GMRFB.format.s.bitsPerPixel, 8)) / 8 3874 + pSVGAState->GMRFB.bytesPerLine * dsty; 3875 int32_t const cbGstPitch = pSVGAState->GMRFB.bytesPerLine; 3876 3877 rc = vmsvgaGMRTransfer(pThis, SVGA3D_READ_HOST_VRAM, 3878 pbHstBuf, cbHstBuf, offHst, cbHstPitch, 3879 gstPtr, offGst, cbGstPitch, 3880 (width * RT_ALIGN(pThis->svga.uBpp, 8)) / 8, height); 3881 AssertRC(rc); 3830 3882 break; 3831 3883 }
Note:
See TracChangeset
for help on using the changeset viewer.