From 84812097801bb48fe1ba9b2b0a6d1a13258f602e Mon Sep 17 00:00:00 2001 From: Alessio Sergi Date: Fri, 28 Jul 2017 11:40:40 +0200 Subject: [PATCH] nvidia304: linux 4.[11-12] patches --- srcpkgs/nvidia304/files/kernel_4.11.patch | 44 ++++++++++++++++++ srcpkgs/nvidia304/files/kernel_4.12.patch | 54 +++++++++++++++++++++++ srcpkgs/nvidia304/template | 4 +- 3 files changed, 101 insertions(+), 1 deletion(-) create mode 100644 srcpkgs/nvidia304/files/kernel_4.11.patch create mode 100644 srcpkgs/nvidia304/files/kernel_4.12.patch diff --git a/srcpkgs/nvidia304/files/kernel_4.11.patch b/srcpkgs/nvidia304/files/kernel_4.11.patch new file mode 100644 index 00000000000..6aec20b86d2 --- /dev/null +++ b/srcpkgs/nvidia304/files/kernel_4.11.patch @@ -0,0 +1,44 @@ +--- kernel/nv-drm.c.orig ++++ kernel/nv-drm.c +@@ -22,6 +22,8 @@ + #include + #endif + ++#include ++ + extern nv_linux_state_t *nv_linux_devices; + + static int nv_drm_load( +@@ -42,7 +44,11 @@ + return -ENODEV; + } + ++#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 11, 0) + static int nv_drm_unload( ++#else ++static void nv_drm_unload( ++#endif + struct drm_device *dev + ) + { +@@ -52,11 +58,19 @@ + { + if (nvl->dev == dev->pdev) + { ++#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 11, 0) + return 0; ++#else ++ return; ++#endif + } + } + ++#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 11, 0) + return -ENODEV; ++#else ++ return; ++#endif + } + + static const struct file_operations nv_drm_fops = { + diff --git a/srcpkgs/nvidia304/files/kernel_4.12.patch b/srcpkgs/nvidia304/files/kernel_4.12.patch new file mode 100644 index 00000000000..fe7a70bbad4 --- /dev/null +++ b/srcpkgs/nvidia304/files/kernel_4.12.patch @@ -0,0 +1,54 @@ +--- kernel/conftest.sh.orig ++++ kernel/conftest.sh +@@ -362,7 +362,11 @@ + # Determine if the set_memory_uc() function is present. + # + CODE=" +- #include ++ #if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 12, 0) ++ #include ++ #else ++ #include ++ #endif + void conftest_set_memory_uc(void) { + set_memory_uc(); + }" +@@ -375,7 +379,11 @@ + # Determine if the set_memory_array_uc() function is present. + # + CODE=" +- #include ++ #if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 12, 0) ++ #include ++ #else ++ #include ++ #endif + void conftest_set_memory_array_uc(void) { + set_memory_array_uc(); + }" +@@ -388,7 +396,11 @@ + # Determine if the set_pages_uc() function is present. + # + CODE=" +- #include ++ #if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 12, 0) ++ #include ++ #else ++ #include ++ #endif + void conftest_set_pages_uc(void) { + set_pages_uc(); + }" +--- kernel/nv-vm.c.orig ++++ kernel/nv-vm.c +@@ -13,6 +13,10 @@ + #include "nv.h" + #include "nv-linux.h" + ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 12, 0) ++ #include ++#endif ++ + static inline void nv_set_contig_memory_uc(nv_pte_t *page_ptr, NvU32 num_pages) + { + if (nv_update_memory_types) diff --git a/srcpkgs/nvidia304/template b/srcpkgs/nvidia304/template index 3233f64f436..2627aebb437 100644 --- a/srcpkgs/nvidia304/template +++ b/srcpkgs/nvidia304/template @@ -3,7 +3,7 @@ _desc="NVIDIA drivers (For GeForce 5 FX, 6, 7, 8 series)" pkgname=nvidia304 version=304.135 -revision=4 +revision=5 maintainer="Juan RP " license="Proprietary NVIDIA license" homepage="http://www.nvidia.com" @@ -39,6 +39,8 @@ do_configure() { cd ${_pkg} patch -sNp0 -i ${FILESDIR}/drm-driver-legacy.patch patch -sNp0 -i ${FILESDIR}/kernel_4.10.patch + patch -sNp0 -i ${FILESDIR}/kernel_4.11.patch + patch -sNp0 -i ${FILESDIR}/kernel_4.12.patch } do_install() { cd ${_pkg}