diff options
author | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-07-28 22:30:24 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-07-28 22:30:24 -0400 |
commit | 933a6208d84c92d92f9264a2e28d0fc317d41fd1 (patch) | |
tree | dd774882b46c47bbe7ee44a317ecca34b234993f | |
parent | 715dad5992b1466320c1ac674db46297e57acf21 (diff) | |
parent | f191f144079b0083c6fa7d01a4acbd7263fb5032 (diff) |
Merge branch 'agp-patches' of git://git.kernel.org/pub/scm/linux/kernel/git/airlied/agp-2.6
* 'agp-patches' of git://git.kernel.org/pub/scm/linux/kernel/git/airlied/agp-2.6:
agp: AMD AGP is used on UP1100 & UP1500 alpha boxen
intel_agp: really fix 945/965GME
agp: don't lock pages
AGP: document boot options
Fix "use after free" / "double free" bug in ati_create_gatt_pages / ati_free_gatt_pages
-rw-r--r-- | Documentation/kernel-parameters.txt | 7 | ||||
-rw-r--r-- | drivers/char/agp/Kconfig | 2 | ||||
-rw-r--r-- | drivers/char/agp/ati-agp.c | 9 | ||||
-rw-r--r-- | drivers/char/agp/generic.c | 2 | ||||
-rw-r--r-- | drivers/char/agp/intel-agp.c | 19 | ||||
-rw-r--r-- | drivers/char/agp/sgi-agp.c | 1 |
6 files changed, 22 insertions, 18 deletions
diff --git a/Documentation/kernel-parameters.txt b/Documentation/kernel-parameters.txt index fb80e9ffea68..1156653338fe 100644 --- a/Documentation/kernel-parameters.txt +++ b/Documentation/kernel-parameters.txt | |||
@@ -30,6 +30,7 @@ the beginning of each description states the restrictions within which a | |||
30 | parameter is applicable: | 30 | parameter is applicable: |
31 | 31 | ||
32 | ACPI ACPI support is enabled. | 32 | ACPI ACPI support is enabled. |
33 | AGP AGP (Accelerated Graphics Port) is enabled. | ||
33 | ALSA ALSA sound support is enabled. | 34 | ALSA ALSA sound support is enabled. |
34 | APIC APIC support is enabled. | 35 | APIC APIC support is enabled. |
35 | APM Advanced Power Management support is enabled. | 36 | APM Advanced Power Management support is enabled. |
@@ -227,6 +228,12 @@ and is between 256 and 4096 characters. It is defined in the file | |||
227 | to assume that this machine's pmtimer latches its value | 228 | to assume that this machine's pmtimer latches its value |
228 | and always returns good values. | 229 | and always returns good values. |
229 | 230 | ||
231 | agp= [AGP] | ||
232 | { off | try_unsupported } | ||
233 | off: disable AGP support | ||
234 | try_unsupported: try to drive unsupported chipsets | ||
235 | (may crash computer or cause data corruption) | ||
236 | |||
230 | enable_timer_pin_1 [i386,x86-64] | 237 | enable_timer_pin_1 [i386,x86-64] |
231 | Enable PIN 1 of APIC timer | 238 | Enable PIN 1 of APIC timer |
232 | Can be useful to work around chipset bugs | 239 | Can be useful to work around chipset bugs |
diff --git a/drivers/char/agp/Kconfig b/drivers/char/agp/Kconfig index a9f9c48c2424..713533d8a86e 100644 --- a/drivers/char/agp/Kconfig +++ b/drivers/char/agp/Kconfig | |||
@@ -50,7 +50,7 @@ config AGP_ATI | |||
50 | 50 | ||
51 | config AGP_AMD | 51 | config AGP_AMD |
52 | tristate "AMD Irongate, 761, and 762 chipset support" | 52 | tristate "AMD Irongate, 761, and 762 chipset support" |
53 | depends on AGP && X86_32 | 53 | depends on AGP && (X86_32 || ALPHA) |
54 | help | 54 | help |
55 | This option gives you AGP support for the GLX component of | 55 | This option gives you AGP support for the GLX component of |
56 | X on AMD Irongate, 761, and 762 chipsets. | 56 | X on AMD Irongate, 761, and 762 chipsets. |
diff --git a/drivers/char/agp/ati-agp.c b/drivers/char/agp/ati-agp.c index 780e59e588ad..da7513d7b4e7 100644 --- a/drivers/char/agp/ati-agp.c +++ b/drivers/char/agp/ati-agp.c | |||
@@ -123,21 +123,16 @@ static int ati_create_gatt_pages(int nr_tables) | |||
123 | 123 | ||
124 | for (i = 0; i < nr_tables; i++) { | 124 | for (i = 0; i < nr_tables; i++) { |
125 | entry = kzalloc(sizeof(struct ati_page_map), GFP_KERNEL); | 125 | entry = kzalloc(sizeof(struct ati_page_map), GFP_KERNEL); |
126 | tables[i] = entry; | ||
126 | if (entry == NULL) { | 127 | if (entry == NULL) { |
127 | while (i > 0) { | ||
128 | kfree(tables[i-1]); | ||
129 | i--; | ||
130 | } | ||
131 | kfree(tables); | ||
132 | retval = -ENOMEM; | 128 | retval = -ENOMEM; |
133 | break; | 129 | break; |
134 | } | 130 | } |
135 | tables[i] = entry; | ||
136 | retval = ati_create_page_map(entry); | 131 | retval = ati_create_page_map(entry); |
137 | if (retval != 0) | 132 | if (retval != 0) |
138 | break; | 133 | break; |
139 | } | 134 | } |
140 | ati_generic_private.num_tables = nr_tables; | 135 | ati_generic_private.num_tables = i; |
141 | ati_generic_private.gatt_pages = tables; | 136 | ati_generic_private.gatt_pages = tables; |
142 | 137 | ||
143 | if (retval != 0) | 138 | if (retval != 0) |
diff --git a/drivers/char/agp/generic.c b/drivers/char/agp/generic.c index d535c406b319..3db4f4076ed4 100644 --- a/drivers/char/agp/generic.c +++ b/drivers/char/agp/generic.c | |||
@@ -1170,7 +1170,6 @@ void *agp_generic_alloc_page(struct agp_bridge_data *bridge) | |||
1170 | map_page_into_agp(page); | 1170 | map_page_into_agp(page); |
1171 | 1171 | ||
1172 | get_page(page); | 1172 | get_page(page); |
1173 | SetPageLocked(page); | ||
1174 | atomic_inc(&agp_bridge->current_memory_agp); | 1173 | atomic_inc(&agp_bridge->current_memory_agp); |
1175 | return page_address(page); | 1174 | return page_address(page); |
1176 | } | 1175 | } |
@@ -1187,7 +1186,6 @@ void agp_generic_destroy_page(void *addr) | |||
1187 | page = virt_to_page(addr); | 1186 | page = virt_to_page(addr); |
1188 | unmap_page_from_agp(page); | 1187 | unmap_page_from_agp(page); |
1189 | put_page(page); | 1188 | put_page(page); |
1190 | unlock_page(page); | ||
1191 | free_page((unsigned long)addr); | 1189 | free_page((unsigned long)addr); |
1192 | atomic_dec(&agp_bridge->current_memory_agp); | 1190 | atomic_dec(&agp_bridge->current_memory_agp); |
1193 | } | 1191 | } |
diff --git a/drivers/char/agp/intel-agp.c b/drivers/char/agp/intel-agp.c index a1240603912c..294cdbf4d44d 100644 --- a/drivers/char/agp/intel-agp.c +++ b/drivers/char/agp/intel-agp.c | |||
@@ -20,7 +20,9 @@ | |||
20 | #define PCI_DEVICE_ID_INTEL_82965G_IG 0x29A2 | 20 | #define PCI_DEVICE_ID_INTEL_82965G_IG 0x29A2 |
21 | #define PCI_DEVICE_ID_INTEL_82965GM_HB 0x2A00 | 21 | #define PCI_DEVICE_ID_INTEL_82965GM_HB 0x2A00 |
22 | #define PCI_DEVICE_ID_INTEL_82965GM_IG 0x2A02 | 22 | #define PCI_DEVICE_ID_INTEL_82965GM_IG 0x2A02 |
23 | #define PCI_DEVICE_ID_INTEL_82965GME_HB 0x2A10 | ||
23 | #define PCI_DEVICE_ID_INTEL_82965GME_IG 0x2A12 | 24 | #define PCI_DEVICE_ID_INTEL_82965GME_IG 0x2A12 |
25 | #define PCI_DEVICE_ID_INTEL_82945GME_HB 0x27AC | ||
24 | #define PCI_DEVICE_ID_INTEL_82945GME_IG 0x27AE | 26 | #define PCI_DEVICE_ID_INTEL_82945GME_IG 0x27AE |
25 | #define PCI_DEVICE_ID_INTEL_G33_HB 0x29C0 | 27 | #define PCI_DEVICE_ID_INTEL_G33_HB 0x29C0 |
26 | #define PCI_DEVICE_ID_INTEL_G33_IG 0x29C2 | 28 | #define PCI_DEVICE_ID_INTEL_G33_IG 0x29C2 |
@@ -33,7 +35,8 @@ | |||
33 | agp_bridge->dev->device == PCI_DEVICE_ID_INTEL_82965G_1_HB || \ | 35 | agp_bridge->dev->device == PCI_DEVICE_ID_INTEL_82965G_1_HB || \ |
34 | agp_bridge->dev->device == PCI_DEVICE_ID_INTEL_82965Q_HB || \ | 36 | agp_bridge->dev->device == PCI_DEVICE_ID_INTEL_82965Q_HB || \ |
35 | agp_bridge->dev->device == PCI_DEVICE_ID_INTEL_82965G_HB || \ | 37 | agp_bridge->dev->device == PCI_DEVICE_ID_INTEL_82965G_HB || \ |
36 | agp_bridge->dev->device == PCI_DEVICE_ID_INTEL_82965GM_HB) | 38 | agp_bridge->dev->device == PCI_DEVICE_ID_INTEL_82965GM_HB || \ |
39 | agp_bridge->dev->device == PCI_DEVICE_ID_INTEL_82965GME_HB) | ||
37 | 40 | ||
38 | #define IS_G33 (agp_bridge->dev->device == PCI_DEVICE_ID_INTEL_G33_HB || \ | 41 | #define IS_G33 (agp_bridge->dev->device == PCI_DEVICE_ID_INTEL_G33_HB || \ |
39 | agp_bridge->dev->device == PCI_DEVICE_ID_INTEL_Q35_HB || \ | 42 | agp_bridge->dev->device == PCI_DEVICE_ID_INTEL_Q35_HB || \ |
@@ -213,7 +216,6 @@ static void *i8xx_alloc_pages(void) | |||
213 | } | 216 | } |
214 | global_flush_tlb(); | 217 | global_flush_tlb(); |
215 | get_page(page); | 218 | get_page(page); |
216 | SetPageLocked(page); | ||
217 | atomic_inc(&agp_bridge->current_memory_agp); | 219 | atomic_inc(&agp_bridge->current_memory_agp); |
218 | return page_address(page); | 220 | return page_address(page); |
219 | } | 221 | } |
@@ -229,7 +231,6 @@ static void i8xx_destroy_pages(void *addr) | |||
229 | change_page_attr(page, 4, PAGE_KERNEL); | 231 | change_page_attr(page, 4, PAGE_KERNEL); |
230 | global_flush_tlb(); | 232 | global_flush_tlb(); |
231 | put_page(page); | 233 | put_page(page); |
232 | unlock_page(page); | ||
233 | __free_pages(page, 2); | 234 | __free_pages(page, 2); |
234 | atomic_dec(&agp_bridge->current_memory_agp); | 235 | atomic_dec(&agp_bridge->current_memory_agp); |
235 | } | 236 | } |
@@ -527,6 +528,7 @@ static void intel_i830_init_gtt_entries(void) | |||
527 | agp_bridge->dev->device == PCI_DEVICE_ID_INTEL_82915GM_HB || | 528 | agp_bridge->dev->device == PCI_DEVICE_ID_INTEL_82915GM_HB || |
528 | agp_bridge->dev->device == PCI_DEVICE_ID_INTEL_82945G_HB || | 529 | agp_bridge->dev->device == PCI_DEVICE_ID_INTEL_82945G_HB || |
529 | agp_bridge->dev->device == PCI_DEVICE_ID_INTEL_82945GM_HB || | 530 | agp_bridge->dev->device == PCI_DEVICE_ID_INTEL_82945GM_HB || |
531 | agp_bridge->dev->device == PCI_DEVICE_ID_INTEL_82945GME_HB || | ||
530 | IS_I965 || IS_G33) | 532 | IS_I965 || IS_G33) |
531 | gtt_entries = MB(48) - KB(size); | 533 | gtt_entries = MB(48) - KB(size); |
532 | else | 534 | else |
@@ -538,6 +540,7 @@ static void intel_i830_init_gtt_entries(void) | |||
538 | agp_bridge->dev->device == PCI_DEVICE_ID_INTEL_82915GM_HB || | 540 | agp_bridge->dev->device == PCI_DEVICE_ID_INTEL_82915GM_HB || |
539 | agp_bridge->dev->device == PCI_DEVICE_ID_INTEL_82945G_HB || | 541 | agp_bridge->dev->device == PCI_DEVICE_ID_INTEL_82945G_HB || |
540 | agp_bridge->dev->device == PCI_DEVICE_ID_INTEL_82945GM_HB || | 542 | agp_bridge->dev->device == PCI_DEVICE_ID_INTEL_82945GM_HB || |
543 | agp_bridge->dev->device == PCI_DEVICE_ID_INTEL_82945GME_HB || | ||
541 | IS_I965 || IS_G33) | 544 | IS_I965 || IS_G33) |
542 | gtt_entries = MB(64) - KB(size); | 545 | gtt_entries = MB(64) - KB(size); |
543 | else | 546 | else |
@@ -1848,9 +1851,9 @@ static const struct intel_driver_description { | |||
1848 | NULL, &intel_915_driver }, | 1851 | NULL, &intel_915_driver }, |
1849 | { PCI_DEVICE_ID_INTEL_82945G_HB, PCI_DEVICE_ID_INTEL_82945G_IG, 0, "945G", | 1852 | { PCI_DEVICE_ID_INTEL_82945G_HB, PCI_DEVICE_ID_INTEL_82945G_IG, 0, "945G", |
1850 | NULL, &intel_915_driver }, | 1853 | NULL, &intel_915_driver }, |
1851 | { PCI_DEVICE_ID_INTEL_82945GM_HB, PCI_DEVICE_ID_INTEL_82945GM_IG, 1, "945GM", | 1854 | { PCI_DEVICE_ID_INTEL_82945GM_HB, PCI_DEVICE_ID_INTEL_82945GM_IG, 0, "945GM", |
1852 | NULL, &intel_915_driver }, | 1855 | NULL, &intel_915_driver }, |
1853 | { PCI_DEVICE_ID_INTEL_82945GM_HB, PCI_DEVICE_ID_INTEL_82945GME_IG, 0, "945GME", | 1856 | { PCI_DEVICE_ID_INTEL_82945GME_HB, PCI_DEVICE_ID_INTEL_82945GME_IG, 0, "945GME", |
1854 | NULL, &intel_915_driver }, | 1857 | NULL, &intel_915_driver }, |
1855 | { PCI_DEVICE_ID_INTEL_82946GZ_HB, PCI_DEVICE_ID_INTEL_82946GZ_IG, 0, "946GZ", | 1858 | { PCI_DEVICE_ID_INTEL_82946GZ_HB, PCI_DEVICE_ID_INTEL_82946GZ_IG, 0, "946GZ", |
1856 | NULL, &intel_i965_driver }, | 1859 | NULL, &intel_i965_driver }, |
@@ -1860,9 +1863,9 @@ static const struct intel_driver_description { | |||
1860 | NULL, &intel_i965_driver }, | 1863 | NULL, &intel_i965_driver }, |
1861 | { PCI_DEVICE_ID_INTEL_82965G_HB, PCI_DEVICE_ID_INTEL_82965G_IG, 0, "965G", | 1864 | { PCI_DEVICE_ID_INTEL_82965G_HB, PCI_DEVICE_ID_INTEL_82965G_IG, 0, "965G", |
1862 | NULL, &intel_i965_driver }, | 1865 | NULL, &intel_i965_driver }, |
1863 | { PCI_DEVICE_ID_INTEL_82965GM_HB, PCI_DEVICE_ID_INTEL_82965GM_IG, 1, "965GM", | 1866 | { PCI_DEVICE_ID_INTEL_82965GM_HB, PCI_DEVICE_ID_INTEL_82965GM_IG, 0, "965GM", |
1864 | NULL, &intel_i965_driver }, | 1867 | NULL, &intel_i965_driver }, |
1865 | { PCI_DEVICE_ID_INTEL_82965GM_HB, PCI_DEVICE_ID_INTEL_82965GME_IG, 0, "965GME/GLE", | 1868 | { PCI_DEVICE_ID_INTEL_82965GME_HB, PCI_DEVICE_ID_INTEL_82965GME_IG, 0, "965GME/GLE", |
1866 | NULL, &intel_i965_driver }, | 1869 | NULL, &intel_i965_driver }, |
1867 | { PCI_DEVICE_ID_INTEL_7505_0, 0, 0, "E7505", &intel_7505_driver, NULL }, | 1870 | { PCI_DEVICE_ID_INTEL_7505_0, 0, 0, "E7505", &intel_7505_driver, NULL }, |
1868 | { PCI_DEVICE_ID_INTEL_7205_0, 0, 0, "E7205", &intel_7505_driver, NULL }, | 1871 | { PCI_DEVICE_ID_INTEL_7205_0, 0, 0, "E7205", &intel_7505_driver, NULL }, |
@@ -2051,11 +2054,13 @@ static struct pci_device_id agp_intel_pci_table[] = { | |||
2051 | ID(PCI_DEVICE_ID_INTEL_82915GM_HB), | 2054 | ID(PCI_DEVICE_ID_INTEL_82915GM_HB), |
2052 | ID(PCI_DEVICE_ID_INTEL_82945G_HB), | 2055 | ID(PCI_DEVICE_ID_INTEL_82945G_HB), |
2053 | ID(PCI_DEVICE_ID_INTEL_82945GM_HB), | 2056 | ID(PCI_DEVICE_ID_INTEL_82945GM_HB), |
2057 | ID(PCI_DEVICE_ID_INTEL_82945GME_HB), | ||
2054 | ID(PCI_DEVICE_ID_INTEL_82946GZ_HB), | 2058 | ID(PCI_DEVICE_ID_INTEL_82946GZ_HB), |
2055 | ID(PCI_DEVICE_ID_INTEL_82965G_1_HB), | 2059 | ID(PCI_DEVICE_ID_INTEL_82965G_1_HB), |
2056 | ID(PCI_DEVICE_ID_INTEL_82965Q_HB), | 2060 | ID(PCI_DEVICE_ID_INTEL_82965Q_HB), |
2057 | ID(PCI_DEVICE_ID_INTEL_82965G_HB), | 2061 | ID(PCI_DEVICE_ID_INTEL_82965G_HB), |
2058 | ID(PCI_DEVICE_ID_INTEL_82965GM_HB), | 2062 | ID(PCI_DEVICE_ID_INTEL_82965GM_HB), |
2063 | ID(PCI_DEVICE_ID_INTEL_82965GME_HB), | ||
2059 | ID(PCI_DEVICE_ID_INTEL_G33_HB), | 2064 | ID(PCI_DEVICE_ID_INTEL_G33_HB), |
2060 | ID(PCI_DEVICE_ID_INTEL_Q35_HB), | 2065 | ID(PCI_DEVICE_ID_INTEL_Q35_HB), |
2061 | ID(PCI_DEVICE_ID_INTEL_Q33_HB), | 2066 | ID(PCI_DEVICE_ID_INTEL_Q33_HB), |
diff --git a/drivers/char/agp/sgi-agp.c b/drivers/char/agp/sgi-agp.c index cda608c42bea..98cf8abb3e57 100644 --- a/drivers/char/agp/sgi-agp.c +++ b/drivers/char/agp/sgi-agp.c | |||
@@ -51,7 +51,6 @@ static void *sgi_tioca_alloc_page(struct agp_bridge_data *bridge) | |||
51 | return NULL; | 51 | return NULL; |
52 | 52 | ||
53 | get_page(page); | 53 | get_page(page); |
54 | SetPageLocked(page); | ||
55 | atomic_inc(&agp_bridge->current_memory_agp); | 54 | atomic_inc(&agp_bridge->current_memory_agp); |
56 | return page_address(page); | 55 | return page_address(page); |
57 | } | 56 | } |