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 098e0f52c0
)
This commit is contained in:
parent
01319a9006
commit
15e550cc9a
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue