Skip to contentSkip to conversation

ui/gtk: set scanout mode in gd_egl/gd_gl_area_scanout_texture

PATCH In review Dongwon Kim 2 participants 2 messages Jul 25, 2023 – Aug 7, 2023

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ui/gtk: set scanout mode in gd_egl/gd_gl_area_scanout_texture

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)
Cc Gerd Hoffmann <[email protected]>
Cc Marc-André Lureau <[email protected]>
Cc Vivek Kasireddy <[email protected]>
---
 ui/gtk-egl.c     | 1 +
 ui/gtk-gl-area.c | 1 +
 2 files changed, 2 insertions(+)
ui/gtk-egl.c +1 -0
index 4c29ac10d0..a1060fd80f 100644
@@ -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);
 }
ui/gtk-gl-area.c +1 -0
index 1ce34a249e..52dcac161e 100644
@@ -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);
 }
Signature · 1 line
2.34.1
Reviewed-by on v1 1/1
#1 lore raw

Hi

Quoted 11 lines · Dongwon Kim

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.

Quoted 6 lines
Fixes 92b58156e7 ("ui/gtk: set scanout-mode right before scheduling draw)
Cc Gerd Hoffmann <[email protected]>
Cc Marc-André Lureau <[email protected]>
Cc Vivek Kasireddy <[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
index 4c29ac10d0..a1060fd80f 100644
@@ -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);
 }
ui/gtk-gl-area.c +1 -1
index 1ce34a249e..52dcac161e 100644
@@ -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

Signature · 1 line
Marc-André Lureau