From 34403d1f4f8ad9bd3d7b5cc1819fae4013074628 Mon Sep 17 00:00:00 2001 From: Derek Foreman Date: Mon, 27 Apr 2026 15:46:26 -0500 Subject: [PATCH] drm: Deprecate non-atomic mode sets We've been keeping these poorly tested paths around long enough, it's time to deprecate them, to be dropped after the next major release. Signed-off-by: Derek Foreman --- libweston/backend-drm/kms.c | 9 +++++++++ meson.build | 3 +++ meson_options.txt | 7 +++++++ 3 files changed, 19 insertions(+) diff --git a/libweston/backend-drm/kms.c b/libweston/backend-drm/kms.c index 073f797d8..f53830b3f 100644 --- a/libweston/backend-drm/kms.c +++ b/libweston/backend-drm/kms.c @@ -2069,6 +2069,15 @@ init_kms_caps(struct drm_device *device) weston_log("DRM: %s atomic modesetting\n", device->atomic_modeset ? "supports" : "does not support"); + if (!device->atomic_modeset) { +#ifdef ALLOW_DEPRECATED_MODESET + weston_log("DRM Warning: Non-atomic modeset support is deprecated and will be removed.\n"); +#else + weston_log("Error: Kernel DRM KMS does not support DRM_CLIENT_CAP_ATOMIC.\n"); + return -1; +#endif + } + if (!getenv("WESTON_DISABLE_GBM_MODIFIERS")) { ret = drmGetCap(device->kms_device->fd, DRM_CAP_ADDFB2_MODIFIERS, &cap); if (ret == 0) diff --git a/meson.build b/meson.build index 1d8b62d5e..5832b4b1c 100644 --- a/meson.build +++ b/meson.build @@ -221,6 +221,9 @@ else prog_glslang = find_program('', required : false) endif +if get_option('allow-deprecated-modeset') + config_h.set('ALLOW_DEPRECATED_MODESET', '1') +endif subdir('include') subdir('protocol') diff --git a/meson_options.txt b/meson_options.txt index 0ebaee5c5..3027c3b1c 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -209,3 +209,10 @@ option( value : false, description : 'Enable performance analysis with Perfetto.' ) + +option( + 'allow-deprecated-modeset', + type: 'boolean', + value: false, + description: 'DEPRECATED: Non-atomic modeset paths will be removed' +)