[PATCH 1/2] uninorth: Use same sizes array everywhere
Michel Dänzer
michel at tungstengraphics.com
Tue Aug 22 02:09:17 EST 2006
Until we have evidence of the opposite, we'll just assume for the sake of
simplicity that all revisions of UniNorth support the same aperture sizes.
Also derive the number of supported sizes from the array definition.
Signed-off-by: Michel Dänzer <michel at tungstengraphics.com>
---
drivers/char/agp/uninorth-agp.c | 27 ++++++---------------------
1 files changed, 6 insertions(+), 21 deletions(-)
diff --git a/drivers/char/agp/uninorth-agp.c b/drivers/char/agp/uninorth-agp.c
index 91b71e7..78c8cb2 100644
--- a/drivers/char/agp/uninorth-agp.c
+++ b/drivers/char/agp/uninorth-agp.c
@@ -450,24 +450,7 @@ void null_cache_flush(void)
/* Setup function */
-static struct aper_size_info_32 uninorth_sizes[7] =
-{
-#if 0 /* Not sure uninorth supports that high aperture sizes */
- {256, 65536, 6, 64},
- {128, 32768, 5, 32},
- {64, 16384, 4, 16},
-#endif
- {32, 8192, 3, 8},
- {16, 4096, 2, 4},
- {8, 2048, 1, 2},
- {4, 1024, 0, 1}
-};
-
-/*
- * Not sure that u3 supports that high aperture sizes but it
- * would strange if it did not :)
- */
-static struct aper_size_info_32 u3_sizes[8] =
+static struct aper_size_info_32 uninorth_sizes[8] =
{
{512, 131072, 7, 128},
{256, 65536, 6, 64},
@@ -483,7 +466,8 @@ struct agp_bridge_driver uninorth_agp_dr
.owner = THIS_MODULE,
.aperture_sizes = (void *)uninorth_sizes,
.size_type = U32_APER_SIZE,
- .num_aperture_sizes = 4,
+ .num_aperture_sizes = sizeof(uninorth_sizes)
+ / sizeof(struct aper_size_info_32),
.configure = uninorth_configure,
.fetch_size = uninorth_fetch_size,
.cleanup = uninorth_cleanup,
@@ -505,9 +489,10 @@ struct agp_bridge_driver uninorth_agp_dr
struct agp_bridge_driver u3_agp_driver = {
.owner = THIS_MODULE,
- .aperture_sizes = (void *)u3_sizes,
+ .aperture_sizes = (void *)uninorth_sizes,
.size_type = U32_APER_SIZE,
- .num_aperture_sizes = 8,
+ .num_aperture_sizes = sizeof(uninorth_sizes)
+ / sizeof(struct aper_size_info_32),
.configure = uninorth_configure,
.fetch_size = uninorth_fetch_size,
.cleanup = uninorth_cleanup,
--
Earthling Michel Dänzer | http://tungstengraphics.com
Libre software enthusiast | Debian, X and DRI developer
More information about the Linuxppc-dev
mailing list