View | Details | Raw Unified | Return to bug 202228 | Differences between
and this patch

Collapse All | Expand All

(-)b/nvidia-driver/Makefile (-20 / +31 lines)
Lines 71-80 Link Here
71
EXTRA_PATCHES=	${FILESDIR}/extra-patch-mk-nvidia.lib.mk
71
EXTRA_PATCHES=	${FILESDIR}/extra-patch-mk-nvidia.lib.mk
72
.endif
72
.endif
73
73
74
.if ${NVVERSION} >= 304.088
74
.if ${NVVERSION} >= 304.088 && ${NVVERSION} < 355.006
75
NVSRC=""
75
EXTRA_PATCHES+=	${FILESDIR}/extra-patch-src-Makefile \
76
EXTRA_PATCHES+=	${FILESDIR}/extra-patch-src-Makefile \
76
		${FILESDIR}/extra-patch-src-nv-freebsd.h \
77
		${FILESDIR}/extra-patch-src-nv-freebsd.h \
77
		${FILESDIR}/extra-patch-src-nv-misc.h
78
		${FILESDIR}/extra-patch-src-nv-misc.h
79
.else
80
NVSRC=nvidia
81
EXTRA_PATCHES+=	${FILESDIR}/extra-patch-src-nvidia-Makefile \
82
		${FILESDIR}/extra-patch-src-nvidia-nv-freebsd.h \
83
		${FILESDIR}/extra-patch-src-nvidia-nv-misc.h
78
.endif
84
.endif
79
85
80
.if ${NVVERSION} >= 304.125 # 331.020
86
.if ${NVVERSION} >= 304.125 # 331.020
Lines 134-146 Link Here
134
140
135
post-patch: .SILENT
141
post-patch: .SILENT
136
# We should support -CURRENT: kill the check
142
# We should support -CURRENT: kill the check
137
	${REINPLACE_CMD} -e '24,26d' ${WRKSRC}/src/nv-freebsd.h
143
	${REINPLACE_CMD} -e '24,26d' ${WRKSRC}/src/${NVSRC}/nv-freebsd.h
138
# Adjust legacy drivers for updated d_mmap() since FreeBSD src SVN r201223
144
# Adjust legacy drivers for updated d_mmap() since FreeBSD src SVN r201223
139
.if ${NVVERSION} < 195.022
145
.if ${NVVERSION} < 195.022
140
	${REINPLACE_CMD} -e 's/vm_offset_t offset/vm_ooffset_t offset/ ; \
146
	${REINPLACE_CMD} -e 's/vm_offset_t offset/vm_ooffset_t offset/ ; \
141
		s/vm_offset_t \*address/vm_paddr_t *address/ ; \
147
		s/vm_offset_t \*address/vm_paddr_t *address/ ; \
142
		s/int nprot/&, vm_memattr_t *memattr/' \
148
		s/int nprot/&, vm_memattr_t *memattr/' \
143
			${WRKSRC}/src/nvidia_dev.c
149
			${WRKSRC}/src/${NVSRC}/nvidia_dev.c
144
.endif
150
.endif
145
# In the legacy drivers: remove page queue locking and add page locking
151
# In the legacy drivers: remove page queue locking and add page locking
146
# around vm_page_(un)wire() after FreeBSD src SVN r207410, r207617, and
152
# around vm_page_(un)wire() after FreeBSD src SVN r207410, r207617, and
Lines 149-223 Link Here
149
.if ${NVVERSION} < 304.064
155
.if ${NVVERSION} < 304.064
150
	${REINPLACE_CMD} -E '/vm_page_(un)?lock_queues\(\);/d ; \
156
	${REINPLACE_CMD} -E '/vm_page_(un)?lock_queues\(\);/d ; \
151
		s/(vm_page_(un)?wire\()([^,]+)(, 0)?(\);)/vm_page_lock(\3); & vm_page_unlock(\3);/' \
157
		s/(vm_page_(un)?wire\()([^,]+)(, 0)?(\);)/vm_page_lock(\3); & vm_page_unlock(\3);/' \
152
			${WRKSRC}/src/nvidia_subr.c
158
			${WRKSRC}/src/${NVSRC}/nvidia_subr.c
