aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/video
diff options
context:
space:
mode:
authorDavid S. Miller <davem@sunset.davemloft.net>2006-03-21 05:29:39 -0500
committerDavid S. Miller <davem@sunset.davemloft.net>2006-03-22 04:15:13 -0500
commit14778d9072e53d2171f66ffd9657daff41acfaed (patch)
tree3b60565ec1e957800fc3bf4743497202a24f8279 /drivers/video
parente952f31bce6e9f64db01f607abc46529ba57ac9e (diff)
[SPARC]: Respect vm_page_prot in io_remap_page_range().
Make sure the callers do a pgprot_noncached() on vma->vm_page_prot. Pointed out by Hugh Dickens. Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/video')
-rw-r--r--drivers/video/fbmem.c8
-rw-r--r--drivers/video/sbuslib.c2
2 files changed, 3 insertions, 7 deletions
diff --git a/drivers/video/fbmem.c b/drivers/video/fbmem.c
index 996c7b58564e..07d882b14396 100644
--- a/drivers/video/fbmem.c
+++ b/drivers/video/fbmem.c
@@ -1169,11 +1169,6 @@ fb_mmap(struct file *file, struct vm_area_struct * vma)
1169 vma->vm_pgoff = off >> PAGE_SHIFT; 1169 vma->vm_pgoff = off >> PAGE_SHIFT;
1170 /* This is an IO map - tell maydump to skip this VMA */ 1170 /* This is an IO map - tell maydump to skip this VMA */
1171 vma->vm_flags |= VM_IO | VM_RESERVED; 1171 vma->vm_flags |= VM_IO | VM_RESERVED;
1172#if defined(__sparc_v9__)
1173 if (io_remap_pfn_range(vma, vma->vm_start, off >> PAGE_SHIFT,
1174 vma->vm_end - vma->vm_start, vma->vm_page_prot))
1175 return -EAGAIN;
1176#else
1177#if defined(__mc68000__) 1172#if defined(__mc68000__)
1178#if defined(CONFIG_SUN3) 1173#if defined(CONFIG_SUN3)
1179 pgprot_val(vma->vm_page_prot) |= SUN3_PAGE_NOCACHE; 1174 pgprot_val(vma->vm_page_prot) |= SUN3_PAGE_NOCACHE;
@@ -1195,7 +1190,7 @@ fb_mmap(struct file *file, struct vm_area_struct * vma)
1195#elif defined(__i386__) || defined(__x86_64__) 1190#elif defined(__i386__) || defined(__x86_64__)
1196 if (boot_cpu_data.x86 > 3) 1191 if (boot_cpu_data.x86 > 3)
1197 pgprot_val(vma->vm_page_prot) |= _PAGE_PCD; 1192 pgprot_val(vma->vm_page_prot) |= _PAGE_PCD;
1198#elif defined(__mips__) 1193#elif defined(__mips__) || defined(__sparc_v9__)
1199 vma->vm_page_prot = pgprot_noncached(vma->vm_page_prot); 1194 vma->vm_page_prot = pgprot_noncached(vma->vm_page_prot);
1200#elif defined(__hppa__) 1195#elif defined(__hppa__)
1201 pgprot_val(vma->vm_page_prot) |= _PAGE_NO_CACHE; 1196 pgprot_val(vma->vm_page_prot) |= _PAGE_NO_CACHE;
@@ -1212,7 +1207,6 @@ fb_mmap(struct file *file, struct vm_area_struct * vma)
1212 if (io_remap_pfn_range(vma, vma->vm_start, off >> PAGE_SHIFT, 1207 if (io_remap_pfn_range(vma, vma->vm_start, off >> PAGE_SHIFT,
1213 vma->vm_end - vma->vm_start, vma->vm_page_prot)) 1208 vma->vm_end - vma->vm_start, vma->vm_page_prot))
1214 return -EAGAIN; 1209 return -EAGAIN;
1215#endif /* !__sparc_v9__ */
1216 return 0; 1210 return 0;
1217#endif /* !sparc32 */ 1211#endif /* !sparc32 */
1218} 1212}
diff --git a/drivers/video/sbuslib.c b/drivers/video/sbuslib.c
index a4d7cc51ce0b..34ef859ee414 100644
--- a/drivers/video/sbuslib.c
+++ b/drivers/video/sbuslib.c
@@ -58,6 +58,8 @@ int sbusfb_mmap_helper(struct sbus_mmap_map *map,
58 /* To stop the swapper from even considering these pages */ 58 /* To stop the swapper from even considering these pages */
59 vma->vm_flags |= (VM_IO | VM_RESERVED); 59 vma->vm_flags |= (VM_IO | VM_RESERVED);
60 60
61 vma->vm_page_prot = pgprot_noncached(vma->vm_page_prot);
62
61 /* Each page, see which map applies */ 63 /* Each page, see which map applies */
62 for (page = 0; page < size; ){ 64 for (page = 0; page < size; ){
63 map_size = 0; 65 map_size = 0;