diff options
Diffstat (limited to 'drivers/char')
-rw-r--r-- | drivers/char/agp/intel-agp.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/drivers/char/agp/intel-agp.c b/drivers/char/agp/intel-agp.c index 37678550b3eb..30c36ac2cd00 100644 --- a/drivers/char/agp/intel-agp.c +++ b/drivers/char/agp/intel-agp.c | |||
@@ -178,6 +178,7 @@ static struct _intel_private { | |||
178 | * popup and for the GTT. | 178 | * popup and for the GTT. |
179 | */ | 179 | */ |
180 | int gtt_entries; /* i830+ */ | 180 | int gtt_entries; /* i830+ */ |
181 | int gtt_total_size; | ||
181 | union { | 182 | union { |
182 | void __iomem *i9xx_flush_page; | 183 | void __iomem *i9xx_flush_page; |
183 | void *i8xx_flush_page; | 184 | void *i8xx_flush_page; |
@@ -1153,7 +1154,7 @@ static int intel_i915_configure(void) | |||
1153 | readl(intel_private.registers+I810_PGETBL_CTL); /* PCI Posting. */ | 1154 | readl(intel_private.registers+I810_PGETBL_CTL); /* PCI Posting. */ |
1154 | 1155 | ||
1155 | if (agp_bridge->driver->needs_scratch_page) { | 1156 | if (agp_bridge->driver->needs_scratch_page) { |
1156 | for (i = intel_private.gtt_entries; i < current_size->num_entries; i++) { | 1157 | for (i = intel_private.gtt_entries; i < intel_private.gtt_total_size; i++) { |
1157 | writel(agp_bridge->scratch_page, intel_private.gtt+i); | 1158 | writel(agp_bridge->scratch_page, intel_private.gtt+i); |
1158 | } | 1159 | } |
1159 | readl(intel_private.gtt+i-1); /* PCI Posting. */ | 1160 | readl(intel_private.gtt+i-1); /* PCI Posting. */ |
@@ -1308,6 +1309,8 @@ static int intel_i915_create_gatt_table(struct agp_bridge_data *bridge) | |||
1308 | if (!intel_private.gtt) | 1309 | if (!intel_private.gtt) |
1309 | return -ENOMEM; | 1310 | return -ENOMEM; |
1310 | 1311 | ||
1312 | intel_private.gtt_total_size = gtt_map_size / 4; | ||
1313 | |||
1311 | temp &= 0xfff80000; | 1314 | temp &= 0xfff80000; |
1312 | 1315 | ||
1313 | intel_private.registers = ioremap(temp, 128 * 4096); | 1316 | intel_private.registers = ioremap(temp, 128 * 4096); |
@@ -1395,6 +1398,8 @@ static int intel_i965_create_gatt_table(struct agp_bridge_data *bridge) | |||
1395 | if (!intel_private.gtt) | 1398 | if (!intel_private.gtt) |
1396 | return -ENOMEM; | 1399 | return -ENOMEM; |
1397 | 1400 | ||
1401 | intel_private.gtt_total_size = gtt_size / 4; | ||
1402 | |||
1398 | intel_private.registers = ioremap(temp, 128 * 4096); | 1403 | intel_private.registers = ioremap(temp, 128 * 4096); |
1399 | if (!intel_private.registers) { | 1404 | if (!intel_private.registers) { |
1400 | iounmap(intel_private.gtt); | 1405 | iounmap(intel_private.gtt); |