summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Seifert <soap@gentoo.org>2020-12-07 13:57:41 +0100
committerDavid Seifert <soap@gentoo.org>2020-12-07 13:57:41 +0100
commit477b1935411fdc4646c5ef49a1414faeda70058d (patch)
tree171f7a4d6ed0a6ebc47fb31cfaee15bc53ec8a2c /x11-drivers/nvidia-drivers
parentsys-apps/likwid-4.3.4: migrate to lua-single.eclass (diff)
downloadgentoo-477b1935411fdc4646c5ef49a1414faeda70058d.tar.gz
gentoo-477b1935411fdc4646c5ef49a1414faeda70058d.tar.bz2
gentoo-477b1935411fdc4646c5ef49a1414faeda70058d.zip
x11-drivers/nvidia-drivers: Add patch for modesetting allocation failures
Bug: https://bugs.gentoo.org/755497 Package-Manager: Portage-3.0.12, Repoman-3.0.2 Suggested-by: Gregory Beauregard <gentoobugs@gably.net> Signed-off-by: David Seifert <soap@gentoo.org>
Diffstat (limited to 'x11-drivers/nvidia-drivers')
-rw-r--r--x11-drivers/nvidia-drivers/files/nvidia-drivers-455.45.01-reduce-kmalloc-limit.patch18
-rw-r--r--x11-drivers/nvidia-drivers/nvidia-drivers-455.45.01-r1.ebuild (renamed from x11-drivers/nvidia-drivers/nvidia-drivers-455.45.01.ebuild)1
2 files changed, 19 insertions, 0 deletions
diff --git a/x11-drivers/nvidia-drivers/files/nvidia-drivers-455.45.01-reduce-kmalloc-limit.patch b/x11-drivers/nvidia-drivers/files/nvidia-drivers-455.45.01-reduce-kmalloc-limit.patch
new file mode 100644
index 000000000000..c61033bf2a92
--- /dev/null
+++ b/x11-drivers/nvidia-drivers/files/nvidia-drivers-455.45.01-reduce-kmalloc-limit.patch
@@ -0,0 +1,18 @@
+Patch taken from
+ https://forums.developer.nvidia.com/t/455-23-04-page-allocation-failure-in-kernel-module-at-random-points/155250/55
+Bug: https://bugs.gentoo.org/755497
+Credits go to Gregory Beauregard for pointing this out
+
+--- a/kernel/nvidia-modeset/nvidia-modeset-linux.c
++++ b/kernel/nvidia-modeset/nvidia-modeset-linux.c
+@@ -282,8 +282,8 @@
+ * are called while nvkms_lock is held.
+ *************************************************************************/
+
+-/* Don't use kmalloc for allocations larger than 128k */
+-#define KMALLOC_LIMIT (128 * 1024)
++/* Don't use kmalloc for allocations larger than one page */
++#define KMALLOC_LIMIT PAGE_SIZE
+
+ void* NVKMS_API_CALL nvkms_alloc(size_t size, NvBool zero)
+ {
diff --git a/x11-drivers/nvidia-drivers/nvidia-drivers-455.45.01.ebuild b/x11-drivers/nvidia-drivers/nvidia-drivers-455.45.01-r1.ebuild
index 836ce3fa1243..f549e169c640 100644
--- a/x11-drivers/nvidia-drivers/nvidia-drivers-455.45.01.ebuild
+++ b/x11-drivers/nvidia-drivers/nvidia-drivers-455.45.01-r1.ebuild
@@ -78,6 +78,7 @@ QA_PREBUILT="opt/* usr/lib*"
S=${WORKDIR}/
PATCHES=(
"${FILESDIR}"/${PN}-440.26-locale.patch
+ "${FILESDIR}"/${PN}-455.45.01-reduce-kmalloc-limit.patch
)
NV_KV_MAX_PLUS="5.10"
CONFIG_CHECK="