[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[RFC PATCH 4/9] ui/gtk: Disable the scanout when a detached tab is close
From: |
Dongwon Kim |
Subject: |
[RFC PATCH 4/9] ui/gtk: Disable the scanout when a detached tab is closed |
Date: |
Tue, 20 Jun 2023 17:43:50 -0700 |
From: Vivek Kasireddy <vivek.kasireddy@intel.com>
When a detached tab window is closed, the underlying (EGL) context
is destroyed; therefore, disable the scanout which also destroys the
underlying framebuffer (id) and other objects. Also add calls to
make the context current in disable scanout and other missing places.
Cc: Gerd Hoffmann <kraxel@redhat.com>
Cc: Daniel P. Berrangé <berrange@redhat.com>
Cc: Markus Armbruster <armbru@redhat.com>
Cc: Philippe Mathieu-Daudé <philmd@linaro.org>
Cc: Marc-André Lureau <marcandre.lureau@redhat.com>
Signed-off-by: Vivek Kasireddy <vivek.kasireddy@intel.com>
Signed-off-by: Dongwon Kim <dongwon.kim@intel.com>
---
ui/gtk-egl.c | 3 +++
ui/gtk-gl-area.c | 2 ++
ui/gtk.c | 1 +
3 files changed, 6 insertions(+)
diff --git a/ui/gtk-egl.c b/ui/gtk-egl.c
index 443873e266..aa22ebbd98 100644
--- a/ui/gtk-egl.c
+++ b/ui/gtk-egl.c
@@ -214,6 +214,9 @@ void gd_egl_scanout_disable(DisplayChangeListener *dcl)
{
VirtualConsole *vc = container_of(dcl, VirtualConsole, gfx.dcl);
+ eglMakeCurrent(qemu_egl_display, vc->gfx.esurface,
+ vc->gfx.esurface, vc->gfx.ectx);
+
vc->gfx.w = 0;
vc->gfx.h = 0;
gtk_egl_set_scanout_mode(vc, false);
diff --git a/ui/gtk-gl-area.c b/ui/gtk-gl-area.c
index 68b16a5ff1..8228cc9f3f 100644
--- a/ui/gtk-gl-area.c
+++ b/ui/gtk-gl-area.c
@@ -270,6 +270,7 @@ void gd_gl_area_scanout_disable(DisplayChangeListener *dcl)
{
VirtualConsole *vc = container_of(dcl, VirtualConsole, gfx.dcl);
+ gtk_gl_area_make_current(GTK_GL_AREA(vc->gfx.drawing_area));
gtk_gl_area_set_scanout_mode(vc, false);
}
@@ -282,6 +283,7 @@ void gd_gl_area_scanout_flush(DisplayChangeListener *dcl,
return;
}
+ gtk_gl_area_make_current(GTK_GL_AREA(vc->gfx.drawing_area));
if (vc->gfx.guest_fb.dmabuf && !vc->gfx.guest_fb.dmabuf->draw_submitted) {
graphic_hw_gl_block(vc->gfx.dcl.con, true);
vc->gfx.guest_fb.dmabuf->draw_submitted = true;
diff --git a/ui/gtk.c b/ui/gtk.c
index f9096aea14..90ecb8b82f 100644
--- a/ui/gtk.c
+++ b/ui/gtk.c
@@ -1400,6 +1400,7 @@ static gboolean gd_tab_window_close(GtkWidget *widget,
GdkEvent *event,
vc->gfx.visible = false;
gd_set_ui_size(vc, 0, 0);
+ dpy_gl_scanout_disable(vc->gfx.dcl.con);
gtk_widget_set_sensitive(vc->menu_item, true);
gd_widget_reparent(vc->window, s->notebook, vc->tab_item);
gtk_notebook_set_tab_label_text(GTK_NOTEBOOK(s->notebook),
--
2.34.1
- [RFC PATCH 0/9] ui: guest displays multiple connectors suppport and hotplug in, Dongwon Kim, 2023/06/20
- [RFC PATCH 1/9] ui/gtk: skip drawing guest scanout when associated VC is invisible, Dongwon Kim, 2023/06/20
- [RFC PATCH 3/9] ui/gtk: reset visible flag when window is minimized, Dongwon Kim, 2023/06/20
- [RFC PATCH 2/9] ui/gtk: set the ui size to 0 when invisible, Dongwon Kim, 2023/06/20
- [RFC PATCH 4/9] ui/gtk: Disable the scanout when a detached tab is closed,
Dongwon Kim <=
- [RFC PATCH 5/9] ui/gtk: Factor out tab window creation into a separate function, Dongwon Kim, 2023/06/20
- [RFC PATCH 7/9] ui/gtk: unblock gl if draw submitted already or fence is not yet signaled, Dongwon Kim, 2023/06/20
- [RFC PATCH 6/9] ui/gtk: Add a new parameter to assign connectors/monitors to GFX VCs, Dongwon Kim, 2023/06/20
- [RFC PATCH 8/9] ui/gtk: skip drawing if any of ctx/surface/image don't exist, Dongwon Kim, 2023/06/20
- [RFC PATCH 9/9] ui/gtk: skip refresh/rendering if VC is invisible, Dongwon Kim, 2023/06/20