diff options
author | Antonino A. Daplas <adaplas@gmail.com> | 2007-07-17 07:05:27 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-07-17 13:23:11 -0400 |
commit | 10eb2659cc6059d0c4de2e2c66d1534091519f56 (patch) | |
tree | 804a53c7a3fd6fb4ef72454a0d962c3883bbb828 /drivers/video/fbmem.c | |
parent | 0c6c1ce079082ddde9ba5636c352c235cd395aa1 (diff) |
fbdev: move arch-specific bits to their respective subdirectories
Move arch-specific bits of fb_mmap() to their respective subdirectories
[bob.picco@hp.com: efi_range_is_wc is referenced but not declared]
[bunk@stusta.de: fix include/asm-m68k/fb.h]
Signed-off-by: Antonino Daplas <adaplas@gmail.com>
Acked-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Adrian Bunk <bunk@stusta.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/video/fbmem.c')
-rw-r--r-- | drivers/video/fbmem.c | 62 |
1 files changed, 4 insertions, 58 deletions
diff --git a/drivers/video/fbmem.c b/drivers/video/fbmem.c index 38c2e2558f5e..8d6dbe8b8dd1 100644 --- a/drivers/video/fbmem.c +++ b/drivers/video/fbmem.c | |||
@@ -33,17 +33,10 @@ | |||
33 | #include <linux/err.h> | 33 | #include <linux/err.h> |
34 | #include <linux/device.h> | 34 | #include <linux/device.h> |
35 | #include <linux/efi.h> | 35 | #include <linux/efi.h> |
36 | #include <linux/fb.h> | ||
36 | 37 | ||
37 | #if defined(__mc68000__) || defined(CONFIG_APUS) | 38 | #include <asm/fb.h> |
38 | #include <asm/setup.h> | ||
39 | #endif | ||
40 | |||
41 | #include <asm/io.h> | ||
42 | #include <asm/uaccess.h> | ||
43 | #include <asm/page.h> | ||
44 | #include <asm/pgtable.h> | ||
45 | 39 | ||
46 | #include <linux/fb.h> | ||
47 | 40 | ||
48 | /* | 41 | /* |
49 | * Frame buffer device initialization and setup routines | 42 | * Frame buffer device initialization and setup routines |
@@ -1155,17 +1148,15 @@ fb_compat_ioctl(struct file *file, unsigned int cmd, unsigned long arg) | |||
1155 | } | 1148 | } |
1156 | #endif | 1149 | #endif |
1157 | 1150 | ||
1158 | static int | 1151 | static int |
1159 | fb_mmap(struct file *file, struct vm_area_struct * vma) | 1152 | fb_mmap(struct file *file, struct vm_area_struct * vma) |
1160 | { | 1153 | { |
1161 | int fbidx = iminor(file->f_path.dentry->d_inode); | 1154 | int fbidx = iminor(file->f_path.dentry->d_inode); |
1162 | struct fb_info *info = registered_fb[fbidx]; | 1155 | struct fb_info *info = registered_fb[fbidx]; |
1163 | struct fb_ops *fb = info->fbops; | 1156 | struct fb_ops *fb = info->fbops; |
1164 | unsigned long off; | 1157 | unsigned long off; |
1165 | #if !defined(__sparc__) || defined(__sparc_v9__) | ||
1166 | unsigned long start; | 1158 | unsigned long start; |
1167 | u32 len; | 1159 | u32 len; |
1168 | #endif | ||
1169 | 1160 | ||
1170 | if (vma->vm_pgoff > (~0UL >> PAGE_SHIFT)) | 1161 | if (vma->vm_pgoff > (~0UL >> PAGE_SHIFT)) |
1171 | return -EINVAL; | 1162 | return -EINVAL; |
@@ -1180,12 +1171,6 @@ fb_mmap(struct file *file, struct vm_area_struct * vma) | |||
1180 | return res; | 1171 | return res; |
1181 | } | 1172 | } |
1182 | 1173 | ||
1183 | #if defined(__sparc__) && !defined(__sparc_v9__) | ||
1184 | /* Should never get here, all fb drivers should have their own | ||
1185 | mmap routines */ | ||
1186 | return -EINVAL; | ||
1187 | #else | ||
1188 | /* !sparc32... */ | ||
1189 | lock_kernel(); | 1174 | lock_kernel(); |
1190 | 1175 | ||
1191 | /* frame buffer memory */ | 1176 | /* frame buffer memory */ |
@@ -1209,50 +1194,11 @@ fb_mmap(struct file *file, struct vm_area_struct * vma) | |||
1209 | vma->vm_pgoff = off >> PAGE_SHIFT; | 1194 | vma->vm_pgoff = off >> PAGE_SHIFT; |
1210 | /* This is an IO map - tell maydump to skip this VMA */ | 1195 | /* This is an IO map - tell maydump to skip this VMA */ |
1211 | vma->vm_flags |= VM_IO | VM_RESERVED; | 1196 | vma->vm_flags |= VM_IO | VM_RESERVED; |
1212 | #if defined(__mc68000__) | 1197 | fb_pgprotect(file, vma, off); |
1213 | #if defined(CONFIG_SUN3) | ||
1214 | pgprot_val(vma->vm_page_prot) |= SUN3_PAGE_NOCACHE; | ||
1215 | #elif defined(CONFIG_MMU) | ||
1216 | if (CPU_IS_020_OR_030) | ||
1217 | pgprot_val(vma->vm_page_prot) |= _PAGE_NOCACHE030; | ||
1218 | if (CPU_IS_040_OR_060) { | ||
1219 | pgprot_val(vma->vm_page_prot) &= _CACHEMASK040; | ||
1220 | /* Use no-cache mode, serialized */ | ||
1221 | pgprot_val(vma->vm_page_prot) |= _PAGE_NOCACHE_S; | ||
1222 | } | ||
1223 | #endif | ||
1224 | #elif defined(__powerpc__) | ||
1225 | vma->vm_page_prot = phys_mem_access_prot(file, off >> PAGE_SHIFT, | ||
1226 | vma->vm_end - vma->vm_start, | ||
1227 | vma->vm_page_prot); | ||
1228 | #elif defined(__alpha__) | ||
1229 | /* Caching is off in the I/O space quadrant by design. */ | ||
1230 | #elif defined(__i386__) || defined(__x86_64__) | ||
1231 | if (boot_cpu_data.x86 > 3) | ||
1232 | pgprot_val(vma->vm_page_prot) |= _PAGE_PCD; | ||
1233 | #elif defined(__mips__) || defined(__sparc_v9__) | ||
1234 | vma->vm_page_prot = pgprot_noncached(vma->vm_page_prot); | ||
1235 | #elif defined(__hppa__) | ||
1236 | pgprot_val(vma->vm_page_prot) |= _PAGE_NO_CACHE; | ||
1237 | #elif defined(__arm__) || defined(__sh__) || defined(__m32r__) | ||
1238 | vma->vm_page_prot = pgprot_writecombine(vma->vm_page_prot); | ||
1239 | #elif defined(__avr32__) | ||
1240 | vma->vm_page_prot = __pgprot((pgprot_val(vma->vm_page_prot) | ||
1241 | & ~_PAGE_CACHABLE) | ||
1242 | | (_PAGE_BUFFER | _PAGE_DIRTY)); | ||
1243 | #elif defined(__ia64__) | ||
1244 | if (efi_range_is_wc(vma->vm_start, vma->vm_end - vma->vm_start)) | ||
1245 | vma->vm_page_prot = pgprot_writecombine(vma->vm_page_prot); | ||
1246 | else | ||
1247 | vma->vm_page_prot = pgprot_noncached(vma->vm_page_prot); | ||
1248 | #else | ||
1249 | #warning What do we have to do here?? | ||
1250 | #endif | ||
1251 | if (io_remap_pfn_range(vma, vma->vm_start, off >> PAGE_SHIFT, | 1198 | if (io_remap_pfn_range(vma, vma->vm_start, off >> PAGE_SHIFT, |
1252 | vma->vm_end - vma->vm_start, vma->vm_page_prot)) | 1199 | vma->vm_end - vma->vm_start, vma->vm_page_prot)) |
1253 | return -EAGAIN; | 1200 | return -EAGAIN; |
1254 | return 0; | 1201 | return 0; |
1255 | #endif /* !sparc32 */ | ||
1256 | } | 1202 | } |
1257 | 1203 | ||
1258 | static int | 1204 | static int |