From 56ad55261c313f3736193fb6a10d71713de161c8 Mon Sep 17 00:00:00 2001 From: ChaosAttractor <46527539+LostAttractor@users.noreply.github.com> Date: Wed, 8 Feb 2023 18:56:30 +0800 Subject: [PATCH 1/5] zephyrus ga401: add amdgpu driver --- asus/zephyrus/ga401/default.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/asus/zephyrus/ga401/default.nix b/asus/zephyrus/ga401/default.nix index 2130ca7..df1c284 100644 --- a/asus/zephyrus/ga401/default.nix +++ b/asus/zephyrus/ga401/default.nix @@ -3,6 +3,7 @@ { imports = [ ../../../common/cpu/amd + ../../../common/gpu/amd ../../../common/gpu/nvidia/prime.nix ../../../common/pc/laptop ../../../common/pc/ssd From 0b49fc7783e7125c8ec48abd2bb6bb902421f5f6 Mon Sep 17 00:00:00 2001 From: ChaosAttractor <46527539+LostAttractor@users.noreply.github.com> Date: Wed, 8 Feb 2023 18:56:56 +0800 Subject: [PATCH 2/5] zephyrus ga401: add amd cpu pstate --- asus/zephyrus/ga401/default.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/asus/zephyrus/ga401/default.nix b/asus/zephyrus/ga401/default.nix index df1c284..7c6f75d 100644 --- a/asus/zephyrus/ga401/default.nix +++ b/asus/zephyrus/ga401/default.nix @@ -3,6 +3,7 @@ { imports = [ ../../../common/cpu/amd + ../../../common/cpu/amd/pstate.nix ../../../common/gpu/amd ../../../common/gpu/nvidia/prime.nix ../../../common/pc/laptop From b5416e9171d95e7ed94abad325218f78a8fab5f8 Mon Sep 17 00:00:00 2001 From: ChaosAttractor <46527539+LostAttractor@users.noreply.github.com> Date: Wed, 8 Feb 2023 18:57:46 +0800 Subject: [PATCH 3/5] zephyrus ga401: change pc/ssd to pc/laptop/ssd --- asus/zephyrus/ga401/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/asus/zephyrus/ga401/default.nix b/asus/zephyrus/ga401/default.nix index 7c6f75d..32a8e70 100644 --- a/asus/zephyrus/ga401/default.nix +++ b/asus/zephyrus/ga401/default.nix @@ -7,7 +7,7 @@ ../../../common/gpu/amd ../../../common/gpu/nvidia/prime.nix ../../../common/pc/laptop - ../../../common/pc/ssd + ../../../common/pc/laptop/ssd ]; hardware.nvidia.prime = { From 5c55f2428f571fe06e382c800454176b4f8b67f5 Mon Sep 17 00:00:00 2001 From: ChaosAttractor Date: Fri, 10 Feb 2023 01:06:28 +0800 Subject: [PATCH 4/5] zephyrus ga401: Enable asusd services --- asus/zephyrus/ga401/default.nix | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/asus/zephyrus/ga401/default.nix b/asus/zephyrus/ga401/default.nix index 32a8e70..49ab039 100644 --- a/asus/zephyrus/ga401/default.nix +++ b/asus/zephyrus/ga401/default.nix @@ -1,4 +1,4 @@ -{ ... }: +{ lib, ... }: { imports = [ @@ -15,9 +15,13 @@ nvidiaBusId = "PCI:1:0:0"; }; - # fixes mic mute button - services.udev.extraHwdb = '' - evdev:name:*:dmi:bvn*:bvr*:bd*:svnASUS*:pn*:* - KEYBOARD_KEY_ff31007c=f20 - ''; + services = { + asusd.enable = lib.mkDefault true; + + # fixes mic mute button + udev.extraHwdb = '' + evdev:name:*:dmi:bvn*:bvr*:bd*:svnASUS*:pn*:* + KEYBOARD_KEY_ff31007c=f20 + ''; + }; } From 0d8c852503581906dada5e8a22ca5d9248f87427 Mon Sep 17 00:00:00 2001 From: ChaosAttractor Date: Fri, 10 Feb 2023 14:54:19 +0800 Subject: [PATCH 5/5] zephyrus ga401: Enable nvidia powerManagement & modesetting (nvidia-drm) --- asus/zephyrus/ga401/default.nix | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/asus/zephyrus/ga401/default.nix b/asus/zephyrus/ga401/default.nix index 49ab039..4899dd7 100644 --- a/asus/zephyrus/ga401/default.nix +++ b/asus/zephyrus/ga401/default.nix @@ -10,9 +10,17 @@ ../../../common/pc/laptop/ssd ]; - hardware.nvidia.prime = { - amdgpuBusId = "PCI:4:0:0"; - nvidiaBusId = "PCI:1:0:0"; + hardware.nvidia = { + # PCI-Express Runtime D3 Power Management is enabled by default on this laptop + # But it can fix screen tearing & suspend/resume screen corruption in sync mode + modesetting.enable = lib.mkDefault true; + # Enable DRM kernel mode setting + powerManagement.enable = lib.mkDefault true; + + prime = { + amdgpuBusId = "PCI:4:0:0"; + nvidiaBusId = "PCI:1:0:0"; + }; }; services = {