diff mbox series

[4/4] ui/gtk-egl: guest fb texture needs to be regenerated when reinitializing egl

Message ID 20210706233445.7094-1-dongwon.kim@intel.com (mailing list archive)
State New, archived
Headers show
Series None | expand

Commit Message

Kim, Dongwon July 6, 2021, 11:34 p.m. UTC
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)

Signed-off-by: Dongwon Kim <dongwon.kim@intel.com>
---
 ui/gtk-egl.c | 4 ++++
 1 file changed, 4 insertions(+)

Comments

Kasireddy, Vivek July 16, 2021, 10:23 p.m. UTC | #1
> 
> 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)
> 
> Signed-off-by: Dongwon Kim <dongwon.kim@intel.com>
> ---
>  ui/gtk-egl.c | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/ui/gtk-egl.c b/ui/gtk-egl.c index 32516b806c..5dd7c7e1f5 100644
> --- a/ui/gtk-egl.c
> +++ b/ui/gtk-egl.c
> @@ -129,6 +129,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) {
> +            vc->gfx.guest_fb.dmabuf->texture = 0;
[Kasireddy, Vivek] Shouldn't you call egl_dmabuf_release_texture() instead?


Thanks,
Vivek
> +            gd_egl_scanout_dmabuf(dcl, vc->gfx.guest_fb.dmabuf);
> +        }
>      }
> 
>      graphic_hw_update(dcl->con);
> --
> 2.17.1
>
diff mbox series

Patch

diff --git a/ui/gtk-egl.c b/ui/gtk-egl.c
index 32516b806c..5dd7c7e1f5 100644
--- a/ui/gtk-egl.c
+++ b/ui/gtk-egl.c
@@ -129,6 +129,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) {
+            vc->gfx.guest_fb.dmabuf->texture = 0;
+            gd_egl_scanout_dmabuf(dcl, vc->gfx.guest_fb.dmabuf);
+        }
     }
 
     graphic_hw_update(dcl->con);