Merge pull request #1992 from r-vdp/amdgpu-dcdebugmask-options

common/gpu/amd: add hardware.amdgpu.dcDebugMask options
This commit is contained in:
Ramses authored and GitHub committed 2026-10-02 13:35:22 +00:00
commit 0953bb1a60
5 files changed
+64 -25

No files matched your search

+36
View File
@@ -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}" ];
};
}
+2
View File
@@ -1,6 +1,8 @@
{ lib, ... }:
{
imports = [ ./dc-debug-mask.nix ];
config = {
services.xserver.videoDrivers = lib.mkDefault [ "modesetting" ];