[Letux-kernel] [small team RFC v3 10/10] XXX: fbmem: force use of device memtype
H. Nikolaus Schaller
hns at goldelico.com
Mon Feb 5 17:21:05 CET 2018
This reverts commit
"XXX ARM: fbdev: force use of device memtype
This *really* doesn't belong here
I should just override fb_mmap for omapdrm fbdev"
and moves the override option to fb_mmap.
Missing: choose pgprot_device() for OMAP5 with TILER only and pgprot_writecombine() otherwise.
---
arch/arm/include/asm/fb.h | 2 +-
drivers/video/fbdev/core/fbmem.c | 4 ++++
2 files changed, 5 insertions(+), 1 deletion(-)
diff --git a/arch/arm/include/asm/fb.h b/arch/arm/include/asm/fb.h
index b4974b825dc1..d92e99cd8c8a 100644
--- a/arch/arm/include/asm/fb.h
+++ b/arch/arm/include/asm/fb.h
@@ -8,7 +8,7 @@
static inline void fb_pgprotect(struct file *file, struct vm_area_struct *vma,
unsigned long off)
{
- vma->vm_page_prot = pgprot_device(vma->vm_page_prot);
+ vma->vm_page_prot = pgprot_writecombine(vma->vm_page_prot);
}
static inline int fb_is_primary_device(struct fb_info *info)
diff --git a/drivers/video/fbdev/core/fbmem.c b/drivers/video/fbdev/core/fbmem.c
index f741ba8df01b..d40b1b549d87 100644
--- a/drivers/video/fbdev/core/fbmem.c
+++ b/drivers/video/fbdev/core/fbmem.c
@@ -1434,7 +1434,11 @@ fb_mmap(struct file *file, struct vm_area_struct * vma)
* SME protection is removed
*/
vma->vm_page_prot = pgprot_decrypted(vma->vm_page_prot);
+#if 0 // OMAP5 TILER may need it (or not?) but it breaks on OMAP3
+ vma->vm_page_prot = pgprot_device(vma->vm_page_prot);
+#else // all others incl. OMAP3 w/o TILER
fb_pgprotect(file, vma, start);
+#endif
return vm_iomap_memory(vma, start, len);
}
--
2.12.2
More information about the Letux-kernel
mailing list