summaryrefslogtreecommitdiff
path: root/x11-drivers
diff options
context:
space:
mode:
authorV3n3RiX <venerix@redcorelinux.org>2019-02-10 02:46:13 +0000
committerV3n3RiX <venerix@redcorelinux.org>2019-02-10 02:46:13 +0000
commitd362090620ee2c812ad94af0a94e9f335ee8ed62 (patch)
tree62b5eded82f995d7b8080ef2a350d8060a4844b7 /x11-drivers
parent02aaac86e9ea9ba142f6fa6319f99a3fcbb79e9d (diff)
x11-drivers/nvidia-drivers : apply the same patches as dkms package; sys-kernel/nvidia-drivers-dkms : upgrade to EAPI=6
Diffstat (limited to 'x11-drivers')
-rw-r--r--x11-drivers/nvidia-drivers/files/390.87-ipmi_user.patch20
-rw-r--r--x11-drivers/nvidia-drivers/files/390.87-vmf_insert_pfn.patch11
-rw-r--r--x11-drivers/nvidia-drivers/files/kernel-4.16.patch33
-rw-r--r--x11-drivers/nvidia-drivers/files/kernel-4.19.patch49
-rw-r--r--x11-drivers/nvidia-drivers/files/nvidia-drivers-390.87-conf.patch28
-rw-r--r--x11-drivers/nvidia-drivers/nvidia-drivers-390.87-r1.ebuild (renamed from x11-drivers/nvidia-drivers/nvidia-drivers-390.87.ebuild)8
6 files changed, 149 insertions, 0 deletions
diff --git a/x11-drivers/nvidia-drivers/files/390.87-ipmi_user.patch b/x11-drivers/nvidia-drivers/files/390.87-ipmi_user.patch
new file mode 100644
index 00000000..03aa4287
--- /dev/null
+++ b/x11-drivers/nvidia-drivers/files/390.87-ipmi_user.patch
@@ -0,0 +1,20 @@
+--- a/kernel/nvidia/os-interface.c 2018-12-27 11:57:21.788109696 +1100
++++ b/kernel/nvidia/os-interface.c 2018-12-27 11:59:45.300394369 +1100
+@@ -1697,7 +1697,7 @@
+
+ struct nv_ipmi_softc
+ {
+- ipmi_user_t p_user; // ptr to ipmi_msghandler user structure
++ struct ipmi_user *p_user; // ptr to ipmi_msghandler user structure
+ spinlock_t msg_lock;
+ struct list_head msgs;
+ NvU32 seqNum; //request sequence number
+@@ -1706,7 +1706,7 @@
+ static inline int
+ nv_ipmi_set_my_address
+ (
+- ipmi_user_t user,
++ struct ipmi_user *user,
+ unsigned char address
+ )
+ { \ No newline at end of file
diff --git a/x11-drivers/nvidia-drivers/files/390.87-vmf_insert_pfn.patch b/x11-drivers/nvidia-drivers/files/390.87-vmf_insert_pfn.patch
new file mode 100644
index 00000000..b78bff28
--- /dev/null
+++ b/x11-drivers/nvidia-drivers/files/390.87-vmf_insert_pfn.patch
@@ -0,0 +1,11 @@
+--- a/kernel/nvidia-drm/nvidia-drm-gem-nvkms-memory.c 2018-12-27 12:02:01.534608650 +1100
++++ b/kernel/nvidia-drm/nvidia-drm-gem-nvkms-memory.c 2018-12-27 12:04:31.541940558 +1100
+@@ -237,7 +237,7 @@
+
+ page_offset = vmf->pgoff - drm_vma_node_start(&gem->vma_node);
+
+- ret = vm_insert_pfn(vma, address, pfn + page_offset);
++ ret = vmf_insert_pfn(vma, address, pfn + page_offset);
+
+ switch (ret) {
+ case 0: \ No newline at end of file
diff --git a/x11-drivers/nvidia-drivers/files/kernel-4.16.patch b/x11-drivers/nvidia-drivers/files/kernel-4.16.patch
new file mode 100644
index 00000000..67172815
--- /dev/null
+++ b/x11-drivers/nvidia-drivers/files/kernel-4.16.patch
@@ -0,0 +1,33 @@
+diff --git a/kernel/common/inc/nv-linux.h b/kernel/common/inc/nv-linux.h
+index 10fc418..22ef968 100644
+--- a/kernel/common/inc/nv-linux.h
++++ b/kernel/common/inc/nv-linux.h
+@@ -175,7 +175,11 @@ static inline uid_t __kuid_val(kuid_t uid)
+
+ #if defined(NV_VM_INSERT_PAGE_PRESENT)
+ #include <linux/pagemap.h>
++#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 16, 0)
+ #include <linux/dma-mapping.h>
++#else
++#include <linux/dma-direct.h>
++#endif
+ #endif
+
+ #if defined(CONFIG_SWIOTLB) && defined(NVCPU_AARCH64)
+diff --git a/kernel/conftest.sh b/kernel/conftest.sh
+index b23dbb4..42dc576 100755
+--- a/kernel/conftest.sh
++++ b/kernel/conftest.sh
+@@ -1906,7 +1906,12 @@ compile_test() {
+ # Determine if the phys_to_dma function is present.
+ #
+ CODE="
++ #include <linux/version.h>
++#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 16, 0)
+ #include <linux/dma-mapping.h>
++#else
++ #include <linux/dma-direct.h>
++#endif
+ void conftest_phys_to_dma(void) {
+ phys_to_dma();
+ }"
diff --git a/x11-drivers/nvidia-drivers/files/kernel-4.19.patch b/x11-drivers/nvidia-drivers/files/kernel-4.19.patch
new file mode 100644
index 00000000..7ddae3b9
--- /dev/null
+++ b/x11-drivers/nvidia-drivers/files/kernel-4.19.patch
@@ -0,0 +1,49 @@
+diff -Naru a/kernel/nvidia-drm/nvidia-drm-connector.c b/kernel/nvidia-drm/nvidia-drm-connector.c
+--- a/kernel/nvidia-drm/nvidia-drm-connector.c 2018-10-23 07:58:50.447742183 +0200
++++ b/kernel/nvidia-drm/nvidia-drm-connector.c 2018-10-23 08:00:13.927741400 +0200
+@@ -35,6 +35,8 @@
+ #include <drm/drm_atomic.h>
+ #include <drm/drm_atomic_helper.h>
+
++#include <linux/version.h>
++
+ static void nv_drm_connector_destroy(struct drm_connector *connector)
+ {
+ struct nv_drm_connector *nv_connector = to_nv_connector(connector);
+@@ -226,7 +228,11 @@
+
+
+ if (nv_connector->edid != NULL) {
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 19, 0)
++ drm_connector_update_edid_property(
++#else
+ drm_mode_connector_update_edid_property(
++#endif
+ connector, nv_connector->edid);
+ }
+
+diff -Naru kernel.orig/nvidia-drm/nvidia-drm-encoder.c kernel/nvidia-drm/nvidia-drm-encoder.c
+--- a/kernel/nvidia-drm/nvidia-drm-encoder.c 2018-10-23 07:58:50.447742183 +0200
++++ b/kernel/nvidia-drm/nvidia-drm-encoder.c 2018-10-23 08:01:21.587740766 +0200
+@@ -35,6 +35,8 @@
+ #include <drm/drm_atomic.h>
+ #include <drm/drm_atomic_helper.h>
+
++#include <linux/version.h>
++
+ static void nv_drm_encoder_destroy(struct drm_encoder *encoder)
+ {
+ struct nv_drm_encoder *nv_encoder = to_nv_encoder(encoder);
+@@ -215,8 +217,11 @@
+ }
+
+ /* Attach encoder and connector */
+-
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 19, 0)
++ ret = drm_connector_attach_encoder(connector, encoder);
++#else
+ ret = drm_mode_connector_attach_encoder(connector, encoder);
++#endif
+
+ if (ret != 0) {
+ NV_DRM_DEV_LOG_ERR( \ No newline at end of file
diff --git a/x11-drivers/nvidia-drivers/files/nvidia-drivers-390.87-conf.patch b/x11-drivers/nvidia-drivers/files/nvidia-drivers-390.87-conf.patch
new file mode 100644
index 00000000..06fc058d
--- /dev/null
+++ b/x11-drivers/nvidia-drivers/files/nvidia-drivers-390.87-conf.patch
@@ -0,0 +1,28 @@
+diff -Nur a/kernel/dkms.conf b/kernel/dkms.conf
+--- a/kernel/dkms.conf 2018-03-22 05:39:53.000000000 +0000
++++ b/kernel/dkms.conf 2018-04-09 16:18:23.177125417 +0100
+@@ -1,12 +1,20 @@
+-PACKAGE_NAME="nvidia"
+-PACKAGE_VERSION="__VERSION_STRING"
++PACKAGE_NAME="nvidia-drivers-dkms"
++PACKAGE_VERSION="390.87"
+ AUTOINSTALL="yes"
+
+ # By default, DKMS will add KERNELRELEASE to the make command line; however,
+ # this will cause the kernel module build to infer that it was invoked via
+ # Kbuild directly instead of DKMS. The dkms(8) manual page recommends quoting
+ # the 'make' command name to suppress this behavior.
+-MAKE[0]="'make' -j__JOBS NV_EXCLUDE_BUILD_MODULES='__EXCLUDE_MODULES' KERNEL_UNAME=${kernelver} modules"
++MAKE[0]="'make' -j`nproc` NV_EXCLUDE_BUILD_MODULES='__EXCLUDE_MODULES' KERNEL_UNAME=${kernelver} modules"
+
+ # The list of kernel modules will be generated by nvidia-installer at runtime.
+-__DKMS_MODULES
++BUILT_MODULE_NAME[0]="nvidia"
++DEST_MODULE_LOCATION[0]="/extra/dkms"
++BUILT_MODULE_NAME[1]="nvidia-uvm"
++DEST_MODULE_LOCATION[1]="/extra/dkms"
++BUILT_MODULE_NAME[2]="nvidia-modeset"
++DEST_MODULE_LOCATION[2]="/extra/dkms"
++BUILT_MODULE_NAME[3]="nvidia-drm"
++DEST_MODULE_LOCATION[3]="/extra/dkms"
++
diff --git a/x11-drivers/nvidia-drivers/nvidia-drivers-390.87.ebuild b/x11-drivers/nvidia-drivers/nvidia-drivers-390.87-r1.ebuild
index f6c045ef..ae762032 100644
--- a/x11-drivers/nvidia-drivers/nvidia-drivers-390.87.ebuild
+++ b/x11-drivers/nvidia-drivers/nvidia-drivers-390.87-r1.ebuild
@@ -44,6 +44,14 @@ RDEPEND="
QA_PREBUILT="opt/* usr/lib*"
+PATCHES=(
+ "${FILESDIR}"/kernel-4.16.patch
+ "${FILESDIR}"/kernel-4.19.patch
+ "${FILESDIR}"/"${P}"-conf.patch
+ "${FILESDIR}"/"${PV}"-vmf_insert_pfn.patch
+ "${FILESDIR}"/"${PV}"-ipmi_user.patch
+)
+
S=${WORKDIR}/
pkg_setup() {