You are not logged in.
Pages: 1
Topic closed
hi
for all kernel 2.6.9 testers out there here are the files to run the nvidia drivers with 2.6.9, a big thank you to gentoo for the patches
rest see below it has now a nice formatting
Offline
thanks for the package: to make it prettier, i'll jsut do this:
you may also want to use the url for the patch download instead of a pre-downloaded file, to help out maintainers
PKGBUILD
# Maintainer : Tobias Powalowski <tpowa@archlinux.org>
pkgname=nvidia
pkgver=1.0.6111
pkgbinary=NVIDIA-Linux-x86-1.0-6111
pkgrel=3
pkgdesc="Drivers for XFree86/X.Org"
url="http://www.nvidia.com"
depends=('bash' 'gcc' 'binutils' 'glibc' 'make')
source=(ftp://download.nvidia.com/XFree86/Linux-x86/1.0-6111/$pkgbinary-pkg0.run nv-pci_find_class.patch
nv-remap-range.patch nv_enable_pci.patch power-suspend-2.6.9-changes.patch vmalloc-reserve.patch)
install="nvidia.install"
build() {
cd $startdir/src/
#needed for normal pkgbuild
#install -D -m 755 $pkgbinary-pkg0.run $startdir/pkg/opt/nvidia/$pkgbinary-pkg0.run
#now for 2.6.9 new install method until fixed nvidia drivers will be available
chmod +x $pkgbinary-pkg0.run
./$pkgbinary-pkg0.run --extract-only
cd $pkgbinary-pkg0
#installing patches for kernel 2.6.9
patch -Np0 -i ../power-suspend-2.6.9-changes.patch
patch -Np0 -i ../nv_enable_pci.patch
patch -Np0 -i ../vmalloc-reserve.patch
patch -Np0 -i ../nv-pci_find_class.patch
patch -Np0 -i ../nv-remap-range.patch
cd ..
#clean src
rm *
mkdir -p $startdir/pkg/opt/nvidia
mv * $startdir/pkg/opt/nvidia
}
md5sums=('b2b725a8f8de279264b71f08ee30f20f' '9a2e47f4fb00f24eca79b8adf0af0c60'
'a449b5f1cc91f0ef78e33fac7be4a1a2' '8dfe337a4a42c42234c798f9d67ee642'
'335be8e5143f2227bcf74718de074343' '20bc0ed10ea690f7eaacdae040768d42')
nvidia.install
#driver=NVIDIA-Linux-x86-1.0-6111-pkg0.run
driver=NVIDIA-Linux-x86-1.0-6111-pkg0/./nvidia-installer
post_install() {
cat << EOF
IMPORTANT
==> In order to use the software you have to agree to NVIDIA's license located in
==> /usr/share/doc/NVIDIA_GLX-1.0/LICENSE else please remove this package
==> You have to be in console mode to finish installation!
==> Else it won't install! You have to rerun 'pacman -S nvidia'
Installation starts now ...
EOF
/opt/nvidia/./$driver -a -q --no-network --ui=none -n > /dev/null 2>&1
modprobe nvidia
rm -r /opt/nvidia
cat << EOF
If you need more information about setting up nvidia drivers have a look at:
"http://wiki.archlinux.org/index.php/How to install NVIDIA Driver"
EOF
}
post_upgrade() {
post_install $1
}
pre_remove() {
cat << EOF
==> Deinstallation starts now!
EOF
rmmod nvidia
nvidia-installer -a -q --no-network --ui=none --uninstall >> dev/null
cat << EOF
==> Don't forget to update your /etc/X11/XF86Config or /etc/X11/xorg.conf and rc.conf!
EOF
}
op=$1
shift
$op $*
nv-pci_find_class.patch
--- usr/src/nv/conftest.sh.old 2004-09-15 10:57:44.000000000 +1000
+++ usr/src/nv/conftest.sh 2004-09-15 11:48:52.561314384 +1000
@@ -23,6 +23,30 @@
fi
case "$4" in
+ check_pci_class)
+ #
+ # Determine if the current kernel uses pci_find_class or pci_get_class
+ #
+
+ echo "#include <linux/pci.h>
+ int do_test_pci_class(void) {
+ struct pci_dev *get_dev;
+ get_dev = pci_get_class(0,NULL);
+ }" > conftest$$.c
+
+ $CC $CFLAGS -c conftest$$.c > /dev/null 2>&1
+ rm -f conftest$$.c
+
+ if [ -f conftest$$.o ]; then
+ echo "get"
+ rm -f conftest$$.o
+ exit 0
+ else
+ echo "find"
+ exit 0
+ fi
+ ;;
+
remap_page_range)
#
# Determine the number of arguments expected by remap_page_range.
--- usr/src/nv/nv.c.old 2004-09-15 11:40:05.079503808 +1000
+++ usr/src/nv/nv.c 2004-09-15 11:47:40.042338944 +1000
@@ -639,7 +639,11 @@
u8 cap_ptr;
int func, slot;
+#ifdef HAVE_PCI_GET_CLASS
+ dev = pci_get_class(class << 8, NULL);
+#else
dev = pci_find_class(class << 8, NULL);
+#endif
do {
for (func = 0; func < 8; func++) {
slot = PCI_SLOT(dev->devfn);
@@ -650,7 +654,11 @@
if (cap_ptr)
return fn;
}
+#ifdef HAVE_PCI_GET_CLASS
+ dev = pci_get_class(class << 8, dev);
+#else
dev = pci_find_class(class << 8, dev);
+#endif
} while (dev);
return NULL;
@@ -3484,12 +3492,20 @@
struct pci_dev *dev = NULL;
int count = 0;
+#ifdef HAVE_PCI_GET_CLASS
+ dev = pci_get_class(PCI_CLASS_DISPLAY_VGA << 8, dev);
+#else
dev = pci_find_class(PCI_CLASS_DISPLAY_VGA << 8, dev);
+#endif
while (dev)
{
if ((dev->vendor == 0x10de) && (dev->device >= 0x20))
count++;
+#ifdef HAVE_PCI_GET_CLASS
+ dev = pci_get_class(PCI_CLASS_DISPLAY_VGA << 8, dev);
+#else
dev = pci_find_class(PCI_CLASS_DISPLAY_VGA << 8, dev);
+#endif
}
return count;
}
--- usr/src/nv/Makefile.kbuild.old 2004-09-15 10:57:52.000000000 +1000
+++ usr/src/nv/Makefile.kbuild 2004-09-15 11:39:30.153813320 +1000
@@ -185,6 +185,12 @@
endif
endif
+ifeq ($(shell $(CONFTEST) check_pci_class), get)
+ EXTRA_CFLAGS += -DHAVE_PCI_GET_CLASS
+else
+ EXTRA_CFLAGS += -DHAVE_PCI_FIND_CLASS
+endif
+
#
# Miscellaneous NVIDIA kernel module build support targets. They are needed
# to satisfy KBUILD requirements and to support NVIDIA specifics.
--- usr/src/nv/Makefile.nvidia.old 2004-09-15 11:44:30.980080776 +1000
+++ usr/src/nv/Makefile.nvidia 2004-09-15 11:45:37.209012448 +1000
@@ -73,6 +73,12 @@
DEFINES += -DNV_CHANGE_PAGE_ATTR_PRESENT
endif
+ifeq ($(shell $(CONFTEST) check_pci_class), get)
+ DEFINES += -DHAVE_PCI_GET_CLASS
+else
+ DEFINES += -DHAVE_PCI_FIND_CLASS
+endif
+
DEFINES+=$(EXTRA_DEFINES)
# allow build parameters to be passed in through the environment
nv-remap-range.patch
nv-remap-range.patch:
--- usr/src/nv/Makefile.kbuild.orig 2004-10-04 19:57:29.364110664 +1000
+++ usr/src/nv/Makefile.kbuild 2004-10-04 20:01:23.803470464 +1000
@@ -133,7 +133,7 @@
endif
#
-# NVIDIA specific CFLAGS and #define's. The remap_page_range check has become
+# NVIDIA specific CFLAGS and #define's. The remap_range check has become
# necessary with the introduction of the five argument version to Linux 2.4
# distribution kernels; this conflicting change cannot be detected at compile
# time.
@@ -160,13 +160,15 @@
endif
-ifeq ($(PATCHLEVEL), 4)
- REMAP_PAGE_RANGE := $(shell $(CONFTEST) remap_page_range)
+ REMAP_RANGE := $(shell $(CONFTEST) remap_range)
- ifeq ($(REMAP_PAGE_RANGE), 5)
+ ifeq ($(REMAP_RANGE), PFN)
+ EXTRA_CFLAGS += -DREMAP_PFN_RANGE
+ endif
+
+ ifeq ($(REMAP_RANGE), 5)
EXTRA_CFLAGS += -DREMAP_PAGE_RANGE_5
endif
- ifeq ($(REMAP_PAGE_RANGE), 4)
+ ifeq ($(REMAP_RANGE), 4)
EXTRA_CFLAGS += -DREMAP_PAGE_RANGE_4
endif
-endif
--- usr/src/nv/Makefile.nvidia.orig 2004-10-04 19:57:36.572014896 +1000
+++ usr/src/nv/Makefile.nvidia 2004-10-04 20:01:13.459043056 +1000
@@ -60,12 +60,15 @@
INSTALL=$(shell which install)
INCLUDES += -I$(KERNEL_HEADERS)
-REMAP_PAGE_RANGE := $(shell $(CONFTEST) remap_page_range)
+REMAP_RANGE := $(shell $(CONFTEST) remap_range)
-ifeq ($(REMAP_PAGE_RANGE), 5)
+ifeq ($(REMAP_RANGE), PFN)
+ DEFINES += -DREMAP_PFN_RANGE
+endif
+ifeq ($(REMAP_RANGE), 5)
DEFINES += -DREMAP_PAGE_RANGE_5
endif
-ifeq ($(REMAP_PAGE_RANGE), 4)
+ifeq ($(REMAP_RANGE), 4)
DEFINES += -DREMAP_PAGE_RANGE_4
endif
--- usr/src/nv/conftest.sh.orig 2004-10-04 19:38:34.819587648 +1000
+++ usr/src/nv/conftest.sh 2004-10-04 19:56:28.547356216 +1000
@@ -47,11 +47,27 @@
fi
;;
- remap_page_range)
+ remap_range)
#
# Determine the number of arguments expected by remap_page_range.
+ # Extended to determine if should use remap_pfn_range() aswell
#
+ echo "#include <linux/mm.h>
+ int do_test_remap_page_range(void) {
+ pgprot_t pgprot;
+ remap_pfn_range(NULL, 0L, 0L, 0L, pgprot);
+ }" > conftest$$.c
+
+ $CC $CFLAGS -c conftest$$.c > /dev/null 2>&1
+ rm -f conftest$$.c
+
+ if [ -f conftest$$.o ]; then
+ echo "PFN"
+ rm -f conftest$$.o;
+ exit 0
+ fi
+
echo "#include <linux/mm.h>
int do_test_remap_page_range(void) {
pgprot_t pgprot;
--- usr/src/nv/nv-linux.h.orig 2004-10-04 19:25:54.819125280 +1000
+++ usr/src/nv/nv-linux.h 2004-10-04 19:38:26.043921752 +1000
@@ -567,13 +567,15 @@
* relevant releases to date use it. This version was backported to 2.4
* without means to identify the change, hence this hack.
*/
-#if defined(KERNEL_2_6) || defined(REMAP_PAGE_RANGE_5)
-#define NV_REMAP_PAGE_RANGE(x...) remap_page_range(vma, x)
+#if defined(REMAP_PFN_RANGE)
+#define NV_REMAP_RANGE(from, offset, x...) remap_pfn_range(vma, from, ((offset)) >> PAGE_SHIFT, x)
+#elif defined(KERNEL_2_6) || defined(REMAP_PAGE_RANGE_5)
+#define NV_REMAP_RANGE(x...) remap_page_range(vma, x)
#elif defined(REMAP_PAGE_RANGE_4)
-#define NV_REMAP_PAGE_RANGE(x...) remap_page_range(x)
+#define NV_REMAP_RANGE(x...) remap_page_range(x)
#else
#warning "conftest.sh failed, assuming old Linux 2.4 remap_page_range(4)!"
-#define NV_REMAP_PAGE_RANGE(x...) remap_page_range(x)
+#define NV_REMAP_RANGE(x...) remap_page_range(x)
#endif
#if defined(pmd_offset_map)
--- usr/src/nv/nv.c.orig 2004-10-04 19:25:49.387950944 +1000
+++ usr/src/nv/nv.c 2004-10-04 19:31:56.270176368 +1000
@@ -1775,7 +1775,7 @@
pages = nv->regs->size / PAGE_SIZE;
vma->vm_page_prot = pgprot_noncached(vma->vm_page_prot);
- if (NV_REMAP_PAGE_RANGE(vma->vm_start,
+ if (NV_REMAP_RANGE(vma->vm_start,
NV_VMA_OFFSET(vma),
vma->vm_end - vma->vm_start,
vma->vm_page_prot))
@@ -1794,7 +1794,7 @@
pages = nv->fb->size / PAGE_SIZE;
vma->vm_page_prot = pgprot_noncached(vma->vm_page_prot);
- if (NV_REMAP_PAGE_RANGE(vma->vm_start,
+ if (NV_REMAP_RANGE(vma->vm_start,
NV_VMA_OFFSET(vma),
vma->vm_end - vma->vm_start,
vma->vm_page_prot))
@@ -1912,7 +1912,7 @@
while (pages--)
{
page = (unsigned long) at->page_table[i++].phys_addr;
- if (NV_REMAP_PAGE_RANGE(start, page, PAGE_SIZE, vma->vm_page_prot))
+ if (NV_REMAP_RANGE(start, page, PAGE_SIZE, vma->vm_page_prot))
return -EAGAIN;
start += PAGE_SIZE;
pos += PAGE_SIZE;
--- usr/src/nv/os-agp.c.orig 2004-10-04 19:26:06.363370288 +1000
+++ usr/src/nv/os-agp.c 2004-10-04 19:32:06.228662448 +1000
@@ -331,10 +331,10 @@
agp_addr = agpinfo.aper_base + (agp_data->offset << PAGE_SHIFT);
#if defined(NVCPU_IA64)
- err = NV_REMAP_PAGE_RANGE(vma->vm_start, (size_t) agp_addr,
+ err = NV_REMAP_RANGE(vma->vm_start, (size_t) agp_addr,
agp_data->num_pages << PAGE_SHIFT, vma->vm_page_prot);
#else
- err = NV_REMAP_PAGE_RANGE(vma->vm_start, (size_t) agp_addr,
+ err = NV_REMAP_RANGE(vma->vm_start, (size_t) agp_addr,
agp_data->num_pages << PAGE_SHIFT, PAGE_SHARED);
#endif
--- usr/src/nv/os-interface.c.orig 2004-10-04 19:26:14.267168728 +1000
+++ usr/src/nv/os-interface.c 2004-10-04 19:32:12.958639336 +1000
@@ -1087,7 +1087,7 @@
vma = (struct vm_area_struct *) *priv;
- if (NV_REMAP_PAGE_RANGE(vma->vm_start,
+ if (NV_REMAP_RANGE(vma->vm_start,
start & PAGE_MASK, size_bytes, PAGE_SHARED))
return NULL;
nv_enable_pci.patch
--- usr/src/nv/nv.c 2004-08-23 13:58:15.000000000 -0500
+++ usr/src/nv.new/nv.c 2004-08-23 13:58:35.000000000 -0500
@@ -1225,6 +1225,7 @@
{
nv_state_t *nv = NV_STATE_PTR(&nv_linux_devices[i]);
release_mem_region(nv->bar.regs.address, nv->bar.regs.size);
+ pci_disable_device(nv_linux_devices[i].dev);
}
}
@@ -3516,6 +3517,28 @@
return -1;
}
+ // enable io, mem, and bus-mastering in pci config space
+ if (pci_enable_device(dev) != 0)
+ {
+ nv_printf(NV_DBG_ERRORS,
+ "NVRM: pci_enable_device failed, abortingn");
+ return -1;
+ }
+
+ // request ownership of our bars
+ // keeps other drivers from banging our registers.
+ // only do this for registers, as vesafb requests our framebuffer and will
+ // keep us from working properly
+ if (!request_mem_region(dev->resource[0].start,
+ dev->resource[0].end - dev->resource[0].start + 1,
+ "nvidia"))
+ {
+ nv_printf(NV_DBG_ERRORS,
+ "NVRM: pci_request_regions failed, abortingn");
+ goto err_disable_dev;
+ }
+ pci_set_master(dev);
+
/* initialize bus-dependent config state */
nvl = &nv_linux_devices[num_nv_devices];
nv = NV_STATE_PTR(nvl);
@@ -3545,7 +3568,7 @@
nv_printf(NV_DBG_ERRORS, "NVRM: Please check your BIOS settings. n");
nv_printf(NV_DBG_ERRORS, "NVRM: [Plug & Play OS ] should be set to NO n");
nv_printf(NV_DBG_ERRORS, "NVRM: [Assign IRQ to VGA] should be set to YES n");
- return -1;
+ goto err_zero_dev;
}
/* sanity check the IO apertures */
@@ -3569,39 +3592,9 @@
nv->bar.fb.address, nv->bar.fb.size);
}
- /* Clear out the data */
- os_mem_set(nvl, 0, sizeof(nv_linux_state_t));
-
- return -1;
- }
-
- // request ownership of our bars
- // keeps other drivers from banging our registers.
- // only do this for registers, as vesafb requests our framebuffer and will
- // keep us from working properly
- if (!request_mem_region(nv->bar.regs.address, nv->bar.regs.size, "nvidia"))
- {
- nv_printf(NV_DBG_ERRORS,
- "NVRM: pci_request_regions failed, abortingn");
-
- /* Clear out the data */
- os_mem_set(nvl, 0, sizeof(nv_linux_state_t));
-
- return -1;
+ goto err_zero_dev;
}
- // enable io, mem, and bus-mastering in pci config space
- if (pci_enable_device(dev) != 0)
- {
- nv_printf(NV_DBG_ERRORS,
- "NVRM: pci_enable_device failed, abortingn");
-
- pci_release_regions(dev);
- os_mem_set(nvl, 0, sizeof(nv_linux_state_t));
-
- return -1;
- }
- pci_set_master(nvl->dev);
#if defined(NV_BUILD_NV_PAT_SUPPORT)
if (nvos_find_pci_express_capability(nvl->dev))
@@ -3618,13 +3611,7 @@
if (nv->bar.regs.map == NULL)
{
nv_printf(NV_DBG_ERRORS, "NVRM: failed to map registers!!n");
-
- pci_release_regions(dev);
-
- /* Clear out the data */
- os_mem_set(nvl, 0, sizeof(nv_linux_state_t));
-
- return -1;
+ goto err_zero_dev;
}
nv->flags |= NV_FLAG_MAP_REGS_EARLY;
#endif
@@ -3641,6 +3628,15 @@
num_nv_devices++;
return 0;
+
+err_zero_dev:
+ os_mem_set(nvl, 0, sizeof(nv_linux_state_t));
+ release_mem_region(dev->resource[0].start,
+ dev->resource[0].end - dev->resource[0].start + 1);
+
+err_disable_dev:
+ pci_disable_device(dev);
+ return -1;
}
int NV_API_CALL nv_no_incoherent_mappings
power-suspend-2.6.9-changes.patch
--- usr/src/nv/nv.c.orig 2004-08-28 02:48:36.393223808 +1000
+++ usr/src/nv/nv.c 2004-08-28 02:50:36.354986848 +1000
@@ -3692,9 +3692,16 @@
return -1;
}
+ // Fix up problems with PM_SAVE_STATE being removed from 2.6.9
+ #ifdef PM_SAVE_STATE
+ #define PM_TMP PM_SAVE_STATE
+ #else
+ #define PM_TMP PM_SUSPEND
+ #endif
+
switch (state)
{
- case PM_SAVE_STATE:
+ case PM_TMP:
nv_printf(NV_DBG_INFO, "NVRM: ACPI: received standby eventn");
status = rm_power_management(nv, 0, NV_PM_ACPI_STANDBY);
break;
vmalloc-reserve.patch:
diff -uNp --exclude='*.orig' --exclude='*.rej' --exclude='*.dmn' -r usr/src/nv/nv.c usr/src/nv/nv.c
--- usr/src/nv/nv.c 2004-08-31 22:52:17.000000000 +0100
+++ usr/src/nv/nv.c 2004-09-20 02:49:42.399538232 +0100
@@ -19,6 +19,10 @@
MODULE_ALIAS_CHARDEV_MAJOR(NV_MAJOR_DEVICE_NUMBER);
#endif
+#ifndef __VMALLOC_RESERVE
+unsigned int __VMALLOC_RESERVE;
+#endif
+
/*
* our global state; one per device
*/
Offline
many thanks for making it prettier
how you do this?
something like (/verbatim)?
Offline
the syntax is called BBCode (http://bbs.archlinux.org/faq.php?mode=bbcode)
i used the tags [ code ] blah [ /code ] (without spaces) which does the nice green formatting
Offline
This is what happens when I try to build package.
==> Making package: nvidia (Wed Oct 20 20:25:17 PDT 2004)
==> Checking Runtime Dependencies...
==> Checking Buildtime Dependencies...
==> Retrieving Sources...
==> Using local copy of NVIDIA-Linux-x86-1.0-6111-pkg0.run
==> Found nv-pci_find_class.patch in build dir
==> Found nv-remap-range.patch in build dir
==> Found nv_enable_pci.patch in build dir
==> Found power-suspend-2.6.9-changes.patch in build dir
==> ERROR: vmalloc-reserve.patch was not found in the build directory and is not a proper URL.
==> Aborting...
Is vmalloc-reserve.patch not needed?
Offline
Look at the last patch: vmalloc.patch
--- usr/src/nv/nv.c 2004-08-31 22:52:17.000000000 +0100
+++ usr/src/nv/nv.c 2004-09-20 02:49:42.399538232 +0100
@@ -19,6 +19,10 @@
MODULE_ALIAS_CHARDEV_MAJOR(NV_MAJOR_DEVICE_NUMBER);
#endif
+#ifndef __VMALLOC_RESERVE
+unsigned int __VMALLOC_RESERVE;
+#endif
+
/*
* our global state; one per device
*/
P4 2.8Ghz @ 2.8Ghz SL6WT
Zalman CNPS7000-Cu
865PE Neo-2 LS BIOs 2.4
512mb Mushkin Level II
160GB Maxtor HD
Geforce 4 440MX
Antec 3700 1 exhaust and 1 intake fans
Linux 2.6.x
Linux user 314187
ArchLinux
Offline
hmm ...
i made a pkgbuild that uses a patched installer, instead of patching everything myself (because i never saw the actual patch files)
anyway, i'd like to see this package in testing, beside kernel 2.6.9
thanks for the efforts
Offline
paranoos, do you have a link to the patched installer?
Offline
yes. here.
Offline
I tried that it does not include the pci_find_*.patch?
Could provide a bz2 file with the patches. I have a problem apply them to NVIDIA-* I get the malform patch message by cut and pasteing the above source patches.
I would really appreciate that.....
Thanks in advance....
Walt
P4 2.8Ghz @ 2.8Ghz SL6WT
Zalman CNPS7000-Cu
865PE Neo-2 LS BIOs 2.4
512mb Mushkin Level II
160GB Maxtor HD
Geforce 4 440MX
Antec 3700 1 exhaust and 1 intake fans
Linux 2.6.x
Linux user 314187
ArchLinux
Offline
hi the above is only posted that you can patch it on your own
when 2.6.9 is official then the nvidia package gets updated
with the above files
Offline
The thing is I create my own custom kernel with 2.6.9-bk?. All I need is the patch files to patch either 6111 or an earlier version of the nvidia driver.
Edit: I got the source patches. I will be applying them towards 6106, because sometimes 6111 hangs. I will use 6111 for a while to see if it hangs the I will fix 6106.
Walt
P4 2.8Ghz @ 2.8Ghz SL6WT
Zalman CNPS7000-Cu
865PE Neo-2 LS BIOs 2.4
512mb Mushkin Level II
160GB Maxtor HD
Geforce 4 440MX
Antec 3700 1 exhaust and 1 intake fans
Linux 2.6.x
Linux user 314187
ArchLinux
Offline
thanks for adding these drivers to Testing.
Offline
Pages: 1
Topic closed