[PATCH qxl-wddm-dod 18/20] qxl-wddm-dod: Optimize allocation of memory chunks

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

 



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

Increased size of allocation to reduce number of allocation per
bitmap. Before change the procedure ignored 'alloc_size' parameter
and always allocated memory chunk according to 'size' parameter.
As a result, first chunk could be up to 64K and all following are
limited by line size. For example, for bitmap 1280x1024 there was
more than 1008 chunks allocated, for bitmap 128x1024 - 897 chunks.
We change the procedure to use chunk size up to 64K (similar to first
chunk). This reduces in described examples number of allocation from
1008 to 64 and 897 to 8 respectively.

Signed-off-by: Yuri Benditovich <yuri.benditovich@xxxxxxxxxx>
---
 qxldod/QxlDod.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/qxldod/QxlDod.cpp b/qxldod/QxlDod.cpp
index 0105a46..be1e6b9 100755
--- a/qxldod/QxlDod.cpp
+++ b/qxldod/QxlDod.cpp
@@ -4549,7 +4549,7 @@ BOOLEAN QxlDevice::PutBytesAlign(QXLDataChunk **chunk_ptr, UINT8 **now_ptr,
     UINT8 *now = *now_ptr;
     UINT8 *end = *end_ptr;
     size_t maxAllocSize = BITS_BUF_MAX - BITS_BUF_MAX % size;
-    alloc_size = MIN(size, maxAllocSize);
+    alloc_size = MIN(alloc_size, maxAllocSize);
     DbgPrint(TRACE_LEVEL_VERBOSE, ("---> %s\n", __FUNCTION__));
 
     while (size) {
-- 
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]