summary refs log tree commit diff stats
path: root/ui/gtk-egl.c
diff options
context:
space:
mode:
authorDongwon Kim <dongwon.kim@intel.com>2021-11-03 23:51:50 -0700
committerGerd Hoffmann <kraxel@redhat.com>2021-11-05 12:29:34 +0100
commit4872a023a593e6519b272a57fea03abe13a7bb00 (patch)
tree90eb2ff0cafef59d49218abbaeddac4a5a0300a5 /ui/gtk-egl.c
parent01eb4749f03fe6881388287ede65f6662de11d0a (diff)
downloadfocaccia-qemu-4872a023a593e6519b272a57fea03abe13a7bb00.tar.gz
focaccia-qemu-4872a023a593e6519b272a57fea03abe13a7bb00.zip
ui/gtk-egl: guest fb texture needs to be regenerated when reinitializing egl
If guest fb is backed by dmabuf (blob-resource), the texture bound to the
old context needs to be recreated in case the egl is re-initialized (e.g.
new window for vc is created in case of detaching/reattaching of the tab)

v2: call egl_dmabuf_release_texutre instead of putting 0 to dmabuf->texture
    (Vivek Kasireddy)

Cc: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Dongwon Kim <dongwon.kim@intel.com>
Message-Id: <20211104065153.28897-3-dongwon.kim@intel.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Diffstat (limited to 'ui/gtk-egl.c')
-rw-r--r--ui/gtk-egl.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/ui/gtk-egl.c b/ui/gtk-egl.c
index 2164995098..f2026e4b5c 100644
--- a/ui/gtk-egl.c
+++ b/ui/gtk-egl.c
@@ -155,6 +155,10 @@ void gd_egl_refresh(DisplayChangeListener *dcl)
             surface_gl_destroy_texture(vc->gfx.gls, vc->gfx.ds);
             surface_gl_create_texture(vc->gfx.gls, vc->gfx.ds);
         }
+        if (vc->gfx.guest_fb.dmabuf) {
+            egl_dmabuf_release_texture(vc->gfx.guest_fb.dmabuf);
+            gd_egl_scanout_dmabuf(dcl, vc->gfx.guest_fb.dmabuf);
+        }
     }
 
     graphic_hw_update(dcl->con);