|
Suckless OGL 1.0.0
A lean, high-performance C11 PBR Renderer
|
#include <stdbool.h>#include <stdint.h>#include <stdio.h>Go to the source code of this file.
Data Structures | |
| struct | GPUUsageMonitor |
| Reads GPU utilization % via Linux DRM fdinfo (same method as MangoHud). More... | |
Enumerations | |
| enum | { GPU_USAGE_MAX_FDS = 64 , GPU_USAGE_MAX_KEY_LEN = 48 } |
Functions | |
| void | gpu_usage_init (GPUUsageMonitor *mon) |
| Scans /proc/self/fdinfo/ and opens streams for GPU engine time reading. | |
| void | gpu_usage_cleanup (GPUUsageMonitor *mon) |
| Closes all open fdinfo streams. | |
| void | gpu_usage_update (GPUUsageMonitor *mon) |
| Re-reads fdinfo streams and computes GPU load %. Should be called periodically (e.g., every 500ms). | |
| float | gpu_usage_get_load (const GPUUsageMonitor *mon) |
| Returns the last computed GPU load (0.0–100.0). | |
| bool | gpu_usage_is_available (const GPUUsageMonitor *mon) |
| Returns true if a supported DRM driver was detected. | |
| void gpu_usage_cleanup | ( | GPUUsageMonitor * | mon | ) |
Closes all open fdinfo streams.
| float gpu_usage_get_load | ( | const GPUUsageMonitor * | mon | ) |
Returns the last computed GPU load (0.0–100.0).
| void gpu_usage_init | ( | GPUUsageMonitor * | mon | ) |
Scans /proc/self/fdinfo/ and opens streams for GPU engine time reading.
| bool gpu_usage_is_available | ( | const GPUUsageMonitor * | mon | ) |
Returns true if a supported DRM driver was detected.
| void gpu_usage_update | ( | GPUUsageMonitor * | mon | ) |
Re-reads fdinfo streams and computes GPU load %. Should be called periodically (e.g., every 500ms).