The open source OpenXR runtime
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

u/pacing: Add env var to use minimal frame period instead of calculated

authored by

BabbleBones and committed by
Jakob Bornecrantz
8b441bdb b14a8b44

+14 -1
+14 -1
src/xrt/auxiliary/util/u_pacing_app.c
··· 25 25 DEBUG_GET_ONCE_LOG_OPTION(log_level, "U_PACING_APP_LOG", U_LOGGING_WARN) 26 26 DEBUG_GET_ONCE_FLOAT_OPTION(min_app_time_ms, "U_PACING_APP_MIN_TIME_MS", 1.0f) 27 27 DEBUG_GET_ONCE_FLOAT_OPTION(min_margin_ms, "U_PACING_APP_MIN_MARGIN_MS", 2.0f) 28 + DEBUG_GET_ONCE_BOOL_OPTION(use_min_frame_period, "U_PACING_APP_USE_MIN_FRAME_PERIOD", false) 28 29 29 30 #define UPA_LOG_T(...) U_LOG_IFL_T(debug_get_log_option_log_level(), __VA_ARGS__) 30 31 #define UPA_LOG_D(...) U_LOG_IFL_D(debug_get_log_option_log_level(), __VA_ARGS__) ··· 444 445 445 446 DEBUG_PRINT_ID(frame_id); 446 447 447 - uint64_t period_ns = calc_period(pa); 448 + uint64_t period_ns; 449 + 450 + /* 451 + * We can either limit the application to a calculated frame rate that 452 + * depends on it's total frame time. Or we try to use the minimal frame 453 + * period, aka the compositor's frame period. This will use more power. 454 + */ 455 + if (!debug_get_bool_option_use_min_frame_period()) { 456 + period_ns = min_period(pa); 457 + } else { 458 + period_ns = calc_period(pa); 459 + } 460 + 448 461 uint64_t predict_ns = predict_display_time(pa, now_ns, period_ns); 449 462 // How long we think the frame should take. 450 463 uint64_t frame_time_ns = total_app_time_ns(pa);