Author: leigh123linux
Update of /cvs/nonfree/rpms/nvidia-304xx-kmod/devel
In directory old02.ovh.rpmfusion.lan:/tmp/cvs-serv22614
Modified Files:
kernel_v3.11.patch nvidia-304xx-kmod.spec
Log Message:
* Wed Nov 06 2013 Leigh Scott <leigh123linux(a)googlemail.com> - 304.108-4
- use nvidia fix for get_num_physpages
kernel_v3.11.patch:
b/kernel/patch-get_num_physpages.h | 10 ++++++++++
kernel/Makefile.kbuild | 1 +
kernel/conftest.sh | 24 ++++++++++++++++++++++++
kernel/nv-linux.h | 4 ++++
kernel/nv-vm.c | 5 +++++
5 files changed, 44 insertions(+)
Index: kernel_v3.11.patch
===================================================================
RCS file: /cvs/nonfree/rpms/nvidia-304xx-kmod/devel/kernel_v3.11.patch,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- kernel_v3.11.patch 7 Oct 2013 11:03:00 -0000 1.3
+++ kernel_v3.11.patch 6 Nov 2013 10:43:50 -0000 1.4
@@ -1,10 +1,74 @@
+This patch will work on installers for version 304.108 of the NVIDIA
+Linux driver.
+
+It will not apply cleanly against older 304 drivers, but can be made to
+work with some minor changes.
+
+--- /dev/null
++++ b/kernel/patch-get_num_physpages.h
+@@ -0,0 +1,10 @@
++#define NV_PATCH_get_num_physpages_DESCRIPTION \
++"This patch adds support for kernels such as Linux 3.11, which use the "\
++"get_num_physpages() function instead of the num_physpages variable to "\
++"report the number of physical pages. In order to avoid compatibility "\
++"problems that would otherwise result from differences between what "\
++"the removed num_physpages variable reported versus what is reported "\
++"by get_num_physpages(), the driver will fall back to a different memory "\
++"allocation strategy on systems where num_phsypages is not available, when "\
++"the amount of system memory matches or exceeds the upper bound of a given "\
++"GPU's physical address space.\n"
+
+--- a/kernel/Makefile.kbuild
++++ b/kernel/Makefile.kbuild
+@@ -175,6 +175,7 @@ COMPILE_TESTS = \
+ file_operations \
+ sg_init_table \
+ pci_get_domain_bus_and_slot \
++ get_num_physpages \
+ efi_enabled \
+ proc_create_data \
+ pde_data \
+--- a/kernel/conftest.sh
++++ b/kernel/conftest.sh
+@@ -1551,6 +1551,30 @@ compile_test() {
+ fi
+ ;;
+
++ get_num_physpages)
++ #
++ # Determine if the get_num_physpages() function is
++ # present.
++ #
++ echo "$CONFTEST_PREAMBLE
++ #include <linux/mm.h>
++ void conftest_get_num_physpages(void) {
++ get_num_physpages(NULL);
++ }" > conftest$$.c
++
++ $CC $CFLAGS -c conftest$$.c > /dev/null 2>&1
++ rm -f conftest$$.c
++
++ if [ -f conftest$$.o ]; then
++ echo "#undef NV_GET_NUM_PHYSPAGES_PRESENT" >>
conftest.h
++ rm -f conftest$$.o
++ return
++ else
++ echo "#define NV_GET_NUM_PHYSPAGES_PRESENT" >>
conftest.h
++ return
++ fi
++ ;;
++
+ proc_remove)
+ #
+ # Determine if the proc_remove() function is present.
+
--- a/kernel/nv-linux.h
+++ b/kernel/nv-linux.h
-@@ -1028,7 +1028,11 @@ static inline int nv_execute_on_all_cpus
+@@ -1028,7 +1028,11 @@ static inline int nv_execute_on_all_cpus(void (*func)(void *info),
void *info)
#endif
#if !defined(NV_VMWARE)
-+#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 11, 0)
++#if defined(NV_GET_NUM_PHYSPAGES_PRESENT)
+#define NV_NUM_PHYSPAGES get_num_physpages()
+#else
#define NV_NUM_PHYSPAGES num_physpages
@@ -12,3 +76,20 @@
#define NV_GET_CURRENT_PROCESS() current->tgid
#define NV_IN_ATOMIC() in_atomic()
#define NV_LOCAL_BH_DISABLE() local_bh_disable()
+
+--- a/kernel/nv-vm.c
++++ b/kernel/nv-vm.c
+@@ -479,8 +479,13 @@ static unsigned int nv_compute_gfp_mask(
+ system_memory_size = (os_get_system_memory_size() * RM_PAGE_SIZE);
+ if (system_memory_size != 0)
+ {
++#if !defined(NV_GET_NUM_PHYSPAGES_PRESENT)
+ if (dev->dma_mask < (system_memory_size - 1))
+ gfp_mask = NV_GFP_DMA32;
++#else
++ if (dev->dma_mask <= (system_memory_size - 1))
++ gfp_mask = NV_GFP_DMA32;
++#endif
+ }
+ else if (dev->dma_mask < 0xffffffffffULL)
+ {
Index: nvidia-304xx-kmod.spec
===================================================================
RCS file: /cvs/nonfree/rpms/nvidia-304xx-kmod/devel/nvidia-304xx-kmod.spec,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- nvidia-304xx-kmod.spec 25 Sep 2013 20:58:24 -0000 1.3
+++ nvidia-304xx-kmod.spec 6 Nov 2013 10:43:50 -0000 1.4
@@ -8,7 +8,7 @@
Name: nvidia-304xx-kmod
Version: 304.108
# Taken over by kmodtool
-Release: 3%{?dist}
+Release: 4%{?dist}
Summary: NVIDIA display driver kernel module
Group: System Environment/Kernel
License: Redistributable, no modification permitted
@@ -81,6 +81,9 @@
%changelog
+* Wed Nov 06 2013 Leigh Scott <leigh123linux(a)googlemail.com> - 304.108-4
+- use nvidia fix for get_num_physpages
+
* Wed Sep 25 2013 Leigh Scott <leigh123linux(a)googlemail.com> - 304.108-3
- patch for 3.12.0 kernel