[Spice-devel,07/12] qxl-wddm-dod: Set VSync indication period to 200ms

Submitted by Yuri Benditovich on March 12, 2017, 8:45 a.m.

Details

Message ID 1489308309-9728-8-git-send-email-yuri.benditovich@daynix.com
State New
Headers show
Series "Set of patches for further support of VSync" ( rev: 1 ) in Spice

Not browsing as part of any series.

Commit Message

Yuri Benditovich March 12, 2017, 8:45 a.m.
Default indication period (13-17ms) from the driver to OS
increases total CPU consumption during presentation operations.
Reducing indication frequency to 200 ms reduces cost of this
feature. Till now we do not see any negative impact of this.

Signed-off-by: Yuri Benditovich <yuri.benditovich@daynix.com>
---
 qxldod/QxlDod.cpp | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

Patch hide | download patch | download mbox

diff --git a/qxldod/QxlDod.cpp b/qxldod/QxlDod.cpp
index 7750467..bb9b227 100755
--- a/qxldod/QxlDod.cpp
+++ b/qxldod/QxlDod.cpp
@@ -19,6 +19,7 @@ 
                           (QXL_INTERRUPT_CURSOR) | \
                           (QXL_INTERRUPT_IO_CMD))
 
+#define VSYNC_PERIOD    200 // ms, use 0 for auto
 #define VSYNC_RATE      75
 
 BOOLEAN g_bSupportVSync;
@@ -5043,8 +5044,9 @@  VOID QxlDod::EnableVsync(BOOLEAN bEnable)
         else
         {
             LARGE_INTEGER li;
-            LONG period = 1000 / VSYNC_RATE;
-            DbgPrint(TRACE_LEVEL_WARNING, ("Enabled VSync(fired %d)\n", m_VsyncFiredCounter));
+            LONG period = VSYNC_PERIOD;
+            if (!period) period = 1000 / VSYNC_RATE;
+            DbgPrint(TRACE_LEVEL_WARNING, ("Enabled VSync %d ms(fired %d)\n", period, m_VsyncFiredCounter));
             li.QuadPart = -10000000 / VSYNC_RATE;
             KeSetTimerEx(&m_VsyncTimer, li, period, &m_VsyncTimerDpc);
         }

Comments

> 
> Default indication period (13-17ms) from the driver to OS
> increases total CPU consumption during presentation operations.
> Reducing indication frequency to 200 ms reduces cost of this
> feature. Till now we do not see any negative impact of this.
> 
> Signed-off-by: Yuri Benditovich <yuri.benditovich@daynix.com>
> ---
>  qxldod/QxlDod.cpp | 6 ++++--
>  1 file changed, 4 insertions(+), 2 deletions(-)
> 
> diff --git a/qxldod/QxlDod.cpp b/qxldod/QxlDod.cpp
> index 7750467..bb9b227 100755
> --- a/qxldod/QxlDod.cpp
> +++ b/qxldod/QxlDod.cpp
> @@ -19,6 +19,7 @@
>                            (QXL_INTERRUPT_CURSOR) | \
>                            (QXL_INTERRUPT_IO_CMD))
>  
> +#define VSYNC_PERIOD    200 // ms, use 0 for auto
>  #define VSYNC_RATE      75
>  
>  BOOLEAN g_bSupportVSync;
> @@ -5043,8 +5044,9 @@ VOID QxlDod::EnableVsync(BOOLEAN bEnable)
>          else
>          {
>              LARGE_INTEGER li;
> -            LONG period = 1000 / VSYNC_RATE;
> -            DbgPrint(TRACE_LEVEL_WARNING, ("Enabled VSync(fired %d)\n",
> m_VsyncFiredCounter));
> +            LONG period = VSYNC_PERIOD;
> +            if (!period) period = 1000 / VSYNC_RATE;
> +            DbgPrint(TRACE_LEVEL_WARNING, ("Enabled VSync %d ms(fired
> %d)\n", period, m_VsyncFiredCounter));
>              li.QuadPart = -10000000 / VSYNC_RATE;
>              KeSetTimerEx(&m_VsyncTimer, li, period, &m_VsyncTimerDpc);
>          }

Acked-by: Frediano Ziglio <fziglio@redhat.com>

Frediano