Update Monado

This commit is contained in:
Patrick Nicolas
2025-08-26 22:58:33 +02:00
parent 8f8e583eb6
commit d4665eb713
5 changed files with 2 additions and 226 deletions
+1 -1
View File
@@ -41,7 +41,7 @@
# Keep in sync with CMakeLists.txt monado rev
rev = builtins.readFile ./monado-rev;
# Nix will output the correct hash when it doesn't match
hash = "sha256-4P/ejRAitrYn8hXZPaDOcx27utfm+aVLjtqL6JxZYAg=";
hash = "sha256-nc198/nj9bvT5VpoEVuHraZKYyjhiFA3S46RzrWA96Q=";
};
};
+1 -1
View File
@@ -1 +1 @@
5c137fe28b232fe460f9b03defa7749adc32ee48
76577fe5cfc6904d44e7618f96af3d9387475106
@@ -1,64 +0,0 @@
From 34699c38c4ebb5c968b4e1053ddbf48b31dbe72d Mon Sep 17 00:00:00 2001
From: Patrick Nicolas <patricknicolas@laposte.net>
Date: Tue, 5 Aug 2025 15:51:48 +0200
Subject: [PATCH 11/13] a/vk: Track VK_KHR_video_maintenance1
---
scripts/generate_vk_helpers.py | 1 +
src/xrt/auxiliary/vk/vk_bundle_init.c | 8 ++++++++
src/xrt/auxiliary/vk/vk_helpers.h | 1 +
3 files changed, 10 insertions(+)
diff --git a/scripts/generate_vk_helpers.py b/scripts/generate_vk_helpers.py
index 330b1b05e..80902193a 100755
--- a/scripts/generate_vk_helpers.py
+++ b/scripts/generate_vk_helpers.py
@@ -307,6 +307,7 @@ DEVICE_EXTENSIONS_TO_CHECK = [
"VK_KHR_present_wait",
"VK_KHR_synchronization2",
"VK_KHR_timeline_semaphore",
+ "VK_KHR_video_maintenance1",
"VK_EXT_calibrated_timestamps",
"VK_EXT_display_control",
"VK_EXT_external_memory_dma_buf",
diff --git a/src/xrt/auxiliary/vk/vk_bundle_init.c b/src/xrt/auxiliary/vk/vk_bundle_init.c
index f28f7591f..b435d73dd 100644
--- a/src/xrt/auxiliary/vk/vk_bundle_init.c
+++ b/src/xrt/auxiliary/vk/vk_bundle_init.c
@@ -754,6 +754,7 @@ fill_in_has_device_extensions(struct vk_bundle *vk, struct u_string_list *ext_li
vk->has_KHR_present_wait = false;
vk->has_KHR_synchronization2 = false;
vk->has_KHR_timeline_semaphore = false;
+ vk->has_KHR_video_maintenance1 = false;
vk->has_EXT_calibrated_timestamps = false;
vk->has_EXT_display_control = false;
vk->has_EXT_external_memory_dma_buf = false;
@@ -868,6 +869,13 @@ fill_in_has_device_extensions(struct vk_bundle *vk, struct u_string_list *ext_li
}
#endif // defined(VK_KHR_timeline_semaphore)
+#if defined(VK_KHR_video_maintenance1)
+ if (strcmp(ext, VK_KHR_VIDEO_MAINTENANCE_1_EXTENSION_NAME) == 0) {
+ vk->has_KHR_video_maintenance1 = true;
+ continue;
+ }
+#endif // defined(VK_KHR_video_maintenance1)
+
#if defined(VK_EXT_calibrated_timestamps)
if (strcmp(ext, VK_EXT_CALIBRATED_TIMESTAMPS_EXTENSION_NAME) == 0) {
vk->has_EXT_calibrated_timestamps = true;
diff --git a/src/xrt/auxiliary/vk/vk_helpers.h b/src/xrt/auxiliary/vk/vk_helpers.h
index 896b597d4..3b5cbb9c8 100644
--- a/src/xrt/auxiliary/vk/vk_helpers.h
+++ b/src/xrt/auxiliary/vk/vk_helpers.h
@@ -142,6 +142,7 @@ struct vk_bundle
bool has_KHR_present_wait;
bool has_KHR_synchronization2;
bool has_KHR_timeline_semaphore;
+ bool has_KHR_video_maintenance1;
bool has_EXT_calibrated_timestamps;
bool has_EXT_display_control;
bool has_EXT_external_memory_dma_buf;
--
2.50.1
@@ -1,134 +0,0 @@
From 2300c7509699db2a59e4bd0eee33890a2d906156 Mon Sep 17 00:00:00 2001
From: Patrick Nicolas <patricknicolas@laposte.net>
Date: Tue, 5 Aug 2025 16:00:59 +0200
Subject: [PATCH 12/13] a/vk: Expose video_maintenance_1 device feature
---
src/xrt/auxiliary/vk/vk_bundle_init.c | 40 +++++++++++++++++++++++++--
src/xrt/auxiliary/vk/vk_helpers.h | 4 +++
2 files changed, 42 insertions(+), 2 deletions(-)
diff --git a/src/xrt/auxiliary/vk/vk_bundle_init.c b/src/xrt/auxiliary/vk/vk_bundle_init.c
index b435d73dd..501cd6f3c 100644
--- a/src/xrt/auxiliary/vk/vk_bundle_init.c
+++ b/src/xrt/auxiliary/vk/vk_bundle_init.c
@@ -1098,6 +1098,13 @@ filter_device_features(struct vk_bundle *vk,
};
#endif
+#ifdef VK_KHR_video_maintenance1
+ VkPhysicalDeviceVideoMaintenance1FeaturesKHR video_maintenance_1_info = {
+ .sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VIDEO_MAINTENANCE_1_FEATURES_KHR,
+ .pNext = NULL,
+ };
+#endif
+
#ifdef VK_ANDROID_external_format_resolve
VkPhysicalDeviceExternalFormatResolveFeaturesANDROID ext_fmt_resolve_info = {
.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTERNAL_FORMAT_RESOLVE_FEATURES_ANDROID,
@@ -1148,6 +1155,13 @@ filter_device_features(struct vk_bundle *vk,
}
#endif
+#ifdef VK_KHR_video_maintenance1
+ if (vk->has_KHR_video_maintenance1) {
+ vk_append_to_pnext_chain((VkBaseInStructure *)&physical_device_features,
+ (VkBaseInStructure *)&video_maintenance_1_info);
+ }
+#endif
+
#ifdef VK_ANDROID_external_format_resolve
if (vk->has_ANDROID_external_format_resolve) {
vk_append_to_pnext_chain((VkBaseInStructure *)&physical_device_features,
@@ -1187,6 +1201,10 @@ filter_device_features(struct vk_bundle *vk,
CHECK(synchronization_2, synchronization_2_info.synchronization2);
#endif
+#ifdef VK_KHR_video_maintenance1
+ CHECK(video_maintenance_1, video_maintenance_1_info.videoMaintenance1);
+#endif
+
#ifdef VK_ANDROID_external_format_resolve
CHECK(ext_fmt_resolve, ext_fmt_resolve_info.externalFormatResolve);
#endif
@@ -1207,14 +1225,16 @@ filter_device_features(struct vk_bundle *vk,
"\n\tshader_storage_image_write_without_format: %i"
"\n\tstorage_buffer_8bit_access: %i"
"\n\tsynchronization_2: %i"
- "\n\ttimeline_semaphore: %i", //
+ "\n\ttimeline_semaphore: %i"
+ "\n\tvideo_maintenance_1: %i", //
device_features->ext_fmt_resolve, //
device_features->null_descriptor, //
device_features->shader_image_gather_extended, //
device_features->shader_storage_image_write_without_format, //
device_features->storage_buffer_8bit_access, //
device_features->synchronization_2, //
- device_features->timeline_semaphore); //
+ device_features->timeline_semaphore, //
+ device_features->video_maintenance_1); //
}
@@ -1262,6 +1282,7 @@ vk_create_device(struct vk_bundle *vk,
vk->features.timeline_semaphore = device_features.timeline_semaphore;
vk->features.synchronization_2 = device_features.synchronization_2;
vk->features.present_wait = device_features.present_wait;
+ vk->features.video_maintenance_1 = device_features.video_maintenance_1;
/*
@@ -1384,6 +1405,14 @@ vk_create_device(struct vk_bundle *vk,
};
#endif
+#ifdef VK_KHR_video_maintenance1
+ VkPhysicalDeviceVideoMaintenance1FeaturesKHR video_maintenance_1_info = {
+ .sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VIDEO_MAINTENANCE_1_FEATURES_KHR,
+ .pNext = NULL,
+ .videoMaintenance1 = device_features.video_maintenance_1,
+ };
+#endif
+
#ifdef VK_ANDROID_external_format_resolve
VkPhysicalDeviceExternalFormatResolveFeaturesANDROID ext_fmt_resolve_info = {
.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTERNAL_FORMAT_RESOLVE_FEATURES_ANDROID,
@@ -1444,6 +1473,13 @@ vk_create_device(struct vk_bundle *vk,
}
#endif
+#ifdef VK_KHR_video_maintenance1
+ if (vk->has_KHR_video_maintenance1) {
+ vk_append_to_pnext_chain((VkBaseInStructure *)&device_create_info,
+ (VkBaseInStructure *)&video_maintenance_1_info);
+ }
+#endif
+
#ifdef VK_ANDROID_external_format_resolve
if (vk->has_ANDROID_external_format_resolve) {
vk_append_to_pnext_chain((VkBaseInStructure *)&device_create_info,
diff --git a/src/xrt/auxiliary/vk/vk_helpers.h b/src/xrt/auxiliary/vk/vk_helpers.h
index 3b5cbb9c8..748c06dac 100644
--- a/src/xrt/auxiliary/vk/vk_helpers.h
+++ b/src/xrt/auxiliary/vk/vk_helpers.h
@@ -179,6 +179,9 @@ struct vk_bundle
//! Was KHR_present_wait requested, available, and enabled?
bool present_wait;
+
+ //! Was KHR_video_maintenance1 requested, available, and enabled?
+ bool video_maintenance_1;
} features;
//! Is the GPU a tegra device.
@@ -1030,6 +1033,7 @@ struct vk_device_features
bool ext_fmt_resolve;
bool storage_buffer_8bit_access;
bool present_wait;
+ bool video_maintenance_1;
};
/*!
--
2.50.1
@@ -1,26 +0,0 @@
From 8c874368dfaa363e088e91c05adf2a96f921671d Mon Sep 17 00:00:00 2001
From: Patrick Nicolas <patricknicolas@laposte.net>
Date: Tue, 5 Aug 2025 16:01:59 +0200
Subject: [PATCH 13/13] c/util: Request video_maintenance_1 feature
This will only be enabled if the VK_KHR_maintenance1 extension was
requested.
---
src/xrt/compositor/util/comp_vulkan.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/src/xrt/compositor/util/comp_vulkan.c b/src/xrt/compositor/util/comp_vulkan.c
index 5618f4f78..9c719275c 100644
--- a/src/xrt/compositor/util/comp_vulkan.c
+++ b/src/xrt/compositor/util/comp_vulkan.c
@@ -282,6 +282,7 @@ create_device(struct vk_bundle *vk, const struct comp_vulkan_arguments *vk_args)
.timeline_semaphore = vk_args->timeline_semaphore,
.synchronization_2 = true,
.present_wait = true,
+ .video_maintenance_1 = true,
};
ret = vk_init_mutex(vk);
--
2.50.1