ui/gtk: skip refresh if new dmabuf has been submitted

Skip refresh if a new dmabuf (guest scanout frame) has already been
submitted and ready to be drawn because the scanout will be updated
with new frame anyway.

Cc: Gerd Hoffmann <kraxel@redhat.com>
Cc: Marc-André Lureau <marcandre.lureau@redhat.com>
Cc: Vivek Kasireddy <vivek.kasireddy@intel.com>
Signed-off-by: Dongwon Kim <dongwon.kim@intel.com>
Acked-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Message-ID: <20230706183355.29361-2-dongwon.kim@intel.com>
This commit is contained in:
Dongwon Kim 2023-07-06 11:33:55 -07:00 committed by Marc-André Lureau
parent 92b58156e7
commit 1be878eb97
2 changed files with 8 additions and 0 deletions

View File

@ -148,6 +148,10 @@ void gd_egl_refresh(DisplayChangeListener *dcl)
gd_update_monitor_refresh_rate( gd_update_monitor_refresh_rate(
vc, vc->window ? vc->window : vc->gfx.drawing_area); vc, vc->window ? vc->window : vc->gfx.drawing_area);
if (vc->gfx.guest_fb.dmabuf && vc->gfx.guest_fb.dmabuf->draw_submitted) {
return;
}
if (!vc->gfx.esurface) { if (!vc->gfx.esurface) {
gd_egl_init(vc); gd_egl_init(vc);
if (!vc->gfx.esurface) { if (!vc->gfx.esurface) {

View File

@ -125,6 +125,10 @@ void gd_gl_area_refresh(DisplayChangeListener *dcl)
gd_update_monitor_refresh_rate(vc, vc->window ? vc->window : vc->gfx.drawing_area); 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) {
return;
}
if (!vc->gfx.gls) { if (!vc->gfx.gls) {
if (!gtk_widget_get_realized(vc->gfx.drawing_area)) { if (!gtk_widget_get_realized(vc->gfx.drawing_area)) {
return; return;