From cac588bbf2f131930c8f60524a7c95a3b45347ad Mon Sep 17 00:00:00 2001
From: Jakob Bornecrantz <jakob@collabora.com>
Date: Wed, 26 Aug 2020 12:59:33 +0100
Subject: [PATCH] st/oxr: Get maximum layers from the compositor info

---
 src/xrt/state_trackers/oxr/oxr_system.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/xrt/state_trackers/oxr/oxr_system.c b/src/xrt/state_trackers/oxr/oxr_system.c
index 566da4673..946a60bd6 100644
--- a/src/xrt/state_trackers/oxr/oxr_system.c
+++ b/src/xrt/state_trackers/oxr/oxr_system.c
@@ -220,10 +220,10 @@ oxr_system_get_properties(struct oxr_logger *log,
 	snprintf(properties->systemName, XR_MAX_SYSTEM_NAME_SIZE,
 	         "Monado: %.*s", 247, xdev->str);
 
-	//! Get from compositor.
-	uint32_t max = XR_MIN_COMPOSITION_LAYERS_SUPPORTED;
+	// Get from compositor.
+	struct xrt_compositor_info *info = &sys->xcn->base.info;
 
-	properties->graphicsProperties.maxLayerCount = max;
+	properties->graphicsProperties.maxLayerCount = info->max_layers;
 	properties->graphicsProperties.maxSwapchainImageWidth = 1024 * 16;
 	properties->graphicsProperties.maxSwapchainImageHeight = 1024 * 16;
 	properties->trackingProperties.orientationTracking =