Author: kwizart
Update of /cvs/nonfree/rpms/nvidia-kmod/F-12
In directory se02.es.rpmfusion.net:/tmp/cvs-serv23518/F-12
Modified Files:
.cvsignore nvidia-kmod.spec sources
Added Files:
NVIDIA_kernel-195.36.24-6120611.diff.txt
Log Message:
Update to 195.36.31
--- NEW FILE NVIDIA_kernel-195.36.24-6120611.diff.txt ---
diff -ru usr/src/nv/Makefile.kbuild usr/src/nv.6120611/Makefile.kbuild
--- usr/src/nv/Makefile.kbuild 2010-04-22 20:40:43.000000000 -0700
+++ usr/src/nv.6120611/Makefile.kbuild 2010-06-08 07:51:02.147829142 -0700
@@ -165,7 +165,8 @@
proc_dir_entry \
INIT_WORK \
acpi_walk_namespace \
- agp_memory
+ agp_memory \
+ scatterlist
#
# Miscellaneous NVIDIA kernel module build support targets. They are needed
diff -ru usr/src/nv/Makefile.nvidia usr/src/nv.6120611/Makefile.nvidia
--- usr/src/nv/Makefile.nvidia 2010-04-22 20:40:43.000000000 -0700
+++ usr/src/nv.6120611/Makefile.nvidia 2010-06-08 07:51:58.040355195 -0700
@@ -56,7 +56,8 @@
i2c_adapter \
smp_call_function \
acpi_evaluate_integer \
- proc_dir_entry
+ proc_dir_entry \
+ scatterlist
DEFINES+=$(EXTRA_DEFINES)
diff -ru usr/src/nv/conftest.sh usr/src/nv.6120611/conftest.sh
--- usr/src/nv/conftest.sh 2010-04-22 20:40:43.000000000 -0700
+++ usr/src/nv.6120611/conftest.sh 2010-06-08 07:50:23.346851935 -0700
@@ -1079,6 +1079,31 @@
fi
;;
+ scatterlist)
+ #
+ # Determine if the 'scatterlist' structure has
+ # a 'page_link' member.
+ #
+ echo "$CONFTEST_PREAMBLE
+ #include <linux/types.h>
+ #include <linux/scatterlist.h>
+ int conftest_scatterlist(void) {
+ return offsetof(struct scatterlist, page_link);
+ }" > conftest$$.c
+
+ $CC $CFLAGS -c conftest$$.c > /dev/null 2>&1
+ rm -f conftest$$.c
+
+ if [ -f conftest$$.o ]; then
+ echo "#undef NV_SCATTERLIST_HAS_PAGE" >> conftest.h
+ rm -f conftest$$.o
+ return
+ else
+ echo "#define NV_SCATTERLIST_HAS_PAGE" >> conftest.h
+ return
+ fi
+ ;;
+
esac
}
diff -ru usr/src/nv/nv-linux.h usr/src/nv.6120611/nv-linux.h
--- usr/src/nv/nv-linux.h 2010-04-22 20:40:40.000000000 -0700
+++ usr/src/nv.6120611/nv-linux.h 2010-06-08 07:50:23.346851935 -0700
@@ -334,14 +334,28 @@
#define NV_MAX_RECURRING_WARNING_MESSAGES 10
/* add support for iommu.
- * on x86_64 platforms, this uses the gart to remap pages that are > 32-bits
- * to < 32-bits.
+ * On the x86-64 platform, the driver may need to remap system
+ * memory pages via AMD K8/Intel VT-d IOMMUs if a given
+ * GPUs addressing capabilities are limited such that it can
+ * not access the original page directly. Examples of this
+ * are legacy PCI-E devices.
*/
-#if defined(NVCPU_X86_64) && !defined(GFP_DMA32)
+#if (defined(NVCPU_X86_64) && !defined(GFP_DMA32)) || defined(CONFIG_DMAR)
#define NV_SG_MAP_BUFFERS 1
extern int nv_swiotlb;
+
+#if defined(CONFIG_DMAR)
+#define NV_INTEL_IOMMU 1
+#else
+/*
+ * Limit use of IOMMU/SWIOTLB space to 60 MB, leaving 4 MB for the rest of
+ * the system (assuming a 64 MB IOMMU/SWIOTLB).
+ * This is not required if Intel VT-d IOMMU is used to remap pages.
+ */
+#define NV_NEED_REMAP_CHECK 1
#define NV_REMAP_LIMIT_DEFAULT (60 * 1024 * 1024)
#endif
+#endif
/* add support for software i/o tlb support.
* normally, you'd expect this to be transparent, but unfortunately this is not
diff -ru usr/src/nv/nv-vm.c usr/src/nv.6120611/nv-vm.c
--- usr/src/nv/nv-vm.c 2010-04-22 20:40:39.000000000 -0700
+++ usr/src/nv.6120611/nv-vm.c 2010-06-08 07:50:23.346851935 -0700
@@ -102,8 +102,10 @@
/* track how much memory has been remapped through the iommu/swiotlb */
+#if defined(NV_NEED_REMAP_CHECK)
extern unsigned int nv_remap_count;
extern unsigned int nv_remap_limit;
+#endif
static inline int nv_map_sg(struct pci_dev *dev, struct scatterlist *sg)
{
@@ -136,31 +138,27 @@
unsigned int num_pages
)
{
- int force_remap = FALSE;
struct scatterlist *sg_ptr = &page_list[0]->sg_list;
unsigned int i;
static int count = 0;
+#if defined(NV_SCATTERLIST_HAS_PAGE)
sg_ptr->page = virt_to_page(base);
+#else
+ sg_ptr->page_link = virt_to_page(base);
+#endif
sg_ptr->offset = (unsigned long)base & ~PAGE_MASK;
sg_ptr->length = num_pages * PAGE_SIZE;
-#if defined(DEBUG) && !defined(KERNEL_2_4)
- /*
- * XXX If the user specifically requested that the IOMMU
- * be used, then override the address range check below
- * and unconditionally call nv_map_sg() to remap the page(s).
- */
- force_remap = force_iommu;
-#endif
-
- if (!force_remap &&
- ((virt_to_phys(base) + sg_ptr->length - 1) & ~dev->dma_mask) == 0)
+#if !defined(NV_INTEL_IOMMU)
+ if (((virt_to_phys(base) + sg_ptr->length - 1) & ~dev->dma_mask) == 0)
{
sg_ptr->dma_address = virt_to_phys(base);
goto done;
}
+#endif
+#if defined(NV_NEED_REMAP_CHECK)
if ((nv_remap_count + sg_ptr->length) > nv_remap_limit)
{
if (count < NV_MAX_RECURRING_WARNING_MESSAGES)
@@ -178,6 +176,7 @@
}
return 1;
}
+#endif
i = NV_MAP_SG_MAX_RETRIES;
do {
@@ -190,7 +189,11 @@
nv_unmap_sg(dev, sg_ptr);
memset(&sg_tmp, 0, sizeof(struct scatterlist));
+#if defined(NV_SCATTERLIST_HAS_PAGE)
sg_tmp.page = sg_ptr->page;
+#else
+ sg_tmp.page_link = sg_ptr->page_link;
+#endif
sg_tmp.offset = sg_ptr->offset;
sg_tmp.length = 2048;
@@ -215,8 +218,10 @@
return -1;
}
+#if defined(NV_NEED_REMAP_CHECK)
if (sg_ptr->dma_address != virt_to_phys(base))
nv_remap_count += sg_ptr->length;
+#endif
// this is a bit of a hack to make contiguous allocations easier to handle
// nv_sg_load below relies on the page_ptr addresses being filed in, as
@@ -283,7 +288,9 @@
{
nv_unmap_sg(dev, sg_ptr);
page_ptr->dma_addr = 0;
+#if defined(NV_NEED_REMAP_CHECK)
nv_remap_count -= sg_ptr->length;
+#endif
}
}
#endif /* NV_SG_MAP_BUFFERS */
diff -ru usr/src/nv/nv.c usr/src/nv.6120611/nv.c
--- usr/src/nv/nv.c 2010-04-22 20:40:38.000000000 -0700
+++ usr/src/nv.6120611/nv.c 2010-06-08 07:50:23.350892195 -0700
@@ -129,9 +129,11 @@
#if defined(NV_SG_MAP_BUFFERS)
int nv_swiotlb = 0;
+#if defined(NV_NEED_REMAP_CHECK)
unsigned int nv_remap_count;
unsigned int nv_remap_limit;
#endif
+#endif
int nv_update_memory_types = 1;
static int nv_mmconfig_failure_detected = 0;
@@ -1534,7 +1536,7 @@
goto failed;
}
-#if defined(NV_SG_MAP_BUFFERS)
+#if defined(NV_SG_MAP_BUFFERS) && defined(NV_NEED_REMAP_CHECK)
rm_read_registry_dword(sp, nv, "NVreg", "RemapLimit",
&nv_remap_limit);
// allow an override, but use default if no override
@@ -1854,7 +1856,7 @@
"NVRM: final KM memory usage: 0x%x bytes\n", km_usage);
}
#endif
-#if defined(NV_SG_MAP_BUFFERS)
+#if defined(NV_SG_MAP_BUFFERS) && defined(NV_NEED_REMAP_CHECK)
if (nv_remap_count != 0)
{
nv_printf(NV_DBG_ERRORS,
Index: .cvsignore
===================================================================
RCS file: /cvs/nonfree/rpms/nvidia-kmod/F-12/.cvsignore,v
retrieving revision 1.20
retrieving revision 1.21
diff -u -r1.20 -r1.21
--- .cvsignore 28 Apr 2010 19:54:26 -0000 1.20
+++ .cvsignore 21 Jun 2010 10:33:17 -0000 1.21
@@ -1 +1 @@
-nvidia-kmod-data-195.36.24.tar.bz2
+nvidia-kmod-data-195.36.31.tar.bz2
Index: nvidia-kmod.spec
===================================================================
RCS file: /cvs/nonfree/rpms/nvidia-kmod/F-12/nvidia-kmod.spec,v
retrieving revision 1.89
retrieving revision 1.90
diff -u -r1.89 -r1.90
--- nvidia-kmod.spec 18 Jun 2010 12:56:56 -0000 1.89
+++ nvidia-kmod.spec 21 Jun 2010 10:33:17 -0000 1.90
@@ -3,13 +3,13 @@
# "buildforkernels newest" macro for just that build; immediately after
# queuing that build enable the macro again for subsequent builds; that way
# a new akmod package will only get build when a new one is actually needed
-%define buildforkernels newest
+#define buildforkernels newest
Name: nvidia-kmod
Epoch: 1
-Version: 195.36.24
+Version: 195.36.31
# Taken over by kmodtool
-Release: 1%{?dist}.3
+Release: 1%{?dist}
Summary: NVIDIA display driver kernel module
Group: System Environment/Kernel
License: Redistributable, no modification permitted
@@ -25,6 +25,10 @@
Source11: nvidia-kmodtool-excludekernel-filterfile
+#http://www.nvnews.net/vbulletin/showthread.php?t=151791
+Patch0: NVIDIA_kernel-195.36.24-6120611.diff.txt
+#http://bugs.gentoo.org/show_bug.cgi?id=301318
+#Patch1: nvidia-190.53-2.6.33.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
# needed for plague to make sure it builds for i586 and i686
@@ -50,7 +54,10 @@
for arch in x86 x64
do
pushd nvidiapkg-${arch}
-#disabled
+ pushd usr/src/nv
+%patch0 -p3 -b .iommu
+#%patch1 -p3 -b .acpi
+ popd
popd
done
@@ -94,33 +101,17 @@
%changelog
-* Fri Jun 18 2010 Thorsten Leemhuis <fedora [AT] leemhuis [DOT] info> -
1:195.36.24-1.3
-- rebuild for new kernel
-
-* Sat May 01 2010 Thorsten Leemhuis <fedora [AT] leemhuis [DOT] info> -
1:195.36.24-1.2
-- rebuild for new kernel
+* Thu Jun 17 2010 Nicolas Chaubvet <kwizart(a)gmail.com> - 1:195.36.31-1
+- Update to 195.36.31
+- Fix acpi_walk_namespace call with kernel 2.6.33 and later.
+
http://bugs.gentoo.org/show_bug.cgi?id=301318
-* Thu Apr 29 2010 Thorsten Leemhuis <fedora [AT] leemhuis [DOT] info> -
1:195.36.24-1.1
-- rebuild for new kernel
+* Sun Jun 13 2010 Nicolas Chauvet <kwizart(a)gmail.com> - 1:195.36.24-2
+- Backport IOMMU -
http://www.nvnews.net/vbulletin/showthread.php?t=151791
* Sat Apr 24 2010 Nicolas Chauvet <kwizart(a)fedoraproject.org> - 1:195.36.24-1
- Update to 195.36.24
-* Thu Apr 22 2010 Thorsten Leemhuis <fedora [AT] leemhuis [DOT] info> -
1:195.36.15-1.5
-- rebuild for new kernel
-
-* Mon Apr 19 2010 Thorsten Leemhuis <fedora [AT] leemhuis [DOT] info> -
1:195.36.15-1.4
-- rebuild for new kernel
-
-* Sat Apr 17 2010 Thorsten Leemhuis <fedora [AT] leemhuis [DOT] info> -
1:195.36.15-1.3
-- rebuild for new kernel
-
-* Sat Apr 10 2010 Thorsten Leemhuis <fedora [AT] leemhuis [DOT] info> -
1:195.36.15-1.2
-- rebuild for new kernel
-
-* Mon Mar 29 2010 Thorsten Leemhuis <fedora [AT] leemhuis [DOT] info> -
1:195.36.15-1.1
-- rebuild for new kernel
-
* Sat Mar 27 2010 Nicolas Chauvet <kwizart(a)fedoraproject.org> - 1:195.36.15-1
- Update to 195.36.15
Index: sources
===================================================================
RCS file: /cvs/nonfree/rpms/nvidia-kmod/F-12/sources,v
retrieving revision 1.20
retrieving revision 1.21
diff -u -r1.20 -r1.21
--- sources 28 Apr 2010 19:54:26 -0000 1.20
+++ sources 21 Jun 2010 10:33:17 -0000 1.21
@@ -1 +1 @@
-f6743503f98dd95f44ddb9b6f87117a5 nvidia-kmod-data-195.36.24.tar.bz2
+013fe3ae0e449b22398a290aa13621dd nvidia-kmod-data-195.36.31.tar.bz2