mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-06-11 12:15:34 +03:00
nixos/amdgpu: add overdrive and ppfeaturemask option (#411155)
- `programs.corectrl.gpuOverclock.enable` -> `hardware.amdgpu.overdrive.enable` - `programs.corectrl.gpuOverclock.ppfeaturemask` -> `hardware.amdgpu.overdrive.ppfeaturemask` - `programs.tuxclocker.enableAMD` -> `hardware.amdgpu.overdrive.enable`
This commit is contained in:
parent
84937b29d6
commit
c9f192da92
4 changed files with 50 additions and 39 deletions
|
@ -8,13 +8,23 @@ let
|
|||
inherit (lib)
|
||||
mkEnableOption
|
||||
mkIf
|
||||
mkOption
|
||||
mkPackageOption
|
||||
;
|
||||
|
||||
cfg = config.programs.corectrl;
|
||||
in
|
||||
{
|
||||
imports = [
|
||||
(lib.mkRenamedOptionModule
|
||||
[ "programs" "corectrl" "gpuOverclock" "enable" ]
|
||||
[ "hardware" "amdgpu" "overdrive" "enable" ]
|
||||
)
|
||||
(lib.mkRenamedOptionModule
|
||||
[ "programs" "corectrl" "gpuOverclock" "ppfeaturemask" ]
|
||||
[ "hardware" "amdgpu" "overdrive" "ppfeaturemask" ]
|
||||
)
|
||||
];
|
||||
|
||||
options.programs.corectrl = {
|
||||
enable = mkEnableOption ''
|
||||
CoreCtrl, a tool to overclock amd graphics cards and processors.
|
||||
|
@ -24,23 +34,6 @@ in
|
|||
package = mkPackageOption pkgs "corectrl" {
|
||||
extraDescription = "Useful for overriding the configuration options used for the package.";
|
||||
};
|
||||
|
||||
gpuOverclock = {
|
||||
enable = mkEnableOption ''
|
||||
GPU overclocking
|
||||
'';
|
||||
ppfeaturemask = mkOption {
|
||||
type = lib.types.str;
|
||||
default = "0xfffd7fff";
|
||||
example = "0xffffffff";
|
||||
description = ''
|
||||
Sets the `amdgpu.ppfeaturemask` kernel option.
|
||||
In particular, it is used here to set the overdrive bit.
|
||||
Default is `0xfffd7fff` as it is less likely to cause flicker issues.
|
||||
Setting it to `0xffffffff` enables all features.
|
||||
'';
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
|
@ -61,12 +54,6 @@ in
|
|||
}
|
||||
});
|
||||
'';
|
||||
|
||||
# https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/drivers/gpu/drm/amd/include/amd_shared.h#n169
|
||||
# The overdrive bit
|
||||
boot.kernelParams = mkIf cfg.gpuOverclock.enable [
|
||||
"amdgpu.ppfeaturemask=${cfg.gpuOverclock.ppfeaturemask}"
|
||||
];
|
||||
};
|
||||
|
||||
meta.maintainers = with lib.maintainers; [
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue