Commit bd88ee4c authored by Eric Anholt's avatar Eric Anholt Committed by Dave Airlie

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: default avatarEric Anholt <eric@anholt.net>
Signed-off-by: default avatarDave Airlie <airlied@redhat.com>
parent 28af0a27
...@@ -233,7 +233,7 @@ i915_gem_gtt_pwrite(struct drm_device *dev, struct drm_gem_object *obj, ...@@ -233,7 +233,7 @@ i915_gem_gtt_pwrite(struct drm_device *dev, struct drm_gem_object *obj,
if (unwritten) if (unwritten)
#endif /* CONFIG_HIGHMEM */ #endif /* CONFIG_HIGHMEM */
{ {
vaddr = ioremap(pfn << PAGE_SHIFT, PAGE_SIZE); vaddr = ioremap_wc(pfn << PAGE_SHIFT, PAGE_SIZE);
#if WATCH_PWRITE #if WATCH_PWRITE
DRM_INFO("pwrite slow i %d o %d l %d " DRM_INFO("pwrite slow i %d o %d l %d "
"pfn %ld vaddr %p\n", "pfn %ld vaddr %p\n",
...@@ -1612,8 +1612,9 @@ i915_gem_object_pin_and_relocate(struct drm_gem_object *obj, ...@@ -1612,8 +1612,9 @@ i915_gem_object_pin_and_relocate(struct drm_gem_object *obj,
if (reloc_page != NULL) if (reloc_page != NULL)
iounmap(reloc_page); iounmap(reloc_page);
reloc_page = ioremap(dev->agp->base + reloc_page = ioremap_wc(dev->agp->base +
(reloc_offset & ~(PAGE_SIZE - 1)), (reloc_offset &
~(PAGE_SIZE - 1)),
PAGE_SIZE); PAGE_SIZE);
last_reloc_offset = reloc_offset; last_reloc_offset = reloc_offset;
if (reloc_page == NULL) { if (reloc_page == NULL) {
...@@ -2318,7 +2319,9 @@ i915_gem_init_hws(struct drm_device *dev) ...@@ -2318,7 +2319,9 @@ i915_gem_init_hws(struct drm_device *dev)
dev_priv->hws_map.flags = 0; dev_priv->hws_map.flags = 0;
dev_priv->hws_map.mtrr = 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) { if (dev_priv->hws_map.handle == NULL) {
DRM_ERROR("Failed to map status page.\n"); DRM_ERROR("Failed to map status page.\n");
memset(&dev_priv->hws_map, 0, sizeof(dev_priv->hws_map)); memset(&dev_priv->hws_map, 0, sizeof(dev_priv->hws_map));
...@@ -2369,7 +2372,7 @@ i915_gem_init_ringbuffer(struct drm_device *dev) ...@@ -2369,7 +2372,7 @@ i915_gem_init_ringbuffer(struct drm_device *dev)
dev_priv->ring.map.flags = 0; dev_priv->ring.map.flags = 0;
dev_priv->ring.map.mtrr = 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) { if (dev_priv->ring.map.handle == NULL) {
DRM_ERROR("Failed to map ringbuffer.\n"); DRM_ERROR("Failed to map ringbuffer.\n");
memset(&dev_priv->ring, 0, sizeof(dev_priv->ring)); memset(&dev_priv->ring, 0, sizeof(dev_priv->ring));
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment