xserver: Branch 'master' - 2 commits
GitLab Mirror
gitlab-mirror at kemper.freedesktop.org
Tue Feb 4 13:04:26 UTC 2025
hw/xwayland/xwayland-glamor-gbm.c | 9 +++++++++
1 file changed, 9 insertions(+)
New commits:
commit e8784b7d897aa22ed93f63a57dea04bdfa784388
Author: Olivier Fourdan <ofourdan at redhat.com>
Date: Tue Feb 4 11:35:36 2025 +0100
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 at redhat.com>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1768>
diff --git a/hw/xwayland/xwayland-glamor-gbm.c b/hw/xwayland/xwayland-glamor-gbm.c
index ce80284e0..05668b8e9 100644
--- a/hw/xwayland/xwayland-glamor-gbm.c
+++ b/hw/xwayland/xwayland-glamor-gbm.c
@@ -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);
commit b27b5cd5f3c2f6e17e0c68f783dca7273b7d2d84
Author: Michel Dänzer <michel at daenzer.net>
Date: Tue Feb 4 11:09:29 2025 +0100
xwayland/glamor: Clean-up GBM's screen private on failure
If we bail out initializing GBM glamor backend, the screen private for
the GBM backend may remain, pointing at freed memory.
To avoid that issue, make sure to clear up the screen's private for the
GBM backend.
Closes: https://gitlab.freedesktop.org/xorg/xserver/-/issues/1785
Signed-off-by: Michel Dänzer <michel at daenzer.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1768>
diff --git a/hw/xwayland/xwayland-glamor-gbm.c b/hw/xwayland/xwayland-glamor-gbm.c
index 21c0dd594..ce80284e0 100644
--- a/hw/xwayland/xwayland-glamor-gbm.c
+++ b/hw/xwayland/xwayland-glamor-gbm.c
@@ -631,6 +631,9 @@ xwl_glamor_gbm_cleanup(struct xwl_screen *xwl_screen)
{
struct xwl_gbm_private *xwl_gbm = xwl_gbm_get(xwl_screen);
+ if (!xwl_gbm)
+ return;
+
if (xwl_gbm->device_name)
free(xwl_gbm->device_name);
drmFreeDevice(&xwl_gbm->device);
@@ -643,6 +646,8 @@ xwl_glamor_gbm_cleanup(struct xwl_screen *xwl_screen)
if (xwl_screen->explicit_sync)
wp_linux_drm_syncobj_manager_v1_destroy(xwl_screen->explicit_sync);
+ dixSetPrivate(&xwl_screen->screen->devPrivates, &xwl_gbm_private_key,
+ NULL);
free(xwl_gbm);
}
More information about the xorg-commit
mailing list