aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/char/agp/intel-gtt.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/char/agp/intel-gtt.c')
-rw-r--r--drivers/char/agp/intel-gtt.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/drivers/char/agp/intel-gtt.c b/drivers/char/agp/intel-gtt.c
index 96e5fd1aa554..9edeb060efb2 100644
--- a/drivers/char/agp/intel-gtt.c
+++ b/drivers/char/agp/intel-gtt.c
@@ -531,10 +531,10 @@ static struct aper_size_info_fixed intel_i830_sizes[] =
531 {512, 131072, 7}, 531 {512, 131072, 7},
532}; 532};
533 533
534static void intel_i830_init_gtt_entries(void) 534static unsigned int intel_gtt_stolen_entries(void)
535{ 535{
536 u16 gmch_ctrl; 536 u16 gmch_ctrl;
537 int gtt_entries = 0; 537 unsigned int gtt_entries = 0;
538 u8 rdct; 538 u8 rdct;
539 int local = 0; 539 int local = 0;
540 static const int ddt[4] = { 0, 16, 32, 64 }; 540 static const int ddt[4] = { 0, 16, 32, 64 };
@@ -770,7 +770,7 @@ static void intel_i830_init_gtt_entries(void)
770 gtt_entries = 0; 770 gtt_entries = 0;
771 } 771 }
772 772
773 intel_private.base.gtt_stolen_entries = gtt_entries; 773 return gtt_entries;
774} 774}
775 775
776static void intel_i830_fini_flush(void) 776static void intel_i830_fini_flush(void)
@@ -846,7 +846,7 @@ static int intel_i830_create_gatt_table(struct agp_bridge_data *bridge)
846 global_cache_flush(); /* FIXME: ?? */ 846 global_cache_flush(); /* FIXME: ?? */
847 847
848 /* we have to call this as early as possible after the MMIO base address is known */ 848 /* we have to call this as early as possible after the MMIO base address is known */
849 intel_i830_init_gtt_entries(); 849 intel_private.base.gtt_stolen_entries = intel_gtt_stolen_entries();
850 if (intel_private.base.gtt_stolen_entries == 0) { 850 if (intel_private.base.gtt_stolen_entries == 0) {
851 iounmap(intel_private.registers); 851 iounmap(intel_private.registers);
852 return -ENOMEM; 852 return -ENOMEM;
@@ -1336,7 +1336,7 @@ static int intel_i915_create_gatt_table(struct agp_bridge_data *bridge)
1336 global_cache_flush(); /* FIXME: ? */ 1336 global_cache_flush(); /* FIXME: ? */
1337 1337
1338 /* we have to call this as early as possible after the MMIO base address is known */ 1338 /* we have to call this as early as possible after the MMIO base address is known */
1339 intel_i830_init_gtt_entries(); 1339 intel_private.base.gtt_stolen_entries = intel_gtt_stolen_entries();
1340 if (intel_private.base.gtt_stolen_entries == 0) { 1340 if (intel_private.base.gtt_stolen_entries == 0) {
1341 iounmap(intel_private.gtt); 1341 iounmap(intel_private.gtt);
1342 iounmap(intel_private.registers); 1342 iounmap(intel_private.registers);
@@ -1460,7 +1460,7 @@ static int intel_i965_create_gatt_table(struct agp_bridge_data *bridge)
1460 global_cache_flush(); /* FIXME: ? */ 1460 global_cache_flush(); /* FIXME: ? */
1461 1461
1462 /* we have to call this as early as possible after the MMIO base address is known */ 1462 /* we have to call this as early as possible after the MMIO base address is known */
1463 intel_i830_init_gtt_entries(); 1463 intel_private.base.gtt_stolen_entries = intel_gtt_stolen_entries();
1464 if (intel_private.base.gtt_stolen_entries == 0) { 1464 if (intel_private.base.gtt_stolen_entries == 0) {
1465 iounmap(intel_private.gtt); 1465 iounmap(intel_private.gtt);
1466 iounmap(intel_private.registers); 1466 iounmap(intel_private.registers);