···2525DEBUG_GET_ONCE_LOG_OPTION(log_level, "U_PACING_APP_LOG", U_LOGGING_WARN)
2626DEBUG_GET_ONCE_FLOAT_OPTION(min_app_time_ms, "U_PACING_APP_MIN_TIME_MS", 1.0f)
2727DEBUG_GET_ONCE_FLOAT_OPTION(min_margin_ms, "U_PACING_APP_MIN_MARGIN_MS", 2.0f)
2828+DEBUG_GET_ONCE_BOOL_OPTION(use_min_frame_period, "U_PACING_APP_USE_MIN_FRAME_PERIOD", false)
28292930#define UPA_LOG_T(...) U_LOG_IFL_T(debug_get_log_option_log_level(), __VA_ARGS__)
3031#define UPA_LOG_D(...) U_LOG_IFL_D(debug_get_log_option_log_level(), __VA_ARGS__)
···444445445446 DEBUG_PRINT_ID(frame_id);
446447447447- uint64_t period_ns = calc_period(pa);
448448+ uint64_t period_ns;
449449+450450+ /*
451451+ * We can either limit the application to a calculated frame rate that
452452+ * depends on it's total frame time. Or we try to use the minimal frame
453453+ * period, aka the compositor's frame period. This will use more power.
454454+ */
455455+ if (!debug_get_bool_option_use_min_frame_period()) {
456456+ period_ns = min_period(pa);
457457+ } else {
458458+ period_ns = calc_period(pa);
459459+ }
460460+448461 uint64_t predict_ns = predict_display_time(pa, now_ns, period_ns);
449462 // How long we think the frame should take.
450463 uint64_t frame_time_ns = total_app_time_ns(pa);