From 841f166ff96fc2f3ecd1c0cc08072633033d41bf Mon Sep 17 00:00:00 2001 From: Franz Pletz Date: Wed, 25 Sep 2024 17:44:31 +0200 Subject: [PATCH] linuxPackages.nvidiaPackages.latest.open: fix for linux 6.11 Fixes framebuffer support in Linux 6.11. Fixes #343774, #323396. --- pkgs/os-specific/linux/nvidia-x11/default.nix | 7 +++++++ pkgs/os-specific/linux/nvidia-x11/generic.nix | 2 ++ pkgs/os-specific/linux/nvidia-x11/open.nix | 3 +++ 3 files changed, 12 insertions(+) diff --git a/pkgs/os-specific/linux/nvidia-x11/default.nix b/pkgs/os-specific/linux/nvidia-x11/default.nix index dd4cd3d94a17..f6c45ac6a42a 100644 --- a/pkgs/os-specific/linux/nvidia-x11/default.nix +++ b/pkgs/os-specific/linux/nvidia-x11/default.nix @@ -22,6 +22,12 @@ let url = "https://github.com/gentoo/gentoo/raw/c64caf53/x11-drivers/nvidia-drivers/files/nvidia-drivers-470.223.02-gpl-pfn_valid.patch"; hash = "sha256-eZiQQp2S/asE7MfGvfe6dA/kdCvek9SYa/FFGp24dVg="; }; + + # Fixes framebuffer with linux 6.11 + fbdev_linux_611_patch = fetchpatch { + url = "https://patch-diff.githubusercontent.com/raw/NVIDIA/open-gpu-kernel-modules/pull/692.patch"; + hash = "sha256-OYw8TsHDpBE5DBzdZCBT45+AiznzO9SfECz5/uXN5Uc="; + }; in rec { mkDriver = generic; @@ -48,6 +54,7 @@ rec { openSha256 = "sha256-/32Zf0dKrofTmPZ3Ratw4vDM7B+OgpC4p7s+RHUjCrg="; settingsSha256 = "sha256-kQsvDgnxis9ANFmwIwB7HX5MkIAcpEEAHc8IBOLdXvk="; persistencedSha256 = "sha256-E2J2wYYyRu7Kc3MMZz/8ZIemcZg68rkzvqEwFAL3fFs="; + patchesOpen = [ fbdev_linux_611_patch ]; }); beta = selectHighestVersion latest (generic { diff --git a/pkgs/os-specific/linux/nvidia-x11/generic.nix b/pkgs/os-specific/linux/nvidia-x11/generic.nix index 87fde8db2340..bc4a22621cf3 100644 --- a/pkgs/os-specific/linux/nvidia-x11/generic.nix +++ b/pkgs/os-specific/linux/nvidia-x11/generic.nix @@ -23,6 +23,7 @@ , postPatch ? null , patchFlags ? null , patches ? [ ] +, patchesOpen ? [ ] , preInstall ? null , postInstall ? null , broken ? false @@ -201,6 +202,7 @@ let (hash: callPackage ./open.nix { inherit hash; nvidia_x11 = self; + patches = patchesOpen; broken = brokenOpen; }) openSha256; diff --git a/pkgs/os-specific/linux/nvidia-x11/open.nix b/pkgs/os-specific/linux/nvidia-x11/open.nix index a6795c3fd5e7..d9926f9cc3eb 100644 --- a/pkgs/os-specific/linux/nvidia-x11/open.nix +++ b/pkgs/os-specific/linux/nvidia-x11/open.nix @@ -4,6 +4,7 @@ , kernel , nvidia_x11 , hash +, patches ? [ ] , broken ? false }: @@ -18,6 +19,8 @@ stdenv.mkDerivation ({ inherit hash; }; + inherit patches; + nativeBuildInputs = kernel.moduleBuildDependencies; makeFlags = kernel.makeFlags ++ [