diff options
author | Olivier Fourdan <ofourdan@redhat.com> | 2021-04-19 18:11:19 +0200 |
---|---|---|
committer | Olivier Fourdan <ofourdan@redhat.com> | 2021-06-21 11:16:58 +0200 |
commit | 15e550cc9a5a7fff7f97d74e22cf96bcb0fbf568 (patch) | |
tree | 436703deee6040c04694f17b9b3097273c7a0f5f | |
parent | 01319a9006d32286b73bdff0417bd7da47d2724d (diff) | |
download | xserver-15e550cc9a5a7fff7f97d74e22cf96bcb0fbf568.tar.gz |
xwayland/eglstream: Do not commit without surface
The EGL surface for the xwl_pixmap is created once the stream is ready
and valid.
If the pixmap's EGL surface fails, for whatever reason, the xwl_pixmap
will be unusable and will end up as an invalid wl_buffer.
Make sure we do not allow commits in that case and recreate the
xwl_pixmap/stream.
Signed-off-by: Olivier Fourdan <ofourdan@redhat.com>
Reviewed-by: Michel Dänzer <mdaenzer@redhat.com>
https://gitlab.freedesktop.org/xorg/xserver/-/issues/1156
(cherry picked from commit 098e0f52c088c6eb52c7e54c5a11cefabd480908)
-rw-r--r-- | hw/xwayland/xwayland-glamor-eglstream.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/hw/xwayland/xwayland-glamor-eglstream.c b/hw/xwayland/xwayland-glamor-eglstream.c index 399a691d3..ce066cd9e 100644 --- a/hw/xwayland/xwayland-glamor-eglstream.c +++ b/hw/xwayland/xwayland-glamor-eglstream.c @@ -670,7 +670,14 @@ xwl_glamor_eglstream_allow_commits(struct xwl_window *xwl_window) return FALSE; } else { - return TRUE; + if (xwl_pixmap->surface != EGL_NO_SURFACE) + return TRUE; + + /* The pending stream got removed, we have a xwl_pixmap and + * yet we do not have a surface. + * So something went wrong with the surface creation, retry. + */ + xwl_eglstream_destroy_pixmap_stream(xwl_pixmap); } } |