[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 4/7] ui/gtk: prevent ui lock up when dpy_gl_update called again be
From: |
Gerd Hoffmann |
Subject: |
[PULL 4/7] ui/gtk: prevent ui lock up when dpy_gl_update called again before current draw event occurs |
Date: |
Wed, 23 Nov 2022 15:44:33 +0100 |
From: Dongwon Kim <dongwon.kim@intel.com>
A warning, "qemu: warning: console: no gl-unblock within" followed by
guest scanout lockup can happen if dpy_gl_update is called in a row
and the second call is made before gd_draw_event scheduled by the first
call is taking place. This is because draw call returns without decrementing
gl_block ref count if the dmabuf was already submitted as shown below.
(gd_gl_area_draw/gd_egl_draw)
if (dmabuf) {
if (!dmabuf->draw_submitted) {
return;
} else {
dmabuf->draw_submitted = false;
}
}
So it should not schedule any redundant draw event in case draw_submitted is
already set in gd_egl_fluch/gd_gl_area_scanout_flush.
Cc: Gerd Hoffmann <kraxel@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>
Message-Id: <20221021192315.9110-1-dongwon.kim@intel.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
---
ui/gtk-egl.c | 2 +-
ui/gtk-gl-area.c | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/ui/gtk-egl.c b/ui/gtk-egl.c
index 35f917ceb15e..e84431790c9b 100644
--- a/ui/gtk-egl.c
+++ b/ui/gtk-egl.c
@@ -341,7 +341,7 @@ void gd_egl_flush(DisplayChangeListener *dcl,
VirtualConsole *vc = container_of(dcl, VirtualConsole, gfx.dcl);
GtkWidget *area = vc->gfx.drawing_area;
- if (vc->gfx.guest_fb.dmabuf) {
+ 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;
gtk_widget_queue_draw_area(area, x, y, w, h);
diff --git a/ui/gtk-gl-area.c b/ui/gtk-gl-area.c
index 682638a197d2..7696df1f6bc4 100644
--- a/ui/gtk-gl-area.c
+++ b/ui/gtk-gl-area.c
@@ -278,7 +278,7 @@ void gd_gl_area_scanout_flush(DisplayChangeListener *dcl,
{
VirtualConsole *vc = container_of(dcl, VirtualConsole, gfx.dcl);
- if (vc->gfx.guest_fb.dmabuf) {
+ 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;
}
--
2.38.1
- [PULL 0/7] Fixes 20221123 patches, Gerd Hoffmann, 2022/11/23
- [PULL 1/7] Revert "usbredir: avoid queuing hello packet on snapshot restore", Gerd Hoffmann, 2022/11/23
- [PULL 5/7] hw/usb/hcd-xhci: Reset the XHCIState with device_cold_reset(), Gerd Hoffmann, 2022/11/23
- [PULL 3/7] hw/usb/hcd-xhci.c: spelling: tranfer, Gerd Hoffmann, 2022/11/23
- [PULL 4/7] ui/gtk: prevent ui lock up when dpy_gl_update called again before current draw event occurs,
Gerd Hoffmann <=
- [PULL 6/7] hw/audio/intel-hda: don't reset codecs twice, Gerd Hoffmann, 2022/11/23
- [PULL 7/7] hw/audio/intel-hda: Drop unnecessary prototype, Gerd Hoffmann, 2022/11/23
- [PULL 2/7] gtk: disable GTK Clipboard with a new meson option, Gerd Hoffmann, 2022/11/23
- Re: [PULL 0/7] Fixes 20221123 patches, Peter Maydell, 2022/11/23
- Re: [PULL 0/7] Fixes 20221123 patches, Stefan Hajnoczi, 2022/11/23