File tree Expand file tree Collapse file tree 10 files changed +86
-92
lines changed
microsoft/surface/common/kernel Expand file tree Collapse file tree 10 files changed +86
-92
lines changed Original file line number Diff line number Diff line change 66 ../../../common/gpu/amd
77 ] ;
88
9- boot . kernelParams =
10- [
11- # There seems to be an issue with panel self-refresh (PSR) that
12- # causes hangs for users.
13- #
14- # https://community.frame.work/t/fedora-kde-becomes-suddenly-slow/58459
15- # https://gitlab.freedesktop.org/drm/amd/-/issues/3647
16- "amdgpu.dcdebugmask=0x10"
17- ]
18- # Workaround for SuspendThenHibernate: https://lore.kernel.org/linux-kernel/20231106162310.85711-1-mario.limonciello@amd.com/
19- ++ lib . optionals ( lib . versionOlder config . boot . kernelPackages . kernel . version "6.8" ) [
20- "rtc_cmos.use_acpi_alarm=1"
21- ] ;
9+ boot . kernelParams = [
10+ # There seems to be an issue with panel self-refresh (PSR) that
11+ # causes hangs for users.
12+ #
13+ # https://community.frame.work/t/fedora-kde-becomes-suddenly-slow/58459
14+ # https://gitlab.freedesktop.org/drm/amd/-/issues/3647
15+ "amdgpu.dcdebugmask=0x10"
16+ ]
17+ # Workaround for SuspendThenHibernate: https://lore.kernel.org/linux-kernel/20231106162310.85711-1-mario.limonciello@amd.com/
18+ ++ lib . optionals ( lib . versionOlder config . boot . kernelPackages . kernel . version "6.8" ) [
19+ "rtc_cmos.use_acpi_alarm=1"
20+ ] ;
2221
2322 # AMD has better battery life with PPD over TLP:
2423 # https://community.frame.work/t/responded-amd-7040-sleep-states/38101/13
Original file line number Diff line number Diff line change 99 ../../../common/cpu/intel
1010 ] ;
1111
12- boot . kernelParams =
13- [
14- # For Power consumption
15- # https://community.frame.work/t/linux-battery-life-tuning/6665/156
16- "nvme.noacpi=1"
17- ]
18- # Fixes a regression in s2idle, making it more power efficient than deep sleep
19- # Update 04/2024: It appears that s2idle-regression got fixed in newer kernel-versions (SebTM)
20- # (see: https://github.com/NixOS/nixos-hardware/pull/903#discussion_r1556096657)
21- ++ lib . lists . optional ( lib . versionOlder config . boot . kernelPackages . kernel . version "6.8" ) "acpi_osi=\" !Windows 2020\" " ;
12+ boot . kernelParams = [
13+ # For Power consumption
14+ # https://community.frame.work/t/linux-battery-life-tuning/6665/156
15+ "nvme.noacpi=1"
16+ ]
17+ # Fixes a regression in s2idle, making it more power efficient than deep sleep
18+ # Update 04/2024: It appears that s2idle-regression got fixed in newer kernel-versions (SebTM)
19+ # (see: https://github.com/NixOS/nixos-hardware/pull/903#discussion_r1556096657)
20+ ++ lib . lists . optional ( lib . versionOlder config . boot . kernelPackages . kernel . version "6.8" ) "acpi_osi=\" !Windows 2020\" " ;
2221
2322 # Requires at least 5.16 for working wi-fi and bluetooth.
2423 # https://community.frame.work/t/using-the-ax210-with-linux-on-the-framework-laptop/1844/89
Original file line number Diff line number Diff line change 66 ../../../common/gpu/amd
77 ] ;
88
9- boot . kernelParams =
10- [
11- # There seems to be an issue with panel self-refresh (PSR) that
12- # causes hangs for users.
13- #
14- # https://community.frame.work/t/fedora-kde-becomes-suddenly-slow/58459
15- # https://gitlab.freedesktop.org/drm/amd/-/issues/3647
16- "amdgpu.dcdebugmask=0x10"
17- ]
18- # Workaround for SuspendThenHibernate: https://lore.kernel.org/linux-kernel/20231106162310.85711-1-mario.limonciello@amd.com/
19- ++ lib . optionals ( lib . versionOlder config . boot . kernelPackages . kernel . version "6.8" ) [
20- "rtc_cmos.use_acpi_alarm=1"
21- ] ;
9+ boot . kernelParams = [
10+ # There seems to be an issue with panel self-refresh (PSR) that
11+ # causes hangs for users.
12+ #
13+ # https://community.frame.work/t/fedora-kde-becomes-suddenly-slow/58459
14+ # https://gitlab.freedesktop.org/drm/amd/-/issues/3647
15+ "amdgpu.dcdebugmask=0x10"
16+ ]
17+ # Workaround for SuspendThenHibernate: https://lore.kernel.org/linux-kernel/20231106162310.85711-1-mario.limonciello@amd.com/
18+ ++ lib . optionals ( lib . versionOlder config . boot . kernelPackages . kernel . version "6.8" ) [
19+ "rtc_cmos.use_acpi_alarm=1"
20+ ] ;
2221
2322 # AMD has better battery life with PPD over TLP:
2423 # https://community.frame.work/t/responded-amd-7040-sleep-states/38101/13
Original file line number Diff line number Diff line change 1010 # remove all packages for amd igpu. I only removed amdgpu from
1111 # services.xserver.videoDrivers by overriding. This is because the specialization
1212 # of nix cannot implement such an operation as canceling an import.
13- hardware =
14- {
15- nvidia . prime . offload . enable = false ;
16- }
17- // lib . optionalAttrs ( options ? amdgpu . opencl . enable ) {
18- # introduced in https://github.com/NixOS/nixpkgs/pull/319865
19- amdgpu . opencl . enable = lib . mkDefault false ;
20- } ;
13+ hardware = {
14+ nvidia . prime . offload . enable = false ;
15+ }
16+ // lib . optionalAttrs ( options ? amdgpu . opencl . enable ) {
17+ # introduced in https://github.com/NixOS/nixpkgs/pull/319865
18+ amdgpu . opencl . enable = lib . mkDefault false ;
19+ } ;
2120}
Original file line number Diff line number Diff line change 1010 # remove all packages for amd igpu. I only removed amdgpu from
1111 # services.xserver.videoDrivers by overriding. This is because the specialization
1212 # of nix cannot implement such an operation as canceling an import.
13- hardware =
14- {
15- nvidia . prime . offload . enable = false ;
16- }
17- // lib . optionalAttrs ( options ? amdgpu . opencl . enable ) {
18- # introduced in https://github.com/NixOS/nixpkgs/pull/319865
19- amdgpu . opencl . enable = lib . mkDefault false ;
20- } ;
13+ hardware = {
14+ nvidia . prime . offload . enable = false ;
15+ }
16+ // lib . optionalAttrs ( options ? amdgpu . opencl . enable ) {
17+ # introduced in https://github.com/NixOS/nixpkgs/pull/319865
18+ amdgpu . opencl . enable = lib . mkDefault false ;
19+ } ;
2120}
Original file line number Diff line number Diff line change 33{
44 imports = [ ../hybrid ] ;
55 services . xserver . videoDrivers = [ "nvidia" ] ;
6- hardware =
7- {
8- nvidia . prime . offload . enable = false ;
9- }
10- // lib . optionalAttrs ( options ? amdgpu . opencl . enable ) {
11- # introduced in https://github.com/NixOS/nixpkgs/pull/319865
12- amdgpu . opencl . enable = lib . mkDefault false ;
13- } ;
6+ hardware = {
7+ nvidia . prime . offload . enable = false ;
8+ }
9+ // lib . optionalAttrs ( options ? amdgpu . opencl . enable ) {
10+ # introduced in https://github.com/NixOS/nixpkgs/pull/319865
11+ amdgpu . opencl . enable = lib . mkDefault false ;
12+ } ;
1413}
Original file line number Diff line number Diff line change 1414
1515 # amdgpu.backlight=0 makes the backlight work
1616 # acpi_backlight=none allows the backlight save/load systemd service to work on older kernel versions
17- boot . kernelParams =
18- [ "amdgpu.backlight=0" ]
19- ++ lib . optional ( lib . versionOlder config . boot . kernelPackages . kernel . version "6.1.6" ) "acpi_backlight=none" ;
17+ boot . kernelParams = [
18+ "amdgpu.backlight=0"
19+ ]
20+ ++ lib . optional ( lib . versionOlder config . boot . kernelPackages . kernel . version "6.1.6" ) "acpi_backlight=none" ;
2021
2122 # For mainline support of rtw89 wireless networking
2223 boot . kernelPackages = lib . mkIf ( lib . versionOlder pkgs . linux . version "5.16" ) pkgs . linuxPackages_latest ;
Original file line number Diff line number Diff line change 2424 let
2525 inherit ( builtins ) removeAttrs ;
2626
27- args' =
28- {
29- inherit
30- src
31- version
32- modDirVersion
33- kernelPatches
34- ;
35- }
36- // removeAttrs args [
37- "url"
38- "sha256"
39- ] ;
27+ args' = {
28+ inherit
29+ src
30+ version
31+ modDirVersion
32+ kernelPatches
33+ ;
34+ }
35+ // removeAttrs args [
36+ "url"
37+ "sha256"
38+ ] ;
4039 linuxPackage = buildLinux args' ;
4140 linuxPackages' = recurseIntoAttrs ( linuxPackagesFor linuxPackage ) ;
4241 in
Original file line number Diff line number Diff line change @@ -47,21 +47,20 @@ pkgs.stdenv.mkDerivation rec {
4747 ${ firmwareSeco } --auto-accept --force
4848 '' ;
4949
50- filesToInstall =
51- [
52- "firmware-imx-${ fwHdmiVersion } /firmware/hdmi/cadence/dpfw.bin"
53- "firmware-imx-${ fwHdmiVersion } /firmware/hdmi/cadence/hdmi?xfw.bin"
54- ]
55- ++ pkgs . lib . optional ( targetBoard == "imx8qm" ) (
56- "imx-sc-firmware-${ fwScVersion } /mx8qm-mek-scfw-tcm.bin"
57- + " "
58- + "imx-seco-${ fwSecoVersion } /firmware/seco/mx8qmb0-ahab-container.img"
59- )
60- ++ pkgs . lib . optional ( targetBoard == "imx8qxp" ) (
61- "imx-sc-firmware-${ fwScVersion } /mx8qx-mek-scfw-tcm.bin"
62- + " "
63- + "imx-seco-${ fwSecoVersion } /firmware/seco/mx8qxc0-ahab-container.img"
64- ) ;
50+ filesToInstall = [
51+ "firmware-imx-${ fwHdmiVersion } /firmware/hdmi/cadence/dpfw.bin"
52+ "firmware-imx-${ fwHdmiVersion } /firmware/hdmi/cadence/hdmi?xfw.bin"
53+ ]
54+ ++ pkgs . lib . optional ( targetBoard == "imx8qm" ) (
55+ "imx-sc-firmware-${ fwScVersion } /mx8qm-mek-scfw-tcm.bin"
56+ + " "
57+ + "imx-seco-${ fwSecoVersion } /firmware/seco/mx8qmb0-ahab-container.img"
58+ )
59+ ++ pkgs . lib . optional ( targetBoard == "imx8qxp" ) (
60+ "imx-sc-firmware-${ fwScVersion } /mx8qx-mek-scfw-tcm.bin"
61+ + " "
62+ + "imx-seco-${ fwSecoVersion } /firmware/seco/mx8qxc0-ahab-container.img"
63+ ) ;
6564
6665 installPhase = ''
6766 mkdir -p $out
Original file line number Diff line number Diff line change 4545 } ;
4646 }
4747 { patch = ./irq-desc-to-data.patch ; }
48- ] ++ kernelPatches ;
48+ ]
49+ ++ kernelPatches ;
4950
5051 structuredExtraConfig = with lib . kernel ; {
5152 # A ton of stuff just does not build. We disable it all.
You can’t perform that action at this time.
0 commit comments