[PATCH qxl-wddm-dod v3 1/2] Move code for discarding drawable to separate procedure

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: "yuri.benditovich@xxxxxxxxxx" <yuri.benditovich@xxxxxxxxxx>

Signed-off-by: Yuri Benditovich <yuri.benditovich@xxxxxxxxxx>
Acked-by: Frediano Ziglio <fziglio@xxxxxxxxxx>
---
 qxldod/QxlDod.cpp | 21 ++++++++++++++-------
 qxldod/QxlDod.h   |  1 +
 2 files changed, 15 insertions(+), 7 deletions(-)

diff --git a/qxldod/QxlDod.cpp b/qxldod/QxlDod.cpp
index 1953688..5ee54f5 100755
--- a/qxldod/QxlDod.cpp
+++ b/qxldod/QxlDod.cpp
@@ -4500,6 +4500,19 @@ BOOLEAN QxlDevice::AttachNewBitmap(QXLDrawable *drawable, UINT8 *src, UINT8 *src
     return TRUE;
 }
 
+void QxlDevice::DiscardDrawable(QXLDrawable *drawable)
+{
+    PAGED_CODE();
+    PLIST_ENTRY pDelayedList = DelayedList(drawable);
+    // if some delayed chunks were allocated, free them
+    while (!IsListEmpty(pDelayedList)) {
+        DelayedChunk *pdc = (DelayedChunk *)RemoveHeadList(pDelayedList);
+        delete[] reinterpret_cast<BYTE*>(pdc);
+    }
+    ReleaseOutput(drawable->release_info.id);
+    DbgPrint(TRACE_LEVEL_WARNING, ("%s\n", __FUNCTION__));
+}
+
 QXLDrawable *QxlDevice::PrepareBltBits (
     BLT_INFO* pDst,
     CONST BLT_INFO* pSrc,
@@ -4549,13 +4562,7 @@ QXLDrawable *QxlDevice::PrepareBltBits (
     src += pSrc->Pitch * (height - 1);
 
     if (!AttachNewBitmap(drawable, src, src_end, (INT)pSrc->Pitch, !g_bSupportVSync)) {
-        PLIST_ENTRY pDelayedList = DelayedList(drawable);
-        // if some delayed chunks were allocated, free them
-        while (!IsListEmpty(pDelayedList)) {
-            DelayedChunk *pdc = (DelayedChunk *)RemoveHeadList(pDelayedList);
-            delete[] reinterpret_cast<BYTE*>(pdc);
-        }
-        ReleaseOutput(drawable->release_info.id);
+        DiscardDrawable(drawable);
         drawable = NULL;
     } else {
         DbgPrint(TRACE_LEVEL_INFORMATION, ("%s drawable= %p type = %d, effect = %d Dest right(%d) left(%d) top(%d) bottom(%d) src_bitmap= %p.\n", __FUNCTION__,
diff --git a/qxldod/QxlDod.h b/qxldod/QxlDod.h
index e865032..b524577 100755
--- a/qxldod/QxlDod.h
+++ b/qxldod/QxlDod.h
@@ -603,6 +603,7 @@ private:
     void WaitForCursorRing(void);
     void PushCursor(void);
     BOOLEAN AttachNewBitmap(QXLDrawable *drawable, UINT8 *src, UINT8 *src_end, INT pitch, BOOLEAN bForce);
+    void DiscardDrawable(QXLDrawable *drawable);
     BOOLEAN PutBytesAlign(QXLDataChunk **chunk_ptr, UINT8 **now_ptr,
                             UINT8 **end_ptr, UINT8 *src, int size,
                             size_t alloc_size, PLIST_ENTRY pDelayed);
-- 
2.9.3

_______________________________________________
Spice-devel mailing list
Spice-devel@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/spice-devel




[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]     [Monitors]