From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:40444) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fVZ8a-000552-Hf for qemu-devel@nongnu.org; Wed, 20 Jun 2018 05:10:53 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fVZ8V-0002fu-Qv for qemu-devel@nongnu.org; Wed, 20 Jun 2018 05:10:48 -0400 Received: from indium.canonical.com ([91.189.90.7]:33680) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fVZ8V-0002fb-Jz for qemu-devel@nongnu.org; Wed, 20 Jun 2018 05:10:43 -0400 Received: from loganberry.canonical.com ([91.189.90.37]) by indium.canonical.com with esmtp (Exim 4.86_2 #2 (Debian)) id 1fVZ8U-0008NF-3P for ; Wed, 20 Jun 2018 09:10:42 +0000 Received: from loganberry.canonical.com (localhost [127.0.0.1]) by loganberry.canonical.com (Postfix) with ESMTP id 12C372E802D for ; Wed, 20 Jun 2018 09:10:42 +0000 (UTC) MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Date: Wed, 20 Jun 2018 09:03:50 -0000 From: Thomas Huth <1777786@bugs.launchpad.net> Reply-To: Bug 1777786 <1777786@bugs.launchpad.net> Sender: bounces@canonical.com References: <152947832268.7374.8550233006013647387.malonedeb@wampee.canonical.com> Message-Id: <152948543047.1873.6003822053837891174.malone@chaenomeles.canonical.com> Errors-To: bounces@canonical.com Subject: [Qemu-devel] [Bug 1777786] Re: virtio-gpu-3d.c: change virtio_gpu_fence_poll timer scale List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org 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 ge= t 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 g= lMapBufferRange/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=EF=BC=8C Benchmark result raise up to 22 FPS. From a4003af5c4fe92d55353f42767d0c45de95bb78f Mon Sep 17 00:00:00 2001 From: chen wei 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, t= he fps is 3. atfer change the fps up to 23. Signed-off-by: chen wei Signed-off-by: wang qiang --- 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 =3D timer_new_ms(QEMU_CLOCK_VIRTUAL, + g->fence_poll =3D 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