]> git.proxmox.com Git - mirror_qemu.git/commit
ui/gtk-egl: Check EGLSurface before doing scanout
authorAntonio Caggiano <quic_acaggian@quicinc.com>
Mon, 16 Oct 2023 12:32:15 +0000 (14:32 +0200)
committerMarc-André Lureau <marcandre.lureau@redhat.com>
Tue, 7 Nov 2023 07:45:48 +0000 (11:45 +0400)
commit6f189a08c1b0085808af1bfbf4567f0da193ecc1
tree8e2190b9e9d59c5bc06dd716f5e222efb817b01a
parent565f85a9c293818a91a3d3414311303de7e00cec
ui/gtk-egl: Check EGLSurface before doing scanout

The first time gd_egl_scanout_texture() is called, there's a possibility
that the GTK drawing area might not be realized yet, in which case its
associated GdkWindow is NULL. This means gd_egl_init() was also skipped
and the EGLContext and EGLSurface stored in the VirtualGfxConsole are
not valid yet.

Continuing with the scanout in this conditions would result in hitting
an assert in libepoxy: "Couldn't find current GLX or EGL context".

A possible workaround is to just ignore the scanout request, giving the
the GTK drawing area some time to finish its realization. At that point,
the gd_egl_init() will succeed and the EGLContext and EGLSurface stored
in the VirtualGfxConsole will be valid.

Signed-off-by: Antonio Caggiano <quic_acaggian@quicinc.com>
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Message-Id: <20231016123215.2699269-1-quic_acaggian@quicinc.com>
ui/gtk-egl.c