blob: ab4c960146e3d60ab0e59d8396cc95bfba04f7b3 [file] [log] [blame]
Greg Kroah-Hartmanb2441312017-11-01 15:07:57 +01001/* SPDX-License-Identifier: GPL-2.0 */
H. Peter Anvin1965aae2008-10-22 22:26:29 -07002#ifndef _ASM_X86_FB_H
3#define _ASM_X86_FB_H
Thomas Gleixner106619c2007-10-15 23:28:20 +02004
5#include <linux/fb.h>
6#include <linux/fs.h>
7#include <asm/page.h>
8
9static inline void fb_pgprotect(struct file *file, struct vm_area_struct *vma,
10 unsigned long off)
11{
Juergen Grossc27ce0a2014-11-03 14:01:48 +010012 unsigned long prot;
13
14 prot = pgprot_val(vma->vm_page_prot) & ~_PAGE_CACHE_MASK;
Thomas Gleixner106619c2007-10-15 23:28:20 +020015 if (boot_cpu_data.x86 > 3)
Juergen Grossc27ce0a2014-11-03 14:01:48 +010016 pgprot_val(vma->vm_page_prot) =
17 prot | cachemode2protval(_PAGE_CACHE_MODE_UC_MINUS);
Thomas Gleixner106619c2007-10-15 23:28:20 +020018}
19
Thomas Gleixner106619c2007-10-15 23:28:20 +020020extern int fb_is_primary_device(struct fb_info *info);
Thomas Gleixner106619c2007-10-15 23:28:20 +020021
H. Peter Anvin1965aae2008-10-22 22:26:29 -070022#endif /* _ASM_X86_FB_H */