$darkmode
Runtime performance optimization implementation. More...
Enumerations | |
| enum | { PERF_RT_PRIORITY = 50 } |
| Default real-time priority for SCHED_FIFO (1-99). More... | |
| enum | { PERF_NICE_VALUE = -10 } |
| Nice value for elevated priority (-20 to 19). More... | |
Functions | |
| static int | detect_gamemode (void) |
| Detect if GameMode daemon is available. More... | |
| static int | detect_native_capabilities (void) |
| Detect if native scheduling capabilities are available. More... | |
| int | perf_mode_init (PerfModeContext *ctx) |
| Initialize the performance mode subsystem. More... | |
| static int | activate_gamemode (PerfModeContext *ctx) |
| Activate using GameMode backend. More... | |
| static int | deactivate_gamemode (PerfModeContext *ctx) |
| Deactivate GameMode backend. More... | |
| static int | activate_native (PerfModeContext *ctx) |
| Activate using native Linux scheduler. More... | |
| static int | deactivate_native (PerfModeContext *ctx) |
| Deactivate native Linux scheduler. More... | |
| int | perf_mode_request_start (PerfModeContext *ctx) |
| Request activation of performance mode. More... | |
| int | perf_mode_request_end (PerfModeContext *ctx) |
| Request deactivation of performance mode. More... | |
| void | perf_mode_cleanup (PerfModeContext *ctx) |
| Clean up performance mode resources. More... | |
| PerfModeState | perf_mode_get_state (const PerfModeContext *ctx) |
| Get the current performance mode state. More... | |
| PerfModeBackend | perf_mode_get_backend (const PerfModeContext *ctx) |
| Get the detected backend type. More... | |
| const char * | perf_mode_get_state_string (const PerfModeContext *ctx) |
| Get a human-readable string for the current state. More... | |
| int | perf_mode_is_active (const PerfModeContext *ctx) |
| Check if performance mode is currently active. More... | |
Runtime performance optimization implementation.
Implements performance mode with two backends:
|
static |
Activate using GameMode backend.
| ctx | Context ptr. |
|
static |
Activate using native Linux scheduler.
| ctx | Context ptr. |
|
static |
Deactivate GameMode backend.
| ctx | Context ptr. |
|
static |
Deactivate native Linux scheduler.
| ctx | Context ptr. |
|
static |
Detect if GameMode daemon is available.
|
static |
Detect if native scheduling capabilities are available.
| void perf_mode_cleanup | ( | PerfModeContext * | ctx | ) |
Clean up performance mode resources.
Ensures any active optimizations are properly reverted. Should be called at application shutdown.
| ctx | Pointer to the context. |
| PerfModeBackend perf_mode_get_backend | ( | const PerfModeContext * | ctx | ) |
Get the detected backend type.
| ctx | Pointer to the context. |
| PerfModeState perf_mode_get_state | ( | const PerfModeContext * | ctx | ) |
Get the current performance mode state.
| ctx | Pointer to the context. |
| const char* perf_mode_get_state_string | ( | const PerfModeContext * | ctx | ) |
Get a human-readable string for the current state.
| ctx | Pointer to the context. |
| int perf_mode_init | ( | PerfModeContext * | ctx | ) |
Initialize the performance mode subsystem.
Detects available backends (GameMode daemon, native capabilities). Should be called once at application startup.
| ctx | Pointer to the context to initialize. |
| int perf_mode_is_active | ( | const PerfModeContext * | ctx | ) |
Check if performance mode is currently active.
| ctx | Pointer to the context. |
| int perf_mode_request_end | ( | PerfModeContext * | ctx | ) |
Request deactivation of performance mode.
Reverts any system changes made by perf_mode_request_start().
| ctx | Pointer to the context. |
| int perf_mode_request_start | ( | PerfModeContext * | ctx | ) |
Request activation of performance mode.
Attempts to activate performance optimizations using the best available backend. Effects may include:
| ctx | Pointer to the context. |