accel/ivpu: Enable HWS by default on all platforms
[drm/drm-misc.git] / include / asm-generic / video.h
blobb1da2309d943432e86e66298c0ca44b223b99046
1 /* SPDX-License-Identifier: GPL-2.0 */
3 #ifndef __ASM_GENERIC_VIDEO_H_
4 #define __ASM_GENERIC_VIDEO_H_
6 /*
7 * Only include this header file from your architecture's <asm/fb.h>.
8 */
10 #include <linux/io.h>
11 #include <linux/mm_types.h>
12 #include <linux/pgtable.h>
13 #include <linux/types.h>
15 struct device;
17 #ifndef pgprot_framebuffer
18 #define pgprot_framebuffer pgprot_framebuffer
19 static inline pgprot_t pgprot_framebuffer(pgprot_t prot,
20 unsigned long vm_start, unsigned long vm_end,
21 unsigned long offset)
23 return pgprot_writecombine(prot);
25 #endif
27 #ifndef video_is_primary_device
28 #define video_is_primary_device video_is_primary_device
29 static inline bool video_is_primary_device(struct device *dev)
31 return false;
33 #endif
36 * I/O helpers for the framebuffer. Prefer these functions over their
37 * regular counterparts. The regular I/O functions provide in-order
38 * access and swap bytes to/from little-endian ordering. Neither is
39 * required for framebuffers. Instead, the helpers read and write
40 * raw framebuffer data. Independent operations can be reordered for
41 * improved performance.
44 #ifndef fb_readb
45 static inline u8 fb_readb(const volatile void __iomem *addr)
47 return __raw_readb(addr);
49 #define fb_readb fb_readb
50 #endif
52 #ifndef fb_readw
53 static inline u16 fb_readw(const volatile void __iomem *addr)
55 return __raw_readw(addr);
57 #define fb_readw fb_readw
58 #endif
60 #ifndef fb_readl
61 static inline u32 fb_readl(const volatile void __iomem *addr)
63 return __raw_readl(addr);
65 #define fb_readl fb_readl
66 #endif
68 #ifndef fb_readq
69 #if defined(__raw_readq)
70 static inline u64 fb_readq(const volatile void __iomem *addr)
72 return __raw_readq(addr);
74 #define fb_readq fb_readq
75 #endif
76 #endif
78 #ifndef fb_writeb
79 static inline void fb_writeb(u8 b, volatile void __iomem *addr)
81 __raw_writeb(b, addr);
83 #define fb_writeb fb_writeb
84 #endif
86 #ifndef fb_writew
87 static inline void fb_writew(u16 b, volatile void __iomem *addr)
89 __raw_writew(b, addr);
91 #define fb_writew fb_writew
92 #endif
94 #ifndef fb_writel
95 static inline void fb_writel(u32 b, volatile void __iomem *addr)
97 __raw_writel(b, addr);
99 #define fb_writel fb_writel
100 #endif
102 #ifndef fb_writeq
103 #if defined(__raw_writeq)
104 static inline void fb_writeq(u64 b, volatile void __iomem *addr)
106 __raw_writeq(b, addr);
108 #define fb_writeq fb_writeq
109 #endif
110 #endif
112 #ifndef fb_memcpy_fromio
113 static inline void fb_memcpy_fromio(void *to, const volatile void __iomem *from, size_t n)
115 memcpy_fromio(to, from, n);
117 #define fb_memcpy_fromio fb_memcpy_fromio
118 #endif
120 #ifndef fb_memcpy_toio
121 static inline void fb_memcpy_toio(volatile void __iomem *to, const void *from, size_t n)
123 memcpy_toio(to, from, n);
125 #define fb_memcpy_toio fb_memcpy_toio
126 #endif
128 #ifndef fb_memset
129 static inline void fb_memset_io(volatile void __iomem *addr, int c, size_t n)
131 memset_io(addr, c, n);
133 #define fb_memset fb_memset_io
134 #endif
136 #endif /* __ASM_GENERIC_VIDEO_H_ */