fix: screen flickering (disable PSR/-SU)

This commit is contained in:
Swarsel 2024-12-25 16:09:12 +01:00
parent fbb8e23461
commit ea6f9e9634
Signed by: swarsel
GPG key ID: 26A54C31F2A4FD84

View file

@ -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, ... }: { config, lib, modulesPath, ... }:
{ {
@ -12,6 +9,16 @@
boot.initrd.availableKernelModules = [ "nvme" "xhci_pci" "thunderbolt" "usb_storage" "cryptd" "usbhid" "sd_mod" "r8152" ]; boot.initrd.availableKernelModules = [ "nvme" "xhci_pci" "thunderbolt" "usb_storage" "cryptd" "usbhid" "sd_mod" "r8152" ];
boot.initrd.kernelModules = [ ]; boot.initrd.kernelModules = [ ];
boot.kernelModules = [ "kvm-amd" ]; 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.extraModulePackages = [ ];
boot.initrd.luks.devices."cryptroot" = { boot.initrd.luks.devices."cryptroot" = {
# improve performance on ssds # improve performance on ssds
@ -19,58 +26,6 @@
preLVM = true; 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 # 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 # (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 # still possible to use this option, but it's recommended to use it in conjunction