From 2fd001cd36005846caa6456fff1008c6f5bae9d4 Mon Sep 17 00:00:00 2001 From: Thomas Zimmermann Date: Fri, 29 Mar 2024 21:32:12 +0100 Subject: arch: Rename fbdev header and source files The per-architecture fbdev code has no dependencies on fbdev and can be used for any video-related subsystem. Rename the files to 'video'. Use video-sti.c on parisc as the source file depends on CONFIG_STI_CORE. On arc, arm, arm64, sh, and um the asm header file is an empty wrapper around the file in asm-generic. Let Kbuild generate the file. The build system does this automatically. Only um needs to generate video.h explicitly, so that it overrides the host architecture's header. The latter would otherwise interfere with the build. Further update all includes statements, include guards, and Makefiles. Also update a few strings and comments to refer to video instead of fbdev. v3: - arc, arm, arm64, sh: generate asm header via build system (Sam, Helge, Arnd) - um: rename fb.h to video.h - fix typo in commit message (Sam) Signed-off-by: Thomas Zimmermann Reviewed-by: Sam Ravnborg Cc: Vineet Gupta Cc: Catalin Marinas Cc: Will Deacon Cc: Huacai Chen Cc: WANG Xuerui Cc: Geert Uytterhoeven Cc: Thomas Bogendoerfer Cc: "James E.J. Bottomley" Cc: Helge Deller Cc: Michael Ellerman Cc: Nicholas Piggin Cc: Yoshinori Sato Cc: Rich Felker Cc: John Paul Adrian Glaubitz Cc: "David S. Miller" Cc: Andreas Larsson Cc: Thomas Gleixner Cc: Ingo Molnar Cc: Borislav Petkov Cc: Dave Hansen Cc: x86@kernel.org Cc: "H. Peter Anvin" Signed-off-by: Arnd Bergmann --- include/asm-generic/Kbuild | 2 +- include/asm-generic/fb.h | 136 -------------------------------------------- include/asm-generic/video.h | 136 ++++++++++++++++++++++++++++++++++++++++++++ include/linux/fb.h | 2 +- 4 files changed, 138 insertions(+), 138 deletions(-) delete mode 100644 include/asm-generic/fb.h create mode 100644 include/asm-generic/video.h (limited to 'include') diff --git a/include/asm-generic/Kbuild b/include/asm-generic/Kbuild index d436bee4d129..b20fa25a7e8d 100644 --- a/include/asm-generic/Kbuild +++ b/include/asm-generic/Kbuild @@ -22,7 +22,6 @@ mandatory-y += dma-mapping.h mandatory-y += dma.h mandatory-y += emergency-restart.h mandatory-y += exec.h -mandatory-y += fb.h mandatory-y += ftrace.h mandatory-y += futex.h mandatory-y += hardirq.h @@ -62,5 +61,6 @@ mandatory-y += uaccess.h mandatory-y += unaligned.h mandatory-y += vermagic.h mandatory-y += vga.h +mandatory-y += video.h mandatory-y += word-at-a-time.h mandatory-y += xor.h diff --git a/include/asm-generic/fb.h b/include/asm-generic/fb.h deleted file mode 100644 index 4788c1e1c6bc..000000000000 --- a/include/asm-generic/fb.h +++ /dev/null @@ -1,136 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0 */ - -#ifndef __ASM_GENERIC_FB_H_ -#define __ASM_GENERIC_FB_H_ - -/* - * Only include this header file from your architecture's . - */ - -#include -#include -#include -#include - -struct device; - -#ifndef pgprot_framebuffer -#define pgprot_framebuffer pgprot_framebuffer -static inline pgprot_t pgprot_framebuffer(pgprot_t prot, - unsigned long vm_start, unsigned long vm_end, - unsigned long offset) -{ - return pgprot_writecombine(prot); -} -#endif - -#ifndef video_is_primary_device -#define video_is_primary_device video_is_primary_device -static inline bool video_is_primary_device(struct device *dev) -{ - return false; -} -#endif - -/* - * I/O helpers for the framebuffer. Prefer these functions over their - * regular counterparts. The regular I/O functions provide in-order - * access and swap bytes to/from little-endian ordering. Neither is - * required for framebuffers. Instead, the helpers read and write - * raw framebuffer data. Independent operations can be reordered for - * improved performance. - */ - -#ifndef fb_readb -static inline u8 fb_readb(const volatile void __iomem *addr) -{ - return __raw_readb(addr); -} -#define fb_readb fb_readb -#endif - -#ifndef fb_readw -static inline u16 fb_readw(const volatile void __iomem *addr) -{ - return __raw_readw(addr); -} -#define fb_readw fb_readw -#endif - -#ifndef fb_readl -static inline u32 fb_readl(const volatile void __iomem *addr) -{ - return __raw_readl(addr); -} -#define fb_readl fb_readl -#endif - -#ifndef fb_readq -#if defined(__raw_readq) -static inline u64 fb_readq(const volatile void __iomem *addr) -{ - return __raw_readq(addr); -} -#define fb_readq fb_readq -#endif -#endif - -#ifndef fb_writeb -static inline void fb_writeb(u8 b, volatile void __iomem *addr) -{ - __raw_writeb(b, addr); -} -#define fb_writeb fb_writeb -#endif - -#ifndef fb_writew -static inline void fb_writew(u16 b, volatile void __iomem *addr) -{ - __raw_writew(b, addr); -} -#define fb_writew fb_writew -#endif - -#ifndef fb_writel -static inline void fb_writel(u32 b, volatile void __iomem *addr) -{ - __raw_writel(b, addr); -} -#define fb_writel fb_writel -#endif - -#ifndef fb_writeq -#if defined(__raw_writeq) -static inline void fb_writeq(u64 b, volatile void __iomem *addr) -{ - __raw_writeq(b, addr); -} -#define fb_writeq fb_writeq -#endif -#endif - -#ifndef fb_memcpy_fromio -static inline void fb_memcpy_fromio(void *to, const volatile void __iomem *from, size_t n) -{ - memcpy_fromio(to, from, n); -} -#define fb_memcpy_fromio fb_memcpy_fromio -#endif - -#ifndef fb_memcpy_toio -static inline void fb_memcpy_toio(volatile void __iomem *to, const void *from, size_t n) -{ - memcpy_toio(to, from, n); -} -#define fb_memcpy_toio fb_memcpy_toio -#endif - -#ifndef fb_memset -static inline void fb_memset_io(volatile void __iomem *addr, int c, size_t n) -{ - memset_io(addr, c, n); -} -#define fb_memset fb_memset_io -#endif - -#endif /* __ASM_GENERIC_FB_H_ */ diff --git a/include/asm-generic/video.h b/include/asm-generic/video.h new file mode 100644 index 000000000000..b1da2309d943 --- /dev/null +++ b/include/asm-generic/video.h @@ -0,0 +1,136 @@ +/* SPDX-License-Identifier: GPL-2.0 */ + +#ifndef __ASM_GENERIC_VIDEO_H_ +#define __ASM_GENERIC_VIDEO_H_ + +/* + * Only include this header file from your architecture's . + */ + +#include +#include +#include +#include + +struct device; + +#ifndef pgprot_framebuffer +#define pgprot_framebuffer pgprot_framebuffer +static inline pgprot_t pgprot_framebuffer(pgprot_t prot, + unsigned long vm_start, unsigned long vm_end, + unsigned long offset) +{ + return pgprot_writecombine(prot); +} +#endif + +#ifndef video_is_primary_device +#define video_is_primary_device video_is_primary_device +static inline bool video_is_primary_device(struct device *dev) +{ + return false; +} +#endif + +/* + * I/O helpers for the framebuffer. Prefer these functions over their + * regular counterparts. The regular I/O functions provide in-order + * access and swap bytes to/from little-endian ordering. Neither is + * required for framebuffers. Instead, the helpers read and write + * raw framebuffer data. Independent operations can be reordered for + * improved performance. + */ + +#ifndef fb_readb +static inline u8 fb_readb(const volatile void __iomem *addr) +{ + return __raw_readb(addr); +} +#define fb_readb fb_readb +#endif + +#ifndef fb_readw +static inline u16 fb_readw(const volatile void __iomem *addr) +{ + return __raw_readw(addr); +} +#define fb_readw fb_readw +#endif + +#ifndef fb_readl +static inline u32 fb_readl(const volatile void __iomem *addr) +{ + return __raw_readl(addr); +} +#define fb_readl fb_readl +#endif + +#ifndef fb_readq +#if defined(__raw_readq) +static inline u64 fb_readq(const volatile void __iomem *addr) +{ + return __raw_readq(addr); +} +#define fb_readq fb_readq +#endif +#endif + +#ifndef fb_writeb +static inline void fb_writeb(u8 b, volatile void __iomem *addr) +{ + __raw_writeb(b, addr); +} +#define fb_writeb fb_writeb +#endif + +#ifndef fb_writew +static inline void fb_writew(u16 b, volatile void __iomem *addr) +{ + __raw_writew(b, addr); +} +#define fb_writew fb_writew +#endif + +#ifndef fb_writel +static inline void fb_writel(u32 b, volatile void __iomem *addr) +{ + __raw_writel(b, addr); +} +#define fb_writel fb_writel +#endif + +#ifndef fb_writeq +#if defined(__raw_writeq) +static inline void fb_writeq(u64 b, volatile void __iomem *addr) +{ + __raw_writeq(b, addr); +} +#define fb_writeq fb_writeq +#endif +#endif + +#ifndef fb_memcpy_fromio +static inline void fb_memcpy_fromio(void *to, const volatile void __iomem *from, size_t n) +{ + memcpy_fromio(to, from, n); +} +#define fb_memcpy_fromio fb_memcpy_fromio +#endif + +#ifndef fb_memcpy_toio +static inline void fb_memcpy_toio(volatile void __iomem *to, const void *from, size_t n) +{ + memcpy_toio(to, from, n); +} +#define fb_memcpy_toio fb_memcpy_toio +#endif + +#ifndef fb_memset +static inline void fb_memset_io(volatile void __iomem *addr, int c, size_t n) +{ + memset_io(addr, c, n); +} +#define fb_memset fb_memset_io +#endif + +#endif /* __ASM_GENERIC_VIDEO_H_ */ diff --git a/include/linux/fb.h b/include/linux/fb.h index 0dd27364d56f..bd97240dd272 100644 --- a/include/linux/fb.h +++ b/include/linux/fb.h @@ -12,7 +12,7 @@ #include #include -#include +#include struct backlight_device; struct device; -- cgit v1.2.3