summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFaith Ekstrand <faith.ekstrand@collabora.com>2023-08-03 18:32:45 -0500
committerMarge Bot <emma+marge@anholt.net>2023-08-04 21:32:07 +0000
commit8c62b3938a89a60baf56ebdbfb6b85157993ab2a (patch)
tree5234739b936ce71557827946e34d2b584be9da33
parentb2fe4c772953cbce27df46e0368f160e5a0be820 (diff)
nvk: Enable the new UAPI
We also add a meson option to disable it and re-enable the legacy API. This code probably won't last long but it gives developers the option. Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
-rw-r--r--meson.build6
-rw-r--r--meson_options.txt7
-rw-r--r--src/nouveau/vulkan/meson.build9
-rw-r--r--src/nouveau/winsys/nouveau_device.h4
4 files changed, 23 insertions, 3 deletions
diff --git a/meson.build b/meson.build
index 248eadf1398..83f4e9cf66d 100644
--- a/meson.build
+++ b/meson.build
@@ -261,6 +261,12 @@ with_any_intel = [
].contains(true)
with_any_nouveau = with_gallium_nouveau or with_nouveau_vk
+if with_nouveau_vk and get_option('nvk-legacy-uapi')
+ pre_args += '-DNVK_NEW_UAPI=0'
+else
+ pre_args += '-DNVK_NEW_UAPI=1'
+endif
+
if with_swrast_vk and not with_gallium_softpipe
error('swrast vulkan requires gallium swrast')
endif
diff --git a/meson_options.txt b/meson_options.txt
index f940b4b51c8..512e05d1eef 100644
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -671,3 +671,10 @@ option (
value : 'disabled',
description: 'Enable Intel Xe KMD support.'
)
+
+option(
+ 'nvk-legacy-uapi',
+ type : 'boolean',
+ value : 'false',
+ description : 'Build support for legacy kernel uAPI.'
+)
diff --git a/src/nouveau/vulkan/meson.build b/src/nouveau/vulkan/meson.build
index 78afd27e32f..b3c8db6f557 100644
--- a/src/nouveau/vulkan/meson.build
+++ b/src/nouveau/vulkan/meson.build
@@ -1,7 +1,5 @@
nvk_files = files(
'../../gallium/auxiliary/tgsi/tgsi_from_mesa.c',
- 'nvk_bo_sync.c',
- 'nvk_bo_sync.h',
'nvk_buffer.c',
'nvk_buffer.h',
'nvk_buffer_view.c',
@@ -60,6 +58,13 @@ nvk_files = files(
'nvk_wsi.h'
)
+if get_option('nvk-legacy-uapi')
+ nvk_files += files(
+ 'nvk_bo_sync.c',
+ 'nvk_bo_sync.h',
+ )
+endif
+
nvk_entrypoints = custom_target(
'nvk_entrypoints',
input : [vk_entrypoints_gen, vk_api_xml],
diff --git a/src/nouveau/winsys/nouveau_device.h b/src/nouveau/winsys/nouveau_device.h
index db30e8c6486..0468c140528 100644
--- a/src/nouveau/winsys/nouveau_device.h
+++ b/src/nouveau/winsys/nouveau_device.h
@@ -15,7 +15,9 @@ struct hash_table;
extern "C" {
#endif
-#define NVK_NEW_UAPI 0
+#ifndef NVK_NEW_UAPI
+#define NVK_NEW_UAPI 1
+#endif
enum nvk_debug {
/* dumps all push buffers after submission */