From 8dcc1f83111da0fb7a09f24089bc7f98f00f5685 Mon Sep 17 00:00:00 2001 From: Dylan Baker Date: Tue, 20 Dec 2022 14:52:18 -0800 Subject: [PATCH] meson: use a feature option for dri3 This removes the deprecated 'true' and 'false' options, and uses a meson feature, requiring significantly less code. Reviewed-by: Jesse Natalie Acked-by: Alyssa Rosenzweig Part-of: --- docs/drivers/svga3d.rst | 2 +- docs/gallium-nine.rst | 2 +- meson.build | 14 +------------- meson_options.txt | 4 +--- 4 files changed, 4 insertions(+), 18 deletions(-) diff --git a/docs/drivers/svga3d.rst b/docs/drivers/svga3d.rst index 39a330fee7066..6374511aec5bd 100644 --- a/docs/drivers/svga3d.rst +++ b/docs/drivers/svga3d.rst @@ -193,7 +193,7 @@ Building the Code :: cd $TOP/mesa - meson builddir --prefix=/usr --libdir=${LIBDIR} -Dgallium-drivers=svga -Dgallium-xa=true -Ddri3=false + meson builddir --prefix=/usr --libdir=${LIBDIR} -Dgallium-drivers=svga -Dgallium-xa=true -Ddri3=disabled ninja -C builddir sudo ninja -C builddir install diff --git a/docs/gallium-nine.rst b/docs/gallium-nine.rst index 35b0399718830..3cbfc23d28309 100644 --- a/docs/gallium-nine.rst +++ b/docs/gallium-nine.rst @@ -24,7 +24,7 @@ Beware: Most Direct3D games are 32-bit, and thus need a 32-bit version of Mesa. $ meson configure \ -D gallium-nine=true \ - -D dri3=true \ + -D dri3=enabled \ ... Paths diff --git a/meson.build b/meson.build index e23daccdb22f1..19a95d37b0096 100644 --- a/meson.build +++ b/meson.build @@ -606,19 +606,7 @@ endif # GNU/Hurd includes egl_dri2, without drm. with_dri2 = (with_dri or with_any_vk) and (with_dri_platform == 'drm' or host_machine.system() == 'gnu') -_dri3 = get_option('dri3') -if _dri3 == 'true' - _dri3 = 'enabled' - warning('dri3 option "true" deprecated, please use "enabled" instead.') -elif _dri3 == 'false' - _dri3 = 'disabled' - warning('dri3 option "false" deprecated, please use "disabled" instead.') -endif -if _dri3 == 'auto' - with_dri3 = system_has_kms_drm and with_dri2 -else - with_dri3 = _dri3 == 'enabled' -endif +with_dri3 = get_option('dri3').disable_auto_if(not (system_has_kms_drm and with_dri2)).allowed() if with_any_vk and (with_platform_x11 and not with_dri3) error('Vulkan drivers require dri3 for X11 support') diff --git a/meson_options.txt b/meson_options.txt index b8e3d73b3025c..a40bebe879936 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -46,9 +46,7 @@ option( option( 'dri3', - type : 'combo', - value : 'auto', - choices : ['auto', 'true', 'false', 'disabled', 'enabled'], + type : 'feature', description : 'enable support for dri3' ) option(