diff --git a/src/xrt/compositor/main/comp_settings.c b/src/xrt/compositor/main/comp_settings.c
index 1c62c5f1886392ffe1648fef9db0d8ea928fbe7f..a14cd3d4d6c54e429e110b21537e2bdd4bfeade8 100644
--- a/src/xrt/compositor/main/comp_settings.c
+++ b/src/xrt/compositor/main/comp_settings.c
@@ -21,6 +21,7 @@ DEBUG_GET_ONCE_BOOL_OPTION(force_wayland, "XRT_COMPOSITOR_FORCE_WAYLAND", false)
 DEBUG_GET_ONCE_BOOL_OPTION(validate_vulkan, "XRT_COMPOSITOR_VULKAN_VALIDATION", false)
 DEBUG_GET_ONCE_BOOL_OPTION(wireframe, "XRT_COMPOSITOR_WIREFRAME", false)
 DEBUG_GET_ONCE_NUM_OPTION(force_gpu_index, "XRT_COMPOSITOR_FORCE_GPU_INDEX", -1)
+DEBUG_GET_ONCE_NUM_OPTION(desired_mode, "XRT_COMPOSITOR_DESIRED_MODE", -1)
 // clang-format on
 
 void
@@ -49,6 +50,7 @@ comp_settings_init(struct comp_settings *s, struct xrt_device *xdev)
 	s->validate_vulkan = debug_get_bool_option_validate_vulkan();
 	s->gpu_index = debug_get_num_option_force_gpu_index();
 	s->debug.wireframe = debug_get_bool_option_wireframe();
+	s->desired_mode = debug_get_num_option_desired_mode();
 
 	if (debug_get_bool_option_force_nvidia()) {
 		s->window_type = WINDOW_DIRECT_NVIDIA;
diff --git a/src/xrt/compositor/main/comp_settings.h b/src/xrt/compositor/main/comp_settings.h
index a697b3c92c9bfaad9a701119663f5a30121133c2..cb8d8223d97fdb17e8d18c3db6d7dd7310734fb6 100644
--- a/src/xrt/compositor/main/comp_settings.h
+++ b/src/xrt/compositor/main/comp_settings.h
@@ -96,6 +96,9 @@ struct comp_settings
 
 	//! Run the compositor on this Vulkan physical device
 	int gpu_index;
+
+	//! Try to choose the mode with this index for direct mode
+	int desired_mode;
 };
 
 /*!
diff --git a/src/xrt/compositor/main/comp_window_direct_mode.cpp b/src/xrt/compositor/main/comp_window_direct_mode.cpp
index a4b044d7edb8889dbeb6ce73a70ce5206da1b402..f0622585d9ccc4f28aa2dc02849c37b931b7a214 100644
--- a/src/xrt/compositor/main/comp_window_direct_mode.cpp
+++ b/src/xrt/compositor/main/comp_window_direct_mode.cpp
@@ -479,8 +479,26 @@ comp_window_direct_get_primary_display_mode(struct comp_window_direct *w,
 
 	print_modes(w, mode_properties, mode_count);
 
-	int chosen_mode =
-	    choose_best_vk_mode_auto(w, mode_properties, mode_count);
+
+	int chosen_mode = 0;
+
+	int desired_mode = w->base.c->settings.desired_mode;
+	if (desired_mode + 1 > (int)mode_count) {
+		COMP_ERROR(w->base.c,
+		           "Requested mode index %d, but max is %d. Falling "
+		           "back to automatic mode selection",
+		           desired_mode, mode_count);
+		chosen_mode =
+		    choose_best_vk_mode_auto(w, mode_properties, mode_count);
+	} else if (desired_mode < 0) {
+		chosen_mode =
+		    choose_best_vk_mode_auto(w, mode_properties, mode_count);
+	} else {
+		COMP_DEBUG(w->base.c, "Using manually chosen mode %d",
+		           desired_mode);
+		chosen_mode = desired_mode;
+	}
+
 	VkDisplayModePropertiesKHR props = mode_properties[chosen_mode];
 
 	COMP_DEBUG(w->base.c, "found display mode %dx%d@%.2f",