Loading...
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
10static 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
18static 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_ */
1/* SPDX-License-Identifier: GPL-2.0 */
2#ifndef _SPARC_FB_H_
3#define _SPARC_FB_H_
4
5#include <linux/io.h>
6
7#include <asm/page.h>
8
9struct fb_info;
10
11#ifdef CONFIG_SPARC32
12static inline pgprot_t pgprot_framebuffer(pgprot_t prot,
13 unsigned long vm_start, unsigned long vm_end,
14 unsigned long offset)
15{
16 return prot;
17}
18#define pgprot_framebuffer pgprot_framebuffer
19#endif
20
21int fb_is_primary_device(struct fb_info *info);
22#define fb_is_primary_device fb_is_primary_device
23
24static inline void fb_memcpy_fromio(void *to, const volatile void __iomem *from, size_t n)
25{
26 sbus_memcpy_fromio(to, from, n);
27}
28#define fb_memcpy_fromio fb_memcpy_fromio
29
30static inline void fb_memcpy_toio(volatile void __iomem *to, const void *from, size_t n)
31{
32 sbus_memcpy_toio(to, from, n);
33}
34#define fb_memcpy_toio fb_memcpy_toio
35
36static inline void fb_memset_io(volatile void __iomem *addr, int c, size_t n)
37{
38 sbus_memset_io(addr, c, n);
39}
40#define fb_memset fb_memset_io
41
42#include <asm-generic/fb.h>
43
44#endif /* _SPARC_FB_H_ */