aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorVenkatesh Pallipadi <venkatesh.pallipadi@intel.com>2009-02-24 20:35:14 -0500
committerIngo Molnar <mingo@elte.hu>2009-02-25 07:09:52 -0500
commit17581ad812a9abb0182260374ef2e52d4a808a64 (patch)
treed105f3b5bffb879c57516d7a477e787104183d52 /include
parent7880f7464546842ee14179bef16a6e14381ea638 (diff)
gpu/drm, x86, PAT: PAT support for io_mapping_*
Make io_mapping_create_wc and io_mapping_free go through PAT to make sure that there are no memory type aliases. Signed-off-by: Venkatesh Pallipadi <venkatesh.pallipadi@intel.com> Signed-off-by: Suresh Siddha <suresh.b.siddha@intel.com> Cc: Dave Airlie <airlied@redhat.com> Cc: Jesse Barnes <jbarnes@virtuousgeek.org> Cc: Eric Anholt <eric@anholt.net> Cc: Keith Packard <keithp@keithp.com> Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'include')
-rw-r--r--include/linux/io-mapping.h6
1 files changed, 4 insertions, 2 deletions
diff --git a/include/linux/io-mapping.h b/include/linux/io-mapping.h
index cbc2f0cd631b..f1ed66c43787 100644
--- a/include/linux/io-mapping.h
+++ b/include/linux/io-mapping.h
@@ -49,8 +49,9 @@ static inline struct io_mapping *
49io_mapping_create_wc(resource_size_t base, unsigned long size) 49io_mapping_create_wc(resource_size_t base, unsigned long size)
50{ 50{
51 struct io_mapping *iomap; 51 struct io_mapping *iomap;
52 pgprot_t prot;
52 53
53 if (!is_io_mapping_possible(base, size)) 54 if (!reserve_io_memtype_wc(base, size, &prot))
54 return NULL; 55 return NULL;
55 56
56 iomap = kmalloc(sizeof(*iomap), GFP_KERNEL); 57 iomap = kmalloc(sizeof(*iomap), GFP_KERNEL);
@@ -59,13 +60,14 @@ io_mapping_create_wc(resource_size_t base, unsigned long size)
59 60
60 iomap->base = base; 61 iomap->base = base;
61 iomap->size = size; 62 iomap->size = size;
62 iomap->prot = pgprot_writecombine(__pgprot(__PAGE_KERNEL)); 63 iomap->prot = prot;
63 return iomap; 64 return iomap;
64} 65}
65 66
66static inline void 67static inline void
67io_mapping_free(struct io_mapping *mapping) 68io_mapping_free(struct io_mapping *mapping)
68{ 69{
70 free_io_memtype(mapping->base, mapping->size);
69 kfree(mapping); 71 kfree(mapping);
70} 72}
71 73