Update Customization

NGnius 2024-05-05 02:43:20 +01:00
parent cc259ac54d
commit 101f6ccb6a

@ -1,81 +1,13 @@
As of v1.1.0, PowerTools supports customizing values for most functionality. This can be useful for advanced uses like overclocking or untested hardware. Please remember that the [terms of the license](https://github.com/NGnius/PowerTools/blob/main/LICENSE) place all responsibility on the user to use these features responsibly.
NOTE: Advanced features are meant to be used by advanced users. Advanced users are expected to be able to figure this out without NGnius.
As of v2.0.0, the same customization file is used for all devices.
# Steam Deck
NOTE: Advanced features are meant to be used by advanced users. Advanced users are expected to be able to figure this out without dev intervention.
The Steam Deck driver has an optional advanced mode which is activated when a valid `pt_oc.json` JSON file is present in the `~/.config/powertools` folder. No values are optional. Any file error will be logged to `/tmp/powertools.log` (release builds) and the default config will be used instead. This file roughly reflects the design of PowerTools internal Steam Deck drivers, so it may change with any update ([major, minor, and even patch](https://semver.org/) updates).
# Limits Override
The structure and default values are defined in [oc_limits.rs](https://github.com/NGnius/PowerTools/blob/main/backend/src/settings/steam_deck/oc_limits.rs). If you do not understand the [JSON sample](https://github.com/NGnius/PowerTools/blob/main/pt_oc.json) as well as the [Rust declaration](https://github.com/NGnius/PowerTools/blob/main/backend/src/settings/steam_deck/oc_limits.rs) you should not use this feature.
There is an optional file `limits_override.ron` RON file which will override the default limits chosen by PowerTools for various components. This file must be placed in `~/homebrew/settings/PowerTools` (the same folder which contains settings profiles). Any file error will be logged to the main PowerTools [log location](https://git.ngni.us/NG-SD-Plugins/PowerTools/wiki/Directory-Structure#logs) and the limits override file will be ignored. Some effort is made to keep this file consistent between updates, but [major and minor](https://semver.org/) updates may introduce incompatibilities.
NOTE: since some kernel interfaces only accept the default Steam Deck ranges, changing certain ranges is only a placebo in the UI. The log is your friend to find out when this is happening.
The file structure base is defined in [limits.rs](https://git.ngni.us/NG-SD-Plugins/PowerTools/src/branch/main/backend/limits_core/src/json_v2/limits.rs) (the immediate folder contains more specific parts) and a generated RON sample file is in [limits_override.ron](https://git.ngni.us/NG-SD-Plugins/PowerTools/src/branch/main/limits_override.ron). If you do not understand these files, please do not use this feature. These files reuse the limits server data structures, so all types and names directly correspond to their respective default limit.
## battery
The top-level `battery` object contains the custom configuration for the battery part of the Steam Deck driver. Presently, this only contains 1 field.
### charge_rate
Bounds for the battery inrush current, in milliamps. The limits are expressed in the format `{"min": u64, "max": u64}`.
### extra_readouts
Show battery current and USB-C PD negotiated power. This is a `bool`.
## cpus
### cpus
A list of CPU objects corresponding to each hardware CPU thread in the same order as the Linux kernel. Extra CPUs in this list will be ignored, missing CPUs in this list will not be possible to change through PowerTools.
#### clock_min
Bounds for the CPU minimum frequency, in MHz. The limits are expressed in the format `{"min": u64, "max": u64}`.
#### clock_max
Bounds for the CPU maximum frequency, in MHz. The limits are expressed in the format `{"min": u64, "max": u64}`.
#### clock_step
CPU frequency slider quanta. This is a `u64`.
### global_governors
A boolean (`true` or `false`) to enable or disable the UI element which sets the governors of all CPUs at once.
## gpu
### fast_ppt
Bounds for the GPU fast PPT value, in W/`ppt_divisor`. The limits are expressed in the format `{"min": u64, "max": u64}`.
### slow_ppt
Bounds for the GPU slow PPT value, in W/`ppt_divisor`. The limits are expressed in the format `{"min": u64, "max": u64}`.
### ppt_divisor
Divisor for the PPT values. This is a `u64`.
### ppt_step
GPU PPT slider quanta. This is a `u64`.
### clock_min
Bounds for the GPU minimum frequency, in MHz. The limits are expressed in the format `{"min": u64, "max": u64}`.
### clock_max
Bounds for the GPU maximum frequency, in MHz. The limits are expressed in the format `{"min": u64, "max": u64}`.
### clock_step
GPU frequency slider quanta. This is a `u64`.
# Other AMD APUs
The generic driver is part of a more sophisticated system to automatically detect which driver and which config need to be loaded for the system that PowerTools is running on. This information is cached in `limits_cache.json` in the `~/.config/powertools` folder. Loading behaviour is similar to `pt_oc.json` except `limits_cache.json` will also be updated by PowerTools daily by downloading the latest version from the URL in the file.
The structure and default values are defined in the [limits_core crate](https://github.com/NGnius/PowerTools/tree/main/backend/limits_core/src/json). The automatic detection and configuration of the generic AMD drivers are handled by [auto_detect.rs](https://github.com/NGnius/PowerTools/blob/main/backend/src/settings/detect/auto_detect.rs). That should be used as the ultimate source of truth, since this documentation cannot communicate that functionality as exhaustively or effectively.
NOTE: some kernel interfaces only accept the default ranges (especially for Steam Deck) so changing certain ranges is only a placebo in the UI. Logs will likely show when this is happening.