xref: /openbmc/linux/arch/sparc/include/asm/fb.h (revision 65844828)
1 /* SPDX-License-Identifier: GPL-2.0 */
2 #ifndef _SPARC_FB_H_
3 #define _SPARC_FB_H_
4 #include <linux/console.h>
5 #include <linux/fb.h>
6 #include <linux/fs.h>
7 #include <asm/page.h>
8 #include <asm/prom.h>
9 
10 static inline void fb_pgprotect(struct file *file, struct vm_area_struct *vma,
11 				unsigned long off)
12 {
13 #ifdef CONFIG_SPARC64
14 	vma->vm_page_prot = pgprot_noncached(vma->vm_page_prot);
15 #endif
16 }
17 
18 static inline int fb_is_primary_device(struct fb_info *info)
19 {
20 	struct device *dev = info->device;
21 	struct device_node *node;
22 
23 	if (console_set_on_cmdline)
24 		return 0;
25 
26 	node = dev->of_node;
27 	if (node &&
28 	    node == of_console_device)
29 		return 1;
30 
31 	return 0;
32 }
33 
34 #endif /* _SPARC_FB_H_ */
35