aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVivek Kasireddy <vivek.kasireddy@intel.com>2021-09-14 14:18:36 -0700
committerGerd Hoffmann <kraxel@redhat.com>2021-09-15 08:41:59 +0200
commitab971f8abb8f3e107619866151335ec6e889b5c5 (patch)
tree49bedfa95fe7846b0f819949e9134b4de6d97b84
parent65b847d284c1ab8a1dbd44d2b046e87e83ebb6e0 (diff)
downloadqemu-ab971f8abb8f3e107619866151335ec6e889b5c5.zip
qemu-ab971f8abb8f3e107619866151335ec6e889b5c5.tar.gz
qemu-ab971f8abb8f3e107619866151335ec6e889b5c5.tar.bz2
ui/gtk-egl: Wait for the draw signal for dmabuf blobs
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> Reviewed-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Vivek Kasireddy <vivek.kasireddy@intel.com> Message-Id: <20210914211837.3229977-5-vivek.kasireddy@intel.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
-rw-r--r--include/ui/gtk.h2
-rw-r--r--ui/gtk-egl.c15
-rw-r--r--ui/gtk.c2
3 files changed, 18 insertions, 1 deletions
diff --git a/include/ui/gtk.h b/include/ui/gtk.h
index 43854f3..7d22aff 100644
--- a/include/ui/gtk.h
+++ b/include/ui/gtk.h
@@ -182,6 +182,8 @@ void gd_egl_cursor_dmabuf(DisplayChangeListener *dcl,
uint32_t hot_x, uint32_t hot_y);
void gd_egl_cursor_position(DisplayChangeListener *dcl,
uint32_t pos_x, uint32_t pos_y);
+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 3a90aeb..72ce5e1 100644
--- a/ui/gtk-egl.c
+++ b/ui/gtk-egl.c
@@ -309,6 +309,21 @@ 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) {
+ graphic_hw_gl_block(vc->gfx.dcl.con, true);
+ 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 5105c0a..b0564d8 100644
--- a/ui/gtk.c
+++ b/ui/gtk.c
@@ -637,7 +637,7 @@ static const DisplayChangeListenerOps dcl_egl_ops = {
.dpy_gl_scanout_dmabuf = gd_egl_scanout_dmabuf,
.dpy_gl_cursor_dmabuf = gd_egl_cursor_dmabuf,
.dpy_gl_cursor_position = gd_egl_cursor_position,
- .dpy_gl_update = gd_egl_scanout_flush,
+ .dpy_gl_update = gd_egl_flush,
.dpy_gl_release_dmabuf = gd_gl_release_dmabuf,
.dpy_has_dmabuf = gd_has_dmabuf,
};