Some more patches from Zander
authorAndrew Bevitt <cyfred@gentoo.org>
Mon, 27 Dec 2004 00:46:54 +0000 (00:46 +0000)
committerAndrew Bevitt <cyfred@gentoo.org>
Mon, 27 Dec 2004 00:46:54 +0000 (00:46 +0000)
media-video/nvidia-kernel/ChangeLog
media-video/nvidia-kernel/files/1.0.6629/NVIDIA_kernel-1.0-6629-1175225.patch
media-video/nvidia-kernel/files/1.0.6629/NVIDIA_kernel-1.0-6629-1182399.patch [new file with mode: 0644]
media-video/nvidia-kernel/files/1.0.6629/nv-disable-preempt-on-smp_processor_id-2.patch [deleted file]
media-video/nvidia-kernel/files/1.0.6629/nv-disable-preempt-on-smp_processor_id.patch
media-video/nvidia-kernel/files/digest-nvidia-kernel-1.0.6629 [deleted file]
media-video/nvidia-kernel/nvidia-kernel-1.0.6629-r1.ebuild
media-video/nvidia-kernel/nvidia-kernel-1.0.6629.ebuild [deleted file]

index 6b80c0bfa4f57362755ae101cd1be84b56ea5672..87e82c0324a0cbc572aac2ae777742a1d21d82c6 100644 (file)
@@ -1,6 +1,14 @@
 # ChangeLog for media-video/nvidia-kernel
 # Copyright 2002-2004 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/media-video/nvidia-kernel/ChangeLog,v 1.105 2004/12/21 00:59:42 cyfred Exp $
+# $Header: /var/cvsroot/gentoo-x86/media-video/nvidia-kernel/ChangeLog,v 1.106 2004/12/27 00:46:54 cyfred Exp $
+
+  27 Dec 2004; Andrew Bevitt <cyfred@gentoo.org>
+  files/1.0.6629/NVIDIA_kernel-1.0-6629-1175225.patch,
+  +files/1.0.6629/NVIDIA_kernel-1.0-6629-1182399.patch,
+  -files/1.0.6629/nv-disable-preempt-on-smp_processor_id-2.patch,
+  files/1.0.6629/nv-disable-preempt-on-smp_processor_id.patch,
+  nvidia-kernel-1.0.6629-r1.ebuild, -nvidia-kernel-1.0.6629.ebuild:
+  Some more patches from Zander
 
   21 Dec 2004; Andrew Bevitt <cyfred@gentoo.org>
   nvidia-kernel-1.0.6629-r1.ebuild:
index 1c6ca8c804ba5ba52fca2eaf808dac2df7f77628..461e80003895b0fee97730fc11b215b45b734b42 100644 (file)
@@ -1,6 +1,6 @@
 diff -ru usr/src/nv/nv-linux.h usr/src/nv.1175225/nv-linux.h
 --- usr/src/nv/nv-linux.h      2004-11-03 22:53:00.000000000 +0100
-+++ usr/src/nv.1175225/nv-linux.h      2004-12-08 22:13:42.000000000 +0100
++++ usr/src/nv.1175225/nv-linux.h      2004-12-21 21:03:33.000000000 +0100
 @@ -533,6 +533,7 @@
   */
  #if defined(CONFIG_SWIOTLB)
@@ -9,7 +9,7 @@ diff -ru usr/src/nv/nv-linux.h usr/src/nv.1175225/nv-linux.h
  extern int nv_swiotlb;
  #endif
  
-@@ -950,10 +951,40 @@
+@@ -950,10 +951,48 @@
      sg_ptr->offset = (unsigned long)base & ~PAGE_MASK;
      sg_ptr->length  = num_pages * PAGE_SIZE;
  
@@ -47,6 +47,14 @@ diff -ru usr/src/nv/nv-linux.h usr/src/nv.1175225/nv-linux.h
          return 1;
      }
 +#endif
++
++    if (sg_ptr->dma_address & ~PAGE_MASK)
++    {
++        nv_printf(NV_DBG_ERRORS,
++            "NVRM: VM: nv_sg_map_buffer: failed to obtain aligned mapping\n");
++        pci_unmap_sg(dev, sg_ptr, num_pages, PCI_DMA_BIDIRECTIONAL);
++        return 1;
++    }
  
      NV_FIXUP_SWIOTLB_VIRT_ADDR_BUG(sg_ptr->dma_address);
  
