ui/gtk: Draw guest frame at refresh cycle
PATCH v2 1/1 ui/gtk: Draw guest frame at refresh cycle
From: Dongwon Kim <[email protected]>
Draw routine needs to be manually invoked in the next refresh if there is a scanout blob from the guest. This is to prevent a situation where there is a scheduled draw event but it won't happen bacause the window is currently in inactive state (minimized or tabified). If draw is not done for a long time, gl_block timeout and/or fence timeout (on the guest) will happen eventually.
v2: Use gd_gl_area_draw(vc) in gtk-gl-area.c
--- ui/gtk-egl.c | 1 + ui/gtk-gl-area.c | 1 + 2 files changed, 2 insertions(+)
ui/gtk-egl.c +1 -0
@@ -150,6 +150,7 @@ void gd_egl_refresh(DisplayChangeListener *dcl) vc, vc->window ? vc->window : vc->gfx.drawing_area);if (vc->gfx.guest_fb.dmabuf && vc->gfx.guest_fb.dmabuf->draw_submitted) { +gd_egl_draw (vc);return ; }
ui/gtk-gl-area.c +1 -0
@@ -126,6 +126,7 @@ void gd_gl_area_refresh(DisplayChangeListener *dcl)gd_update_monitor_refresh_rate (vc, vc->window ? vc->window : vc->gfx.drawing_area);if (vc->gfx.guest_fb.dmabuf && vc->gfx.guest_fb.dmabuf->draw_submitted) { +gd_gl_area_draw (vc);return ; }
Signature · 1 line
2.34.1
Quoted 11 lines · On Sat, Apr 27, 2024 at 2:56 AM <[email protected]> wrote:
From: Dongwon Kim <[email protected]>
Draw routine needs to be manually invoked in the next refresh if there is a scanout blob from the guest. This is to prevent a situation where there is a scheduled draw event but it won't happen bacause the window is currently in inactive state (minimized or tabified). If draw is not done for a long time,
gl_blocktimeout and/or fence timeout (on the guest) will happen eventually.
Quoted 7 lines
v2: Use
gd_gl_area_draw(vc)ingtk-gl-area.cSuggested-by Vivek Kasireddy <[email protected]>Cc Gerd Hoffmann <[email protected]>Cc Marc-André Lureau <[email protected]>Cc Daniel P. Berrangé <[email protected]>Signed-off-by Dongwon Kim <[email protected]>
Quoted 33 lines
--- ui/gtk-egl.c | 1 + ui/gtk-gl-area.c | 1 + 2 files changed, 2 insertions(+)ui/gtk-egl.c +1
-0@@ -150,6 +150,7 @@ void gd_egl_refresh(DisplayChangeListener *dcl) vc, vc->window ? vc->window : vc->gfx.drawing_area);if (vc->gfx.guest_fb.dmabuf && vc->gfx.guest_fb.dmabuf->draw_submitted) { +gd_egl_draw (vc);return ; }ui/gtk-gl-area.c +1
-1@@ -126,6 +126,7 @@ void gd_gl_area_refresh(DisplayChangeListener *dcl)gd_update_monitor_refresh_rate (vc, vc->window ? vc->window : vc->gfx.drawing_area);if (vc->gfx.guest_fb.dmabuf && vc->gfx.guest_fb.dmabuf->draw_submitted) { +gd_gl_area_draw (vc);return ; } --2.34.1
Signature · 1 line
Marc-André Lureau