Implements screen to screen move correctly

Doing some fast check on Windows 8.1 you could note that
moving windows you got a weird effect were windows were a
bit misaligned.
As documented in DXGKARG_PRESENT_DISPLAYONLY page
NumMoves/pMoves fields point to an array of screen-to-screen
moves while our code implemented them as an image drawing
(the same implementation of dirty rects) causing the weird
effect mentioned.
This patch implement the moves using QXL_COPY_BITS operation
instead of a QXL_DRAW_COPY fixing the issue and avoiding sending
image to the server making the move/scroll operations on the
guest faster (and taking less bandwidth).
It seems that Windows 10 doesn't send the move commands but
instead send only dirty rects so you can't note this problem
using Windows 10.

Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Yuri Benditovich <yuri.benditovich@daynix.com>
This commit is contained in:
Frediano Ziglio 2016-12-06 06:10:46 +00:00
parent a495c21748
commit 31ca5d035d
2 changed files with 22 additions and 5 deletions

View File

@ -3738,11 +3738,7 @@ QxlDevice::ExecutePresentDisplayOnly(
DbgPrint(TRACE_LEVEL_INFORMATION, ("--- %d SourcePoint.x = %ld, SourcePoint.y = %ld, DestRect.bottom = %ld, DestRect.left = %ld, DestRect.right = %ld, DestRect.top = %ld\n",
i , pSourcePoint->x, pSourcePoint->y, pDestRect->bottom, pDestRect->left, pDestRect->right, pDestRect->top));
BltBits(&DstBltInfo,
&SrcBltInfo,
1,
pDestRect,
pSourcePoint);
CopyBits(*pDestRect, *pSourcePoint);
}
// Copy all the dirty rects from source image to video frame buffer.
@ -4184,6 +4180,26 @@ VOID QxlDevice::SetImageId(InternalImage *internal,
}
}
void QxlDevice::CopyBits(const RECT& rect, const POINT& sourcePoint)
{
PAGED_CODE();
QXLDrawable *drawable;
DbgPrint(TRACE_LEVEL_VERBOSE, ("---> %s device %d\n", __FUNCTION__,m_Id));
if (!(drawable = Drawable(QXL_COPY_BITS, &rect, NULL, 0))) {
DbgPrint(TRACE_LEVEL_ERROR, ("Cannot get Drawable.\n"));
return;
}
drawable->u.copy_bits.src_pos.x = sourcePoint.x;
drawable->u.copy_bits.src_pos.y = sourcePoint.y;
PushDrawable(drawable);
DbgPrint(TRACE_LEVEL_VERBOSE, ("<--- %s\n", __FUNCTION__));
}
VOID QxlDevice::BltBits (
BLT_INFO* pDst,
CONST BLT_INFO* pSrc,

View File

@ -487,6 +487,7 @@ protected:
UINT NumRects,
_In_reads_(NumRects) CONST RECT *pRects,
POINT* pSourcePoint);
void CopyBits(const RECT& rect, const POINT& sourcePoint);
QXLDrawable *Drawable(UINT8 type,
CONST RECT *area,
CONST RECT *clip,