<html><body><div style="font-family: times new roman, new york, times, serif; font-size: 12pt; color: #000000"><blockquote style="border-left:2px solid #1010FF;margin-left:5px;padding-left:5px;color:#000;font-weight:normal;font-style:normal;text-decoration:none;font-family:Helvetica,Arial,sans-serif;font-size:12pt;"><div><br></div><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div class="">Side note: the .gitattribute in that project seems all wrong. It makes source files a pain to edit under Linux or macOS. Why not mark the source files as text? </div></div></blockquote><div>To avoid cr/lf conversions.<br></div><div>If you can find good flags to make git Windows and git Unix to work you are welcome.<br></div><div>Got mad to try, you fix a tool and you break another.<br></div><div>I have no problems with Linux, my editor just handle DOS files as DOS.<br></div><div><br></div><blockquote style="border-left:2px solid #1010FF;margin-left:5px;padding-left:5px;color:#000;font-weight:normal;font-style:normal;text-decoration:none;font-family:Helvetica,Arial,sans-serif;font-size:12pt;"><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div class=""><br class=""></div><div class=""><div class=""><blockquote class=""><div class="">On 20 Mar 2017, at 13:08, Frediano Ziglio <<a href="mailto:fziglio@redhat.com" class="" target="_blank">fziglio@redhat.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div style="" class=""><blockquote style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;" class=""><br class="">Instead of sending drawable commands down from presentation<br class="">callback, collect drawables objects and pass them to dedicated<br class="">thread for processing. This reduce peak load of presentation<br class="">callback.<br class=""><br class="">Signed-off-by: Javier Celaya <<a href="mailto:javier.celaya@flexvdi.com" class="" target="_blank">javier.celaya@flexvdi.com</a>><br class="">Signed-off-by: Yuri Benditovich <<a href="mailto:yuri.benditovich@daynix.com" class="" target="_blank">yuri.benditovich@daynix.com</a>><br class="">---<br class="">qxldod/QxlDod.cpp | 43 +++++++++++++++++++++++++++++++++----------<br class="">qxldod/QxlDod.h   |  4 ++--<br class="">2 files changed, 35 insertions(+), 12 deletions(-)<br class=""><br class="">diff --git a/qxldod/QxlDod.cpp b/qxldod/QxlDod.cpp<br class="">index b952bf9..01de9b3 100755<br class="">--- a/qxldod/QxlDod.cpp<br class="">+++ b/qxldod/QxlDod.cpp<br class="">@@ -3794,11 +3794,20 @@ QxlDevice::ExecutePresentDisplayOnly(<br class="">    SIZE_T sizeRects = NumDirtyRects*sizeof(RECT);<br class="">    SIZE_T size = sizeof(DoPresentMemory) + sizeMoves + sizeRects;<br class=""><br class="">+    QXLDrawable **pDrawables = reinterpret_cast<QXLDrawable **>(new<br class="">(NonPagedPoolNx) BYTE[sizeof(QXLDrawable *)*(NumDirtyRects + NumMoves +<br class="">1)]);<br class=""></blockquote><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><span style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">here would be</span><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><span style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class=""> QXLDrawable **pDrawables = new (NonPagedPoolNx) QXLDrawable *[NumDirtyRects + NumMoves + 1];</span><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><span style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">is non paged memory needed? Both functions (producer and consumer) are in paged areas.</span><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><blockquote style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;" class="">+    UINT nIndex = 0;<br class="">+<br class="">+    if (!pDrawables)<br class="">+    {<br class="">+        return STATUS_NO_MEMORY;<br class="">+    }<br class="">+<br class="">    DoPresentMemory* ctx = reinterpret_cast<DoPresentMemory*><br class="">                                (new (NonPagedPoolNx) BYTE[size]);<br class=""><br class=""></blockquote><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><span style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">  DoPresentMemory* ctx = new (NonPagedPoolNx) DoPresentMemory;</span><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""></div></div></blockquote><div class=""><br class=""></div><div class="">That would be nicer, but apparently, there is extra stuff padded to it:</div><div class=""><br class=""></div><div class=""><blockquote class=""><blockquote class=""><div class=""><blockquote class="">    SIZE_T size = sizeof(DoPresentMemory) + sizeMoves + sizeRects;<br class=""><br class=""></blockquote></div></blockquote></blockquote></div><div class=""><br class=""></div><div class="">Also, this part of the code was not changed. It was like this before. But is it necessary ? It’s really borderline with respect to alignment. In one case, we have BYTE-aligned memory, in the other it’s at least sizeof(void *).</div><div class=""><br class=""></div><div class="">You could use placement new. Assuming non-paged pool:</div><div class=""><br class=""></div><div class=""><span class="Apple-tab-span" style="white-space:pre">    </span>BYTE *storage = new(NonPagedPoolNx) BYTE[size];</div><div class=""><span class="Apple-tab-span" style="white-space:pre">   </span>DoPresentMemory *ctx = new(storage) DoPresentMemory;</div><div class=""><br class=""></div><div class="">There’s no constructor, apparently. So it does not make much of a difference.</div></div></div></div></blockquote><div>Looking at the code it looks quite weird, a ctx is allocated in the function, then at the end freed,<br></div><div>I found these comments:<br></div><div><br></div><div>    // Alternate between synch and asynch execution, for demonstrating <br>    // that a real hardware implementation can do either<br>...<br></div><div><br></div><div>    // Save Mdl to unmap and unlock the pages in worker thread<br></div><div>...<br></div><div><br></div><div>    // copy moves and update pointer<br>...</div><div><br>    // copy dirty rects and update pointer<br></div><div><br></div><div><br>apparently this is all due to the initial code (from a Microsoft example) that was marshalling this<br></div><div>call to a worker thread.<br></div><div>However now that we are going to introduce a worker thread this looks misleading.<br></div><div>I would remove comments and code. For instance there's no need to copy Moves & DirtyRect<br></div><div>and DoPresentMemory can be allocated just in the stack (or even better removed).<br></div><blockquote style="border-left:2px solid #1010FF;margin-left:5px;padding-left:5px;color:#000;font-weight:normal;font-style:normal;text-decoration:none;font-family:Helvetica,Arial,sans-serif;font-size:12pt;"><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div class=""><div class=""><blockquote class=""><div class=""><div style="" class=""><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><span style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">same comments as above</span><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><blockquote style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;" class="">    if (!ctx)<br class="">    {<br class="">+        delete[] reinterpret_cast<BYTE*>(pDrawables);<br class=""></blockquote><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><span style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">delete[] pDrawables;</span><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><blockquote style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;" class="">        return STATUS_NO_MEMORY;<br class="">    }<br class=""><br class="">@@ -3828,6 +3837,8 @@ QxlDevice::ExecutePresentDisplayOnly(<br class="">        PMDL mdl = IoAllocateMdl((PVOID)SrcAddr, sizeToMap,  FALSE, FALSE,<br class="">        NULL);<br class="">        if(!mdl)<br class="">        {<br class="">+            delete[] reinterpret_cast<BYTE*>(ctx);<br class=""></blockquote></div></div></blockquote><div class=""><br class=""></div><div class=""><div class="">There were several leaks of ctx in case of failure before. I suggest a separate patch to fix that. There are many other places where the current patch does not fix them, for instance VgaDevice::GetModeList can leak m_ModeInfo if m_ModeNumbers can’t be allocated.</div></div></div></div></div></blockquote><div>Can you write some patches about these? These specifically seem not really related.<br></div><blockquote style="border-left:2px solid #1010FF;margin-left:5px;padding-left:5px;color:#000;font-weight:normal;font-style:normal;text-decoration:none;font-family:Helvetica,Arial,sans-serif;font-size:12pt;"><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div class=""><div class=""><br class=""><blockquote class=""><div class=""><div style="" class=""><blockquote style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;" class="">+            delete[] reinterpret_cast<BYTE*>(pDrawables);<br class=""></blockquote><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><span style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">similar to above, in this case "delete ctx;”</span></div></div></blockquote><div class=""><br class=""></div>There is a risk if, indeed, we store more than an object in it. delete[] and delete are implemented differently by some runtimes (I don’t recall about the Win driver runtime). It is not guaranteed that delete ctx would work reliably if we allocated more than sizeof(DoPresentMemory) bytes. Being able to deal with variable size is the very reason for delete[].</div><div class=""><br class=""></div><div class=""><br class=""></div><div class=""><blockquote class=""><div style="" class=""><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><blockquote style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;" class="">            return STATUS_INSUFFICIENT_RESOURCES;<br class="">        }<br class=""><br class="">@@ -3844,6 +3855,8 @@ QxlDevice::ExecutePresentDisplayOnly(<br class="">        {<br class="">            Status = GetExceptionCode();<br class="">            IoFreeMdl(mdl);<br class="">+            delete[] reinterpret_cast<BYTE*>(ctx);<br class="">+            delete[] reinterpret_cast<BYTE*>(pDrawables);</blockquote></div></blockquote></div><div class=""><br class=""></div><div class=""><br class=""></div><div class=""><blockquote class=""><div class=""><div style="" class=""><span style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">ditto</span><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><blockquote style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;" class="">            return Status;<br class="">        }<br class=""><br class="">@@ -3857,6 +3870,8 @@ QxlDevice::ExecutePresentDisplayOnly(<br class="">            Status = STATUS_INSUFFICIENT_RESOURCES;<br class="">            MmUnlockPages(mdl);<br class="">            IoFreeMdl(mdl);<br class="">+            delete[] reinterpret_cast<BYTE*>(ctx);<br class="">+            delete[] reinterpret_cast<BYTE*>(pDrawables);<br class=""></blockquote><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><span style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">ditto</span><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""></div></div></blockquote><div class=""><br class=""></div><div class=""><br class=""></div><blockquote class=""><div class=""><div style="" class=""><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><blockquote style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;" class="">            return Status;<br class="">        }<br class=""><br class="">@@ -3922,7 +3937,9 @@ QxlDevice::ExecutePresentDisplayOnly(<br class="">        DbgPrint(TRACE_LEVEL_INFORMATION, ("--- %d SourcePoint.x = %ld,<br class="">        SourcePoint.y = %ld, DestRect.bottom = %ld, DestRect.left = %ld,<br class="">        DestRect.right = %ld, DestRect.top = %ld\n",<br class="">            i , pSourcePoint->x, pSourcePoint->y, pDestRect->bottom,<br class="">            pDestRect->left, pDestRect->right, pDestRect->top));<br class=""><br class="">-        CopyBits(*pDestRect, *pSourcePoint);<br class="">+        pDrawables[nIndex] = CopyBits(*pDestRect, *pSourcePoint);<br class="">+<br class="">+        if (pDrawables[nIndex]) nIndex++;<br class="">    }<br class=""><br class="">    // Copy all the dirty rects from source image to video frame buffer.<br class="">@@ -3936,11 +3953,13 @@ QxlDevice::ExecutePresentDisplayOnly(<br class="">        DbgPrint(TRACE_LEVEL_INFORMATION, ("--- %d pDirtyRect->bottom = %ld,<br class="">        pDirtyRect->left = %ld, pDirtyRect->right = %ld, pDirtyRect->top =<br class="">        %ld\n",<br class="">            i, pDirtyRect->bottom, pDirtyRect->left, pDirtyRect->right,<br class="">            pDirtyRect->top));<br class=""><br class="">-        BltBits(&DstBltInfo,<br class="">+        pDrawables[nIndex] = BltBits(&DstBltInfo,<br class="">        &SrcBltInfo,<br class="">        1,<br class="">        pDirtyRect,<br class="">        &sourcePoint);<br class="">+<br class="">+        if (pDrawables[nIndex]) nIndex++;<br class="">    }<br class=""><br class="">    // Unmap unmap and unlock the pages.<br class="">@@ -3951,6 +3970,10 @@ QxlDevice::ExecutePresentDisplayOnly(<br class="">    }<br class="">    delete [] reinterpret_cast<BYTE*>(ctx);<br class=""><br class="">+    pDrawables[nIndex] = NULL;<br class="">+<br class="">+    PostToWorkerThread(pDrawables);<br class="">+<br class="">    return STATUS_SUCCESS;<br class="">}<br class=""><br class="">@@ -4364,7 +4387,7 @@ VOID QxlDevice::SetImageId(InternalImage *internal,<br class="">    }<br class="">}<br class=""><br class="">-void QxlDevice::CopyBits(const RECT& rect, const POINT& sourcePoint)<br class="">+QXLDrawable *QxlDevice::CopyBits(const RECT& rect, const POINT& sourcePoint)<br class="">{<br class=""></blockquote><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><span style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">This CopyBits and BltBits are not doing anymore the operation, should</span><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><span style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">be renamed to something like PrepareCopyBits (better names welcome)</span><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""></div></div></blockquote><div class=""><br class=""></div><div class="">But we still need the driver entry points, right?</div></div></div></div></blockquote><div>These are method, not really related to entry points.<br></div><div><br></div><blockquote style="border-left:2px solid #1010FF;margin-left:5px;padding-left:5px;color:#000;font-weight:normal;font-style:normal;text-decoration:none;font-family:Helvetica,Arial,sans-serif;font-size:12pt;"><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div class=""><div class=""><blockquote class=""><div class=""><div style="" class=""><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><blockquote style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;" class="">    PAGED_CODE();<br class="">    QXLDrawable *drawable;<br class="">@@ -4373,18 +4396,18 @@ void QxlDevice::CopyBits(const RECT& rect, const<br class="">POINT& sourcePoint)<br class=""><br class="">    if (!(drawable = Drawable(QXL_COPY_BITS, &rect, NULL, 0))) {<br class="">        DbgPrint(TRACE_LEVEL_ERROR, ("Cannot get Drawable.\n"));<br class="">-        return;<br class="">+        return NULL;<br class="">    }<br class=""><br class="">    drawable->u.copy_bits.src_pos.x = sourcePoint.x;<br class="">    drawable->u.copy_bits.src_pos.y = sourcePoint.y;<br class=""><br class="">-    PushDrawable(drawable);<br class="">-<br class="">    DbgPrint(TRACE_LEVEL_VERBOSE, ("<--- %s\n", __FUNCTION__));<br class="">+<br class="">+    return drawable;<br class="">}<br class=""><br class="">-VOID QxlDevice::BltBits (<br class="">+QXLDrawable *QxlDevice::BltBits (<br class="">    BLT_INFO* pDst,<br class="">    CONST BLT_INFO* pSrc,<br class="">    UINT  NumRects,<br class="">@@ -4407,7 +4430,7 @@ VOID QxlDevice::BltBits (<br class=""><br class="">    if (!(drawable = Drawable(QXL_DRAW_COPY, pRects, NULL, 0))) {<br class="">        DbgPrint(TRACE_LEVEL_ERROR, ("Cannot get Drawable.\n"));<br class="">-        return;<br class="">+        return NULL;<br class="">    }<br class=""><br class="">    CONST RECT* pRect = &pRects[0];<br class="">@@ -4480,9 +4503,9 @@ VOID QxlDevice::BltBits (<br class="">         drawable->surfaces_rects[0].top,<br class="">         drawable->surfaces_rects[0].bottom,<br class="">         drawable->u.copy.src_bitmap));<br class=""><br class="">-    PushDrawable(drawable);<br class="">-<br class="">    DbgPrint(TRACE_LEVEL_VERBOSE, ("<--- %s\n", __FUNCTION__));<br class="">+<br class="">+    return drawable;<br class="">}<br class=""><br class="">VOID QxlDevice::PutBytesAlign(QXLDataChunk **chunk_ptr, UINT8 **now_ptr,<br class="">diff --git a/qxldod/QxlDod.h b/qxldod/QxlDod.h<br class="">index 4a62680..f441f4b 100755<br class="">--- a/qxldod/QxlDod.h<br class="">+++ b/qxldod/QxlDod.h<br class="">@@ -495,12 +495,12 @@ public:<br class="">    BOOLEAN IsBIOSCompatible() { return FALSE; }<br class="">protected:<br class="">    NTSTATUS GetModeList(DXGK_DISPLAY_INFORMATION* pDispInfo);<br class="">-    VOID BltBits (BLT_INFO* pDst,<br class="">+    QXLDrawable *BltBits (BLT_INFO* pDst,<br class="">                    CONST BLT_INFO* pSrc,<br class="">                    UINT  NumRects,<br class="">                    _In_reads_(NumRects) CONST RECT *pRects,<br class="">                    POINT*   pSourcePoint);<br class="">-    void CopyBits(const RECT& rect, const POINT& sourcePoint);<br class="">+    QXLDrawable *CopyBits(const RECT& rect, const POINT& sourcePoint);<br class="">    QXLDrawable *Drawable(UINT8 type,<br class="">                    CONST RECT *area,<br class="">                    CONST RECT *clip,<br class=""></blockquote><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><span style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">Frediano</span></div></div></blockquote></div></div></div></blockquote><div><br></div></div></body></html>