[Spice-devel] [PATCH qxl-wddm-dod] Do not take into account move operations for mapping

Frediano Ziglio fziglio at redhat.com
Fri Jan 27 10:06:13 UTC 2017


This is a follow up of 31ca5d035d2b24912044ef69ff23b3b854cd72dd
("Implements screen to screen move correctly").

As now we don't copy memory to implement moves there's no
reason to take into account these area for memory mappings
as memory is not accessed anymore.

Signed-off-by: Frediano Ziglio <fziglio at redhat.com>
---
 qxldod/QxlDod.cpp | 11 ++---------
 qxldod/QxlDod.h   |  2 +-
 2 files changed, 3 insertions(+), 10 deletions(-)

diff --git a/qxldod/QxlDod.cpp b/qxldod/QxlDod.cpp
index 001cd67..e47f302 100755
--- a/qxldod/QxlDod.cpp
+++ b/qxldod/QxlDod.cpp
@@ -3638,7 +3638,7 @@ QxlDevice::ExecutePresentDisplayOnly(
     // Source bitmap is in user mode, must be locked under __try/__except
     // and mapped to kernel space before use.
     {
-        LONG maxHeight = GetMaxSourceMappingHeight(ctx->Moves, ctx->NumMoves, ctx->DirtyRect, ctx->NumDirtyRects);
+        LONG maxHeight = GetMaxSourceMappingHeight(ctx->DirtyRect, ctx->NumDirtyRects);
         UINT sizeToMap = ctx->SrcPitch * maxHeight;
 
         PMDL mdl = IoAllocateMdl((PVOID)SrcAddr, sizeToMap,  FALSE, FALSE, NULL);
@@ -4533,17 +4533,10 @@ void QxlDevice::SetMonitorConfig(QXLHead * monitor_config)
     AsyncIo(QXL_IO_MONITORS_CONFIG_ASYNC, 0);
 }
 
-LONG QxlDevice::GetMaxSourceMappingHeight(D3DKMT_MOVE_RECT* Moves, ULONG NumMoves, RECT* DirtyRects, ULONG NumDirtyRects)
+LONG QxlDevice::GetMaxSourceMappingHeight(RECT* DirtyRects, ULONG NumDirtyRects)
 {
     PAGED_CODE();
     LONG maxHeight = 0;
-    if (Moves != NULL) {
-        for (UINT i = 0; i < NumMoves; i++) {
-            const POINT&   pSourcePoint = Moves[i].SourcePoint;
-            const RECT&    pDestRect = Moves[i].DestRect;
-            maxHeight = MAX(maxHeight, pDestRect.bottom - pDestRect.top + pSourcePoint.y);
-        }
-    }
     if (DirtyRects != NULL) {
         for (UINT i = 0; i < NumDirtyRects; i++) {
             const RECT&    pDirtyRect = DirtyRects[i];
diff --git a/qxldod/QxlDod.h b/qxldod/QxlDod.h
index 8df1fcf..e782dfb 100755
--- a/qxldod/QxlDod.h
+++ b/qxldod/QxlDod.h
@@ -555,7 +555,7 @@ private:
     NTSTATUS SetCustomDisplay(QXLEscapeSetCustomDisplay* custom_display);
     void SetMonitorConfig(QXLHead* monitor_config);
 
-    static LONG GetMaxSourceMappingHeight(D3DKMT_MOVE_RECT* Moves, ULONG NumMoves, RECT* DirtyRects, ULONG NumDirtyRects);
+    static LONG GetMaxSourceMappingHeight(RECT* DirtyRects, ULONG NumDirtyRects);
 
 private:
     PUCHAR m_IoBase;
-- 
2.9.3



More information about the Spice-devel mailing list