[Spice-devel] [PATCH 7/7] qxl-wddm-dod: Set VSync notification period to 200 ms

Frediano Ziglio fziglio at redhat.com
Mon Feb 13 09:50:40 UTC 2017


> 
> With default period of VSync interrupt notification
> (1sec/refresh rate) the driver with device rev.4
> has a problem when the system starts running after
> restart. Until the issue is solved we set the notification
> period to 200 ms, with this value both rev.3 and rev.4
> function correctly. Final decision about notification
> period postponed until the investigation is done.
> 

Honestly all these VSync patches looks like a workaround
just to make Windows tests happy.

We don't have an h/w monitor so we are providing fake values.
We emulate an interrupt with a timer. I think these stuff should
be avoided just to save CPU power avoiding wake ups not
required.
Also we tweak interrupts and require additional communication
with the server to handle them. Are we sure we don't introduce
delays if we need to process commands like updates that
require feedback from the server?
One of the "classic" usages of VSync is to handle double
buffering used mostly on games. Are we sure that with these
patches we don't end up with games running at 5 FPS to keep in
sync with this emulated VSync?
As a minor m_VsyncFiredCounter is updated just for debugging
purposes.
I suspect this problem with restart is due to int_mask
settings (m_RamHdr->int_mask = 0).

> Signed-off-by: Yuri Benditovich <yuri.benditovich at daynix.com>
> ---
>  qxldod/QxlDod.cpp | 6 ++++--
>  1 file changed, 4 insertions(+), 2 deletions(-)
> 
> diff --git a/qxldod/QxlDod.cpp b/qxldod/QxlDod.cpp
> index fcca7d1..6a50265 100755
> --- a/qxldod/QxlDod.cpp
> +++ b/qxldod/QxlDod.cpp
> @@ -4972,10 +4972,12 @@ VOID QxlDod::EnableVsync(BOOLEAN bEnable)
>          }
>          else
>          {
> +            // set notification period to 200 ms for now, see commit comment
> for details
> +            LONG val = 200;
>              LARGE_INTEGER li;
> -            LONG period = 1000 / VSYNC_RATE;
> +            LONG period = val;
>              DbgPrint(TRACE_LEVEL_WARNING, ("Enabled VSync(fired %d)\n",
>              m_VsyncFiredCounter));
> -            li.QuadPart = -10000000 / VSYNC_RATE;
> +            li.QuadPart = -10000 * val;
>              KeSetTimerEx(&m_VsyncTimer, li, period, &m_VsyncTimerDpc);
>          }
>      }

Frediano


More information about the Spice-devel mailing list