Gentoo Archives: gentoo-commits

From: "Mike Frysinger (vapier)" <vapier@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] gentoo-x86 commit in x11-drivers/nvidia-drivers/files: nvidia-2.6.28.patch
Date: Thu, 25 Dec 2008 10:16:48
Message-Id: E1LFnGp-0005xH-2w@stork.gentoo.org
1 vapier 08/12/25 10:16:47
2
3 Added: nvidia-2.6.28.patch
4 Log:
5 Add patch from upstream for linux 2.6.28 support.
6 (Portage version: 2.2_rc17/cvs/Linux 2.6.27.8 x86_64)
7
8 Revision Changes Path
9 1.1 x11-drivers/nvidia-drivers/files/nvidia-2.6.28.patch
10
11 file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/x11-drivers/nvidia-drivers/files/nvidia-2.6.28.patch?rev=1.1&view=markup
12 plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/x11-drivers/nvidia-drivers/files/nvidia-2.6.28.patch?rev=1.1&content-type=text/plain
13
14 Index: nvidia-2.6.28.patch
15 ===================================================================
16 http://www.nvnews.net/vbulletin/showthread.php?t=121790&page=2#post1823327
17 http://www.nvnews.net/vbulletin/showthread.php?t=121790&page=3#post1843626
18
19 --- usr/src/nv/Makefile.kbuild
20 +++ usr/src/nv.2990799/Makefile.kbuild
21 @@ -185,14 +185,16 @@
22 acquire_console_sem \
23 kmem_cache_create \
24 on_each_cpu \
25 - smp_call_function
26 + smp_call_function \
27 + acpi_evaluate_integer
28 else
29 COMPILE_TESTS = \
30 remap_page_range \
31 vmap \
32 change_page_attr \
33 i2c_adapter \
34 - smp_call_function
35 + smp_call_function \
36 + acpi_evaluate_integer
37 endif
38
39 #
40 --- usr/src/nv/Makefile.nvidia
41 +++ usr/src/nv.2990799/Makefile.nvidia
42 @@ -59,7 +59,8 @@
43 vmap \
44 change_page_attr \
45 i2c_adapter \
46 - smp_call_function
47 + smp_call_function \
48 + acpi_evaluate_integer
49
50 DEFINES+=$(EXTRA_DEFINES)
51
52 --- usr/src/nv/conftest.sh
53 +++ usr/src/nv.2990799/conftest.sh
54 @@ -67,6 +67,8 @@
55 }
56
57 build_cflags() {
58 + ARCH=`uname -m | sed -e 's/i.86/i386/'`
59 +
60 BASE_CFLAGS="-D__KERNEL__ \
61 -DKBUILD_BASENAME=\"#conftest$$\" -DKBUILD_MODNAME=\"#conftest$$\" \
62 -nostdinc -isystem $ISYSTEM"
63 @@ -80,16 +82,20 @@
64 test_xen
65
66 if [ "$OUTPUT" != "$SOURCES" ]; then
67 - ARCH=`uname -m | sed -e 's/i.86/i386/'`
68 MACH_CFLAGS="-I$HEADERS/asm-$ARCH/mach-default"
69 if [ "$ARCH" = "i386" -o "$ARCH" = "x86_64" ]; then
70 MACH_CFLAGS="$MACH_CFLAGS -I$HEADERS/asm-x86/mach-default"
71 + MACH_CFLAGS="$MACH_CFLAGS -I$SOURCES/arch/x86/include/asm/mach-default"
72 fi
73 if [ "$XEN_PRESENT" != "0" ]; then
74 MACH_CFLAGS="-I$HEADERS/asm-$ARCH/mach-xen $MACH_CFLAGS"
75 fi
76 else
77 MACH_CFLAGS="-I$HEADERS/asm/mach-default"
78 + if [ "$ARCH" = "i386" -o "$ARCH" = "x86_64" ]; then
79 + MACH_CFLAGS="$MACH_CFLAGS -I$HEADERS/asm-x86/mach-default"
80 + MACH_CFLAGS="$MACH_CFLAGS -I$SOURCES/arch/x86/include/asm/mach-default"
81 + fi
82 if [ "$XEN_PRESENT" != "0" ]; then
83 MACH_CFLAGS="-I$HEADERS/asm/mach-xen $MACH_CFLAGS"
84 fi
85 @@ -97,6 +103,9 @@
86
87 CFLAGS="$BASE_CFLAGS $MACH_CFLAGS $OUTPUT_CFLAGS -I$HEADERS"
88
89 + if [ "$ARCH" = "i386" -o "$ARCH" = "x86_64" ]; then
90 + CFLAGS="$CFLAGS -I$SOURCES/arch/x86/include"
91 + fi
92 if [ -n "$BUILD_PARAMS" ]; then
93 CFLAGS="$CFLAGS -D$BUILD_PARAMS"
94 fi
95 @@ -858,7 +867,7 @@
96
97 if [ -f conftest$$.o ]; then
98 rm -f conftest$$.o
99 - echo "#undef NV_ON_EACH_CPU" >> conftest.h
100 + echo "#undef NV_ON_EACH_CPU_PRESENT" >> conftest.h
101 return
102 fi
103
104 @@ -897,6 +906,57 @@
105 fi
106 ;;
107
108 + acpi_evaluate_integer)
109 + #
110 + # Determine if the acpi_evaluate_integer() function is
111 + # present and the type of its 'data' argument.
112 + #
113 +
114 + echo "$CONFTEST_PREAMBLE
115 + #include <acpi/acpi_bus.h>
116 + acpi_status acpi_evaluate_integer(acpi_handle h, acpi_string s,
117 + struct acpi_object_list *l, unsigned long long *d) {
118 + return AE_OK;
119 + }" > conftest$$.c
120 +
121 + $CC $CFLAGS -c conftest$$.c > /dev/null 2>&1
122 + rm -f conftest$$.c
123 +
124 + if [ -f conftest$$.o ]; then
125 + rm -f conftest$$.o
126 + echo "#define NV_ACPI_EVALUATE_INTEGER_PRESENT" >> conftest.h
127 + echo "typedef unsigned long long nv_acpi_integer_t;" >> conftest.h
128 + return
129 + fi
130 +
131 + echo "$CONFTEST_PREAMBLE
132 + #include <acpi/acpi_bus.h>
133 + acpi_status acpi_evaluate_integer(acpi_handle h, acpi_string s,
134 + struct acpi_object_list *l, unsigned long *d) {
135 + return AE_OK;
136 + }" > conftest$$.c
137 +
138 + $CC $CFLAGS -c conftest$$.c > /dev/null 2>&1
139 + rm -f conftest$$.c
140 +
141 + if [ -f conftest$$.o ]; then
142 + rm -f conftest$$.o
143 + echo "#define NV_ACPI_EVALUATE_INTEGER_PRESENT" >> conftest.h
144 + echo "typedef unsigned long nv_acpi_integer_t;" >> conftest.h
145 + return
146 + else
147 + #
148 + # We can't report a compile test failure here because
149 + # this is a catch-all for both kernels that don't
150 + # have acpi_evaluate_integer() and kernels that have
151 + # broken header files that make it impossible to
152 + # tell if the function is present.
153 + #
154 + echo "#undef NV_ACPI_EVALUATE_INTEGER_PRESENT" >> conftest.h
155 + echo "typedef unsigned long nv_acpi_integer_t;" >> conftest.h
156 + fi
157 + ;;
158 +
159 esac
160 }
161
162 --- usr/src/nv/nvacpi.c
163 +++ usr/src/nv.2990799/nvacpi.c
164 @@ -136,7 +136,7 @@
165 struct acpi_object_list control_argument_list = { 0, NULL };
166 nv_stack_t *sp = NULL;
167 struct list_head *node, *next;
168 - unsigned long device_id = 0;
169 + nv_acpi_integer_t device_id = 0;
170 int device_counter = 0;
171
172 NV_KMEM_CACHE_ALLOC_STACK(sp);
173 @@ -158,11 +158,9 @@
174
175 os_mem_set((void *)pNvAcpiObject, 0, sizeof(nv_acpi_t));
176
177 - // assign driver data structure ptr to this device
178 - acpi_driver_data(device) = pNvAcpiObject;
179 -
180 - // store a device reference in our object
181 + device->driver_data = pNvAcpiObject;
182 pNvAcpiObject->device = device;
183 +
184 pNvAcpiObject->sp = sp;
185
186 // grab handles to all the important nodes representing devices
187 @@ -306,7 +304,7 @@
188 */
189 nv_acpi_t *pNvAcpiObject = data;
190 u32 event_val = 0;
191 - unsigned long state;
192 + nv_acpi_integer_t state;
193 int status = 0;
194 int device_counter = 0;