All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-devel] [Bug 1777786] [NEW] virtio-gpu-3d.c: change virtio_gpu_fence_poll timer scale
@ 2018-06-20  7:05 Qiang Wang
  2018-06-20  9:03 ` [Qemu-devel] [Bug 1777786] " Thomas Huth
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Qiang Wang @ 2018-06-20  7:05 UTC (permalink / raw)
  To: qemu-devel

Public bug reported:

We use virtio-gpu to accelerate Unigine Heaven Benchmark in VM. But we get only 5 FPS when we use AMD RX460 in our host.
We found that guest os spent a lot of time in waiting for the return of glMapBufferRange/glUnmapBuffer commad. We suspected the host GPU was waiting for fence. So we finally change the timer of fence_poll. Afer change timer from
 ms to us, Benchmark result raise up to 22 FPS.

>From a4003af5c4fe92d55353f42767d0c45de95bb78f Mon Sep 17 00:00:00 2001
From: chen wei <chenwei1@ruijie.com.cn>
Date: Fri, 8 Jun 2018 17:34:45 +0800
Subject: [PATCH] virtio-gpu:improve 3d performance greatly

  opengl function need fence support.when CPU execute opengl function, it need wait fence for synchronize GPU.
so qemu must deal with fence timely as possible. but now the expire time of the timer to deal with fence is 10 ms.
I think it is too long for opengl. So i will change it to 20 ns.
  Before change, when i play Unigine_Heaven 3d game with virglrenderer, the fps is 3.  atfer change the fps up to 23.

Signed-off-by: chen wei   <chenwei1@ruijie.com.cn>
Signed-off-by: wang qiang <qiang_w@ruijie.com.cn>
---
 hw/display/virtio-gpu-3d.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/hw/display/virtio-gpu-3d.c b/hw/display/virtio-gpu-3d.c
index 3558f38..c0a5d21 100644
--- a/hw/display/virtio-gpu-3d.c
+++ b/hw/display/virtio-gpu-3d.c
@@ -582,7 +582,7 @@ static void virtio_gpu_fence_poll(void *opaque)
     virgl_renderer_poll();
     virtio_gpu_process_cmdq(g);
     if (!QTAILQ_EMPTY(&g->cmdq) || !QTAILQ_EMPTY(&g->fenceq)) {
-        timer_mod(g->fence_poll, qemu_clock_get_ms(QEMU_CLOCK_VIRTUAL) + 10);
+        timer_mod(g->fence_poll, qemu_clock_get_us(QEMU_CLOCK_VIRTUAL) + 20);
     }
 }
 
@@ -629,7 +629,7 @@ int virtio_gpu_virgl_init(VirtIOGPU *g)
         return ret;
     }
 
-    g->fence_poll = timer_new_ms(QEMU_CLOCK_VIRTUAL,
+    g->fence_poll = timer_new_us(QEMU_CLOCK_VIRTUAL,
                                  virtio_gpu_fence_poll, g);
 
     if (virtio_gpu_stats_enabled(g->conf)) {
-- 
2.7.4

** Affects: qemu
     Importance: Undecided
         Status: New

** Patch added: "virtio-gpu-improve-3d-performance-greatly.patch"
   https://bugs.launchpad.net/bugs/1777786/+attachment/5154498/+files/virtio-gpu-improve-3d-performance-greatly.patch

-- 
You received this bug notification because you are a member of qemu-
devel-ml, which is subscribed to QEMU.
https://bugs.launchpad.net/bugs/1777786

Title:
  virtio-gpu-3d.c: change virtio_gpu_fence_poll timer scale

Status in QEMU:
  New

Bug description:
  We use virtio-gpu to accelerate Unigine Heaven Benchmark in VM. But we get only 5 FPS when we use AMD RX460 in our host.
  We found that guest os spent a lot of time in waiting for the return of glMapBufferRange/glUnmapBuffer commad. We suspected the host GPU was waiting for fence. So we finally change the timer of fence_poll. Afer change timer from
   ms to us, Benchmark result raise up to 22 FPS.

  From a4003af5c4fe92d55353f42767d0c45de95bb78f Mon Sep 17 00:00:00 2001
  From: chen wei <chenwei1@ruijie.com.cn>
  Date: Fri, 8 Jun 2018 17:34:45 +0800
  Subject: [PATCH] virtio-gpu:improve 3d performance greatly

    opengl function need fence support.when CPU execute opengl function, it need wait fence for synchronize GPU.
  so qemu must deal with fence timely as possible. but now the expire time of the timer to deal with fence is 10 ms.
  I think it is too long for opengl. So i will change it to 20 ns.
    Before change, when i play Unigine_Heaven 3d game with virglrenderer, the fps is 3.  atfer change the fps up to 23.

  Signed-off-by: chen wei   <chenwei1@ruijie.com.cn>
  Signed-off-by: wang qiang <qiang_w@ruijie.com.cn>
  ---
   hw/display/virtio-gpu-3d.c | 4 ++--
   1 file changed, 2 insertions(+), 2 deletions(-)

  diff --git a/hw/display/virtio-gpu-3d.c b/hw/display/virtio-gpu-3d.c
  index 3558f38..c0a5d21 100644
  --- a/hw/display/virtio-gpu-3d.c
  +++ b/hw/display/virtio-gpu-3d.c
  @@ -582,7 +582,7 @@ static void virtio_gpu_fence_poll(void *opaque)
       virgl_renderer_poll();
       virtio_gpu_process_cmdq(g);
       if (!QTAILQ_EMPTY(&g->cmdq) || !QTAILQ_EMPTY(&g->fenceq)) {
  -        timer_mod(g->fence_poll, qemu_clock_get_ms(QEMU_CLOCK_VIRTUAL) + 10);
  +        timer_mod(g->fence_poll, qemu_clock_get_us(QEMU_CLOCK_VIRTUAL) + 20);
       }
   }
   
  @@ -629,7 +629,7 @@ int virtio_gpu_virgl_init(VirtIOGPU *g)
           return ret;
       }
   
  -    g->fence_poll = timer_new_ms(QEMU_CLOCK_VIRTUAL,
  +    g->fence_poll = timer_new_us(QEMU_CLOCK_VIRTUAL,
                                    virtio_gpu_fence_poll, g);
   
       if (virtio_gpu_stats_enabled(g->conf)) {
  -- 
  2.7.4

To manage notifications about this bug go to:
https://bugs.launchpad.net/qemu/+bug/1777786/+subscriptions

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [Qemu-devel] [Bug 1777786] Re: virtio-gpu-3d.c: change virtio_gpu_fence_poll timer scale
  2018-06-20  7:05 [Qemu-devel] [Bug 1777786] [NEW] virtio-gpu-3d.c: change virtio_gpu_fence_poll timer scale Qiang Wang
@ 2018-06-20  9:03 ` Thomas Huth
  2020-11-24 16:43 ` Thomas Huth
  2021-01-24  4:17 ` Launchpad Bug Tracker
  2 siblings, 0 replies; 4+ messages in thread
