Skip to content

Commit ab971f8

Browse files
vivekkreddykraxel
authored andcommitted
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 <[email protected]> Reviewed-by: Gerd Hoffmann <[email protected]> Signed-off-by: Vivek Kasireddy <[email protected]> Message-Id: <[email protected]> Signed-off-by: Gerd Hoffmann <[email protected]>
1 parent 65b847d commit ab971f8

File tree

3 files changed

+18
-1
lines changed

3 files changed

+18
-1
lines changed

include/ui/gtk.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -182,6 +182,8 @@ void gd_egl_cursor_dmabuf(DisplayChangeListener *dcl,
182182
uint32_t hot_x, uint32_t hot_y);
183183
void gd_egl_cursor_position(DisplayChangeListener *dcl,
184184
uint32_t pos_x, uint32_t pos_y);
185+
void gd_egl_flush(DisplayChangeListener *dcl,
186+
uint32_t x, uint32_t y, uint32_t w, uint32_t h);
185187
void gd_egl_scanout_flush(DisplayChangeListener *dcl,
186188
uint32_t x, uint32_t y, uint32_t w, uint32_t h);
187189
void gtk_egl_init(DisplayGLMode mode);

ui/gtk-egl.c

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -309,6 +309,21 @@ void gd_egl_scanout_flush(DisplayChangeListener *dcl,
309309
eglSwapBuffers(qemu_egl_display, vc->gfx.esurface);
310310
}
311311

312+
void gd_egl_flush(DisplayChangeListener *dcl,
313+
uint32_t x, uint32_t y, uint32_t w, uint32_t h)
314+
{
315+
VirtualConsole *vc = container_of(dcl, VirtualConsole, gfx.dcl);
316+
GtkWidget *area = vc->gfx.drawing_area;
317+
318+
if (vc->gfx.guest_fb.dmabuf) {
319+
graphic_hw_gl_block(vc->gfx.dcl.con, true);
320+
gtk_widget_queue_draw_area(area, x, y, w, h);
321+
return;
322+
}
323+
324+
gd_egl_scanout_flush(&vc->gfx.dcl, x, y, w, h);
325+
}
326+
312327
void gtk_egl_init(DisplayGLMode mode)
313328
{
314329
GdkDisplay *gdk_display = gdk_display_get_default();

ui/gtk.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -637,7 +637,7 @@ static const DisplayChangeListenerOps dcl_egl_ops = {
637637
.dpy_gl_scanout_dmabuf = gd_egl_scanout_dmabuf,
638638
.dpy_gl_cursor_dmabuf = gd_egl_cursor_dmabuf,
639639
.dpy_gl_cursor_position = gd_egl_cursor_position,
640-
.dpy_gl_update = gd_egl_scanout_flush,
640+
.dpy_gl_update = gd_egl_flush,
641641
.dpy_gl_release_dmabuf = gd_gl_release_dmabuf,
642642
.dpy_has_dmabuf = gd_has_dmabuf,
643643
};

0 commit comments

Comments
 (0)