qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] ui/gtk: set scanout mode in gd_egl/gd_gl_area_scanout_texture
@ 2023-07-25  0:11 Dongwon Kim
  2023-08-07 11:54 ` Marc-André Lureau
  0 siblings, 1 reply; 2+ messages in thread
From: Dongwon Kim @ 2023-07-25  0:11 UTC (permalink / raw)
  To: qemu-devel
  Cc: Dongwon Kim, Volker Rümelin, Gerd Hoffmann,
	Marc-André Lureau, Vivek Kasireddy

Fixing a regression (black screen) caused by a commit 92b58156e7
("ui/gtk: set scanout-mode right before scheduling draw").

The commit 92b58156e7 was made with an assumption that the scanout
mode needs to be set only if the guest scanout is a dmabuf but there
are cases (e.g. virtio-gpu-virgl) where the scanout is still processed
in a form of a texture but is not backed by dmabuf. So it is needed
to put back the line that sets scanout mode in gd_egl_scanout_texture
and gd_gl_area_scanout_texture.

Fixes: 92b58156e7 ("ui/gtk: set scanout-mode right before scheduling draw)
Reported-by: Volker Rümelin <vr_qemu@t-online.de>
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     | 1 +
 ui/gtk-gl-area.c | 1 +
 2 files changed, 2 insertions(+)

diff --git a/ui/gtk-egl.c b/ui/gtk-egl.c
index 4c29ac10d0..a1060fd80f 100644
--- a/ui/gtk-egl.c
+++ b/ui/gtk-egl.c
@@ -246,6 +246,7 @@ void gd_egl_scanout_texture(DisplayChangeListener *dcl,
     eglMakeCurrent(qemu_egl_display, vc->gfx.esurface,
                    vc->gfx.esurface, vc->gfx.ectx);
 
+    gtk_egl_set_scanout_mode(vc, true);
     egl_fb_setup_for_tex(&vc->gfx.guest_fb, backing_width, backing_height,
                          backing_id, false);
 }
diff --git a/ui/gtk-gl-area.c b/ui/gtk-gl-area.c
index 1ce34a249e..52dcac161e 100644
--- a/ui/gtk-gl-area.c
+++ b/ui/gtk-gl-area.c
@@ -268,6 +268,7 @@ void gd_gl_area_scanout_texture(DisplayChangeListener *dcl,
         return;
     }
 
+    gtk_gl_area_set_scanout_mode(vc, true);
     egl_fb_setup_for_tex(&vc->gfx.guest_fb, backing_width, backing_height,
                          backing_id, false);
 }
-- 
2.34.1



^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] ui/gtk: set scanout mode in gd_egl/gd_gl_area_scanout_texture
  2023-07-25  0:11 [PATCH] ui/gtk: set scanout mode in gd_egl/gd_gl_area_scanout_texture Dongwon Kim
@ 2023-08-07 11:54 ` Marc-André Lureau
  0 siblings, 0 replies; 2+ messages in thread
From: Marc-André Lureau @ 2023-08-07 11:54 UTC (permalink / raw)
  To: Dongwon Kim
  Cc: qemu-devel, Volker Rümelin, Gerd Hoffmann, Vivek Kasireddy

Hi

On Tue, Jul 25, 2023 at 4:35 AM Dongwon Kim <dongwon.kim@intel.com> wrote:
>
> Fixing a regression (black screen) caused by a commit 92b58156e7
> ("ui/gtk: set scanout-mode right before scheduling draw").
>
> The commit 92b58156e7 was made with an assumption that the scanout
> mode needs to be set only if the guest scanout is a dmabuf but there
> are cases (e.g. virtio-gpu-virgl) where the scanout is still processed
> in a form of a texture but is not backed by dmabuf. So it is needed
> to put back the line that sets scanout mode in gd_egl_scanout_texture
> and gd_gl_area_scanout_texture.
>
> Fixes: 92b58156e7 ("ui/gtk: set scanout-mode right before scheduling draw)
> Reported-by: Volker Rümelin <vr_qemu@t-online.de>
> 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>

Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>

> ---
>  ui/gtk-egl.c     | 1 +
>  ui/gtk-gl-area.c | 1 +
>  2 files changed, 2 insertions(+)
>
> diff --git a/ui/gtk-egl.c b/ui/gtk-egl.c
> index 4c29ac10d0..a1060fd80f 100644
> --- a/ui/gtk-egl.c
> +++ b/ui/gtk-egl.c
> @@ -246,6 +246,7 @@ void gd_egl_scanout_texture(DisplayChangeListener *dcl,
>      eglMakeCurrent(qemu_egl_display, vc->gfx.esurface,
>                     vc->gfx.esurface, vc->gfx.ectx);
>
> +    gtk_egl_set_scanout_mode(vc, true);
>      egl_fb_setup_for_tex(&vc->gfx.guest_fb, backing_width, backing_height,
>                           backing_id, false);
>  }
> diff --git a/ui/gtk-gl-area.c b/ui/gtk-gl-area.c
> index 1ce34a249e..52dcac161e 100644
> --- a/ui/gtk-gl-area.c
> +++ b/ui/gtk-gl-area.c
> @@ -268,6 +268,7 @@ void gd_gl_area_scanout_texture(DisplayChangeListener *dcl,
>          return;
>      }
>
> +    gtk_gl_area_set_scanout_mode(vc, true);
>      egl_fb_setup_for_tex(&vc->gfx.guest_fb, backing_width, backing_height,
>                           backing_id, false);
>  }
> --
> 2.34.1
>
>


-- 
Marc-André Lureau


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2023-08-07 11:55 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-07-25  0:11 [PATCH] ui/gtk: set scanout mode in gd_egl/gd_gl_area_scanout_texture Dongwon Kim
2023-08-07 11:54 ` Marc-André Lureau

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).