aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/char
diff options
context:
space:
mode:
authorDaniel Vetter <daniel.vetter@ffwll.ch>2010-09-09 11:52:20 -0400
committerChris Wilson <chris@chris-wilson.co.uk>2010-09-21 06:35:44 -0400
commit97ef1bdd0bc75bce7b2058e9c432b6c277dcf4d3 (patch)
treef60e252600d69331f8b209e5935b77bdb415d076 /drivers/char
parenta6963596a13e62f8e65b1cf3403a330ff2db407c (diff)
intel-gtt: introduce pte write function for gen6
Like for i830. intel_i9xx_configure is now unused, so kill it. Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'drivers/char')
-rw-r--r--drivers/char/agp/intel-gtt.c48
1 files changed, 26 insertions, 22 deletions
diff --git a/drivers/char/agp/intel-gtt.c b/drivers/char/agp/intel-gtt.c
index 9d25ebd50d89..1de45f96db9c 100644
--- a/drivers/char/agp/intel-gtt.c
+++ b/drivers/char/agp/intel-gtt.c
@@ -1232,27 +1232,6 @@ static void intel_i9xx_setup_flush(void)
1232 "can't ioremap flush page - no chipset flushing\n"); 1232 "can't ioremap flush page - no chipset flushing\n");
1233} 1233}
1234 1234
1235static int intel_i9xx_configure(void)
1236{
1237 int i;
1238
1239 intel_enable_gtt();
1240
1241 agp_bridge->gart_bus_addr = intel_private.gma_bus_addr;
1242
1243 if (agp_bridge->driver->needs_scratch_page) {
1244 for (i = intel_private.base.gtt_stolen_entries; i <
1245 intel_private.base.gtt_total_entries; i++) {
1246 writel(agp_bridge->scratch_page, intel_private.gtt+i);
1247 }
1248 readl(intel_private.gtt+i-1); /* PCI Posting. */
1249 }
1250
1251 global_cache_flush();
1252
1253 return 0;
1254}
1255
1256static void intel_i915_chipset_flush(struct agp_bridge_data *bridge) 1235static void intel_i915_chipset_flush(struct agp_bridge_data *bridge)
1257{ 1236{
1258 if (intel_private.i9xx_flush_page) 1237 if (intel_private.i9xx_flush_page)
@@ -1342,6 +1321,30 @@ static void i965_write_entry(dma_addr_t addr, unsigned int entry,
1342 writel(addr | I810_PTE_VALID, intel_private.gtt + entry); 1321 writel(addr | I810_PTE_VALID, intel_private.gtt + entry);
1343} 1322}
1344 1323
1324static void gen6_write_entry(dma_addr_t addr, unsigned int entry,
1325 unsigned int flags)
1326{
1327 unsigned int type_mask = flags & ~AGP_USER_CACHED_MEMORY_GFDT;
1328 unsigned int gfdt = flags & AGP_USER_CACHED_MEMORY_GFDT;
1329 u32 pte_flags;
1330
1331 if (type_mask == AGP_USER_UNCACHED_MEMORY)
1332 pte_flags = GEN6_PTE_UNCACHED;
1333 else if (type_mask == AGP_USER_CACHED_MEMORY_LLC_MLC) {
1334 pte_flags = GEN6_PTE_LLC;
1335 if (gfdt)
1336 pte_flags |= GEN6_PTE_GFDT;
1337 } else { /* set 'normal'/'cached' to LLC by default */
1338 pte_flags = GEN6_PTE_LLC_MLC;
1339 if (gfdt)
1340 pte_flags |= GEN6_PTE_GFDT;
1341 }
1342
1343 /* gen6 has bit11-4 for physical addr bit39-32 */
1344 addr |= (addr >> 28) & 0xff0;
1345 writel(addr | pte_flags, intel_private.gtt + entry);
1346}
1347
1345static int i9xx_setup(void) 1348static int i9xx_setup(void)
1346{ 1349{
1347 u32 reg_addr; 1350 u32 reg_addr;
@@ -1538,7 +1541,7 @@ static const struct agp_bridge_driver intel_gen6_driver = {
1538 .aperture_sizes = intel_fake_agp_sizes, 1541 .aperture_sizes = intel_fake_agp_sizes,
1539 .num_aperture_sizes = ARRAY_SIZE(intel_fake_agp_sizes), 1542 .num_aperture_sizes = ARRAY_SIZE(intel_fake_agp_sizes),
1540 .needs_scratch_page = true, 1543 .needs_scratch_page = true,
1541 .configure = intel_i9xx_configure, 1544 .configure = intel_fake_agp_configure,
1542 .fetch_size = intel_fake_agp_fetch_size, 1545 .fetch_size = intel_fake_agp_fetch_size,
1543 .cleanup = intel_gtt_cleanup, 1546 .cleanup = intel_gtt_cleanup,
1544 .mask_memory = intel_gen6_mask_memory, 1547 .mask_memory = intel_gen6_mask_memory,
@@ -1640,6 +1643,7 @@ static const struct intel_gtt_driver ironlake_gtt_driver = {
1640static const struct intel_gtt_driver sandybridge_gtt_driver = { 1643static const struct intel_gtt_driver sandybridge_gtt_driver = {
1641 .gen = 6, 1644 .gen = 6,
1642 .setup = i9xx_setup, 1645 .setup = i9xx_setup,
1646 .write_entry = gen6_write_entry,
1643}; 1647};
1644 1648
1645/* Table to describe Intel GMCH and AGP/PCIE GART drivers. At least one of 1649/* Table to describe Intel GMCH and AGP/PCIE GART drivers. At least one of