diff mbox series

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

Message ID 20230706183355.29361-2-dongwon.kim@intel.com (mailing list archive)
State New, archived
Headers show
Series ui/gtk: skip refresh if new dmabuf has been submitted | expand

Commit Message

Kim, Dongwon July 6, 2023, 6:33 p.m. UTC
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>
---
 ui/gtk-egl.c     | 4 ++++
 ui/gtk-gl-area.c | 4 ++++
 2 files changed, 8 insertions(+)

Comments

Marc-André Lureau July 17, 2023, 9:31 a.m. UTC | #1
On Thu, Jul 6, 2023 at 10:57 PM Dongwon Kim <dongwon.kim@intel.com> wrote:

> 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>


> ---
>  ui/gtk-egl.c     | 4 ++++
>  ui/gtk-gl-area.c | 4 ++++
>  2 files changed, 8 insertions(+)
>
> diff --git a/ui/gtk-egl.c b/ui/gtk-egl.c
> index d59b8cd7d7..859aa8185e 100644
> --- a/ui/gtk-egl.c
> +++ b/ui/gtk-egl.c
> @@ -144,6 +144,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 7367dfd793..7da75bd025 100644
> --- a/ui/gtk-gl-area.c
> +++ b/ui/gtk-gl-area.c
> @@ -123,6 +123,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;
> --
> 2.34.1
>
>
>
diff mbox series

Patch

diff --git a/ui/gtk-egl.c b/ui/gtk-egl.c
index d59b8cd7d7..859aa8185e 100644
--- a/ui/gtk-egl.c
+++ b/ui/gtk-egl.c
@@ -144,6 +144,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 7367dfd793..7da75bd025 100644
--- a/ui/gtk-gl-area.c
+++ b/ui/gtk-gl-area.c
@@ -123,6 +123,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;