All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v6 0/5] virtio-gpu: Add a default synchronization mechanism for blobs (v6)
@ 2021-09-14 21:18 Vivek Kasireddy
  2021-09-14 21:18 ` [PATCH v6 1/5] ui/gtk: Create a common release_dmabuf helper Vivek Kasireddy
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: Vivek Kasireddy @ 2021-09-14 21:18 UTC (permalink / raw)
  To: qemu-devel; +Cc: Dongwon Kim, Vivek Kasireddy, Gerd Hoffmann

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 some X compositors,
Windows compositors, etc.

The way it works is the Guest submits the resource_flush command and
waits -- for example over a dma fence -- until virtio-gpu sends an ack.
And, the UI will queue a new repaint request and waits until the sync
object associated with the Blit is signaled. Once this is done, the UI
will trigger virtio-gpu to send an ack for the resource_flush cmd.

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)

v4:
- Replace the field 'blob' with 'allow_fences' in QemuDmabuf struct.
  (Gerd)

v5: rebase

v6: Fixed the compilation error on platforms that do not have GBM.

Cc: Gerd Hoffmann <kraxel@redhat.com>
Cc: Dongwon Kim <dongwon.kim@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                    | 48 +++++++++++++++++++++++++++------
 ui/gtk-gl-area.c                | 26 ++++++++++++++++++
 ui/gtk.c                        | 26 ++++++++++++++++--
 9 files changed, 156 insertions(+), 14 deletions(-)

-- 
2.30.2



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

end of thread, other threads:[~2021-09-14 21:37 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-09-14 21:18 [PATCH v6 0/5] virtio-gpu: Add a default synchronization mechanism for blobs (v6) Vivek Kasireddy
2021-09-14 21:18 ` [PATCH v6 1/5] ui/gtk: Create a common release_dmabuf helper Vivek Kasireddy
2021-09-14 21:18 ` [PATCH v6 2/5] ui/egl: Add egl helpers to help with synchronization Vivek Kasireddy
2021-09-14 21:18 ` [PATCH v6 3/5] ui: Create sync objects and fences only for blobs Vivek Kasireddy
2021-09-14 21:18 ` [PATCH v6 4/5] ui/gtk-egl: Wait for the draw signal for dmabuf blobs Vivek Kasireddy
2021-09-14 21:18 ` [PATCH v6 5/5] virtio-gpu: Add gl_flushed callback Vivek Kasireddy

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.