aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu
diff options
context:
space:
mode:
authorEric Anholt <eric@anholt.net>2008-09-23 17:50:57 -0400
committerDave Airlie <airlied@linux.ie>2008-10-17 17:10:52 -0400
commitbd88ee4c1b1c8fc8b78a0ba7b6235d230cea0d05 (patch)
treecd28abc78a2ca03480827bec5952a3d8e2c0ef70 /drivers/gpu
parent28af0a2767412937e8424364a8ece9b230bdbc83 (diff)
drm: Use ioremap_wc in i915_driver instead of ioremap, since we always want WC.
Fixes failure to map the ringbuffer when PAT tells us we don't get to do uncached on something that's already mapped WC, or something along those lines. Signed-off-by: Eric Anholt <eric@anholt.net> Signed-off-by: Dave Airlie <airlied@redhat.com>
Diffstat (limited to 'drivers/gpu')
-rw-r--r--drivers/gpu/drm/i915/i915_gem.c15
1 files changed, 9 insertions, 6 deletions
diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c
index 29d9d21e9413..6ecfd108effa 100644
--- a/drivers/gpu/drm/i915/i915_gem.c
+++ b/drivers/gpu/drm/i915/i915_gem.c
@@ -233,7 +233,7 @@ i915_gem_gtt_pwrite(struct drm_device *dev, struct drm_gem_object *obj,
233 if (unwritten) 233 if (unwritten)
234#endif /* CONFIG_HIGHMEM */ 234#endif /* CONFIG_HIGHMEM */
235 { 235 {
236 vaddr = ioremap(pfn << PAGE_SHIFT, PAGE_SIZE); 236 vaddr = ioremap_wc(pfn << PAGE_SHIFT, PAGE_SIZE);
237#if WATCH_PWRITE 237#if WATCH_PWRITE
238 DRM_INFO("pwrite slow i %d o %d l %d " 238 DRM_INFO("pwrite slow i %d o %d l %d "
239 "pfn %ld vaddr %p\n", 239 "pfn %ld vaddr %p\n",
@@ -1612,9 +1612,10 @@ i915_gem_object_pin_and_relocate(struct drm_gem_object *obj,
1612 if (reloc_page != NULL) 1612 if (reloc_page != NULL)
1613 iounmap(reloc_page); 1613 iounmap(reloc_page);
1614 1614
1615 reloc_page = ioremap(dev->agp->base + 1615 reloc_page = ioremap_wc(dev->agp->base +
1616 (reloc_offset & ~(PAGE_SIZE - 1)), 1616 (reloc_offset &
1617 PAGE_SIZE); 1617 ~(PAGE_SIZE - 1)),
1618 PAGE_SIZE);
1618 last_reloc_offset = reloc_offset; 1619 last_reloc_offset = reloc_offset;
1619 if (reloc_page == NULL) { 1620 if (reloc_page == NULL) {
1620 drm_gem_object_unreference(target_obj); 1621 drm_gem_object_unreference(target_obj);
@@ -2318,7 +2319,9 @@ i915_gem_init_hws(struct drm_device *dev)
2318 dev_priv->hws_map.flags = 0; 2319 dev_priv->hws_map.flags = 0;
2319 dev_priv->hws_map.mtrr = 0; 2320 dev_priv->hws_map.mtrr = 0;
2320 2321
2321 drm_core_ioremap(&dev_priv->hws_map, dev); 2322 /* Ioremapping here is the wrong thing to do. We want cached access.
2323 */
2324 drm_core_ioremap_wc(&dev_priv->hws_map, dev);
2322 if (dev_priv->hws_map.handle == NULL) { 2325 if (dev_priv->hws_map.handle == NULL) {
2323 DRM_ERROR("Failed to map status page.\n"); 2326 DRM_ERROR("Failed to map status page.\n");
2324 memset(&dev_priv->hws_map, 0, sizeof(dev_priv->hws_map)); 2327 memset(&dev_priv->hws_map, 0, sizeof(dev_priv->hws_map));
@@ -2369,7 +2372,7 @@ i915_gem_init_ringbuffer(struct drm_device *dev)
2369 dev_priv->ring.map.flags = 0; 2372 dev_priv->ring.map.flags = 0;
2370 dev_priv->ring.map.mtrr = 0; 2373 dev_priv->ring.map.mtrr = 0;
2371 2374
2372 drm_core_ioremap(&dev_priv->ring.map, dev); 2375 drm_core_ioremap_wc(&dev_priv->ring.map, dev);
2373 if (dev_priv->ring.map.handle == NULL) { 2376 if (dev_priv->ring.map.handle == NULL) {
2374 DRM_ERROR("Failed to map ringbuffer.\n"); 2377 DRM_ERROR("Failed to map ringbuffer.\n");
2375 memset(&dev_priv->ring, 0, sizeof(dev_priv->ring)); 2378 memset(&dev_priv->ring, 0, sizeof(dev_priv->ring));