qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Laurent Vivier <laurent@vivier.eu>
To: Gerd Hoffmann <kraxel@redhat.com>, qemu-devel@nongnu.org
Cc: Dongwon Kim <dongwon.kim@intel.com>,
	"Michael S. Tsirkin" <mst@redhat.com>
Subject: Re: [PULL 4/6] ui/gtk-egl: guest fb texture needs to be regenerated when reinitializing egl
Date: Sat, 6 Nov 2021 21:32:40 +0100	[thread overview]
Message-ID: <e44b788c-0764-66ce-f78b-a7123832fd00@vivier.eu> (raw)
In-Reply-To: <20211105113043.4059361-5-kraxel@redhat.com>

Le 05/11/2021 à 12:30, Gerd Hoffmann a écrit :
> From: Dongwon Kim <dongwon.kim@intel.com>
> 
> 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>
> ---
>   ui/gtk-egl.c | 4 ++++
>   1 file changed, 4 insertions(+)
> 
> diff --git a/ui/gtk-egl.c b/ui/gtk-egl.c
> index 21649950983f..f2026e4b5c9b 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);
> 

This patch breaks something:

$ .../configure' '--target-list=m68k-softmmu' '--enable-virglrenderer'
$ make
...

FAILED: libcommon.fa.p/ui_gtk-egl.c.o
cc -m64 -mcx16 -Ilibcommon.fa.p -I../../../Projects/qemu-next/capstone/include/capstone 
-I../../../Projects/qemu-next/dtc/libfdt -I../../../Projects/qemu-next/slirp 
-I../../../Projects/qemu-next/slirp/src -I/usr/include/pixman-1 -I/usr/include/libpng16 
-I/usr/include/p11-kit-1 -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include 
-I/usr/include/sysprof-4 -I/usr/include/libmount -I/usr/include/blkid -I/usr/include/gio-unix-2.0 
-I/usr/include/virgl -I/usr/include/gtk-3.0 -I/usr/include/pango-1.0 -I/usr/include/harfbuzz 
-I/usr/include/freetype2 -I/usr/include/fribidi -I/usr/include/libxml2 -I/usr/include/cairo 
-I/usr/include/gdk-pixbuf-2.0 -I/usr/include/cloudproviders -I/usr/include/atk-1.0 
-I/usr/include/at-spi2-atk/2.0 -I/usr/include/dbus-1.0 -I/usr/lib64/dbus-1.0/include 
-I/usr/include/at-spi-2.0 -I/usr/include/vte-2.91 -fdiagnostics-color=auto -Wall -Winvalid-pch 
-Werror -std=gnu11 -O2 -g -isystem /home/laurent/Projects/qemu-next/linux-headers -isystem 
linux-headers -iquote . -iquote /home/laurent/Projects/qemu-next -iquote 
/home/laurent/Projects/qemu-next/include -iquote /home/laurent/Projects/qemu-next/disas/libvixl 
-iquote /home/laurent/Projects/qemu-next/tcg/i386 -pthread -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 
-D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -Wstrict-prototypes -Wredundant-decls 
-Wundef -Wwrite-strings -Wmissing-prototypes -fno-strict-aliasing -fno-common -fwrapv 
-Wold-style-declaration -Wold-style-definition -Wtype-limits -Wformat-security -Wformat-y2k 
-Winit-self -Wignored-qualifiers -Wempty-body -Wnested-externs -Wendif-labels -Wexpansion-to-defined 
-Wimplicit-fallthrough=2 -Wno-missing-include-dirs -Wno-shift-negative-value -Wno-psabi 
-fstack-protector-strong -fPIE -D_DEFAULT_SOURCE -D_XOPEN_SOURCE=600 -DNCURSES_WIDECHAR -D_REENTRANT 
-MD -MQ libcommon.fa.p/ui_gtk-egl.c.o -MF libcommon.fa.p/ui_gtk-egl.c.o.d -o 
libcommon.fa.p/ui_gtk-egl.c.o -c ../../../Projects/qemu-next/ui/gtk-egl.c
../../../Projects/qemu-next/ui/gtk-egl.c: In function 'gd_egl_refresh':
../../../Projects/qemu-next/ui/gtk-egl.c:159:13: error: implicit declaration of function 
'egl_dmabuf_release_texture' [-Werror=implicit-function-declaration]
   159 |             egl_dmabuf_release_texture(vc->gfx.guest_fb.dmabuf);
       |             ^~~~~~~~~~~~~~~~~~~~~~~~~~
../../../Projects/qemu-next/ui/gtk-egl.c:159:13: error: nested extern declaration of 
'egl_dmabuf_release_texture' [-Werror=nested-externs]

I think we need something like:

diff --git a/ui/gtk-egl.c b/ui/gtk-egl.c
index f2026e4b5c9b..45cb67712df0 100644
--- a/ui/gtk-egl.c
+++ b/ui/gtk-egl.c
@@ -155,10 +155,12 @@ 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);
          }
+#ifdef CONFIG_GBM
          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);
          }
+#endif
      }

      graphic_hw_update(dcl->con);

Thanks,
Laurent


  reply	other threads:[~2021-11-06 20:34 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-05 11:30 [PULL 0/6] Egl 20211105 patches Gerd Hoffmann
2021-11-05 11:30 ` [PULL 1/6] virtio-gpu: splitting one extended mode guest fb into n-scanouts Gerd Hoffmann
2021-11-05 11:30 ` [PULL 2/6] ui/gtk-egl: un-tab and re-tab should destroy egl surface and context Gerd Hoffmann
2021-11-05 11:30 ` [PULL 3/6] ui/gtk-egl: make sure the right context is set as the current Gerd Hoffmann
2021-11-05 11:30 ` [PULL 4/6] ui/gtk-egl: guest fb texture needs to be regenerated when reinitializing egl Gerd Hoffmann
2021-11-06 20:32   ` Laurent Vivier [this message]
2021-11-08  8:07     ` Philippe Mathieu-Daudé
2021-11-05 11:30 ` [PULL 5/6] ui/gtk: gd_draw_event returns FALSE when no cairo surface is bound Gerd Hoffmann
2021-11-05 11:30 ` [PULL 6/6] ui/gtk-egl: blitting partial guest fb to the proper scanout surface Gerd Hoffmann
2021-11-05 17:13 ` [PULL 0/6] Egl 20211105 patches Richard Henderson
2021-11-05 18:26   ` Philippe Mathieu-Daudé
2021-11-05 18:49     ` Philippe Mathieu-Daudé
2021-11-08  8:12       ` Mark Cave-Ayland
2021-11-08  8:17         ` Philippe Mathieu-Daudé
2021-11-08  9:22           ` Daniel P. Berrangé
2021-11-08  9:36             ` Gerd Hoffmann
2021-11-08  9:37             ` Philippe Mathieu-Daudé
2021-11-08  9:41             ` Mark Cave-Ayland
2021-11-08  9:47               ` Philippe Mathieu-Daudé

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=e44b788c-0764-66ce-f78b-a7123832fd00@vivier.eu \
    --to=laurent@vivier.eu \
    --cc=dongwon.kim@intel.com \
    --cc=kraxel@redhat.com \
    --cc=mst@redhat.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).