From ea6f9e9634931dd550ad9f9ac5f0b3cfce2b701b Mon Sep 17 00:00:00 2001 From: Swarsel Date: Wed, 25 Dec 2024 16:09:12 +0100 Subject: [PATCH] fix: screen flickering (disable PSR/-SU) --- .../nbl-imba-2/hardware-configuration.nix | 65 +++---------------- 1 file changed, 10 insertions(+), 55 deletions(-) diff --git a/hosts/nixos/nbl-imba-2/hardware-configuration.nix b/hosts/nixos/nbl-imba-2/hardware-configuration.nix index cab3d56..5153079 100644 --- a/hosts/nixos/nbl-imba-2/hardware-configuration.nix +++ b/hosts/nixos/nbl-imba-2/hardware-configuration.nix @@ -1,6 +1,3 @@ -# Do not modify this file! It was generated by ‘nixos-generate-config’ -# and may be overwritten by future invocations. Please make changes -# to /etc/nixos/configuration.nix instead. { config, lib, modulesPath, ... }: { @@ -12,6 +9,16 @@ boot.initrd.availableKernelModules = [ "nvme" "xhci_pci" "thunderbolt" "usb_storage" "cryptd" "usbhid" "sd_mod" "r8152" ]; boot.initrd.kernelModules = [ ]; boot.kernelModules = [ "kvm-amd" ]; + + # Fix screen flickering issue at the cost of battery life (disable PSR and PSR-SU, keep PR enabled) + # TODO: figure out if this is worth it + # test PSR/PR state with 'sudo grep '' /sys/kernel/debug/dri/0000*/eDP-2/*_capability' + # ref: + # https://old.reddit.com/r/framework/comments/1goh7hc/anyone_else_get_this_screen_flickering_issue/ + # https://www.reddit.com/r/NixOS/comments/1hjruq1/graphics_corruption_on_kernel_6125_and_up/ + # https://gitlab.freedesktop.org/drm/amd/-/issues/3797 + boot.kernelParams = [ "amdgpu.dcdebugmask=0x410" ]; + boot.extraModulePackages = [ ]; boot.initrd.luks.devices."cryptroot" = { # improve performance on ssds @@ -19,58 +26,6 @@ preLVM = true; }; - # fileSystems."/" = - # { - # device = "/dev/disk/by-uuid/3554892c-9d0b-49b2-b74a-8b5ef45569f7"; - # fsType = "btrfs"; - # options = [ "subvol=root" ]; - # }; - - # boot.initrd.luks.devices."cryptroot".device = "/dev/disk/by-uuid/98b9bf76-ca01-49f5-91ee-1884ae9ce383"; - - # fileSystems."/boot" = - # { - # device = "/dev/disk/by-uuid/5236-F44A"; - # fsType = "vfat"; - # }; - - # fileSystems."/home" = - # { - # device = "/dev/disk/by-uuid/3554892c-9d0b-49b2-b74a-8b5ef45569f7"; - # fsType = "btrfs"; - # options = [ "subvol=home" ]; - # }; - - # fileSystems."/nix" = - # { - # device = "/dev/disk/by-uuid/3554892c-9d0b-49b2-b74a-8b5ef45569f7"; - # fsType = "btrfs"; - # options = [ "subvol=nix" ]; - # }; - - # fileSystems."/persist" = - # { - # device = "/dev/disk/by-uuid/3554892c-9d0b-49b2-b74a-8b5ef45569f7"; - # fsType = "btrfs"; - # options = [ "subvol=persist" ]; - # }; - - # fileSystems."/swap" = - # { - # device = "/dev/disk/by-uuid/3554892c-9d0b-49b2-b74a-8b5ef45569f7"; - # fsType = "btrfs"; - # options = [ "subvol=swap" ]; - # }; - - # fileSystems."/var/log" = - # { - # device = "/dev/disk/by-uuid/3554892c-9d0b-49b2-b74a-8b5ef45569f7"; - # fsType = "btrfs"; - # options = [ "subvol=log" ]; - # }; - - # swapDevices = [ ]; - # Enables DHCP on each ethernet and wireless interface. In case of scripted networking # (the default) this is the recommended approach. When using systemd-networkd it's # still possible to use this option, but it's recommended to use it in conjunction