xwayland/glamor: Disable GLAMOR after GBM cleanup

The cleanup function for GBM is called on the various error paths.

Once xwl_glamor_gbm_cleanup() has been called, GBM support is no longer
usable (and the corresponding data structures are freed), so there is
no way we can keep using GLAMOR after that point.

Make sure to explicitly disable GLAMOR support in that case, so we do
not crash later on trying to use GBM.

Signed-off-by: Olivier Fourdan <ofourdan@redhat.com>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1768>
(cherry picked from commit e8784b7d89)
This commit is contained in:
Olivier Fourdan
2025-02-04 11:35:36 +01:00
committed by Alan Coopersmith
parent dc95d5cbc2
commit f719341987

View File

@@ -634,6 +634,10 @@ xwl_glamor_gbm_cleanup(struct xwl_screen *xwl_screen)
if (!xwl_gbm)
return;
/* Cannot use GBM after clean-up, disable GLAMOR support from now on */
ErrorF("XWAYLAND: Disabling GLAMOR support\n");
xwl_screen->glamor = XWL_GLAMOR_NONE;
if (xwl_gbm->device_name)
free(xwl_gbm->device_name);
drmFreeDevice(&xwl_gbm->device);