blob: 2173432ad7f72ec8326f55048b440cbba7c68048 [file] [log] [blame]
David S. Miller9f747d62007-11-16 03:26:41 -08001#ifndef _SPARC_FB_H_
2#define _SPARC_FB_H_
David S. Miller0a492892010-08-15 00:26:14 -07003#include <linux/console.h>
Antonino A. Daplas317b3c22007-07-17 04:05:28 -07004#include <linux/fb.h>
David S. Miller9f747d62007-11-16 03:26:41 -08005#include <linux/fs.h>
6#include <asm/page.h>
David S. Miller3adf55a2007-07-18 22:03:58 -07007#include <asm/prom.h>
Antonino A. Daplas10eb2652007-07-17 04:05:27 -07008
David S. Miller9f747d62007-11-16 03:26:41 -08009static inline void fb_pgprotect(struct file *file, struct vm_area_struct *vma,
10 unsigned long off)
11{
12#ifdef CONFIG_SPARC64
13 vma->vm_page_prot = pgprot_noncached(vma->vm_page_prot);
14#endif
15}
Antonino A. Daplas10eb2652007-07-17 04:05:27 -070016
Antonino A. Daplas317b3c22007-07-17 04:05:28 -070017static inline int fb_is_primary_device(struct fb_info *info)
18{
David S. Miller3adf55a2007-07-18 22:03:58 -070019 struct device *dev = info->device;
20 struct device_node *node;
21
David S. Miller0a492892010-08-15 00:26:14 -070022 if (console_set_on_cmdline)
23 return 0;
24
Grant Likely61c7a082010-04-13 16:12:29 -070025 node = dev->of_node;
David S. Miller3adf55a2007-07-18 22:03:58 -070026 if (node &&
27 node == of_console_device)
28 return 1;
29
Antonino A. Daplas317b3c22007-07-17 04:05:28 -070030 return 0;
31}
32
David S. Miller9f747d62007-11-16 03:26:41 -080033#endif /* _SPARC_FB_H_ */