153
.endif
159
.endif
154
# Catch up legacy drivers with FreeBSD src SVN r225617
160
# Catch up legacy drivers with FreeBSD src SVN r225617
155
.if ${NVVERSION} < 195.022
161
.if ${NVVERSION} < 195.022
156
	${REINPLACE_CMD} -e '/return/s/ioctl/sys_&/' \
162
	${REINPLACE_CMD} -e '/return/s/ioctl/sys_&/' \
157
		${WRKSRC}/src/nvidia_linux.c
163
		${WRKSRC}/src/${NVSRC}/nvidia_linux.c
158
.endif
164
.endif
159
# Adjust Linux headers #include's after FreeBSD src SVN r246085
165
# Adjust Linux headers #include's after FreeBSD src SVN r246085
160
.if ${OSVERSION} > 1000027 && ${NVVERSION} >= 96.04323
166
.if ${OSVERSION} > 1000027 && ${NVVERSION} >= 96.04323
161
	${REINPLACE_CMD} -E '/#include "machine\/\.\.\/linux(32)?\/linux.h"/ \
167
	${REINPLACE_CMD} -E '/#include "machine\/\.\.\/linux(32)?\/linux.h"/ \
162
		{ x ; s/.*/#include "machine\/..\/..\/compat\/linux\/linux_ioctl.h"/ ; H ; x ; }' \
168
		{ x ; s/.*/#include "machine\/..\/..\/compat\/linux\/linux_ioctl.h"/ ; H ; x ; }' \
163
			${WRKSRC}/src/nvidia_linux.c
169
			${WRKSRC}/src/${NVSRC}/nvidia_linux.c
164
.endif
170
.endif
165
# Adjust vm_object locking after FreeBSD src SVN r248084
171
# Adjust vm_object locking after FreeBSD src SVN r248084
166
.if ${OSVERSION} > 1000029
172
.if ${OSVERSION} > 1000029
167
	${REINPLACE_CMD} -e '/#include <vm\/vm_object.h>/ \
173
	${REINPLACE_CMD} -e '/#include <vm\/vm_object.h>/ \
168
		{ x ; s/.*/#include <sys\/rwlock.h>/ ; G ; }' \
174
		{ x ; s/.*/#include <sys\/rwlock.h>/ ; G ; }' \
169
			${WRKSRC}/src/nv-freebsd.h
175
			${WRKSRC}/src/${NVSRC}/nv-freebsd.h
170
	${REINPLACE_CMD} -E 's/(VM_OBJECT_)(UN)?(LOCK)/\1W\2\3/' \
176
	${REINPLACE_CMD} -E 's/(VM_OBJECT_)(UN)?(LOCK)/\1W\2\3/' \
171
		${WRKSRC}/src/nvidia_subr.c
177
		${WRKSRC}/src/${NVSRC}/nvidia_subr.c
172
.endif
178
.endif
173
# Adjust kmem(9) calls after FreeBSD src SVN r254025
179
# Adjust kmem(9) calls after FreeBSD src SVN r254025
174
.if ${OSVERSION} > 1000040 && ${NVVERSION} < 331.067
180
.if ${OSVERSION} > 1000040 && ${NVVERSION} < 331.067
175
	${REINPLACE_CMD} -e '/kmem_/s/kernel_map/kernel_arena/' \
181
	${REINPLACE_CMD} -e '/kmem_/s/kernel_map/kernel_arena/' \
176
		${WRKSRC}/src/nvidia_subr.c
182
		${WRKSRC}/src/${NVSRC}/nvidia_subr.c
177
.endif
183
.endif
178
# Argument count of vm_map_find() changed in FreeBSD src SVN r255426
184
# Argument count of vm_map_find() changed in FreeBSD src SVN r255426
179
.if ${OSVERSION} > 1000054 && ${NVVERSION} < 304.123 # < 331.067
185
.if ${OSVERSION} > 1000054 && ${NVVERSION} < 304.123 # < 331.067
180
	${REINPLACE_CMD} -e 's/virtual_address, size,/& 0,/' \
186
	${REINPLACE_CMD} -e 's/virtual_address, size,/& 0,/' \
181
		${WRKSRC}/src/nvidia_subr.c
187
		${WRKSRC}/src/${NVSRC}/nvidia_subr.c
182
.endif
188
.endif
183
# Fix CTLFLAG_* values for SYSCTL_ADD_PROC() after FreeBSD src SVN r273377
189
# Fix CTLFLAG_* values for SYSCTL_ADD_PROC() after FreeBSD src SVN r273377
184
.if ${OSVERSION} > 1100039 || ${OSVERSION} > 1001501 && ${OSVERSION} < 1100000
190
.if ${OSVERSION} > 1100039 || ${OSVERSION} > 1001501 && ${OSVERSION} < 1100000
185
	${REINPLACE_CMD} -e '/SYSCTL_ADD_PROC/,/;/ \
191
	${REINPLACE_CMD} -e '/SYSCTL_ADD_PROC/,/;/ \
186
		s/^[[:blank:]]*CTLFLAG_RD/CTLTYPE_STRING |&/' \
192
		s/^[[:blank:]]*CTLFLAG_RD/CTLTYPE_STRING |&/' \
187
			${WRKSRC}/src/nvidia_sysctl.c
193
			${WRKSRC}/src/${NVSRC}/nvidia_sysctl.c
188
.endif
194
.endif
189
# Replace d_thread_t (compat shim to support FreeBSD 4) with `struct thread'
195
# Replace d_thread_t (compat shim to support FreeBSD 4) with `struct thread'
190
	${REINPLACE_CMD} -e 's/d_thread_t/struct thread/' \
196
	${REINPLACE_CMD} -e 's/d_thread_t/struct thread/' \
191
		${WRKSRC}/src/nvidia_ctl.c ${WRKSRC}/src/nvidia_dev.c \
197
		${WRKSRC}/src/${NVSRC}/nvidia_ctl.c ${WRKSRC}/src/${NVSRC}/nvidia_dev.c \
192
		${WRKSRC}/src/nvidia_linux.c
198
		${WRKSRC}/src/${NVSRC}/nvidia_linux.c
193
# Fix stack buffer overflow in nvidia_sysctl_bus_type()
199
# Fix stack buffer overflow in nvidia_sysctl_bus_type()
194
	${REINPLACE_CMD} -e 's/8 bus_type\[4\]/8 bus_type[8]/' \
200
	${REINPLACE_CMD} -e 's/8 bus_type\[4\]/8 bus_type[8]/' \
195
		${WRKSRC}/src/nvidia_sysctl.c
201
		${WRKSRC}/src/${NVSRC}/nvidia_sysctl.c
196
# Unbreak the build of 173.14.xx legacy series on recent -CURRENT
202
# Unbreak the build of 173.14.xx legacy series on recent -CURRENT
197
.if ${NVVERSION} < 195.022 && ${NVVERSION} >= 169.004
203
.if ${NVVERSION} < 195.022 && ${NVVERSION} >= 169.004
198
	${REINPLACE_CMD} -E 's/os_(alloc|free)_contig_pages/NV_API_CALL &/' \
204
	${REINPLACE_CMD} -E 's/os_(alloc|free)_contig_pages/NV_API_CALL &/' \
199
		${WRKSRC}/src/nv-freebsd.h
205
		${WRKSRC}/src/${NVSRC}/nv-freebsd.h
200
.endif
206
.endif
201
# Process OPTIONS
207
# Process OPTIONS
202
.if ${PORT_OPTIONS:MFREEBSD_AGP}
208
.if ${PORT_OPTIONS:MFREEBSD_AGP}
203
	${REINPLACE_CMD} -E 's/undef (NV_SUPPORT_OS_AGP)/define \1/' \
209
	${REINPLACE_CMD} -E 's/undef (NV_SUPPORT_OS_AGP)/define \1/' \
204
		${WRKSRC}/src/nv-freebsd.h
210
		${WRKSRC}/src/${NVSRC}/nv-freebsd.h
205
.endif
211
.endif
206
.if ${PORT_OPTIONS:MACPI_PM}
212
.if ${PORT_OPTIONS:MACPI_PM}
207
	${REINPLACE_CMD} -E 's/undef (NV_SUPPORT_ACPI_PM)/define \1/' \
213
	${REINPLACE_CMD} -E 's/undef (NV_SUPPORT_ACPI_PM)/define \1/' \
208
		${WRKSRC}/src/nv-freebsd.h
214
		${WRKSRC}/src/${NVSRC}/nv-freebsd.h
209
.endif
215
.endif
210
.if ! ${PORT_OPTIONS:MLINUX}
216
.if ! ${PORT_OPTIONS:MLINUX}
211
	${REINPLACE_CMD} -E 's/define (NV_SUPPORT_LINUX_COMPAT)/undef \1/' \
217
	${REINPLACE_CMD} -E 's/define (NV_SUPPORT_LINUX_COMPAT)/undef \1/' \
212
		${WRKSRC}/src/nv-freebsd.h
218
		${WRKSRC}/src/${NVSRC}/nv-freebsd.h
213
.endif
219
.endif
214
.if ${PORT_OPTIONS:MPAE}
220
.if ${PORT_OPTIONS:MPAE}
215
	${REINPLACE_CMD} -E 's/undef (NV_SUPPORT_PAE)/define \1/' \
221
	${REINPLACE_CMD} -E 's/undef (NV_SUPPORT_PAE)/define \1/' \
216
		${WRKSRC}/src/nv-freebsd.h
222
		${WRKSRC}/src/${NVSRC}/nv-freebsd.h
217
.endif
223
.endif
218
.if ${PORT_OPTIONS:MWBINVD}
224
.if ${PORT_OPTIONS:MWBINVD}
219
	${REINPLACE_CMD} -E 's/undef (NV_USE_WBINVD)/define \1/' \
225
	${REINPLACE_CMD} -E 's/undef (NV_USE_WBINVD)/define \1/' \
220
		${WRKSRC}/src/nv-freebsd.h
226
		${WRKSRC}/src/${NVSRC}/nv-freebsd.h
221
.endif
227
.endif
222
	${REINPLACE_CMD} -e 's/exists(\/.*/& \&\& !defined(WITHOUT_LINUX)/' \
228
	${REINPLACE_CMD} -e 's/exists(\/.*/& \&\& !defined(WITHOUT_LINUX)/' \
223
		${WRKSRC}/lib/Makefile
229
		${WRKSRC}/lib/Makefile
Lines 268-273 Link Here
268
		${WRKSRC}/lib/libGL/Makefile ${WRKSRC}/doc/Makefile
274
		${WRKSRC}/lib/libGL/Makefile ${WRKSRC}/doc/Makefile
269
.endif
275
.endif
270
276
277
.if ${NVVERSION} >= 358.009
278
	${REINPLACE_CMD} -e 's/d_thread_t/struct thread/g' \
279
		${WRKSRC}/src/nvidia-modeset/nvidia-modeset-freebsd.c
280
.endif
281
271
pre-install:
282
pre-install:
272
	@${MKDIR} ${STAGEDIR}${PREFIX}/${MODULESDIR}/drivers \
283
	@${MKDIR} ${STAGEDIR}${PREFIX}/${MODULESDIR}/drivers \
273
		${STAGEDIR}${PREFIX}/${MODULESDIR}/extensions
284
		${STAGEDIR}${PREFIX}/${MODULESDIR}/extensions
(-)b/nvidia-driver/distinfo (-14 / +2 lines)
Lines 1-14 Link Here
1
SHA256 (NVIDIA-FreeBSD-x86_64-346.96.tar.gz) = 89daaff29afe92d825ec8c00149a703b4eb234e4f16bbfb98673f077521bcff9
1
SHA256 (NVIDIA-FreeBSD-x86_64-358.09.tar.gz) = d6d92c23a1d15ca275db03a59add2969fa8f1ffcafc3cb0786e7c840fe162bc0
2
SIZE (NVIDIA-FreeBSD-x86_64-346.96.tar.gz) = 58774970
2
SIZE (NVIDIA-FreeBSD-x86_64-358.09.tar.gz) = 55191037
3
SHA256 (NVIDIA-FreeBSD-x86-346.96.tar.gz) = a27d7b79c053702bf6524b2c4725321fa557be18a585735e0b8122d884348c3e
4
SIZE (NVIDIA-FreeBSD-x86-346.96.tar.gz) = 58010757
5
SHA256 (NVIDIA-FreeBSD-x86_64-340.93.tar.gz) = 07208f6a832c2da8748b1c4f8b5ce42a7b617f2ee1ac59155fecaff952c30988
6
SIZE (NVIDIA-FreeBSD-x86_64-340.93.tar.gz) = 60215584
7
SHA256 (NVIDIA-FreeBSD-x86-340.93.tar.gz) = 094dc6df60b8e57cf9b94d982cb29c32d5e0c1d81796dbadb39145e78a3b0086
8
SIZE (NVIDIA-FreeBSD-x86-340.93.tar.gz) = 59385673
9
SHA256 (NVIDIA-FreeBSD-x86_64-304.128.tar.gz) = ee38635fb02eb598dd0cdfdbc9014096774104d75ba42fee7688126e531fed8f
10
SIZE (NVIDIA-FreeBSD-x86_64-304.128.tar.gz) = 35481444
11
SHA256 (NVIDIA-FreeBSD-x86-304.128.tar.gz) = c26d0ce5bda8965b37a8b8f91e8580f98b740e16dd21f3aaf7fb6bc84d3dd363
12
SIZE (NVIDIA-FreeBSD-x86-304.128.tar.gz) = 34479549
13
SHA256 (NVIDIA-FreeBSD-x86-173.14.39.tar.gz) = 63a922ce4c5b676b4cb1ace98094dace4cc5408f2553e183df7b2127777a238b
14
SIZE (NVIDIA-FreeBSD-x86-173.14.39.tar.gz) = 20038266
(-)b/nvidia-driver/files/extra-patch-src-nvidia-Makefile (+18 lines)
Line 0 Link Here
1
--- src/nvidia/Makefile.orig	2014-04-04 23:24:59.000000000 +0200
2
+++ src/nvidia/Makefile	2014-05-06 14:31:07.000000000 +0200
3
@@ -24,6 +24,15 @@
4
 stdarg.h:
5
 	@ln -s machine/stdarg.h stdarg.h
6
 
7
+SRCS+=		opt_global.h
8
+.if ${MACHINE_ARCH} == "i386" && !defined(KERNBUILDDIR)
9
+PAE!=		sed -n '/define NV_SUPPORT_PAE/p' nv-freebsd.h
10
+.if !empty(PAE)
11
+opt_global.h:
12
+		echo "#define PAE 1" > ${.TARGET}
13
+.endif
14
+.endif
15
+
16
 *.c: stdarg.h
17
 
18
 beforeinstall:	${KMOD}.ko
(-)b/nvidia-driver/files/extra-patch-src-nvidia-nv-freebsd.h (+14 lines)
Line 0 Link Here
1
--- src/nvidia/nv-freebsd.h.orig	2014-02-13 05:07:44.000000000 +0100
2
+++ src/nvidia/nv-freebsd.h	2014-05-05 18:38:59.000000000 +0200
3
@@ -143,6 +143,11 @@
4
 #define NV_SUPPORT_ACPI_PM
5
 
6
 /*
7
+ * Enable/Disable support for PAE on i386.
8
+ */
9
+#undef NV_SUPPORT_PAE
10
+
11
+/*
12
  * Enable/Disable heavy-weight cache-flush logic. By default, the driver
13
  * relies on the kernel to perform cache flushes using optimized
14
  * routines.
(-)b/nvidia-driver/files/extra-patch-src-nvidia-nv-misc.h (+11 lines)
Line 0 Link Here
1
--- src/nvidia/nv-misc.h.orig	2014-02-13 05:07:44.000000000 +0100
2
+++ src/nvidia/nv-misc.h	2014-05-05 18:45:44.000000000 +0200
3
@@ -11,6 +11,8 @@
4
 #ifndef _NV_MISC_H_
5
 #define _NV_MISC_H_
6
 
7
+#include "opt_global.h"
8
+
9
 #include "nvtypes.h"
10
 #include "rmretval.h"
11
 

Return to bug 202228