diff options
author | Eric Anholt <eric@anholt.net> | 2008-09-23 23:50:57 +0200 |
---|---|---|
committer | Dave Airlie <airlied@linux.ie> | 2008-10-17 23:10:52 +0200 |
commit | bd88ee4c1b1c8fc8b78a0ba7b6235d230cea0d05 (patch) | |
tree | cd28abc78a2ca03480827bec5952a3d8e2c0ef70 /drivers/gpu | |
parent | drm: G33-class hardware has a newer 965-style MCH (no DCC register). (diff) | |
download | linux-bd88ee4c1b1c8fc8b78a0ba7b6235d230cea0d05.tar.xz linux-bd88ee4c1b1c8fc8b78a0ba7b6235d230cea0d05.zip |
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.c | 15 |
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, if (unwritten) #endif /* CONFIG_HIGHMEM */ { - vaddr = ioremap(pfn << PAGE_SHIFT, PAGE_SIZE); + vaddr = ioremap_wc(pfn << PAGE_SHIFT, PAGE_SIZE); #if WATCH_PWRITE DRM_INFO("pwrite slow i %d o %d l %d " "pfn %ld vaddr %p\n", @@ -1612,9 +1612,10 @@ i915_gem_object_pin_and_relocate(struct drm_gem_object *obj, if (reloc_page != NULL) iounmap(reloc_page); - reloc_page = ioremap(dev->agp->base + - (reloc_offset & ~(PAGE_SIZE - 1)), - PAGE_SIZE); + reloc_page = ioremap_wc(dev->agp->base + + (reloc_offset & + ~(PAGE_SIZE - 1)), + PAGE_SIZE); last_reloc_offset = reloc_offset; if (reloc_page == NULL) { drm_gem_object_unreference(target_obj); @@ -2318,7 +2319,9 @@ i915_gem_init_hws(struct drm_device *dev) dev_priv->hws_map.flags = 0; dev_priv->hws_map.mtrr = 0; - drm_core_ioremap(&dev_priv->hws_map, dev); + /* Ioremapping here is the wrong thing to do. We want cached access. + */ + drm_core_ioremap_wc(&dev_priv->hws_map, dev); if (dev_priv->hws_map.handle == NULL) { DRM_ERROR("Failed to map status page.\n"); memset(&dev_priv->hws_map, 0, sizeof(dev_priv->hws_map)); @@ -2369,7 +2372,7 @@ i915_gem_init_ringbuffer(struct drm_device *dev) dev_priv->ring.map.flags = 0; dev_priv->ring.map.mtrr = 0; - drm_core_ioremap(&dev_priv->ring.map, dev); + drm_core_ioremap_wc(&dev_priv->ring.map, dev); if (dev_priv->ring.map.handle == NULL) { DRM_ERROR("Failed to map ringbuffer.\n"); memset(&dev_priv->ring, 0, sizeof(dev_priv->ring)); |