diff --git a/media-video/nvidia-kernel/files/1.0.6629/NVIDIA_kernel-1.0-6629-1182399.patch b/media-video/nvidia-kernel/files/1.0.6629/NVIDIA_kernel-1.0-6629-1182399.patch
new file mode 100644 (file)
index 0000000..140ab04
--- /dev/null
@@ -0,0 +1,105 @@
+diff -ru usr/src/nv/nv-linux.h usr/src/nv.1182399/nv-linux.h
+--- usr/src/nv/nv-linux.h      2004-11-03 22:53:00.000000000 +0100
++++ usr/src/nv.1182399/nv-linux.h      2004-12-21 18:58:41.000000000 +0100
+@@ -155,6 +155,10 @@
+ #endif
+ #endif /* defined(NVCPU_X86) */
+ 
++#ifndef get_cpu
++#define get_cpu() smp_processor_id()
++#define put_cpu()
++#endif
+ 
+ #if !defined (list_for_each)
+ #define list_for_each(pos, head) \
+diff -ru usr/src/nv/nv.c usr/src/nv.1182399/nv.c
+--- usr/src/nv/nv.c    2004-11-03 22:53:00.000000000 +0100
++++ usr/src/nv.1182399/nv.c    2004-12-21 18:58:55.000000000 +0100
+@@ -2769,21 +2769,13 @@
+ }
+ 
+ 
+-/* avoid compiler warnings on UP kernels, 
+- * when spinlock macros are defined away 
+- */
+-#define NO_COMPILER_WARNINGS(nvl) \
+-    if (nvl == NULL) return
+-
+-
+ static void nv_lock_init_locks
+ ( 
+     nv_state_t *nv
+ )
+ {
+-    nv_linux_state_t *nvl = NV_GET_NVL_FROM_NV_STATE(nv);
+-
+-    NO_COMPILER_WARNINGS(nvl);
++    nv_linux_state_t *nvl;
++    nvl = NV_GET_NVL_FROM_NV_STATE(nv);
+ 
+     spin_lock_init(&nvl->rm_lock);
+ 
+@@ -2799,28 +2791,33 @@
+     nv_state_t *nv
+ )
+ {
+-    nv_linux_state_t *nvl = NV_GET_NVL_FROM_NV_STATE(nv);
+-    NO_COMPILER_WARNINGS(nvl);
++    nv_linux_state_t *nvl;
++    int cpu;
++
++    nvl = NV_GET_NVL_FROM_NV_STATE(nv);
++    cpu = get_cpu();
+ 
+-    if (nvl->rm_lock_cpu == smp_processor_id())
++    if (nvl->rm_lock_cpu == cpu)
+     {
+         nvl->rm_lock_count++;
++        put_cpu();
+         return;
+     }
+ 
++    put_cpu();
+     spin_unlock_wait(&nvl->rm_lock);
+     spin_lock_irq(&nvl->rm_lock);
+ 
+-   nvl->rm_lock_cpu = smp_processor_id();
+-   nvl->rm_lock_count = 1;
++    nvl->rm_lock_cpu = smp_processor_id();
++    nvl->rm_lock_count = 1;
+ }
+ 
+ void NV_API_CALL nv_unlock_rm(
+     nv_state_t *nv
+ )
+ {
+-    nv_linux_state_t *nvl = NV_GET_NVL_FROM_NV_STATE(nv);
+-    NO_COMPILER_WARNINGS(nvl);
++    nv_linux_state_t *nvl;
++    nvl = NV_GET_NVL_FROM_NV_STATE(nv);
+ 
+     if (--nvl->rm_lock_count)
+         return;
+diff -ru usr/src/nv/os-interface.c usr/src/nv.1182399/os-interface.c
+--- usr/src/nv/os-interface.c  2004-11-03 22:53:00.000000000 +0100
++++ usr/src/nv.1182399/os-interface.c  2004-12-21 18:58:47.000000000 +0100
+@@ -732,10 +732,17 @@
+ //
+ inline void NV_API_CALL out_string(const char *str)
+ {
++#if DEBUG
+     static int was_newline = 0;
+ 
+-    if (was_newline) printk("%d: %s", smp_processor_id(), str);
+-    else             printk("%s", str);
++    if (NV_NUM_CPUS() > 1 && was_newline)
++    {
++        printk("%d: %s", get_cpu(), str);
++        put_cpu();
++    }
++    else
++#endif
++        printk("%s", str);
+ 
+ #if DEBUG
+     if (NV_NUM_CPUS() > 1)
diff --git a/media-video/nvidia-kernel/files/1.0.6629/nv-disable-preempt-on-smp_processor_id-2.patch b/media-video/nvidia-kernel/files/1.0.6629/nv-disable-preempt-on-smp_processor_id-2.patch
deleted file mode 100644 (file)
index bba0124..0000000
+++ /dev/null
@@ -1,20 +0,0 @@
---- 1/nv/nv.c  2004-12-19 17:08:46.000000000 +0200
-+++ 2/nv/nv.c  2004-12-19 17:09:07.000000000 +0200
-@@ -2821,7 +2821,7 @@ void NV_API_CALL nv_lock_rm(
-     nv_linux_state_t *nvl = NV_GET_NVL_FROM_NV_STATE(nv);
-     NO_COMPILER_WARNINGS(nvl);
- 
--    if (nvl->rm_lock_cpu == smp_processor_id())
-+    if (nvl->rm_lock_cpu == _smp_processor_id())
-     {
-         nvl->rm_lock_count++;
-         return;
-@@ -2830,7 +2830,7 @@ void NV_API_CALL nv_lock_rm(
-     spin_unlock_wait(&nvl->rm_lock);
-     spin_lock_irq(&nvl->rm_lock);
- 
--   nvl->rm_lock_cpu = smp_processor_id();
-+   nvl->rm_lock_cpu = _smp_processor_id();
-    nvl->rm_lock_count = 1;
- }
- 
index 3ec45c97101b8e7eeec53b39aa38879f5272fb3d..ea40fa14f4e3a2d113df3c2d59a17204d0259333 100644 (file)
@@ -1,20 +1,18 @@
---- 1/nv/nv.c  2004-11-07 16:11:33.593487328 +0200
-+++ 2/nv/nv.c  2004-11-07 16:12:12.473576656 +0200
-@@ -3156,6 +3156,8 @@ void NV_API_CALL nv_lock_rm(
-     nv_linux_state_t *nvl = NV_GET_NVL_FROM_NV_STATE(nv);
-     NO_COMPILER_WARNINGS(nvl);
+--- usr/src/nv/nv.c.orig       2004-12-27 11:38:13.298374416 +1100
++++ usr/src/nv/nv.c    2004-12-27 11:42:48.876480176 +1100
+@@ -2814,6 +2814,7 @@
+     int cpu;
  
+     nvl = NV_GET_NVL_FROM_NV_STATE(nv);
 +    preempt_disable();
-+
-     if (nvl->rm_lock_cpu == smp_processor_id())
-     {
-         nvl->rm_lock_count++;
-@@ -3167,6 +3169,8 @@ void NV_API_CALL nv_lock_rm(
+     cpu = get_cpu();
  
-    nvl->rm_lock_cpu = smp_processor_id();
-    nvl->rm_lock_count = 1;
-+
-+   preempt_enable();
+     if (nvl->rm_lock_cpu == cpu)
+@@ -2829,6 +2830,7 @@
+ 
+     nvl->rm_lock_cpu = smp_processor_id();
+     nvl->rm_lock_count = 1;
++    preempt_enable();
  }
  
  void NV_API_CALL nv_unlock_rm(
diff --git a/media-video/nvidia-kernel/files/digest-nvidia-kernel-1.0.6629 b/media-video/nvidia-kernel/files/digest-nvidia-kernel-1.0.6629
deleted file mode 100644 (file)
index 9324510..0000000
+++ /dev/null
@@ -1,2 +0,0 @@
-MD5 f7737c1e95371f37a4fd30da2f11e72c NVIDIA-Linux-x86-1.0-6629-pkg1.run 8725221
-MD5 652e69f549c81a7a3f2806daa74b9c36 NVIDIA-Linux-x86_64-1.0-6629-pkg2.run 7777882
index f9d2b8414b644b549f20d7f1276eca8bfcefcc39..f0816053021ed3dc69c09c2b818d5e5f267a3c28 100644 (file)
@@ -1,6 +1,6 @@
 # Copyright 1999-2004 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/media-video/nvidia-kernel/nvidia-kernel-1.0.6629-r1.ebuild,v 1.3 2004/12/21 00:59:42 cyfred Exp $
+# $Header: /var/cvsroot/gentoo-x86/media-video/nvidia-kernel/nvidia-kernel-1.0.6629-r1.ebuild,v 1.4 2004/12/27 00:46:54 cyfred Exp $
 
 inherit eutils linux-mod
 
@@ -94,12 +94,11 @@ src_unpack() {
 
        # Patches from Zander (http://www.minion.de/files/1.0-6629/)
        epatch ${FILESDIR}/${PV}/NVIDIA_kernel-1.0-6629-1155389.patch
-       # Fix a limitation on available video memory bug #71684
-       epatch ${FILESDIR}/${PV}/NVIDIA_kernel-1.0-6629-1161283.patch
        epatch ${FILESDIR}/${PV}/NVIDIA_kernel-1.0-6629-1162524.patch
        epatch ${FILESDIR}/${PV}/NVIDIA_kernel-1.0-6629-1165235.patch
        epatch ${FILESDIR}/${PV}/NVIDIA_kernel-1.0-6629-1171869.patch
        epatch ${FILESDIR}/${PV}/NVIDIA_kernel-1.0-6629-1175225.patch
+       epatch ${FILESDIR}/${PV}/NVIDIA_kernel-1.0-6629-1182399.patch
 
        # Now any patches specific to the 2.6 kernel should go here
        if kernel_is 2 6
@@ -109,6 +108,8 @@ src_unpack() {
                epatch ${FILESDIR}/${PV}/conftest_koutput_includes.patch
                # Fix calling of smp_processor_id() when preempt is enabled
                epatch ${FILESDIR}/${PV}/nv-disable-preempt-on-smp_processor_id.patch
+               # Fix a limitation on available video memory bug #71684
+               epatch ${FILESDIR}/${PV}/NVIDIA_kernel-1.0-6629-1161283.patch
        fi
 
        # if you set this then it's your own fault when stuff breaks :)
diff --git a/media-video/nvidia-kernel/nvidia-kernel-1.0.6629.ebuild b/media-video/nvidia-kernel/nvidia-kernel-1.0.6629.ebuild
deleted file mode 100644 (file)
index bd459ae..0000000
+++ /dev/null
@@ -1,146 +0,0 @@
-# Copyright 1999-2004 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/media-video/nvidia-kernel/nvidia-kernel-1.0.6629.ebuild,v 1.10 2004/12/05 12:45:35 johnm Exp $
-
-inherit eutils linux-mod
-
-X86_PKG_V="pkg1"
-AMD64_PKG_V="pkg2"
-NV_V="${PV/1.0./1.0-}"
-X86_NV_PACKAGE="NVIDIA-Linux-x86-${NV_V}"
-AMD64_NV_PACKAGE="NVIDIA-Linux-x86_64-${NV_V}"
-
-DESCRIPTION="Linux kernel module for the NVIDIA X11 driver"
-HOMEPAGE="http://www.nvidia.com/"
-SRC_URI="x86? (ftp://download.nvidia.com/XFree86/Linux-x86/${NV_V}/${X86_NV_PACKAGE}-${X86_PKG_V}.run)
-       amd64? (http://download.nvidia.com/XFree86/Linux-x86_64/${NV_V}/${AMD64_NV_PACKAGE}-${AMD64_PKG_V}.run)"
-
-if use x86; then
-       PKG_V="${X86_PKG_V}"
-       NV_PACKAGE="${X86_NV_PACKAGE}"
-elif use amd64; then
-       PKG_V="${AMD64_PKG_V}"
-       NV_PACKAGE="${AMD64_NV_PACKAGE}"
-fi
-
-S="${WORKDIR}/${NV_PACKAGE}-${PKG_V}/usr/src/nv"
-
-LICENSE="NVIDIA"
-SLOT="0"
-KEYWORDS="-* ~x86 ~amd64"
-RESTRICT="nostrip"
-IUSE=""
-
-DEPEND="virtual/linux-sources"
-export _POSIX2_VERSION="199209"
-
-MODULE_NAMES="nvidia(video:${S})"
-BUILD_PARAMS="IGNORE_CC_MISMATCH=yes V=1 SYSSRC=${KV_DIR} SYSOUT=${KV_OUT_DIR}"
-
-mtrr_check() {
-       ebegin "Checking for MTRR support"
-       linux_chkconfig_present MTRR
-       eend $?
-
-       if [ "$?" != 0 ]
-       then
-               eerror "This version needs MTRR support for most chipsets!"
-               eerror "Please enable MTRR support in your kernel config, found at:"
-               eerror
-               eerror "  Processor type and features"
-               eerror "    [*] MTRR (Memory Type Range Register) support"
-               eerror
-               eerror "and recompile your kernel ..."
-               die "MTRR support not detected!"
-       fi
-}
-
-pkg_setup() {
-       linux-mod_pkg_setup
-       mtrr_check;
-}
-
-src_unpack() {
-       # 2.6.10_rc1-mm{1,2,3} all EXPORT_SYMBOL_GPL the udev functions, this breaks loading
-       CS="$(grep -c EXPORT_SYMBOL\(class_simple_create\)\; ${KV_DIR}/drivers/base/class_simple.c)"
-       if [ "${CS}" == "0" ]
-       then
-               ewarn "Your current kernel uses EXPORT_SYMBOL_GPL() on some methods required by nvidia-kernel."
-               ewarn "This probably means you are using 2.6.10_rc1-mm*. Please change away from mm-sources until this is"
-               ewarn "revised and a solution released into the mm branch, development-sources will work."
-               die "Incompatible kernel export."
-       fi
-
-       if [ ${KV_MINOR} -ge 6 -a ${KV_PATCH} -lt 7 ]
-       then
-               echo
-               ewarn "Your kernel version is ${KV_MAJOR}.${KV_MINOR}.${KV_PATCH}"
-               ewarn "This is not officially supported for ${P}. It is likely you"
-               ewarn "will not be able to compile or use the kernel module."
-               ewarn "It is recommended that you upgrade your kernel to a version >= 2.6.7"
-               echo
-               ewarn "DO NOT file bug reports for kernel versions less than 2.6.7 as they will be ignored."
-       fi
-
-       cd ${WORKDIR}
-       bash ${DISTDIR}/${NV_PACKAGE}-${PKG_V}.run --extract-only
-
-       # Add patches below, with a breif description.
-       cd ${S}
-       # Any general patches should go here
-       # Shutup pointer arith warnings
-       use x86 && epatch ${FILESDIR}/${PV}/nv-shutup-warnings.patch
-       use amd64 && epatch ${FILESDIR}/${PV}/nv-amd64-shutup-warnings.patch
-       # Fix a limitation on available video memory bug #71684
-       epatch ${FILESDIR}/${PV}/nv-fix-memory-limit.patch
-       # Fix the vm_flags to only have VM_IO, and not VM_LOCKED as well
-       epatch ${FILESDIR}/${PV}/nv-vm_flags-no-VM_LOCKED.patch
-
-       # Now any patches specific to the 2.6 kernel should go here
-       if kernel_is 2 6
-       then
-               einfo "Applying 2.6 kernel patches"
-               # Fix the /usr/src/linux/include/asm not existing on koutput issue #58294
-               epatch ${FILESDIR}/${PV}/conftest_koutput_includes.patch
-               # Fix pgd_offset() -> pml4_pgd_offset() for >=2.6.10-rc1-mm3
-               epatch ${FILESDIR}/${PV}/nv-pgd_offset.patch
-               # Speedup driver for 2.6 kernel to be on par with 2.4 kernel
-               epatch ${FILESDIR}/${PV}/nv-pgprot-speedup.patch
-               # Fix calling of smp_processor_id() when preempt is enabled
-               epatch ${FILESDIR}/${PV}/nv-disable-preempt-on-smp_processor_id.patch
-       fi
-
-       # if you set this then it's your own fault when stuff breaks :)
-       [ -n "${USE_CRAZY_OPTS}" ] && sed -i "s:-O:${CFLAGS}:" Makefile.*
-
-       # if greater than 2.6.5 use M= instead of SUBDIR=
-       convert_to_m ${S}/Makefile.kbuild
-}
-
-src_install() {
-       linux-mod_src_install
-
-       # Add the aliases
-       sed -e 's:\${PACKAGE}:'${PF}':g' ${FILESDIR}/nvidia > ${WORKDIR}/nvidia
-       insinto /etc/modules.d
-       newins ${WORKDIR}/nvidia nvidia
-
-       # Docs
-       dodoc ${S}/../../share/doc/README
-
-       # The device creation script
-       into /
-       newsbin ${S}/makedevices.sh NVmakedevices.sh
-}
-
-pkg_postinst() {
-       if [ "${ROOT}" = "/" ] && \
-               [ ! -e /dev/.devfsd ] && \
-               [ ! -e /dev/.udev ] && \
-               [ -x /sbin/NVmakedevices.sh ]
-       then
-               /sbin/NVmakedevices.sh >/dev/null 2>&1
-       fi
-
-       linux-mod_pkg_postinst
-}