mbox series

[v3,0/5] virtio-gpu: Add a default synchronization mechanism for blobs

Message ID 20210621192425.1188442-1-vivek.kasireddy@intel.com (mailing list archive)
Headers show
Series virtio-gpu: Add a default synchronization mechanism for blobs | expand

Message

Kasireddy, Vivek June 21, 2021, 7:24 p.m. UTC
When the Guest and Host are using Blob resources, there is a chance
that they may use the underlying storage associated with a Blob at
the same time leading to glitches such as flickering or tearing.
To prevent these from happening, the Host needs to ensure that it
waits until its Blit is completed by the Host GPU before letting
the Guest reuse the Blob.

This should be the default behavior regardless of the type of Guest
that is using Blob resources but would be particularly useful for 
Guests that are using frontbuffer rendering such as Linux with X
or Windows 10, etc.

The way it works is the Guest includes a fence as part of 
resource_flush and waits for it to be signalled. The Host will
queue a repaint request and signal the fence after it completes
waiting on the sync object associated with the Blit.

v2:
- Added more description in the cover letter
- Removed the wait from resource_flush and included it in
  a gl_flushed() callback

v3:
- Instead of explicitly waiting on the sync object and stalling the
  thread, add the relevant fence fd to Qemu's main loop and wait
  for it to be signalled. (suggested by Gerd Hoffmann)

Cc: Gerd Hoffmann <kraxel@redhat.com>
Cc: Dongwon Kim <dongwon.kim@intel.com>
Cc: Tina Zhang <tina.zhang@intel.com>

Vivek Kasireddy (5):
  ui/gtk: Create a common release_dmabuf helper
  ui/egl: Add egl helpers to help with synchronization
  ui: Create sync objects and fences only for blobs
  ui/gtk-egl: Wait for the draw signal for dmabuf blobs
  virtio-gpu: Add gl_flushed callback

 hw/display/virtio-gpu-udmabuf.c |  1 +
 hw/display/virtio-gpu.c         | 32 ++++++++++++++++++++++--
 include/ui/console.h            |  3 +++
 include/ui/egl-helpers.h        |  3 +++
 include/ui/gtk.h                |  5 ++--
 ui/egl-helpers.c                | 26 ++++++++++++++++++++
 ui/gtk-egl.c                    | 43 +++++++++++++++++++++++++++------
 ui/gtk-gl-area.c                | 20 +++++++++++++++
 ui/gtk.c                        | 26 ++++++++++++++++++--
 9 files changed, 145 insertions(+), 14 deletions(-)

Comments

no-reply@patchew.org June 21, 2021, 7:48 p.m. UTC | #1
Patchew URL: https://patchew.org/QEMU/20210621192425.1188442-1-vivek.kasireddy@intel.com/



Hi,

This series seems to have some coding style problems. See output below for
more information:

Type: series
Message-id: 20210621192425.1188442-1-vivek.kasireddy@intel.com
Subject: [PATCH v3 0/5] virtio-gpu: Add a default synchronization mechanism for blobs

=== TEST SCRIPT BEGIN ===
#!/bin/bash
git rev-parse base > /dev/null || exit 0
git config --local diff.renamelimit 0
git config --local diff.renames True
git config --local diff.algorithm histogram
./scripts/checkpatch.pl --mailback base..
=== TEST SCRIPT END ===

Updating 3c8cf5a9c21ff8782164d1def7f44bd888713384
From https://github.com/patchew-project/qemu
   53f306f..0add99e  master     -> master
 - [tag update]      patchew/20210621171021.1819881-1-richard.henderson@linaro.org -> patchew/20210621171021.1819881-1-richard.henderson@linaro.org
 * [new tag]         patchew/20210621192425.1188442-1-vivek.kasireddy@intel.com -> patchew/20210621192425.1188442-1-vivek.kasireddy@intel.com
Switched to a new branch 'test'
33105de virtio-gpu: Add gl_flushed callback
c253f9f ui/gtk-egl: Wait for the draw signal for dmabuf blobs
5909df4 ui: Create sync objects and fences only for blobs
4f7d4b6 ui/egl: Add egl helpers to help with synchronization
a153fed ui/gtk: Create a common release_dmabuf helper

=== OUTPUT BEGIN ===
1/5 Checking commit a153fed2c4e2 (ui/gtk: Create a common release_dmabuf helper)
2/5 Checking commit 4f7d4b6596ae (ui/egl: Add egl helpers to help with synchronization)
ERROR: code indent should never use tabs
#62: FILE: ui/egl-helpers.c:88:
+^I^I^I^IEGL_SYNC_NATIVE_FENCE_ANDROID, NULL);$

total: 1 errors, 0 warnings, 48 lines checked

Patch 2/5 has style problems, please review.  If any of these errors
are false positives report them to the maintainer, see
CHECKPATCH in MAINTAINERS.

3/5 Checking commit 5909df40fbc8 (ui: Create sync objects and fences only for blobs)
4/5 Checking commit c253f9f281ae (ui/gtk-egl: Wait for the draw signal for dmabuf blobs)
5/5 Checking commit 33105de28a52 (virtio-gpu: Add gl_flushed callback)
=== OUTPUT END ===

Test command exited with code: 1


The full log is available at
http://patchew.org/logs/20210621192425.1188442-1-vivek.kasireddy@intel.com/testing.checkpatch/?type=message.
---
Email generated automatically by Patchew [https://patchew.org/].
Please send your feedback to patchew-devel@redhat.com