diff options
Diffstat (limited to 'meta-moblin/packages/linux/linux-moblin-2.6.27/0022-drm-use-ioremap_wc-in-i915-instead-of-ioremap.patch')
-rw-r--r-- | meta-moblin/packages/linux/linux-moblin-2.6.27/0022-drm-use-ioremap_wc-in-i915-instead-of-ioremap.patch | 58 |
1 files changed, 58 insertions, 0 deletions
diff --git a/meta-moblin/packages/linux/linux-moblin-2.6.27/0022-drm-use-ioremap_wc-in-i915-instead-of-ioremap.patch b/meta-moblin/packages/linux/linux-moblin-2.6.27/0022-drm-use-ioremap_wc-in-i915-instead-of-ioremap.patch new file mode 100644 index 0000000000..8e6cbe95a4 --- /dev/null +++ b/meta-moblin/packages/linux/linux-moblin-2.6.27/0022-drm-use-ioremap_wc-in-i915-instead-of-ioremap.patch | |||
@@ -0,0 +1,58 @@ | |||
1 | commit d9f2382adde582f8792ad96e9570716bcbea21a0 | ||
2 | Author: Eric Anholt <eric@anholt.net> | ||
3 | Date: Tue Sep 23 14:50:57 2008 -0700 | ||
4 | |||
5 | drm: Use ioremap_wc in i915_driver instead of ioremap, since we always want WC. | ||
6 | |||
7 | Fixes failure to map the ringbuffer when PAT tells us we don't get to do | ||
8 | uncached on something that's already mapped WC, or something along those lines. | ||
9 | |||
10 | Signed-off-by: Eric Anholt <eric@anholt.net> | ||
11 | |||
12 | diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c | ||
13 | index 29d9d21..6ecfd10 100644 | ||
14 | --- a/drivers/gpu/drm/i915/i915_gem.c | ||
15 | +++ b/drivers/gpu/drm/i915/i915_gem.c | ||
16 | @@ -233,7 +233,7 @@ i915_gem_gtt_pwrite(struct drm_device *dev, struct drm_gem_object *obj, | ||
17 | if (unwritten) | ||
18 | #endif /* CONFIG_HIGHMEM */ | ||
19 | { | ||
20 | - vaddr = ioremap(pfn << PAGE_SHIFT, PAGE_SIZE); | ||
21 | + vaddr = ioremap_wc(pfn << PAGE_SHIFT, PAGE_SIZE); | ||
22 | #if WATCH_PWRITE | ||
23 | DRM_INFO("pwrite slow i %d o %d l %d " | ||
24 | "pfn %ld vaddr %p\n", | ||
25 | @@ -1612,9 +1612,10 @@ i915_gem_object_pin_and_relocate(struct drm_gem_object *obj, | ||
26 | if (reloc_page != NULL) | ||
27 | iounmap(reloc_page); | ||
28 | |||
29 | - reloc_page = ioremap(dev->agp->base + | ||
30 | - (reloc_offset & ~(PAGE_SIZE - 1)), | ||
31 | - PAGE_SIZE); | ||
32 | + reloc_page = ioremap_wc(dev->agp->base + | ||
33 | + (reloc_offset & | ||
34 | + ~(PAGE_SIZE - 1)), | ||
35 | + PAGE_SIZE); | ||
36 | last_reloc_offset = reloc_offset; | ||
37 | if (reloc_page == NULL) { | ||
38 | drm_gem_object_unreference(target_obj); | ||
39 | @@ -2318,7 +2319,9 @@ i915_gem_init_hws(struct drm_device *dev) | ||
40 | dev_priv->hws_map.flags = 0; | ||
41 | dev_priv->hws_map.mtrr = 0; | ||
42 | |||
43 | - drm_core_ioremap(&dev_priv->hws_map, dev); | ||
44 | + /* Ioremapping here is the wrong thing to do. We want cached access. | ||
45 | + */ | ||
46 | + drm_core_ioremap_wc(&dev_priv->hws_map, dev); | ||
47 | if (dev_priv->hws_map.handle == NULL) { | ||
48 | DRM_ERROR("Failed to map status page.\n"); | ||
49 | memset(&dev_priv->hws_map, 0, sizeof(dev_priv->hws_map)); | ||
50 | @@ -2369,7 +2372,7 @@ i915_gem_init_ringbuffer(struct drm_device *dev) | ||
51 | dev_priv->ring.map.flags = 0; | ||
52 | dev_priv->ring.map.mtrr = 0; | ||
53 | |||
54 | - drm_core_ioremap(&dev_priv->ring.map, dev); | ||
55 | + drm_core_ioremap_wc(&dev_priv->ring.map, dev); | ||
56 | if (dev_priv->ring.map.handle == NULL) { | ||
57 | DRM_ERROR("Failed to map ringbuffer.\n"); | ||
58 | memset(&dev_priv->ring, 0, sizeof(dev_priv->ring)); | ||