<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Apr 10, 2017 at 6:47 PM, Frediano Ziglio <span dir="ltr"><<a href="mailto:fziglio@redhat.com" target="_blank">fziglio@redhat.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Previous Windows drivers use mainly DEVRAM so in some environments<br>
(like RHEV-M 4.0) VRAM is really limited.<br>
This patch use DEVRAM as a fallback to avoid getting out of memory<br>
conditions too earlier in such environments.<br>
<br>
Signed-off-by: Frediano Ziglio <<a href="mailto:fziglio@redhat.com">fziglio@redhat.com</a>><br>
---<br>
qxldod/QxlDod.cpp | 2 ++<br>
1 file changed, 2 insertions(+)<br>
<br>
This patch should go on top of "Make easier to change Qxl memory layout"<br>
series.<br>
It implements fallback for allocation requests in VRAM.<br>
Basically if there are no memory in VRAM space DEVRAM is attempted<br>
instead. As memory allocated in VRAM can be in DEVRAM this works<br>
without problems (the opposite is not true as some memory must<br>
reside in DEVRAM).<br>
This patch has the advantage to use more memory as it uses both<br>
Bars and potentially decrease memory fragmentation as small<br>
allocations occurs in a single Bar (Bar0).<br>
<br>
diff --git a/qxldod/QxlDod.cpp b/qxldod/QxlDod.cpp<br>
index 4191525..58a41ff 100755<br>
--- a/qxldod/QxlDod.cpp<br>
+++ b/qxldod/QxlDod.cpp<br>
@@ -4048,6 +4048,8 @@ void *QxlDevice::AllocMem(UINT32 mspace_type, size_t size, BOOL force)<br>
FlushReleaseRing();<br>
<br>
ptr = mspace_malloc(m_MSInfo[mspace_<wbr>type]._mspace, size);<br>
+ if (!ptr && mspace_type == MSPACE_TYPE_VRAM && m_MSInfo[MSPACE_TYPE_DEVRAM]._<wbr>mspace)<br>
</blockquote><div><br></div><div>I think, checking presence of DEVRAM each time is redundant, as the driver fails on early startup stage if Bar0 is not present</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">+ ptr = mspace_malloc(m_MSInfo[MSPACE_<wbr>TYPE_DEVRAM]._mspace, size);<br>
if (ptr) {<br>
break;<br>
}<br>
<span class="HOEnZb"><font color="#888888">--<br>
2.9.3<br>
<br>
______________________________<wbr>_________________<br>
Spice-devel mailing list<br>
<a href="mailto:Spice-devel@lists.freedesktop.org">Spice-devel@lists.freedesktop.<wbr>org</a><br>
<a href="https://lists.freedesktop.org/mailman/listinfo/spice-devel" rel="noreferrer" target="_blank">https://lists.freedesktop.org/<wbr>mailman/listinfo/spice-devel</a><br>
</font></span></blockquote></div><br></div></div>