summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKristopher Kersey <augustus@gentoo.org>2004-01-23 06:21:56 +0000
committerKristopher Kersey <augustus@gentoo.org>2004-01-23 06:21:56 +0000
commitb83c80bb88d17cdc0845c3666d5e67c438e55215 (patch)
treeaab08b2ecc4917733ab6fb2d5197472fbac47ab9 /media-video
parentNew NVIDIA driver 5332 released to public and now Gentoo. (diff)
downloadhistorical-b83c80bb88d17cdc0845c3666d5e67c438e55215.tar.gz
historical-b83c80bb88d17cdc0845c3666d5e67c438e55215.tar.bz2
historical-b83c80bb88d17cdc0845c3666d5e67c438e55215.zip
New NVIDIA driver 5332 released to public and now Gentoo. Added patch to support 2.6.x kernel.
Diffstat (limited to 'media-video')
-rw-r--r--media-video/nvidia-kernel/ChangeLog11
-rw-r--r--media-video/nvidia-kernel/files/1.0.5332/NVIDIA-Linux-x86_64-1.0-5332-2.6.diff151
-rw-r--r--media-video/nvidia-kernel/files/digest-nvidia-kernel-1.0.53321
-rw-r--r--media-video/nvidia-kernel/nvidia-kernel-1.0.5332.ebuild173
4 files changed, 334 insertions, 2 deletions
diff --git a/media-video/nvidia-kernel/ChangeLog b/media-video/nvidia-kernel/ChangeLog
index 95a3f7d3b35e..42b1d61d8908 100644
--- a/media-video/nvidia-kernel/ChangeLog
+++ b/media-video/nvidia-kernel/ChangeLog
@@ -1,6 +1,13 @@
# ChangeLog for media-video/nvidia-kernel
-# Copyright 2002-2003 Gentoo Technologies, Inc.; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/media-video/nvidia-kernel/ChangeLog,v 1.58 2004/01/10 01:29:54 mholzer Exp $
+# Copyright 2002-2004 Gentoo Technologies, Inc.; Distributed under the GPL v2
+# $Header: /var/cvsroot/gentoo-x86/media-video/nvidia-kernel/ChangeLog,v 1.59 2004/01/23 06:21:56 augustus Exp $
+
+*nvidia-kernel-1.0.5332 (23 Jan 2004)
+
+ 23 Jan 2004; <augustus@gentoo.org> nvidia-kernel-1.0.5332.ebuild,
+ files/1.0.5332/NVIDIA-Linux-x86_64-1.0-5332-2.6.diff:
+ New NVIDIA driver 5332 released to public. See NVIDIA's page for full details:
+ http://www.nvidia.com/object/linux_display_amd64_1.0-5332.html
10 Jan 2004; Martin Holzer <mholzer@gentoo.org>
nvidia-kernel-1.0.3123-r2.ebuild, nvidia-kernel-1.0.4180.ebuild,
diff --git a/media-video/nvidia-kernel/files/1.0.5332/NVIDIA-Linux-x86_64-1.0-5332-2.6.diff b/media-video/nvidia-kernel/files/1.0.5332/NVIDIA-Linux-x86_64-1.0-5332-2.6.diff
new file mode 100644
index 000000000000..e9d1f8435ec7
--- /dev/null
+++ b/media-video/nvidia-kernel/files/1.0.5332/NVIDIA-Linux-x86_64-1.0-5332-2.6.diff
@@ -0,0 +1,151 @@
+diff -urN NVIDIA-Linux-x86_64-1.0-5332-pkg0/usr/src/nv/Makefile NVIDIA-Linux-x86_64-1.0-5332-pkg0-gentoo/usr/src/nv/Makefile
+--- NVIDIA-Linux-x86_64-1.0-5332-pkg0/usr/src/nv/Makefile 2004-01-09 16:07:06.000000000 -0500
++++ NVIDIA-Linux-x86_64-1.0-5332-pkg0-gentoo/usr/src/nv/Makefile 2004-01-22 10:18:12.177456272 -0500
+@@ -1,14 +1,14 @@
+ # This Makefile is automatically generated; do not edit
+-# Generated on 'builder26' on Fri Jan 9 12:42:34 PST 2004
++# Generated on 'builder3.nvidia.com' on Thu Jun 19 04:05:35 PDT 2003
+
+ LINUX_MODULE=nv-linux.o
+-DEFINES=-D__KERNEL__ -DMODULE -D_LOOSE_KERNEL_NAMES -mcmodel=kernel -DNTRM -D_GNU_SOURCE -D_LOOSE_KERNEL_NAMES -D__KERNEL__ -DMODULE -DNV_MAJOR_VERSION=1 -DNV_MINOR_VERSION=0 -DNV_PATCHLEVEL=5332 -DNV_UNIX -DNV_LINUX -DNV_INT64_OK -DNV_64_BITS -DNVCPU_X86_64
++DEFINES=-D__KERNEL__ -DMODULE -D_LOOSE_KERNEL_NAMES -DKBUILD_MODNAME="nvidia" -DNTRM -D_GNU_SOURCE -D_LOOSE_KERNEL_NAMES -D__KERNEL__ -DMODULE -DNV_MAJOR_VERSION=1 -DNV_MINOR_VERSION=0 -DNV_PATCHLEVEL=4499 -DNV_UNIX -DNV_LINUX -DNV_INT64_OK -DNVCPU_X86_64 -DNV_64_BITS -DREMAP_PAGE_RANGE_5 -DKBUILD_MODNAME=nvidia
+ INCLUDES=-I.
+
+ OBJECTS=nv.o os-agp.o os-interface.o os-registry.o
+ HEADERS=os-agp.h os-interface.h nv-linux.h nv-misc.h nv-memdbg.h nv.h rmretval.h nvtypes.h $(VERSION_HDR)
+
+-CFLAGS=-Wall -Wimplicit -Wreturn-type -Wswitch -Wformat -Wchar-subscripts -Wparentheses -Wpointer-arith -Wno-multichar -Werror -O -mno-red-zone -MD $(DEFINES) $(INCLUDES) -Wno-cast-qual -Wno-error
++CFLAGS=-Wall -Wimplicit -Wreturn-type -Wswitch -Wformat -Wchar-subscripts -Wparentheses -Wno-cast-qual -Wno-multichar -O2 -MD $(DEFINES) $(INCLUDES) -Wno-cast-qual -mcmodel=kernel -nostdinc -iwithprefix include -fno-strict-aliasing -fno-common -mno-red-zone -mcmodel=kernel -pipe -fno-reorder-blocks -Wno-sign-compare -fno-asynchronous-unwind-tables -fomit-frame-pointer -Wdeclaration-after-statement -Wno-trigraphs -Wno-strict-prototypes
+
+ RESMAN_KERNEL_MODULE=nv-kernel.o
+
+@@ -50,8 +50,10 @@
+ # allow specification of alternate include file tree on command line and extra defines
+ ifdef SYSINCLUDE
+ INCLUDES += -I$(SYSINCLUDE)
++INCLUDES += -I$(SYSINCLUDE)/asm/mach-default
+ else
+ INCLUDES += -I$(KERNINC)
++INCLUDES += -I$(KERNINC)/asm/mach-default
+ endif
+
+ ifeq ($(shell sh conftest.sh remap_page_range $(INCLUDES)), 5)
+@@ -76,24 +78,62 @@
+ install: package-install
+
+ suser-sanity-check:
+- @if ! sh conftest.sh suser_sanity_check nvidia; then exit 1; fi
++ @if ! sh conftest.sh suser_sanity_check; then \
++ echo; \
++ echo "You have insufficient privileges for this operation. Please "; \
++ echo "run \"make install\" as root! "; \
++ echo; \
++ exit 1; \
++ fi
+
+ rmmod-sanity-check:
+- @if ! sh conftest.sh rmmod_sanity_check nvidia; then exit 1; fi
+-
+-gcc-sanity-check:
+- @if ! sh conftest.sh cc_sanity_check full_output $(CC); then exit 1; fi
+-
+-module: gcc-sanity-check $(LINUX_MODULE) $(RESMAN_KERNEL_MODULE)
+- ld -r -o nvidia.o $(LINUX_MODULE) $(RESMAN_KERNEL_MODULE)
+-
+-package-install: module suser-sanity-check rmmod-sanity-check
++ @if ! sh conftest.sh rmmod_sanity_check nvidia; then \
++ echo; \
++ echo "Unable to unload the currently loaded NVIDIA kernel module! "; \
++ echo "Please be certain that you have exited X before attempting "; \
++ echo "to install this version. "; \
++ echo; \
++ exit 1; \
++ fi
++
++cc-sanity-check:
++ @if ! sh conftest.sh cc_sanity_check $(CC); then \
++ echo; \
++ echo "You appear to be building the NVIDIA kernel module with a "; \
++ echo "compiler different from the one that was used to build the "; \
++ echo "running kernel. This may be perfectly fine, but there are "; \
++ echo "cases where this can lead to unexpected behaviour and "; \
++ echo "system crashes. "; \
++ echo; \
++ echo "If you know what you are doing and want to override this "; \
++ echo "check, you can do so by setting IGNORE_CC_MISMATCH. "; \
++ echo; \
++ echo "In any other case, set the CC environment variable to the "; \
++ echo "name of the compiler that was used to build the kernel. "; \
++ echo; \
++ exit 1; \
++ fi
++
++package-install: suser-sanity-check nvidia.o rmmod-sanity-check
++ if [ -d $(BROKENDIR) ]; then \
++ rm -f $(BROKENDIR)/NVdriver; \
++ rmdir --ignore-fail-on-non-empty $(BROKENDIR); \
++ fi && \
+ mkdir -p $(INSTALLDIR) && \
+- $(INSTALL) -m 0664 -o root -g root nvidia.o $(INSTALLDIR)/nvidia.o$(O) && \
+- PATH="$(PATH):/bin:/sbin" depmod -a && \
+- PATH="$(PATH):/bin:/sbin" modprobe nvidia && \
++ rm -f $(INSTALLDIR)/NVdriver && \
++ $(INSTALL) -m 0664 -o root -g root nvidia.ko $(INSTALLDIR)/nvidia.ko$(O) && \
++ /sbin/depmod -a && \
++ /sbin/modprobe nvidia && \
+ sh makedevices.sh && \
+- echo "nvidia.o installed successfully."; \
++ echo "nvidia.ko installed successfully."; \
++
++nvidia.o: cc-sanity-check $(LINUX_MODULE) $(RESMAN_KERNEL_MODULE)
++ ld -d -r -o $@ $(LINUX_MODULE) $(RESMAN_KERNEL_MODULE)
++ if [ -x /usr/src/linux/scripts/modpost ]; then \
++ /usr/src/linux/scripts/modpost $@; \
++ $(CC) -c $(CFLAGS) nvidia.mod.c; \
++ ld -m elf_x86_64 -r -o nvidia.ko $@ nvidia.mod.o; \
++ fi
+
+ $(VERSION_HDR):
+ echo \#define NV_COMPILER \"`$(CC) -v 2>&1 | tail -n 1`\" > $@
+@@ -113,7 +153,7 @@
+
+
+ clean:
+- $(RM) $(OBJECTS) $(LINUX_MODULE) $(VERSION_HDR) *.d NVdriver nvidia.o
++ $(RM) $(OBJECTS) $(LINUX_MODULE) $(VERSION_HDR) *.d NVdriver nvidia.o nvidia.ko nvidia.mod.c nvidia.mod.o
+
+
+ -include $(OBJECTS:%.o=%.d)
+diff -urN NVIDIA-Linux-x86_64-1.0-5332-pkg0/usr/src/nv/nv-linux.h NVIDIA-Linux-x86_64-1.0-5332-pkg0-gentoo/usr/src/nv/nv-linux.h
+--- NVIDIA-Linux-x86_64-1.0-5332-pkg0/usr/src/nv/nv-linux.h 2004-01-09 16:07:05.000000000 -0500
++++ NVIDIA-Linux-x86_64-1.0-5332-pkg0-gentoo/usr/src/nv/nv-linux.h 2004-01-22 10:09:29.821866392 -0500
+@@ -24,7 +24,7 @@
+ # define KERNEL_2_4
+ #elif LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 0)
+ # error This driver does not support 2.5 kernels!
+-#elif LINUX_VERSION_CODE < KERNEL_VERSION(2, 7, 0) && defined(NVCPU_X86)
++#elif LINUX_VERSION_CODE < KERNEL_VERSION(2, 7, 0) && ( defined(NVCPU_X86) || defined(NVCPU_X86_64) )
+ # define KERNEL_2_6
+ #else
+ # error This driver does not support development kernels!
+diff -urN NVIDIA-Linux-x86_64-1.0-5332-pkg0/usr/src/nv/nv.c NVIDIA-Linux-x86_64-1.0-5332-pkg0-gentoo/usr/src/nv/nv.c
+--- NVIDIA-Linux-x86_64-1.0-5332-pkg0/usr/src/nv/nv.c 2004-01-09 16:07:05.000000000 -0500
++++ NVIDIA-Linux-x86_64-1.0-5332-pkg0-gentoo/usr/src/nv/nv.c 2004-01-22 10:11:51.897267648 -0500
+@@ -427,7 +427,8 @@
+ {
+ struct scatterlist *sg_ptr = &at->sg_list[i];
+
+- sg_ptr->address = (char *) page_ptr->virt_addr;
++ sg_ptr->page = virt_to_page( page_ptr->virt_addr );
++ sg_ptr->offset = offset_in_page( page_ptr->virt_addr );
+ sg_ptr->length = PAGE_SIZE;
+
+ if (pci_map_sg(at->dev, sg_ptr, 1, PCI_DMA_BIDIRECTIONAL) == 0)
+@@ -435,7 +436,7 @@
+ goto failed;
+ }
+
+- page_ptr->dma_addr = sg_ptr->dma_address;
++ page_ptr->dma_addr = sg_dma_address(sg_ptr);
+ }
+ #endif
diff --git a/media-video/nvidia-kernel/files/digest-nvidia-kernel-1.0.5332 b/media-video/nvidia-kernel/files/digest-nvidia-kernel-1.0.5332
new file mode 100644
index 000000000000..943071e25292
--- /dev/null
+++ b/media-video/nvidia-kernel/files/digest-nvidia-kernel-1.0.5332
@@ -0,0 +1 @@
+MD5 eede761ab428ff0d27e5f67e8c555972 NVIDIA-Linux-x86_64-1.0-5332-pkg0.run 5597826
diff --git a/media-video/nvidia-kernel/nvidia-kernel-1.0.5332.ebuild b/media-video/nvidia-kernel/nvidia-kernel-1.0.5332.ebuild
new file mode 100644
index 000000000000..203ca941fbba
--- /dev/null
+++ b/media-video/nvidia-kernel/nvidia-kernel-1.0.5332.ebuild
@@ -0,0 +1,173 @@
+# Copyright 1999-2004 Gentoo Technologies, Inc.
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/media-video/nvidia-kernel/nvidia-kernel-1.0.5332.ebuild,v 1.1 2004/01/23 06:21:56 augustus Exp $
+
+PKG_V="pkg0"
+NV_V="${PV/1.0./1.0-}"
+NV_PACKAGE="NVIDIA-Linux-x86_64-${NV_V}"
+S="${WORKDIR}/${NV_PACKAGE}-${PKG_V}/usr/src/nv"
+DESCRIPTION="Linux kernel module for the NVIDIA's X driver"
+HOMEPAGE="http://www.nvidia.com/"
+SRC_URI="ftp://download.nvidia.com/XFree86/Linux-x86_64/${NV_V}/${NV_PACKAGE}-${PKG_V}.run"
+
+# The slot needs to be set to $KV to prevent unmerges of modules for other kernels.
+LICENSE="NVIDIA"
+SLOT="${KV}"
+KEYWORDS="-* ~amd64"
+RESTRICT="nostrip"
+
+DEPEND="virtual/linux-sources"
+export _POSIX2_VERSION="199209"
+
+
+pkg_setup() {
+ if [ ! -f /proc/mtrr ]
+ 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 -> [*] MTRR (Memory Type Range Register) support"
+ eerror
+ eerror "and recompile your kernel ..."
+ die "MTRR support not detected!"
+ fi
+
+ check_version_h
+}
+
+check_version_h() {
+ if [ ! -f "${ROOT}/usr/src/linux/include/linux/version.h" ]
+ then
+ eerror "Please verify that your /usr/src/linux symlink is pointing"
+ eerror "to your current kernel sources, and that you did run:"
+ eerror
+ eerror " # make dep"
+ die "/usr/src/linux symlink not setup!"
+ fi
+}
+
+get_KV_info() {
+ check_version_h
+
+ # Get the kernel version of sources in /usr/src/linux ...
+ export KV_full="$(awk '/UTS_RELEASE/ { gsub("\"", "", $3); print $3 }' \
+ "${ROOT}/usr/src/linux/include/linux/version.h")"
+ export KV_major="$(echo "${KV_full}" | cut -d. -f1)"
+ export KV_minor="$(echo "${KV_full}" | cut -d. -f2)"
+ export KV_micro="$(echo "${KV_full}" | cut -d. -f3 | sed -e 's:[^0-9].*::')"
+}
+
+is_2_4_kernel() {
+ get_KV_info
+
+ if [ "${KV_major}" -eq 2 -a "${KV_minor}" -eq 4 ]
+ then
+ return 0
+ else
+ return 1
+ fi
+}
+
+is_2_5_kernel() {
+ get_KV_info
+
+ if [ "${KV_major}" -eq 2 -a "${KV_minor}" -eq 5 ]
+ then
+ return 0
+ else
+ return 1
+ fi
+}
+
+is_2_6_kernel() {
+ get_KV_info
+
+ if [ "${KV_major}" -eq 2 -a "${KV_minor}" -eq 6 ]
+ then
+ return 0
+ else
+ return 1
+ fi
+}
+
+src_unpack() {
+ cd ${WORKDIR}
+ bash ${DISTDIR}/${NV_PACKAGE}-${PKG_V}.run --extract-only
+
+ # Next section applies patches for linux-2.5 kernel, and/or
+ # bugfixes for linux-2.4. All these are from:
+ #
+ # http://www.minion.de/nvidia/
+ #
+ # Many thanks to Christian Zander <zander@minion.de> for bringing
+ # these to us, and being so helpful to select which to use.
+
+ get_KV_info
+
+ cd ${S}
+ einfo "Linux kernel ${KV_major}.${KV_minor}.${KV_micro}"
+
+ if is_2_5_kernel || is_2_6_kernel
+ then
+ # Kbuild have issues currently (sandbox related).
+ EPATCH_SINGLE_MSG="Applying 2.6.x patch ..." \
+ epatch ${FILESDIR}/${PV}/NVIDIA-Linux-x86_64-1.0-5332-2.6.diff
+ fi
+
+ # if you set this then it's your own fault when stuff breaks :)
+ [ ! -z "${USE_CRAZY_OPTS}" ] && sed -i "s:-O:${CFLAGS}:" Makefile
+}
+
+src_compile() {
+ # Portage should determine the version of the kernel sources
+ check_KV
+
+ # IGNORE_CC_MISMATCH disables a sanity check that's needed when gcc has been
+ # updated but the running kernel is still compiled with an older gcc. This is
+ # needed for chrooted building, where the sanity check detects the gcc of the
+ # kernel outside the chroot rather than within.
+ make IGNORE_CC_MISMATCH="yes" KERNDIR="/usr/src/linux" \
+ clean nvidia.o || die
+}
+
+src_install() {
+ # The driver goes into the standard modules location
+ insinto /lib/modules/${KV}/video
+ if is_2_5_kernel || is_2_6_kernel
+ then
+ doins nvidia.ko
+ else
+ doins nvidia.o
+ fi
+
+ # Add the aliases
+ insinto /etc/modules.d
+ newins ${FILESDIR}/nvidia-1.1 nvidia
+
+ # Docs
+ dodoc ${S}/README
+
+ # The device creation script
+ into /
+ newsbin ${S}/makedevices.sh NVmakedevices.sh
+}
+
+pkg_postinst() {
+ if [ "${ROOT}" = "/" ]
+ then
+ # Update module dependency
+ [ -x /usr/sbin/update-modules ] && /usr/sbin/update-modules
+ if [ ! -e /dev/.devfsd ] && [ -x /sbin/NVmakedevices.sh ]
+ then
+ /sbin/NVmakedevices.sh >/dev/null 2>&1
+ fi
+ fi
+
+ echo
+ einfo "If you are not using devfs, loading the module automatically at"
+ einfo "boot up, you need to add \"nvidia\" to your /etc/modules.autoload."
+ echo
+ ewarn "Please note that the driver name changed from \"NVdriver\""
+ ewarn "to \"nvidia.o\"."
+ echo
+}