meson: use a feature option for dri3
authorDylan Baker <dylan.c.baker@intel.com>
Tue, 20 Dec 2022 22:52:18 +0000 (14:52 -0800)
committerMarge Bot <emma+marge@anholt.net>
Thu, 19 Jan 2023 16:29:03 +0000 (16:29 +0000)
This removes the deprecated 'true' and 'false' options, and uses a meson
feature, requiring significantly less code.

Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Acked-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20409>

docs/drivers/svga3d.rst
docs/gallium-nine.rst
meson.build
meson_options.txt

index 39a330f..6374511 100644 (file)
@@ -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
         
index 35b0399..3cbfc23 100644 (file)
@@ -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
index e23dacc..19a95d3 100644 (file)
@@ -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')
index b8e3d73..a40bebe 100644 (file)
@@ -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(