[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v3 18/20] ui/gtk-egl: Wait for the draw signal for dmabuf blobs
From: |
Vivek Kasireddy |
Subject: |
[PATCH v3 18/20] ui/gtk-egl: Wait for the draw signal for dmabuf blobs |
Date: |
Tue, 11 May 2021 01:08:16 -0700 |
Instead of immediately drawing and submitting, queue and wait
for the draw signal if the dmabuf submitted is a blob.
Cc: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Vivek Kasireddy <vivek.kasireddy@intel.com>
---
include/ui/gtk.h | 2 ++
ui/gtk-egl.c | 14 ++++++++++++++
ui/gtk.c | 2 +-
3 files changed, 17 insertions(+), 1 deletion(-)
diff --git a/include/ui/gtk.h b/include/ui/gtk.h
index 5ae0ad60a6..0929e658f2 100644
--- a/include/ui/gtk.h
+++ b/include/ui/gtk.h
@@ -116,6 +116,8 @@ void gd_egl_cursor_position(DisplayChangeListener *dcl,
uint32_t pos_x, uint32_t pos_y);
void gd_egl_release_dmabuf(DisplayChangeListener *dcl,
QemuDmaBuf *dmabuf);
+void gd_egl_flush(DisplayChangeListener *dcl,
+ uint32_t x, uint32_t y, uint32_t w, uint32_t h);
void gd_egl_scanout_flush(DisplayChangeListener *dcl,
uint32_t x, uint32_t y, uint32_t w, uint32_t h);
void gtk_egl_init(DisplayGLMode mode);
diff --git a/ui/gtk-egl.c b/ui/gtk-egl.c
index e7117695f0..799e3cbc78 100644
--- a/ui/gtk-egl.c
+++ b/ui/gtk-egl.c
@@ -302,6 +302,20 @@ void gd_egl_scanout_flush(DisplayChangeListener *dcl,
eglSwapBuffers(qemu_egl_display, vc->gfx.esurface);
}
+void gd_egl_flush(DisplayChangeListener *dcl,
+ uint32_t x, uint32_t y, uint32_t w, uint32_t h)
+{
+ VirtualConsole *vc = container_of(dcl, VirtualConsole, gfx.dcl);
+ GtkWidget *area = vc->gfx.drawing_area;
+
+ if (vc->gfx.guest_fb.dmabuf) {
+ gtk_widget_queue_draw_area(area, x, y, w, h);
+ return;
+ }
+
+ gd_egl_scanout_flush(&vc->gfx.dcl, x, y, w, h);
+}
+
void gtk_egl_init(DisplayGLMode mode)
{
GdkDisplay *gdk_display = gdk_display_get_default();
diff --git a/ui/gtk.c b/ui/gtk.c
index 7465aa7552..4c6066b015 100644
--- a/ui/gtk.c
+++ b/ui/gtk.c
@@ -685,7 +685,7 @@ static const DisplayChangeListenerOps dcl_egl_ops = {
.dpy_gl_cursor_dmabuf = gd_egl_cursor_dmabuf,
.dpy_gl_cursor_position = gd_egl_cursor_position,
.dpy_gl_release_dmabuf = gd_egl_release_dmabuf,
- .dpy_gl_update = gd_egl_scanout_flush,
+ .dpy_gl_update = gd_egl_flush,
.dpy_gl_wait_dmabuf = gd_gl_wait_dmabuf,
.dpy_has_dmabuf = gd_has_dmabuf,
};
--
2.30.2
- [PATCH v3 05/20] virtio-gpu: Refactor virtio_gpu_set_scanout, (continued)
- [PATCH v3 05/20] virtio-gpu: Refactor virtio_gpu_set_scanout, Vivek Kasireddy, 2021/05/11
- [PATCH v3 08/20] virtio-gpu: Add virtio_gpu_resource_create_blob, Vivek Kasireddy, 2021/05/11
- [PATCH v3 10/20] virtio-gpu: Add helpers to create and destroy dmabuf objects, Vivek Kasireddy, 2021/05/11
- [PATCH v3 12/20] virtio-gpu: Add virtio_gpu_set_scanout_blob, Vivek Kasireddy, 2021/05/11
- [PATCH v3 13/20] virtio-gpu: Update cursor data using blob, Vivek Kasireddy, 2021/05/11
- [PATCH v3 11/20] virtio-gpu: Factor out update scanout, Vivek Kasireddy, 2021/05/11
- [PATCH v3 09/20] ui/pixman: Add qemu_pixman_to_drm_format(), Vivek Kasireddy, 2021/05/11
- [PATCH v3 14/20] virtio-gpu: Add initial definitions for explict flush feature, Vivek Kasireddy, 2021/05/11
- [PATCH v3 15/20] virtio-gpu: Add dmabuf helpers for synchronization, Vivek Kasireddy, 2021/05/11
- [PATCH v3 16/20] virtio-gpu: Add virtio_gpu_wait_flush API, Vivek Kasireddy, 2021/05/11
- [PATCH v3 18/20] ui/gtk-egl: Wait for the draw signal for dmabuf blobs,
Vivek Kasireddy <=
- [PATCH v3 17/20] ui: Add egl helpers for synchronization, Vivek Kasireddy, 2021/05/11
- [PATCH v3 19/20] ui/gtk: Create a common release_dmabuf helper, Vivek Kasireddy, 2021/05/11
- [PATCH v3 20/20] virtio-gpu: Add gl_flushed callback, Vivek Kasireddy, 2021/05/11