[Spice-devel] [RFC PATCH qxl-wddm-dod] Use DEVRAM if no more space is available in VRAM
Yuri Benditovich
yuri.benditovich at daynix.com
Tue Apr 11 15:28:38 UTC 2017
On Mon, Apr 10, 2017 at 6:47 PM, Frediano Ziglio <fziglio at redhat.com> wrote:
> Previous Windows drivers use mainly DEVRAM so in some environments
> (like RHEV-M 4.0) VRAM is really limited.
> This patch use DEVRAM as a fallback to avoid getting out of memory
> conditions too earlier in such environments.
>
> Signed-off-by: Frediano Ziglio <fziglio at redhat.com>
> ---
> qxldod/QxlDod.cpp | 2 ++
> 1 file changed, 2 insertions(+)
>
> This patch should go on top of "Make easier to change Qxl memory layout"
> series.
> It implements fallback for allocation requests in VRAM.
> Basically if there are no memory in VRAM space DEVRAM is attempted
> instead. As memory allocated in VRAM can be in DEVRAM this works
> without problems (the opposite is not true as some memory must
> reside in DEVRAM).
> This patch has the advantage to use more memory as it uses both
> Bars and potentially decrease memory fragmentation as small
> allocations occurs in a single Bar (Bar0).
>
> diff --git a/qxldod/QxlDod.cpp b/qxldod/QxlDod.cpp
> index 4191525..58a41ff 100755
> --- a/qxldod/QxlDod.cpp
> +++ b/qxldod/QxlDod.cpp
> @@ -4048,6 +4048,8 @@ void *QxlDevice::AllocMem(UINT32 mspace_type, size_t
> size, BOOL force)
> FlushReleaseRing();
>
> ptr = mspace_malloc(m_MSInfo[mspace_type]._mspace, size);
> + if (!ptr && mspace_type == MSPACE_TYPE_VRAM &&
> m_MSInfo[MSPACE_TYPE_DEVRAM]._mspace)
>
I think, checking presence of DEVRAM each time is redundant, as the driver
fails on early startup stage if Bar0 is not present
> + ptr = mspace_malloc(m_MSInfo[MSPACE_TYPE_DEVRAM]._mspace,
> size);
> if (ptr) {
> break;
> }
> --
> 2.9.3
>
> _______________________________________________
> Spice-devel mailing list
> Spice-devel at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/spice-devel
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/spice-devel/attachments/20170411/efc48e34/attachment-0001.html>
More information about the Spice-devel
mailing list