mirror of
https://github.com/NixOS/nixos-hardware.git
synced 2026-12-02 05:53:32 +01:00
Merge pull request #1992 from r-vdp/amdgpu-dcdebugmask-options
common/gpu/amd: add hardware.amdgpu.dcDebugMask options
This commit is contained in:
5 files changed
+64
-25
No files matched your search
@@ -0,0 +1,36 @@
|
||||
# Flag values from drivers/gpu/drm/amd/include/amd_shared.h
|
||||
{ config, lib, ... }:
|
||||
let
|
||||
flags = {
|
||||
disablePipeSplit = 1;
|
||||
disableStutter = 2;
|
||||
disableDsc = 4;
|
||||
disableClockGating = 8;
|
||||
disablePsr = 16;
|
||||
disableMpo = 64;
|
||||
disablePsrSu = 512;
|
||||
disableReplay = 1024;
|
||||
disableIps = 2048;
|
||||
};
|
||||
|
||||
cfg = config.hardware.amdgpu.dcDebugMask;
|
||||
|
||||
mask = lib.foldlAttrs (
|
||||
acc: name: bit:
|
||||
if cfg.${name} then lib.bitOr acc bit else acc
|
||||
) 0 flags;
|
||||
in
|
||||
{
|
||||
options.hardware.amdgpu.dcDebugMask = lib.mapAttrs (
|
||||
_name: bit:
|
||||
lib.mkOption {
|
||||
type = lib.types.bool;
|
||||
default = false;
|
||||
description = "Set flag 0x${lib.toHexString bit} in amdgpu.dcdebugmask.";
|
||||
}
|
||||
) flags;
|
||||
|
||||
config = lib.mkIf (mask != 0) {
|
||||
boot.kernelParams = [ "amdgpu.dcdebugmask=0x${lib.toHexString mask}" ];
|
||||
};
|
||||
}
|
||||
@@ -1,6 +1,8 @@
|
||||
{ lib, ... }:
|
||||
|
||||
{
|
||||
imports = [ ./dc-debug-mask.nix ];
|
||||
|
||||
config = {
|
||||
services.xserver.videoDrivers = lib.mkDefault [ "modesetting" ];
|
||||
|
||||
|
||||
Reference in new issue
Block a user