Skip to content

Commit

Permalink
arc: Add our own implementation of fb_pgprotect()
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Alexey Brodkin authored and Vineet Gupta committed Apr 7, 2016
1 parent 732dc97 commit e5e0a65
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions arch/arc/include/asm/fb.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#ifndef _ASM_FB_H_
#define _ASM_FB_H_

#include <linux/fb.h>
#include <linux/fs.h>
#include <asm/page.h>

static inline void fb_pgprotect(struct file *file, struct vm_area_struct *vma,
unsigned long off)
{
vma->vm_page_prot = pgprot_noncached(vma->vm_page_prot);
}

static inline int fb_is_primary_device(struct fb_info *info)
{
return 0;
}

#endif /* _ASM_FB_H_ */

0 comments on commit e5e0a65

Please sign in to comment.