Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

arc: Add our own implementation of fb_pgprotect()

During mmaping of frame-buffer pages to user-space
fb_protect() is called to set proper page settings.

In case of ARC we need to mark pages that are mmaped to
user as uncached because of 2 reasons:
* Huge amount of data if passing through data cache will
thrash cache a lot making cache almost useless for other
less traffic hungry processes.
* Data written by user in FB will be immediately available for
hardware (such as PGU etc) without requirements to flush data
cache regularly.

Signed-off-by: Alexey Brodkin <abrodkin@synopsys.com>
Cc: linux-snps-arc@lists.infradead.org
Signed-off-by: Vineet Gupta <vgupta@synopsys.com>

authored by

Alexey Brodkin and committed by
Vineet Gupta
e5e0a65c 732dc97b

+19
+19
arch/arc/include/asm/fb.h
··· 1 + #ifndef _ASM_FB_H_ 2 + #define _ASM_FB_H_ 3 + 4 + #include <linux/fb.h> 5 + #include <linux/fs.h> 6 + #include <asm/page.h> 7 + 8 + static inline void fb_pgprotect(struct file *file, struct vm_area_struct *vma, 9 + unsigned long off) 10 + { 11 + vma->vm_page_prot = pgprot_noncached(vma->vm_page_prot); 12 + } 13 + 14 + static inline int fb_is_primary_device(struct fb_info *info) 15 + { 16 + return 0; 17 + } 18 + 19 + #endif /* _ASM_FB_H_ */