aboutsummaryrefslogtreecommitdiff
path: root/x11/nvidia-driver
diff options
context:
space:
mode:
authorSergey A. Osokin <osa@FreeBSD.org>2003-07-04 14:35:20 +0000
committerSergey A. Osokin <osa@FreeBSD.org>2003-07-04 14:35:20 +0000
commit241f33e7b86df63a70675007a871b195472272ce (patch)
tree04ca07cb5eacad74acf4a5cef26124a79dfdcd29 /x11/nvidia-driver
parent411f505bba552545a0fc6bb05b9081e6c27980d6 (diff)
downloadports-241f33e7b86df63a70675007a871b195472272ce.tar.gz
ports-241f33e7b86df63a70675007a871b195472272ce.zip
Notes
Diffstat (limited to 'x11/nvidia-driver')
-rw-r--r--x11/nvidia-driver/Makefile63
-rw-r--r--x11/nvidia-driver/distinfo2
-rw-r--r--x11/nvidia-driver/files/patch-nv-freebsd.h43
-rw-r--r--x11/nvidia-driver/files/patch-nvidia_ctl.c30
-rw-r--r--x11/nvidia-driver/files/patch-nvidia_dev.c66
-rw-r--r--x11/nvidia-driver/files/patch-nvidia_subr.c157
-rw-r--r--x11/nvidia-driver/pkg-descr8
-rw-r--r--x11/nvidia-driver/pkg-message12
-rw-r--r--x11/nvidia-driver/pkg-plist8
9 files changed, 53 insertions, 336 deletions
diff --git a/x11/nvidia-driver/Makefile b/x11/nvidia-driver/Makefile
index e16e01a2d60b..d5a13b42dd52 100644
--- a/x11/nvidia-driver/Makefile
+++ b/x11/nvidia-driver/Makefile
@@ -1,35 +1,43 @@
-# New ports collection makefile for: nvidia-driver
-# Date created: 4 December 2002
-# Whom: Stijn Hoop <stijn@win.tue.nl>
+# New ports collection makefile for: nvidia-driver
+# Date created: 4 December 2002
+# Whom: Stijn Hoop <stijn@win.tue.nl>
#
# $FreeBSD$
#
PORTNAME= nvidia-driver
-PORTVERSION= 1.0.3203
-PORTREVISION= 1
+PORTVERSION= 1.0.4365
+PORTREVISION?= 0
CATEGORIES= x11
-MASTER_SITES= http://download.nvidia.com/freebsd/1.0-3203/
-DISTNAME= NVIDIA_FreeBSD-${PORTVERSION:S/0./0-/}
+MASTER_SITES= http://download.nvidia.com/freebsd/1.0-4365/ \
+ ftp://download.nvidia.com/freebsd/1.0-4365/ \
+ http://download1.nvidia.com/freebsd/1.0-4365/ \
+ ftp://download1.nvidia.com/freebsd/1.0-4365/
+DISTNAME= NVIDIA-FreeBSD-x86-${PORTVERSION:S/0./0-/}
-MAINTAINER= ports@freebsd.org
+MAINTAINER= danfe@regency.nsu.ru
COMMENT= NVidia graphics card binary drivers for hardware OpenGL rendering
USE_X_PREFIX= yes
NO_PACKAGE= should be recompiled for a particular FreeBSD kernel
-# XXX Should use ${PKG_INFO} and ${GREP}
-XSERVVERSION!= /usr/sbin/pkg_info -O x11-servers/XFree86-4-Server 2>/dev/null | grep Server- || true
-XLIBVERSION!= /usr/sbin/pkg_info -O x11/XFree86-4-libraries 2>/dev/null | grep libraries- || true
+.include <bsd.port.pre.mk>
+
+# XXX Should use ${PKG_INFO} XXX
+#
+XSERVVERSION!= /usr/sbin/pkg_info -O x11-servers/XFree86-4-Server 2>/dev/null | ${GREP} Server- || true
+XLIBVERSION!= /usr/sbin/pkg_info -O x11/XFree86-4-libraries 2>/dev/null | ${GREP} libraries- || true
PLIST_SUB= XSERVVERSION=${XSERVVERSION} XLIBVERSION=${XLIBVERSION} \
- LINUXBASE=${LINUXBASE}
+ LINUXBASE=${LINUXBASE} NVVERSION=4365
.if !defined(WITHOUT_LINUX)
USE_LINUX= yes
.endif
-.include <bsd.port.pre.mk>
+.if ${OSVERSION} < 470000
+IGNORE= "requires FreeBSD -STABLE, version 4.7-RELEASE or later"
+.endif
.if ${OSVERSION} < 500000
PLIST_SUB+= FREEBSD5="@comment " FREEBSD4=""
@@ -37,27 +45,38 @@ PLIST_SUB+= FREEBSD5="@comment " FREEBSD4=""
PLIST_SUB+= FREEBSD5="" FREEBSD4="@comment "
.endif
-.if ${OSVERSION} > 500000 && ${OSVERSION} < 500105
-IGNORE= "You need a more recent version of -CURRENT for this driver"
+pre-everything::
+.if !defined(WITH_FREEBSD_AGP)
+ @${ECHO_MSG} "Define WITH_FREEBSD_AGP to use FreeBSD AGP GART driver"
+.endif
+.if !defined(FORCE_AGP_RATE)
+ @${ECHO_MSG} "Define FORCE_AGP_RATE to limit the driver to lower speeds"
+.endif
+.if !defined(WITH_NVIDIA_HACKS)
+ @${ECHO_MSG} "Define WITH_NVIDIA_HACKS to enable work-arounds to override basic AGP setup"
.endif
-.if defined(WITH_FREEBSD_AGP) || defined(FORCE_AGP_RATE)
+.if defined(WITH_FREEBSD_AGP) || defined(FORCE_AGP_RATE) || defined(WITH_NVIDIA_HACKS)
USE_REINPLACE= yes
post-patch:
-.if defined(WITH_FREEBSD_AGP)
+. if defined(WITH_FREEBSD_AGP)
@${REINPLACE_CMD} "s/undef USE_OS_AGP_GART/define USE_OS_AGP_GART/" \
${WRKSRC}/src/nv-freebsd.h
-.endif
-.if defined(FORCE_AGP_RATE)
- @${REINPLACE_CMD} "s/4, 0/4, 1/" ${WRKSRC}/src/nvidia_os_registry.c
-.endif
+. endif
+. if defined(FORCE_AGP_RATE)
+ @${REINPLACE_CMD} 's/NVreg_ReqAGPRate,[[:blank:]]*0/NVreg_ReqAGPRate, 1/' ${WRKSRC}/src/nvidia_os_registry.c
+. endif
+. if defined(WITH_NVIDIA_HACKS)
+ @${REINPLACE_CMD} 's/NVreg_UpdateKernelAGP,[[:blank:]]*1/NVreg_UpdateKernelAGP, 0/' ${WRKSRC}/src/nvidia_os_registry.c
+. endif
.endif
-.if defined(WITHOUT_LINUX)
pre-install:
+.if defined(WITHOUT_LINUX)
@${MKDIR} ${LINUXBASE}/usr/lib
.endif
+ @(kldstat -n linux || kldload linux)
post-install:
.if ${OSVERSION} < 500000
diff --git a/x11/nvidia-driver/distinfo b/x11/nvidia-driver/distinfo
index ee5766d7e5d2..582cab2c91cb 100644
--- a/x11/nvidia-driver/distinfo
+++ b/x11/nvidia-driver/distinfo
@@ -1 +1 @@
-MD5 (NVIDIA_FreeBSD-1.0-3203.tar.gz) = b982db9e898a0f3a46c2bf9d15c320d2
+MD5 (NVIDIA-FreeBSD-x86-1.0-4365.tar.gz) = e14d9f2668746ee4d8b47e1c9dbc78af
diff --git a/x11/nvidia-driver/files/patch-nv-freebsd.h b/x11/nvidia-driver/files/patch-nv-freebsd.h
deleted file mode 100644
index a5690cc5756a..000000000000
--- a/x11/nvidia-driver/files/patch-nv-freebsd.h
+++ /dev/null
@@ -1,43 +0,0 @@
---- src/nv-freebsd.h.orig Wed Oct 30 15:30:58 2002
-+++ src/nv-freebsd.h Thu Mar 6 01:27:10 2003
-@@ -27,12 +27,6 @@
- * active development and also unsupported.
- */
-
--#if __FreeBSD_version >= 500000
--#error This driver does not support FreeBSD 5.0/-CURRENT!
--#elif __FreeBSD_version < 470000
--#error This driver requires FreeBSD 4.7 or later!
--#endif
--
- #include <sys/systm.h>
- #include <sys/types.h>
- #include <sys/queue.h>
-@@ -86,6 +80,7 @@
-
- #if __FreeBSD_version >= 500000
- #include <sys/mutex.h>
-+#include <sys/filedesc.h>
- #include <dev/pci/pcireg.h>
- #include <dev/pci/pcivar.h>
-
-@@ -115,6 +110,9 @@
- #define __TD_FDT(td) ((td)->p_fd)
- #define __TD_FDT_CNT(td) ((td)->p_fd->fd_refcnt)
-
-+#define vm_page_lock_queues()
-+#define vm_page_unlock_queues()
-+
- #endif
-
- /*
-@@ -306,7 +304,8 @@
- int nvidia_open_dev (struct nvidia_softc *);
- int nvidia_close_ctl (dev_t, d_thread_t *);
- int nvidia_close_dev (struct nvidia_softc *, dev_t, d_thread_t *);
--int nvidia_mmap_dev (struct nvidia_softc *, vm_offset_t);
-+int nvidia_mmap_dev (struct nvidia_softc *, vm_offset_t,
-+ vm_offset_t *);
-
- #endif /* __NV_FREEBSD_H__ */
-
diff --git a/x11/nvidia-driver/files/patch-nvidia_ctl.c b/x11/nvidia-driver/files/patch-nvidia_ctl.c
deleted file mode 100644
index 6514b873d19b..000000000000
--- a/x11/nvidia-driver/files/patch-nvidia_ctl.c
+++ /dev/null
@@ -1,30 +0,0 @@
---- src/nvidia_ctl.c.orig Wed Oct 30 15:30:58 2002
-+++ src/nvidia_ctl.c Thu Mar 6 01:07:57 2003
-@@ -19,6 +19,7 @@
- static d_poll_t nvidia_ctl_poll;
-
- static struct cdevsw nvidia_ctl_cdevsw = {
-+#if __FreeBSD_version < 500000
- /* open */ nvidia_ctl_open,
- /* close */ nvidia_ctl_close,
- /* read */ noread,
-@@ -32,10 +33,17 @@
- /* dump */ nodump,
- /* psize */ nopsize,
- /* flags */ D_TRACKCLOSE,
--#if __FreeBSD_version < 500000
- /* bmaj */ -1,
--#endif
- /* kqfilter */ NULL,
-+#else
-+ .d_open = nvidia_ctl_open,
-+ .d_close = nvidia_ctl_close,
-+ .d_ioctl = nvidia_ctl_ioctl,
-+ .d_poll = nvidia_ctl_poll,
-+ .d_name = "nvidiactl",
-+ .d_maj = CDEV_MAJOR,
-+ .d_flags = D_TRACKCLOSE
-+#endif
- };
-
- static dev_t nvidia_ctl_cdev;
diff --git a/x11/nvidia-driver/files/patch-nvidia_dev.c b/x11/nvidia-driver/files/patch-nvidia_dev.c
deleted file mode 100644
index d53e31741c73..000000000000
--- a/x11/nvidia-driver/files/patch-nvidia_dev.c
+++ /dev/null
@@ -1,66 +0,0 @@
---- src/nvidia_dev.c.orig Wed Oct 30 15:30:58 2002
-+++ src/nvidia_dev.c Thu Mar 6 01:09:05 2003
-@@ -20,6 +20,7 @@
- static d_mmap_t nvidia_dev_mmap;
-
- static struct cdevsw nvidia_dev_cdevsw = {
-+#if __FreeBSD_version < 500000
- /* open */ nvidia_dev_open,
- /* close */ nvidia_dev_close,
- /* read */ noread,
-@@ -33,10 +34,18 @@
- /* dump */ nodump,
- /* psize */ nopsize,
- /* flags */ D_MEM|D_TRACKCLOSE,
--#if __FreeBSD_version < 500000
- /* bmaj */ -1,
--#endif
- /* kqfilter */ NULL,
-+#else
-+ .d_open = nvidia_dev_open,
-+ .d_close = nvidia_dev_close,
-+ .d_ioctl = nvidia_dev_ioctl,
-+ .d_poll = nvidia_dev_poll,
-+ .d_mmap = nvidia_dev_mmap,
-+ .d_name = "nvidia",
-+ .d_maj = CDEV_MAJOR,
-+ .d_flags = D_MEM|D_TRACKCLOSE
-+#endif
- };
-
- int nvidia_dev_open(
-@@ -135,11 +144,15 @@
- int nvidia_dev_mmap(
- dev_t dev,
- vm_offset_t offset,
-+#if __FreeBSD_version >= 500000
-+ vm_offset_t *paddr,
-+#endif
- int nprot
- )
- {
- nv_state_t *nv;
- struct nvidia_softc *sc;
-+ vm_offset_t phys;
-
- int status;
- int unit = minor(dev);
-@@ -148,10 +161,17 @@
- nv = sc->nv_state;
-
- nv_lock_api(nv);
-- status = nvidia_mmap_dev(sc, offset);
-+ status = nvidia_mmap_dev(sc, offset, &phys);
- nv_unlock_api(nv);
-
-+#if __FreeBSD_version >= 500000
-+ *paddr = phys;
- return status;
-+#else
-+ if (status == -1)
-+ return -1;
-+ return atop(phys);
-+#endif
- }
-
- int nvidia_dev_attach (struct nvidia_softc *sc)
diff --git a/x11/nvidia-driver/files/patch-nvidia_subr.c b/x11/nvidia-driver/files/patch-nvidia_subr.c
deleted file mode 100644
index 4a4b40234a82..000000000000
--- a/x11/nvidia-driver/files/patch-nvidia_subr.c
+++ /dev/null
@@ -1,157 +0,0 @@
---- src/nvidia_subr.c.orig Wed Oct 30 15:30:58 2002
-+++ src/nvidia_subr.c Fri Mar 14 20:47:44 2003
-@@ -130,7 +130,7 @@
- sc = device_get_softc(dev);
- sc->dev = dev;
-
-- sc->nv_state = malloc(sizeof(nv_state_t), M_DEVBUF, M_ZERO);
-+ sc->nv_state = malloc(sizeof(nv_state_t), M_DEVBUF, M_WAITOK | M_ZERO);
- if (sc->nv_state == NULL) {
- error = ENOMEM;
- goto fail;
-@@ -901,12 +901,12 @@
- void *vm;
- u_int32_t i, size = count * PAGE_SIZE;
-
-- at = malloc(sizeof(nv_alloc_t), M_NVIDIA, M_ZERO);
-+ at = malloc(sizeof(nv_alloc_t), M_NVIDIA, M_WAITOK | M_ZERO);
- if (!at) {
- return -ENOMEM;
- }
-
-- vm = malloc(size, M_NVIDIA, M_ZERO);
-+ vm = malloc(size, M_NVIDIA, M_WAITOK | M_ZERO);
- if (!vm) {
- /*
- * This error condition is not unlikely to occur. We allocate our
-@@ -925,7 +925,9 @@
- * prevent random crashes.
- */
- pa = vtophys((vm_offset_t) vm + (i * PAGE_SIZE));
-+ vm_page_lock_queues();
- vm_page_wire(PHYS_TO_VM_PAGE(pa));
-+ vm_page_unlock_queues();
- }
-
- at->object = 0;
-@@ -963,6 +965,7 @@
- count = at->size / PAGE_SIZE;
- SLIST_REMOVE(&sc->alloc_list, at, nv_alloc, list);
-
-+ vm_page_lock_queues();
- for (i = 0; i < count; i++) {
- /*
- * Release "one wiring" of this page; this may reenable paging as
-@@ -971,6 +974,7 @@
- pa = vtophys(at->address + (i * PAGE_SIZE));
- vm_page_unwire(PHYS_TO_VM_PAGE(pa), 0);
- }
-+ vm_page_unlock_queues();
-
- free(at, M_NVIDIA);
- free(address, M_NVIDIA);
-@@ -993,7 +997,7 @@
- vm_page_t m;
- vm_object_t object;
-
-- at = malloc(sizeof(nv_alloc_t), M_NVIDIA, M_ZERO);
-+ at = malloc(sizeof(nv_alloc_t), M_NVIDIA, M_WAITOK | M_ZERO);
- if (!at) {
- return -ENOMEM;
- }
-@@ -1007,13 +1011,19 @@
- * will be allocated.
- */
-
-+#if __FreeBSD_version < 500000
- m = vm_page_grab(object, i, VM_ALLOC_NORMAL);
-+#else
-+ m = vm_page_grab(object, i, VM_ALLOC_NORMAL | VM_ALLOC_WIRED);
-+#endif
- if (!m) {
-+ vm_page_lock_queues();
- for (i -= 1; i >= 0; i--) {
- m = vm_page_lookup(object, i);
- vm_page_wakeup(m);
- vm_page_unwire(m, 0);
- }
-+ vm_page_unlock_queues();
- return -ENOMEM;
- }
-
-@@ -1022,7 +1032,9 @@
- * paging it out while we're still using it. This is necessary to
- * prevent random crashes.
- */
-+#if __FreeBSD_version < 500000
- vm_page_wire(m);
-+#endif
- vm_page_wakeup(m);
- }
-
-@@ -1061,6 +1073,7 @@
- count = at->size / PAGE_SIZE;
- SLIST_REMOVE(&sc->alloc_list, at, nv_alloc, list);
-
-+ vm_page_lock_queues();
- for (i = 0; i < count; i++) {
- /*
- * Release "one wiring" of this page; this may reenable paging as
-@@ -1069,6 +1082,7 @@
- m = vm_page_lookup(at->object, i);
- vm_page_unwire(m, 0);
- }
-+ vm_page_unlock_queues();
-
- free(at, M_NVIDIA);
- vm_object_deallocate(at->object);
-@@ -1401,7 +1415,8 @@
-
- int nvidia_mmap_dev(
- struct nvidia_softc *sc,
-- vm_offset_t offset
-+ vm_offset_t offset,
-+ vm_offset_t *paddr
- )
- {
- nv_alloc_t *at;
-@@ -1412,14 +1427,20 @@
- * are physical addresses and mapped into user-space directly. We can
- * only do some basic sanity checking here.
- */
-- if (IS_FB_OFFSET(nv, offset, PAGE_SIZE))
-- return atop(offset);
-+ if (IS_FB_OFFSET(nv, offset, PAGE_SIZE)) {
-+ *paddr = offset;
-+ return 0;
-+ }
-
-- if (IS_REG_OFFSET(nv, offset, PAGE_SIZE))
-- return atop(offset);
-+ if (IS_REG_OFFSET(nv, offset, PAGE_SIZE)) {
-+ *paddr = offset;
-+ return 0;
-+ }
-
-- if (IS_AGP_OFFSET(nv, offset, PAGE_SIZE))
-- return atop(offset);
-+ if (IS_AGP_OFFSET(nv, offset, PAGE_SIZE)) {
-+ *paddr = offset;
-+ return 0;
-+ }
-
- /*
- * If the offset does not fall into any of the relevant apertures, we
-@@ -1430,8 +1451,10 @@
- */
- SLIST_FOREACH(at, &sc->alloc_list, list) {
- if (offset >= at->address &&
-- offset < at->address + at->size)
-- return atop(vtophys(offset));
-+ offset < at->address + at->size) {
-+ *paddr = vtophys(offset);
-+ return 0;
-+ }
- }
-
- return -1;
diff --git a/x11/nvidia-driver/pkg-descr b/x11/nvidia-driver/pkg-descr
index 630d2c785463..a5a74d1ab98f 100644
--- a/x11/nvidia-driver/pkg-descr
+++ b/x11/nvidia-driver/pkg-descr
@@ -1,6 +1,4 @@
-These are the NVidia binary drivers for hardware OpenGL rendering in X, using
-the GLX/DRI extensions.
+These are the official NVidia binary drivers for hardware OpenGL rendering
+in X, using the GLX extensions.
-***WARNING***: THESE ARE BETA QUALITY DRIVERS AND MAY RENDER YOUR SYSTEM
- UNSTABLE, UNUSABLE OR PRONE TO LOCKUP! INSTALL AT YOUR
- OWN RISK!
+WWW: http://www.nvidia.com/
diff --git a/x11/nvidia-driver/pkg-message b/x11/nvidia-driver/pkg-message
index 0121a5ff62f6..dafe93281811 100644
--- a/x11/nvidia-driver/pkg-message
+++ b/x11/nvidia-driver/pkg-message
@@ -1,20 +1,16 @@
-
-***WARNING***: THESE ARE BETA QUALITY DRIVERS AND MAY RENDER YOUR SYSTEM
- UNSTABLE, UNUSABLE OR PRONE TO LOCKUP! INSTALL AT YOUR
- OWN RISK!
-
To use these drivers, make sure that you have loaded the nvidia kernel
module, by doing
-# kldload nvidia
+ # kldload nvidia
If you compile this package with WITH_FREEBSD_AGP=yes, you must load
the agp.ko kernel module *at boot time* by putting the following
line into your /boot/loader.conf:
-agp_load="YES"
+ agp_load="YES"
+
+or have your kernel compiled with "device agp".
Otherwise the nvidia kernel module will not load.
See ${PREFIX}/share/doc/NVIDIA/README for more information.
-
diff --git a/x11/nvidia-driver/pkg-plist b/x11/nvidia-driver/pkg-plist
index fb66404764a1..3925c718afc2 100644
--- a/x11/nvidia-driver/pkg-plist
+++ b/x11/nvidia-driver/pkg-plist
@@ -48,7 +48,7 @@ nvidia.ko
%%FREEBSD4%%@unexec rm -f /dev/nvidia3
%%FREEBSD4%%@unexec rm -f /dev/nvidiactl
@cwd %%LINUXBASE%%
-usr/lib/libGL.so.1.0.3203
-usr/lib/libGLcore.so.1.0.3203
-@exec ln -sf %D/usr/lib/libGL.so.1.0.3203 %D/usr/lib/libGL.so.1
-@exec ln -sf %D/usr/lib/libGLcore.so.1.0.3203 %D/usr/lib/libGLcore.so.1
+usr/lib/libGL.so.1.0.%%NVVERSION%%
+usr/lib/libGLcore.so.1.0.%%NVVERSION%%
+@exec ln -sf %D/usr/lib/libGL.so.1.0.%%NVVERSION%% %D/usr/lib/libGL.so.1
+@exec ln -sf %D/usr/lib/libGLcore.so.1.0.%%NVVERSION%% %D/usr/lib/libGLcore.so.1