Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: NixOS/nixpkgs
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 561425b1ba28
Choose a base ref
...
head repository: NixOS/nixpkgs
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 00b92751f614
Choose a head ref
  • 5 commits
  • 2 files changed
  • 1 contributor

Commits on Dec 5, 2017

  1. nvidia_x11_legacy340: patch to support kernel 4.14

    /cc #31640.
    
    (cherry picked from commit 6aa3f54)
    vcunat committed Dec 5, 2017

    Verified

    This commit was signed with the committer’s verified signature.
    vcunat Vladimír Čunát
    Copy the full SHA
    a8b76c4 View commit details
  2. nvidia_x11_legacy304: 304.135 -> 304.137

    This now builds with kernel 4.13; Debian has only the typo patch there.
    Curiously, .settings still fails to link on x86_64-linux but works
    on i686-linux, just as with .135.
    
    (cherry picked from commit 1e4d675)
    vcunat committed Dec 5, 2017

    Verified

    This commit was signed with the committer’s verified signature.
    vcunat Vladimír Čunát
    Copy the full SHA
    422f786 View commit details
  3. nvidia_x11_legacy304: fix build with kernel 4.14

    /cc #31640.
    
    (cherry picked from commit b934716)
    vcunat committed Dec 5, 2017

    Verified

    This commit was signed with the committer’s verified signature.
    vcunat Vladimír Čunát
    Copy the full SHA
    120ebc0 View commit details
  4. nvidia_x11_legacy340: add another patch

    I *suspect* that NV_VM_OPERATIONS_STRUCT_HAS_FAULT isn't detected
    in our case for some reason, so this patch doesn't make a difference.
    In any case, the patch seems unlikely to make anything worse.
    
    (cherry picked from commit e9550f2)
    vcunat committed Dec 5, 2017

    Verified

    This commit was signed with the committer’s verified signature.
    vcunat Vladimír Čunát
    Copy the full SHA
    84c97d2 View commit details
  5. Verified

    This commit was signed with the committer’s verified signature.
    vcunat Vladimír Čunát
    Copy the full SHA
    00b9275 View commit details
Showing with 50 additions and 7 deletions.
  1. +19 −7 pkgs/os-specific/linux/nvidia-x11/default.nix
  2. +31 −0 pkgs/os-specific/linux/nvidia-x11/vm_operations_struct-fault.patch
26 changes: 19 additions & 7 deletions pkgs/os-specific/linux/nvidia-x11/default.nix
Original file line number Diff line number Diff line change
@@ -2,6 +2,17 @@

let
generic = args: callPackage (import ./generic.nix args) { };
kernel = callPackage # a hacky way of extracting parameters from callPackage
({ kernel, libsOnly ? false }: if libsOnly then { } else kernel) { };

maybePatch_drm_legacy =
lib.optional (lib.versionOlder "4.14" (kernel.version or "0"))
(fetchurl {
url = "https://raw.githubusercontent.com/MilhouseVH/LibreELEC.tv/b5d2d6a1"
+ "/packages/x11/driver/xf86-video-nvidia-legacy/patches/"
+ "xf86-video-nvidia-legacy-0010-kernel-4.14.patch";
sha256 = "18clfpw03g8dxm61bmdkmccyaxir3gnq451z6xqa2ilm3j820aa5";
});
in
{
# Policy: use the highest stable version as the default (on our master).
@@ -21,6 +32,7 @@ in
persistencedSha256 = "08315rb9l932fgvy758an5vh3jgks0qc4g36xip4l32pkxd9k963";
};


legacy_340 = generic {
version = "340.104";
sha256_32bit = "1l8w95qpxmkw33c4lsf5ar9w2fkhky4x23rlpqvp1j66wbw1b473";
@@ -29,15 +41,14 @@ in
persistencedSha256 = "0zqws2vsrxbxhv6z0nn2galnghcsilcn3s0f70bpm6jqj9wzy7x8";
useGLVND = false;

patches = [
];
patches = maybePatch_drm_legacy ++ [ ./vm_operations_struct-fault.patch ];
};

legacy_304 = generic {
version = "304.135";
sha256_32bit = "14qdl39wird04sqba94dcb77i63igmxxav62ndr4qyyavn8s3c2w";
sha256_64bit = "125mianhvq591np7y5jjrv9vmpbvixnkicr49ni48mcr0yjnjqkh";
settingsSha256 = "1y7swikdngq4nlwzkrq20yfah9zr31n1a5i6nw37awnp8xjilhzm";
version = "304.137";
sha256_32bit = "1y34c2gvmmacxk2c72d4hsysszncgfndc4s1nzldy2q9qagkg66a";
sha256_64bit = "1qp3jv6279k83k3z96p6vg3dd35y9bhmlyyyrkii7sib7bdmc7zb";
settingsSha256 = "0i5znfq6jkabgi8xpcy12pdpww6a67i8mq60z1kjq36mmnb25pmi";
persistencedSha256 = null;
useGLVND = false;
useProfiles = false;
@@ -55,7 +66,8 @@ in
sed 's|^\([+-]\{3\} [ab]\)/|\1/kernel/|' -i ${prefix}/*.patch
patches="$patches ${lib.concatMapStringsSep " " (pname: "${prefix}/${pname}.patch") pnames}"
'';
in applyPatches [ "fix-typos" "drm-driver-legacy" "deprecated-cpu-events" "disable-mtrr" ];
in applyPatches [ "fix-typos" ];
patches = maybePatch_drm_legacy;
};

legacy_173 = callPackage ./legacy173.nix { };
31 changes: 31 additions & 0 deletions pkgs/os-specific/linux/nvidia-x11/vm_operations_struct-fault.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
https://devtalk.nvidia.com/default/topic/1025051/fully-working-patches-2-of-them-for-nvidia-driver-340-104-compiler-installer-file-and-linux-kernels-4-13-amp-4-14/?offset=5
--- a/kernel/uvm/nvidia_uvm_lite.c
+++ b/kernel/uvm/nvidia_uvm_lite.c
@@ -818,8 +818,15 @@ done:
}

#if defined(NV_VM_OPERATIONS_STRUCT_HAS_FAULT)
+#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 11, 0)
int _fault(struct vm_area_struct *vma, struct vm_fault *vmf)
+#else
+int _fault(struct vm_fault *vmf)
+#endif
{
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 11, 0)
+ struct vm_area_struct *vma = vmf->vma;
+#endif
#if defined(NV_VM_FAULT_HAS_ADDRESS)
unsigned long vaddr = vmf->address;
#else
@@ -866,7 +873,11 @@ static struct vm_operations_struct uvmlite_vma_ops =
// it's dealing with anonymous mapping (see handle_pte_fault).
//
#if defined(NV_VM_OPERATIONS_STRUCT_HAS_FAULT)
+#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 11, 0)
int _sigbus_fault(struct vm_area_struct *vma, struct vm_fault *vmf)
+#else
+int _sigbus_fault(struct vm_fault *vmf)
+#endif
{
vmf->page = NULL;
return VM_FAULT_SIGBUS;