From: Thomas Huth @ 2018-06-20  9:03 UTC (permalink / raw)
  To: qemu-devel

Please don't use the bug tracker for providing patches, and send it to
the mailing list instead, see:
https://wiki.qemu.org/Contribute/SubmitAPatch

-- 
You received this bug notification because you are a member of qemu-
devel-ml, which is subscribed to QEMU.
https://bugs.launchpad.net/bugs/1777786

Title:
  virtio-gpu-3d.c: change virtio_gpu_fence_poll timer scale

Status in QEMU:
  New

Bug description:
  We use virtio-gpu to accelerate Unigine Heaven Benchmark in VM. But we get only 5 FPS when we use AMD RX460 in our host.
  We found that guest os spent a lot of time in waiting for the return of glMapBufferRange/glUnmapBuffer commad. We suspected the host GPU was waiting for fence. So we finally change the timer of fence_poll. Afer change timer from
   ms to us, Benchmark result raise up to 22 FPS.

  From a4003af5c4fe92d55353f42767d0c45de95bb78f Mon Sep 17 00:00:00 2001
  From: chen wei <chenwei1@ruijie.com.cn>
  Date: Fri, 8 Jun 2018 17:34:45 +0800
  Subject: [PATCH] virtio-gpu:improve 3d performance greatly

    opengl function need fence support.when CPU execute opengl function, it need wait fence for synchronize GPU.
  so qemu must deal with fence timely as possible. but now the expire time of the timer to deal with fence is 10 ms.
  I think it is too long for opengl. So i will change it to 20 ns.
    Before change, when i play Unigine_Heaven 3d game with virglrenderer, the fps is 3.  atfer change the fps up to 23.

  Signed-off-by: chen wei   <chenwei1@ruijie.com.cn>
  Signed-off-by: wang qiang <qiang_w@ruijie.com.cn>
  ---
   hw/display/virtio-gpu-3d.c | 4 ++--
   1 file changed, 2 insertions(+), 2 deletions(-)

  diff --git a/hw/display/virtio-gpu-3d.c b/hw/display/virtio-gpu-3d.c
  index 3558f38..c0a5d21 100644
  --- a/hw/display/virtio-gpu-3d.c
  +++ b/hw/display/virtio-gpu-3d.c
  @@ -582,7 +582,7 @@ static void virtio_gpu_fence_poll(void *opaque)
       virgl_renderer_poll();
       virtio_gpu_process_cmdq(g);
       if (!QTAILQ_EMPTY(&g->cmdq) || !QTAILQ_EMPTY(&g->fenceq)) {
  -        timer_mod(g->fence_poll, qemu_clock_get_ms(QEMU_CLOCK_VIRTUAL) + 10);
  +        timer_mod(g->fence_poll, qemu_clock_get_us(QEMU_CLOCK_VIRTUAL) + 20);
       }
   }
   
  @@ -629,7 +629,7 @@ int virtio_gpu_virgl_init(VirtIOGPU *g)
           return ret;
       }
   
  -    g->fence_poll = timer_new_ms(QEMU_CLOCK_VIRTUAL,
  +    g->fence_poll = timer_new_us(QEMU_CLOCK_VIRTUAL,
                                    virtio_gpu_fence_poll, g);
   
       if (virtio_gpu_stats_enabled(g->conf)) {
  -- 
  2.7.4

To manage notifications about this bug go to:
https://bugs.launchpad.net/qemu/+bug/1777786/+subscriptions

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Bug 1777786] Re: virtio-gpu-3d.c: change virtio_gpu_fence_poll timer scale
  2018-06-20  7:05 [Qemu-devel] [Bug 1777786] [NEW] virtio-gpu-3d.c: change virtio_gpu_fence_poll timer scale Qiang Wang
  2018-06-20  9:03 ` [Qemu-devel] [Bug 1777786] " Thomas Huth
@ 2020-11-24 16:43 ` Thomas Huth
  2021-01-24  4:17 ` Launchpad Bug Tracker
  2 siblings, 0 replies; 4+ messages in thread
From: Thomas Huth @ 2020-11-24 16:43 UTC (permalink / raw)
  To: qemu-devel

Did you ever send your patch to the mailing list for discussion?

** Changed in: qemu
       Status: New => Incomplete

-- 
You received this bug notification because you are a member of qemu-
devel-ml, which is subscribed to QEMU.
https://bugs.launchpad.net/bugs/1777786

Title:
  virtio-gpu-3d.c: change virtio_gpu_fence_poll timer scale

Status in QEMU:
  Incomplete

Bug description:
  We use virtio-gpu to accelerate Unigine Heaven Benchmark in VM. But we get only 5 FPS when we use AMD RX460 in our host.
  We found that guest os spent a lot of time in waiting for the return of glMapBufferRange/glUnmapBuffer commad. We suspected the host GPU was waiting for fence. So we finally change the timer of fence_poll. Afer change timer from
   ms to us, Benchmark result raise up to 22 FPS.

  From a4003af5c4fe92d55353f42767d0c45de95bb78f Mon Sep 17 00:00:00 2001
  From: chen wei <chenwei1@ruijie.com.cn>
  Date: Fri, 8 Jun 2018 17:34:45 +0800
  Subject: [PATCH] virtio-gpu:improve 3d performance greatly

    opengl function need fence support.when CPU execute opengl function, it need wait fence for synchronize GPU.
  so qemu must deal with fence timely as possible. but now the expire time of the timer to deal with fence is 10 ms.
  I think it is too long for opengl. So i will change it to 20 ns.
    Before change, when i play Unigine_Heaven 3d game with virglrenderer, the fps is 3.  atfer change the fps up to 23.

  Signed-off-by: chen wei   <chenwei1@ruijie.com.cn>
  Signed-off-by: wang qiang <qiang_w@ruijie.com.cn>
  ---
   hw/display/virtio-gpu-3d.c | 4 ++--
   1 file changed, 2 insertions(+), 2 deletions(-)

  diff --git a/hw/display/virtio-gpu-3d.c b/hw/display/virtio-gpu-3d.c
  index 3558f38..c0a5d21 100644
  --- a/hw/display/virtio-gpu-3d.c
  +++ b/hw/display/virtio-gpu-3d.c
  @@ -582,7 +582,7 @@ static void virtio_gpu_fence_poll(void *opaque)
       virgl_renderer_poll();
       virtio_gpu_process_cmdq(g);
       if (!QTAILQ_EMPTY(&g->cmdq) || !QTAILQ_EMPTY(&g->fenceq)) {
  -        timer_mod(g->fence_poll, qemu_clock_get_ms(QEMU_CLOCK_VIRTUAL) + 10);
  +        timer_mod(g->fence_poll, qemu_clock_get_us(QEMU_CLOCK_VIRTUAL) + 20);
       }
   }
   
  @@ -629,7 +629,7 @@ int virtio_gpu_virgl_init(VirtIOGPU *g)
           return ret;
       }
   
  -    g->fence_poll = timer_new_ms(QEMU_CLOCK_VIRTUAL,
  +    g->fence_poll = timer_new_us(QEMU_CLOCK_VIRTUAL,
                                    virtio_gpu_fence_poll, g);
   
       if (virtio_gpu_stats_enabled(g->conf)) {
  -- 
  2.7.4

To manage notifications about this bug go to:
https://bugs.launchpad.net/qemu/+bug/1777786/+subscriptions


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Bug 1777786] Re: virtio-gpu-3d.c: change virtio_gpu_fence_poll timer scale
  2018-06-20  7:05 [Qemu-devel] [Bug 1777786] [NEW] virtio-gpu-3d.c: change virtio_gpu_fence_poll timer scale Qiang Wang
  2018-06-20  9:03 ` [Qemu-devel] [Bug 1777786] " Thomas Huth
  2020-11-24 16:43 ` Thomas Huth
@ 2021-01-24  4:17 ` Launchpad Bug Tracker
  2 siblings, 0 replies; 4+ messages in thread
From: Launchpad Bug Tracker @ 2021-01-24  4:17 UTC (permalink / raw)
  To: qemu-devel

[Expired for QEMU because there has been no activity for 60 days.]

** Changed in: qemu
       Status: Incomplete => Expired

-- 
You received this bug notification because you are a member of qemu-
devel-ml, which is subscribed to QEMU.
https://bugs.launchpad.net/bugs/1777786

Title:
  virtio-gpu-3d.c: change virtio_gpu_fence_poll timer scale

Status in QEMU:
  Expired

Bug description:
  We use virtio-gpu to accelerate Unigine Heaven Benchmark in VM. But we get only 5 FPS when we use AMD RX460 in our host.
  We found that guest os spent a lot of time in waiting for the return of glMapBufferRange/glUnmapBuffer commad. We suspected the host GPU was waiting for fence. So we finally change the timer of fence_poll. Afer change timer from
   ms to us, Benchmark result raise up to 22 FPS.

  From a4003af5c4fe92d55353f42767d0c45de95bb78f Mon Sep 17 00:00:00 2001
  From: chen wei <chenwei1@ruijie.com.cn>
  Date: Fri, 8 Jun 2018 17:34:45 +0800
  Subject: [PATCH] virtio-gpu:improve 3d performance greatly

    opengl function need fence support.when CPU execute opengl function, it need wait fence for synchronize GPU.
  so qemu must deal with fence timely as possible. but now the expire time of the timer to deal with fence is 10 ms.
  I think it is too long for opengl. So i will change it to 20 ns.
    Before change, when i play Unigine_Heaven 3d game with virglrenderer, the fps is 3.  atfer change the fps up to 23.

  Signed-off-by: chen wei   <chenwei1@ruijie.com.cn>
  Signed-off-by: wang qiang <qiang_w@ruijie.com.cn>
  ---
   hw/display/virtio-gpu-3d.c | 4 ++--
   1 file changed, 2 insertions(+), 2 deletions(-)

  diff --git a/hw/display/virtio-gpu-3d.c b/hw/display/virtio-gpu-3d.c
  index 3558f38..c0a5d21 100644
  --- a/hw/display/virtio-gpu-3d.c
  +++ b/hw/display/virtio-gpu-3d.c
  @@ -582,7 +582,7 @@ static void virtio_gpu_fence_poll(void *opaque)
       virgl_renderer_poll();
       virtio_gpu_process_cmdq(g);
       if (!QTAILQ_EMPTY(&g->cmdq) || !QTAILQ_EMPTY(&g->fenceq)) {
  -        timer_mod(g->fence_poll, qemu_clock_get_ms(QEMU_CLOCK_VIRTUAL) + 10);
  +        timer_mod(g->fence_poll, qemu_clock_get_us(QEMU_CLOCK_VIRTUAL) + 20);
       }
   }
   
  @@ -629,7 +629,7 @@ int virtio_gpu_virgl_init(VirtIOGPU *g)
           return ret;
       }
   
  -    g->fence_poll = timer_new_ms(QEMU_CLOCK_VIRTUAL,
  +    g->fence_poll = timer_new_us(QEMU_CLOCK_VIRTUAL,
                                    virtio_gpu_fence_poll, g);
   
       if (virtio_gpu_stats_enabled(g->conf)) {
  -- 
  2.7.4

To manage notifications about this bug go to:
https://bugs.launchpad.net/qemu/+bug/1777786/+subscriptions


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2021-01-24  4:28 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-06-20  7:05 [Qemu-devel] [Bug 1777786] [NEW] virtio-gpu-3d.c: change virtio_gpu_fence_poll timer scale Qiang Wang
2018-06-20  9:03 ` [Qemu-devel] [Bug 1777786] " Thomas Huth
2020-11-24 16:43 ` Thomas Huth
2021-01-24  4:17 ` Launchpad Bug Tracker

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.