From 2c65b43969c77a59f9727146952b7d8cfd074948 Mon Sep 17 00:00:00 2001 From: Patrick Nicolas Date: Tue, 5 Aug 2025 13:24:30 +0200 Subject: [PATCH] Update Monado --- flake.nix | 2 +- monado-rev | 2 +- ...001-c-multi-early-wake-of-compositor.patch | 8 +-- ...02-ipc-server-Always-listen-to-stdin.patch | 4 +- .../monado/0003-Use-extern-socket-fd.patch | 4 +- ...Add-storage-usage-to-distortion-mesh.patch | 4 +- ...vironment-blend-mode-selection-logic.patch | 4 +- .../0006-Convert-to-YCbCr-in-Monado.patch | 56 +++++++++---------- .../0007-store-alpha-channel-in-layer-1.patch | 4 +- ...t-oxr-bind-to-dynamic-role-s-profile.patch | 2 +- ...main-allow-custom-pacing-app-factory.patch | 10 ++-- .../0010-st-oxr-forward-0-refresh-rate.patch | 4 +- ...tortion-with-pixel-aligned-foveation.patch | 6 +- 13 files changed, 54 insertions(+), 56 deletions(-) diff --git a/flake.nix b/flake.nix index dde66d16..e490c997 100644 --- a/flake.nix +++ b/flake.nix @@ -40,7 +40,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-BiqNLYTQseymHgkZ3RLHOesxi6qaf4L0j8dgpgaG7LI="; + hash = "sha256-9t+v3+i5lD7eBapDQ1VE5q/3DG+UPpmibNvXzfTu8do="; }; }; diff --git a/monado-rev b/monado-rev index 800d79e2..0adfe2a2 100644 --- a/monado-rev +++ b/monado-rev @@ -1 +1 @@ -2bf7f5c14b947ab3528e37551eb49753fe982dcb +ea9fff0517614ecbd21f2c918c0496cc025d218c diff --git a/patches/monado/0001-c-multi-early-wake-of-compositor.patch b/patches/monado/0001-c-multi-early-wake-of-compositor.patch index 6d59f358..1e4a784f 100644 --- a/patches/monado/0001-c-multi-early-wake-of-compositor.patch +++ b/patches/monado/0001-c-multi-early-wake-of-compositor.patch @@ -1,4 +1,4 @@ -From 20aa4cc8fd841df0498a3ea34cccbe475db5b800 Mon Sep 17 00:00:00 2001 +From 98c30d9d240c7763b829bace57203e1cd4ab869d Mon Sep 17 00:00:00 2001 From: Patrick Nicolas Date: Tue, 22 Oct 2024 15:23:19 +0200 Subject: [PATCH 01/11] c/multi: early wake of compositor @@ -10,10 +10,10 @@ Subject: [PATCH 01/11] c/multi: early wake of compositor 3 files changed, 41 insertions(+), 7 deletions(-) diff --git a/src/xrt/compositor/multi/comp_multi_compositor.c b/src/xrt/compositor/multi/comp_multi_compositor.c -index d19eda4ff..b9fcd0ca6 100644 +index 553565db4..789a2d042 100644 --- a/src/xrt/compositor/multi/comp_multi_compositor.c +++ b/src/xrt/compositor/multi/comp_multi_compositor.c -@@ -231,7 +231,21 @@ wait_for_scheduled_free(struct multi_compositor *mc) +@@ -232,7 +232,21 @@ wait_for_scheduled_free(struct multi_compositor *mc) os_mutex_lock(&mc->slot_lock); slot_move_and_clear_locked(mc, &mc->scheduled, &mc->progress); os_mutex_unlock(&mc->slot_lock); @@ -128,5 +128,5 @@ index a0bd04e08..9d7610d02 100644 //! @todo Make the clients not go from IDLE to READY before we have completed a first frame. // Make sure there is at least some sort of valid frame data here. -- -2.50.0 +2.50.1 diff --git a/patches/monado/0002-ipc-server-Always-listen-to-stdin.patch b/patches/monado/0002-ipc-server-Always-listen-to-stdin.patch index 01c8f297..0a18b010 100644 --- a/patches/monado/0002-ipc-server-Always-listen-to-stdin.patch +++ b/patches/monado/0002-ipc-server-Always-listen-to-stdin.patch @@ -1,4 +1,4 @@ -From 328076ce8b74e32e6e41c3a53de3e000a43720a4 Mon Sep 17 00:00:00 2001 +From 006c23e5c59dba924d716f482ea13964ba5ea906 Mon Sep 17 00:00:00 2001 From: Patrick Nicolas Date: Tue, 2 Apr 2024 17:14:42 +0200 Subject: [PATCH 02/11] ipc/server: Always listen to stdin @@ -21,5 +21,5 @@ index d364fbed3..ad6b473b7 100644 // default. // This polls stdin. -- -2.50.0 +2.50.1 diff --git a/patches/monado/0003-Use-extern-socket-fd.patch b/patches/monado/0003-Use-extern-socket-fd.patch index e7f27e2c..34a4dae7 100644 --- a/patches/monado/0003-Use-extern-socket-fd.patch +++ b/patches/monado/0003-Use-extern-socket-fd.patch @@ -1,4 +1,4 @@ -From e1c5cdf2de5f1ef5c9556004ffc44a75e0fadc10 Mon Sep 17 00:00:00 2001 +From 35d4d3a774ca65f883aad708de1591e5e142ab43 Mon Sep 17 00:00:00 2001 From: Patrick Nicolas Date: Tue, 8 Oct 2024 22:13:15 +0200 Subject: [PATCH 03/11] Use extern socket fd @@ -34,5 +34,5 @@ index ad6b473b7..ea6fad65b 100644 // We may have been launched with socket activation int num_fds = sd_listen_fds(0); -- -2.50.0 +2.50.1 diff --git a/patches/monado/0004-c-render-Add-storage-usage-to-distortion-mesh.patch b/patches/monado/0004-c-render-Add-storage-usage-to-distortion-mesh.patch index 040c2b6c..d6e81359 100644 --- a/patches/monado/0004-c-render-Add-storage-usage-to-distortion-mesh.patch +++ b/patches/monado/0004-c-render-Add-storage-usage-to-distortion-mesh.patch @@ -1,4 +1,4 @@ -From 8aa74c49f98d57c44c7ee9ad4bfa30c91aae8e67 Mon Sep 17 00:00:00 2001 +From 3a9aec50d2487b873562304406e520107a546189 Mon Sep 17 00:00:00 2001 From: galister <3123227-galister@users.noreply.gitlab.com> Date: Mon, 19 Aug 2024 18:51:45 +0900 Subject: [PATCH 04/11] c/render: Add storage usage to distortion mesh @@ -21,5 +21,5 @@ index 8ac24db8e..5a7e400c3 100644 &image); // out_image VK_CHK_AND_RET(ret, "vk_create_image_simple"); -- -2.50.0 +2.50.1 diff --git a/patches/monado/0005-change-environment-blend-mode-selection-logic.patch b/patches/monado/0005-change-environment-blend-mode-selection-logic.patch index fb014060..657359c1 100644 --- a/patches/monado/0005-change-environment-blend-mode-selection-logic.patch +++ b/patches/monado/0005-change-environment-blend-mode-selection-logic.patch @@ -1,4 +1,4 @@ -From 6e97c25c737f0eb2fda9683caf9d38be66ea5aa9 Mon Sep 17 00:00:00 2001 +From 847328febed05f01d6cd55fea1cb6fd9e89ead6c Mon Sep 17 00:00:00 2001 From: galister <85970-galister@users.noreply.gitlab.freedesktop.org> Date: Sat, 23 Nov 2024 02:42:12 +0900 Subject: [PATCH 05/11] change environment blend mode selection logic @@ -53,5 +53,5 @@ index 9d7610d02..f3131e810 100644 } -- -2.50.0 +2.50.1 diff --git a/patches/monado/0006-Convert-to-YCbCr-in-Monado.patch b/patches/monado/0006-Convert-to-YCbCr-in-Monado.patch index 0bc80fca..f2918f30 100644 --- a/patches/monado/0006-Convert-to-YCbCr-in-Monado.patch +++ b/patches/monado/0006-Convert-to-YCbCr-in-Monado.patch @@ -1,4 +1,4 @@ -From a8d3eae0afd8b61aacc18824982c5b6066b5e4d6 Mon Sep 17 00:00:00 2001 +From 5fcfe965429f8c49b2b77f365de44935d4573a0c Mon Sep 17 00:00:00 2001 From: Patrick Nicolas Date: Wed, 11 Sep 2024 22:56:29 +0200 Subject: [PATCH 06/11] Convert to YCbCr in Monado @@ -10,15 +10,15 @@ Subject: [PATCH 06/11] Convert to YCbCr in Monado src/xrt/compositor/render/render_interface.h | 15 ++- src/xrt/compositor/render/render_resources.c | 35 +++++-- src/xrt/compositor/shaders/distortion.comp | 62 +++++++---- - src/xrt/compositor/util/comp_render.h | 12 ++- + src/xrt/compositor/util/comp_render.h | 11 +- src/xrt/compositor/util/comp_render_cs.c | 19 ++-- - 8 files changed, 175 insertions(+), 81 deletions(-) + 8 files changed, 174 insertions(+), 81 deletions(-) diff --git a/src/xrt/compositor/main/comp_renderer.c b/src/xrt/compositor/main/comp_renderer.c -index 06d1cb72a..80678b9f1 100644 +index f5227e02b..782ef0283 100644 --- a/src/xrt/compositor/main/comp_renderer.c +++ b/src/xrt/compositor/main/comp_renderer.c -@@ -1022,7 +1022,8 @@ dispatch_compute(struct comp_renderer *r, +@@ -1081,7 +1081,8 @@ dispatch_compute(struct comp_renderer *r, // Target Vulkan resources.. VkImage target_image = r->c->target->images[r->acquired_buffer].handle; @@ -28,18 +28,18 @@ index 06d1cb72a..80678b9f1 100644 // Target view information. struct render_viewport_data views[XRT_MAX_VIEWS]; -@@ -1033,7 +1034,8 @@ dispatch_compute(struct comp_renderer *r, - comp_render_cs_initial_init( // - &data, // data - target_image, // target_image -- target_image_view, // target_unorm_view -+ target_image_view_y, // target_unorm_view_y -+ target_image_view_cbcr, // target_unorm_view_cbcr - fast_path, // fast_path - do_timewarp); // do_timewarp +@@ -1144,7 +1145,8 @@ dispatch_compute(struct comp_renderer *r, + comp_render_cs_add_target( // + &data, // data + target_image, // target_image +- target_image_view); // target_unorm_view ++ target_image_view_y, // target_unorm_view_y ++ target_image_view_cbcr); // target_unorm_view_cbcr + // Start the compute pipeline. + render_compute_begin(render); diff --git a/src/xrt/compositor/main/comp_target.h b/src/xrt/compositor/main/comp_target.h -index 143d41639..98301d596 100644 +index 2122f46e7..53dcd631b 100644 --- a/src/xrt/compositor/main/comp_target.h +++ b/src/xrt/compositor/main/comp_target.h @@ -62,7 +62,8 @@ enum comp_target_display_timing_usage @@ -584,10 +584,10 @@ index 08b44d4cf..e1dd1cb58 100644 + imageStore(chroma, ivec2(offset.xy/2 + gl_GlobalInvocationID.xy), vec4(cbcr.x, cbcr.y, 0, 0)); } diff --git a/src/xrt/compositor/util/comp_render.h b/src/xrt/compositor/util/comp_render.h -index 0afe87393..550c014a0 100644 +index 334464256..f4a9140a2 100644 --- a/src/xrt/compositor/util/comp_render.h +++ b/src/xrt/compositor/util/comp_render.h -@@ -189,7 +189,8 @@ struct comp_render_dispatch_data +@@ -202,7 +202,8 @@ struct comp_render_dispatch_data VkImage image; //! Target image view for distortion. @@ -597,17 +597,15 @@ index 0afe87393..550c014a0 100644 } cs; } target; }; -@@ -465,7 +466,8 @@ comp_render_gfx_dispatch(struct render_gfx *render, +@@ -503,14 +504,15 @@ comp_render_gfx_dispatch(struct render_gfx *render, + * @param target_storage_view Corresponding image view + */ static inline void - comp_render_cs_initial_init(struct comp_render_dispatch_data *data, - VkImage target_image, -- VkImageView target_storage_view, -+ VkImageView target_storage_view_y, -+ VkImageView target_storage_view_cbcr, - bool fast_path, - bool do_timewarp) +-comp_render_cs_add_target(struct comp_render_dispatch_data *data, VkImage target_image, VkImageView target_storage_view) ++comp_render_cs_add_target(struct comp_render_dispatch_data *data, VkImage target_image, VkImageView target_storage_view_y, VkImageView target_storage_view_cbcr) { -@@ -476,7 +478,8 @@ comp_render_cs_initial_init(struct comp_render_dispatch_data *data, + // Error tracking. + data->target.initialized = true; // When writing into the target. data->target.cs.image = target_image; @@ -617,7 +615,7 @@ index 0afe87393..550c014a0 100644 } /*! -@@ -565,7 +568,8 @@ comp_render_cs_layer(struct render_compute *render, +@@ -607,7 +609,8 @@ comp_render_cs_layer(struct render_compute *render, const struct xrt_pose *world_pose, const struct xrt_pose *eye_pose, const VkImage target_image, @@ -628,7 +626,7 @@ index 0afe87393..550c014a0 100644 bool do_timewarp); diff --git a/src/xrt/compositor/util/comp_render_cs.c b/src/xrt/compositor/util/comp_render_cs.c -index d9d9ea8a4..29c645bff 100644 +index 4e20b32f0..b2d3ce10d 100644 --- a/src/xrt/compositor/util/comp_render_cs.c +++ b/src/xrt/compositor/util/comp_render_cs.c @@ -347,7 +347,8 @@ crc_clear_output(struct render_compute *render, const struct comp_render_dispatc @@ -700,5 +698,5 @@ index d9d9ea8a4..29c645bff 100644 d->do_timewarp); // } -- -2.50.0 +2.50.1 diff --git a/patches/monado/0007-store-alpha-channel-in-layer-1.patch b/patches/monado/0007-store-alpha-channel-in-layer-1.patch index dee47064..ae0370e1 100644 --- a/patches/monado/0007-store-alpha-channel-in-layer-1.patch +++ b/patches/monado/0007-store-alpha-channel-in-layer-1.patch @@ -1,4 +1,4 @@ -From 9d54ac2408a56556529de2f9173ffcd3d5775bd1 Mon Sep 17 00:00:00 2001 +From a548af96b22969a85e75454d7d136a4cdbd46f36 Mon Sep 17 00:00:00 2001 From: Patrick Nicolas Date: Sun, 3 Nov 2024 13:40:00 +0100 Subject: [PATCH 07/11] store alpha channel in layer 1 @@ -90,5 +90,5 @@ index e1dd1cb58..9ce46fe6f 100644 + imageStore(luma, ivec3(offset.xy/2 + gl_GlobalInvocationID.xy, 1), alpha); } -- -2.50.0 +2.50.1 diff --git a/patches/monado/0008-st-oxr-bind-to-dynamic-role-s-profile.patch b/patches/monado/0008-st-oxr-bind-to-dynamic-role-s-profile.patch index 74754df4..556fbb51 100644 --- a/patches/monado/0008-st-oxr-bind-to-dynamic-role-s-profile.patch +++ b/patches/monado/0008-st-oxr-bind-to-dynamic-role-s-profile.patch @@ -1,4 +1,4 @@ -From a7fbfaf2407a805efa31b3e1a7f0565b46a9004e Mon Sep 17 00:00:00 2001 +From 35c2915478e736fa1013160fd320401a2a947535 Mon Sep 17 00:00:00 2001 From: Patrick Nicolas Date: Wed, 19 Feb 2025 10:13:36 +0100 Subject: [PATCH 08/11] st/oxr: bind to dynamic role's profile diff --git a/patches/monado/0009-c-main-allow-custom-pacing-app-factory.patch b/patches/monado/0009-c-main-allow-custom-pacing-app-factory.patch index ee2ebe44..7c00efd3 100644 --- a/patches/monado/0009-c-main-allow-custom-pacing-app-factory.patch +++ b/patches/monado/0009-c-main-allow-custom-pacing-app-factory.patch @@ -1,4 +1,4 @@ -From 8779248b08863b7a7dda3f9822cb9037372cbd3e Mon Sep 17 00:00:00 2001 +From 0616565306836fa24c1a5c92fe7742a060f411f9 Mon Sep 17 00:00:00 2001 From: Patrick Nicolas Date: Thu, 27 Feb 2025 22:45:36 +0100 Subject: [PATCH 09/11] c/main: allow custom pacing app factory @@ -10,10 +10,10 @@ Subject: [PATCH 09/11] c/main: allow custom pacing app factory 3 files changed, 11 insertions(+), 5 deletions(-) diff --git a/src/xrt/compositor/main/comp_compositor.c b/src/xrt/compositor/main/comp_compositor.c -index eecb14c17..24d061627 100644 +index ada9421df..f0017314f 100644 --- a/src/xrt/compositor/main/comp_compositor.c +++ b/src/xrt/compositor/main/comp_compositor.c -@@ -984,6 +984,7 @@ compositor_init_renderer(struct comp_compositor *c) +@@ -990,6 +990,7 @@ compositor_init_renderer(struct comp_compositor *c) xrt_result_t comp_main_create_system_compositor(struct xrt_device *xdev, const struct comp_target_factory *ctf, @@ -21,7 +21,7 @@ index eecb14c17..24d061627 100644 struct xrt_system_compositor **out_xsysc) { COMP_TRACE_MARKER(); -@@ -1184,10 +1185,11 @@ comp_main_create_system_compositor(struct xrt_device *xdev, +@@ -1190,10 +1191,11 @@ comp_main_create_system_compositor(struct xrt_device *xdev, } // Standard app pacer. @@ -78,5 +78,5 @@ index 617561c37..e10ba8358 100644 #else if (!use_null) { -- -2.50.0 +2.50.1 diff --git a/patches/monado/0010-st-oxr-forward-0-refresh-rate.patch b/patches/monado/0010-st-oxr-forward-0-refresh-rate.patch index c0bffc25..324753e6 100644 --- a/patches/monado/0010-st-oxr-forward-0-refresh-rate.patch +++ b/patches/monado/0010-st-oxr-forward-0-refresh-rate.patch @@ -1,4 +1,4 @@ -From 723732637613edd61b51039544ec69eaaddb8a69 Mon Sep 17 00:00:00 2001 +From e7282236100a88cbdc3f606f1acab6eb51831d77 Mon Sep 17 00:00:00 2001 From: Patrick Nicolas Date: Sat, 15 Mar 2025 22:19:48 +0100 Subject: [PATCH 10/11] st/oxr: forward 0 refresh rate @@ -29,5 +29,5 @@ index b3dac8c8a..27d80be9a 100644 if ((int)(displayRefreshRate * 100.0f) == (int)(sess->sys->xsysc->info.refresh_rates_hz[i] * 100.0f)) { found = true; -- -2.50.0 +2.50.1 diff --git a/patches/monado/0011-Replace-distortion-with-pixel-aligned-foveation.patch b/patches/monado/0011-Replace-distortion-with-pixel-aligned-foveation.patch index 1f7d31ff..53538d71 100644 --- a/patches/monado/0011-Replace-distortion-with-pixel-aligned-foveation.patch +++ b/patches/monado/0011-Replace-distortion-with-pixel-aligned-foveation.patch @@ -1,4 +1,4 @@ -From 89d5e71f70d70958e8c03a038ab4bc0fc262a455 Mon Sep 17 00:00:00 2001 +From 6888508cb1ba85ffc23623c76bd479d1e5ab23a6 Mon Sep 17 00:00:00 2001 From: Patrick Nicolas Date: Mon, 2 Jun 2025 14:51:11 +0200 Subject: [PATCH 11/11] Replace distortion with pixel-aligned foveation @@ -652,7 +652,7 @@ index 9ce46fe6f..f3be617bd 100644 - imageStore(luma, ivec3(offset.xy/2 + gl_GlobalInvocationID.xy, 1), alpha); } diff --git a/src/xrt/compositor/util/comp_render_cs.c b/src/xrt/compositor/util/comp_render_cs.c -index 29c645bff..322b0f761 100644 +index b2d3ce10d..69429dc97 100644 --- a/src/xrt/compositor/util/comp_render_cs.c +++ b/src/xrt/compositor/util/comp_render_cs.c @@ -466,30 +466,15 @@ crc_distortion_fast_path(struct render_compute *render, @@ -696,5 +696,5 @@ index 29c645bff..322b0f761 100644 -- -2.50.0 +2.50.1