aboutsummaryrefslogtreecommitdiff
path: root/ui
diff options
context:
space:
mode:
authorDongwon Kim <dongwon.kim@intel.com>2023-07-06 11:33:55 -0700
committerMarc-André Lureau <marcandre.lureau@redhat.com>2023-07-17 15:22:56 +0400
commit1be878eb97abf8d43c9c5868bca69862ccae5da3 (patch)
treed95ba9ae7f9c7fd1a776ca9b09153a3818476234 /ui
parent92b58156e745b01a20861a872e327693a7e729b1 (diff)
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>
Diffstat (limited to 'ui')
-rw-r--r--ui/gtk-egl.c4
-rw-r--r--ui/gtk-gl-area.c4
2 files changed, 8 insertions, 0 deletions
diff --git a/ui/gtk-egl.c b/ui/gtk-egl.c
index 98b3a116bf..4c29ac10d0 100644
--- a/ui/gtk-egl.c
+++ b/ui/gtk-egl.c
@@ -148,6 +148,10 @@ void gd_egl_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) {
+ return;
+ }
+
if (!vc->gfx.esurface) {
gd_egl_init(vc);
if (!vc->gfx.esurface) {
diff --git a/ui/gtk-gl-area.c b/ui/gtk-gl-area.c
index 28d9e49888..1ce34a249e 100644
--- a/ui/gtk-gl-area.c
+++ b/ui/gtk-gl-area.c
@@ -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);
+ if (vc->gfx.guest_fb.dmabuf && vc->gfx.guest_fb.dmabuf->draw_submitted) {
+ return;
+ }
+
if (!vc->gfx.gls) {
if (!gtk_widget_get_realized(vc->gfx.drawing_area)) {
return;