[Spice-devel] [PATCH 00/12] Set of patches for further support of VSync
Frediano Ziglio
fziglio at redhat.com
Tue Mar 28 14:14:29 UTC 2017
>
> The main goal is to reduce time in GDI callback (PresentDisplayOnly) and
> avoid
> situation when the processing takes more than 2 seconds causing class driver
> watchdog.
>
> 1. We offload sending of drawable commands to separate thread (waiting for
> room in command ring
> may take unpredictable time)
> 2. In case the usage of device memory is high, allocation of bitmap for
> rectangle to draw
> also may take unpredictable time (note that single full screen redraw
> requires >3 MB of space)
> So, we make drawable objects allocation from GDI callaback fast and
> non-forced and in case they
> fail we provide alternate allocation from OS heap
> 3. The thread before send drawable command shall take care on these objects
> that was allocated from
> OS heap and allocate them from device memory (now we are not limited by
> time)
> 4. We still do not enable VSync automatically, but this can be done for
> evaluation/testing purpose via
> setting in the driver's registry
>
A big issue of this approach is that it does not entirely solve
the problem but move it.
Instead of waiting for device memory we fallback to system one
and when we can send commands we copy back to device memory and
send it increasing system memory usage and memory copies.
However I cannot see any limitation so potentially we'll fill
system memory till the guest crash. And if we add a limitation
potentially this will just move the hang to later.
As far as I know we always have available 3 times the amount
of memory of the maximum frame buffer to in theory plenty of
space. But trying to see the drawing from the client I can see
lot of redrawing of the same area again and again so maybe
this is causing the issues with the memory.
Maybe we can find a smarter way to solve this memory issue?
> Yuri Benditovich (12):
> qxl-wddm-dod: Prepare system thread for rendering
> qxl-wddm-dod: Use rendering offload thread
> qxl-wddm-dod: Introduce TimeMeasurement class for timing debugging
> qxl-wddm-dod: Debug warning on long wait on event
> qxl-wddm-dod: Reduce amount of unnecessary printouts
> qxl-wddm-dod: Registry-based control over VSync
> qxl-wddm-dod: Set VSync indication period to 200ms
> qxl-wddm-dod: Prepare for failure to allocate memory
> qxl-wddm-dod: PutBytesAlign supports non-forced allocation
> qxl-wddm-dod: Optimize allocation of memory chunks
> qxl-wddm-dod: Implement non-forced bitmap allocation
> qxl-wddm-dod: Non-forced memory allocations with VSync
>
> qxldod/QxlDod.cpp | 581
> +++++++++++++++++++++++++++++++++++++++++++++---------
> qxldod/QxlDod.h | 87 +++++++-
> qxldod/driver.cpp | 35 ++++
> 3 files changed, 606 insertions(+), 97 deletions(-)
>
Frediano
More information about the Spice-devel
mailing list