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 <tzimmermann@suse.de>
Reviewed-by: Sam Ravnborg <sam@ravnborg.org>
Cc: Vineet Gupta <vgupta@kernel.org>
Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: Will Deacon <will@kernel.org>
Cc: Huacai Chen <chenhuacai@kernel.org>
Cc: WANG Xuerui <kernel@xen0n.name>
Cc: Geert Uytterhoeven <geert@linux-m68k.org>
Cc: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
Cc: "James E.J. Bottomley" <James.Bottomley@HansenPartnership.com>
Cc: Helge Deller <deller@gmx.de>
Cc: Michael Ellerman <mpe@ellerman.id.au>
Cc: Nicholas Piggin <npiggin@gmail.com>
Cc: Yoshinori Sato <ysato@users.sourceforge.jp>
Cc: Rich Felker <dalias@libc.org>
Cc: John Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de>
Cc: "David S. Miller" <davem@davemloft.net>
Cc: Andreas Larsson <andreas@gaisler.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Borislav Petkov <bp@alien8.de>
Cc: Dave Hansen <dave.hansen@linux.intel.com>
Cc: x86@kernel.org
Cc: "H. Peter Anvin" <hpa@zytor.com>
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
This commit is contained in:
Thomas Zimmermann 2024-03-29 21:32:12 +01:00 committed by Arnd Bergmann
parent f178e96de7
commit 2fd001cd36
No known key found for this signature in database
GPG Key ID: 60AB47FFC9095227
22 changed files with 45 additions and 75 deletions

View File

@ -1,8 +0,0 @@
/* SPDX-License-Identifier: GPL-2.0 */
#ifndef _ASM_FB_H_
#define _ASM_FB_H_
#include <asm-generic/fb.h>
#endif /* _ASM_FB_H_ */

View File

@ -1,6 +0,0 @@
#ifndef _ASM_FB_H_
#define _ASM_FB_H_
#include <asm-generic/fb.h>
#endif /* _ASM_FB_H_ */

View File

@ -1,10 +0,0 @@
/* SPDX-License-Identifier: GPL-2.0-only */
/*
* Copyright (C) 2012 ARM Ltd.
*/
#ifndef __ASM_FB_H_
#define __ASM_FB_H_
#include <asm-generic/fb.h>
#endif /* __ASM_FB_H_ */

View File

@ -2,8 +2,8 @@
/* /*
* Copyright (C) 2020-2022 Loongson Technology Corporation Limited * Copyright (C) 2020-2022 Loongson Technology Corporation Limited
*/ */
#ifndef _ASM_FB_H_ #ifndef _ASM_VIDEO_H_
#define _ASM_FB_H_ #define _ASM_VIDEO_H_
#include <linux/compiler.h> #include <linux/compiler.h>
#include <linux/string.h> #include <linux/string.h>
@ -26,6 +26,6 @@ static inline void fb_memset_io(volatile void __iomem *addr, int c, size_t n)
} }
#define fb_memset fb_memset_io #define fb_memset fb_memset_io
#include <asm-generic/fb.h> #include <asm-generic/video.h>
#endif /* _ASM_FB_H_ */ #endif /* _ASM_VIDEO_H_ */

View File

@ -1,6 +1,6 @@
/* SPDX-License-Identifier: GPL-2.0 */ /* SPDX-License-Identifier: GPL-2.0 */
#ifndef _ASM_FB_H_ #ifndef _ASM_VIDEO_H_
#define _ASM_FB_H_ #define _ASM_VIDEO_H_
#include <asm/page.h> #include <asm/page.h>
#include <asm/setup.h> #include <asm/setup.h>
@ -27,6 +27,6 @@ static inline pgprot_t pgprot_framebuffer(pgprot_t prot,
} }
#define pgprot_framebuffer pgprot_framebuffer #define pgprot_framebuffer pgprot_framebuffer
#include <asm-generic/fb.h> #include <asm-generic/video.h>
#endif /* _ASM_FB_H_ */ #endif /* _ASM_VIDEO_H_ */

View File

@ -1,5 +1,5 @@
#ifndef _ASM_FB_H_ #ifndef _ASM_VIDEO_H_
#define _ASM_FB_H_ #define _ASM_VIDEO_H_
#include <asm/page.h> #include <asm/page.h>
@ -13,8 +13,8 @@ static inline pgprot_t pgprot_framebuffer(pgprot_t prot,
/* /*
* MIPS doesn't define __raw_ I/O macros, so the helpers * MIPS doesn't define __raw_ I/O macros, so the helpers
* in <asm-generic/fb.h> don't generate fb_readq() and * in <asm-generic/video.h> don't generate fb_readq() and
* fb_write(). We have to provide them here. * fb_writeq(). We have to provide them here.
* *
* TODO: Convert MIPS to generic I/O. The helpers below can * TODO: Convert MIPS to generic I/O. The helpers below can
* then be removed. * then be removed.
@ -33,6 +33,6 @@ static inline void fb_writeq(u64 b, volatile void __iomem *addr)
#define fb_writeq fb_writeq #define fb_writeq fb_writeq
#endif #endif
#include <asm-generic/fb.h> #include <asm-generic/video.h>
#endif /* _ASM_FB_H_ */ #endif /* _ASM_VIDEO_H_ */

View File

@ -1,6 +1,6 @@
/* SPDX-License-Identifier: GPL-2.0 */ /* SPDX-License-Identifier: GPL-2.0 */
#ifndef _ASM_FB_H_ #ifndef _ASM_VIDEO_H_
#define _ASM_FB_H_ #define _ASM_VIDEO_H_
#include <linux/types.h> #include <linux/types.h>
@ -11,6 +11,6 @@ bool video_is_primary_device(struct device *dev);
#define video_is_primary_device video_is_primary_device #define video_is_primary_device video_is_primary_device
#endif #endif
#include <asm-generic/fb.h> #include <asm-generic/video.h>
#endif /* _ASM_FB_H_ */ #endif /* _ASM_VIDEO_H_ */

View File

@ -1,3 +1,3 @@
# SPDX-License-Identifier: GPL-2.0-only # SPDX-License-Identifier: GPL-2.0-only
obj-$(CONFIG_STI_CORE) += fbdev.o obj-$(CONFIG_STI_CORE) += video-sti.o

View File

@ -9,7 +9,7 @@
#include <video/sticore.h> #include <video/sticore.h>
#include <asm/fb.h> #include <asm/video.h>
bool video_is_primary_device(struct device *dev) bool video_is_primary_device(struct device *dev)
{ {

View File

@ -1,6 +1,6 @@
/* SPDX-License-Identifier: GPL-2.0 */ /* SPDX-License-Identifier: GPL-2.0 */
#ifndef _ASM_FB_H_ #ifndef _ASM_VIDEO_H_
#define _ASM_FB_H_ #define _ASM_VIDEO_H_
#include <asm/page.h> #include <asm/page.h>
@ -12,6 +12,6 @@ static inline pgprot_t pgprot_framebuffer(pgprot_t prot,
} }
#define pgprot_framebuffer pgprot_framebuffer #define pgprot_framebuffer pgprot_framebuffer
#include <asm-generic/fb.h> #include <asm-generic/video.h>
#endif /* _ASM_FB_H_ */ #endif /* _ASM_VIDEO_H_ */

View File

@ -517,7 +517,7 @@ int pci_iobar_pfn(struct pci_dev *pdev, int bar, struct vm_area_struct *vma)
} }
/* /*
* This one is used by /dev/mem and fbdev who have no clue about the * This one is used by /dev/mem and video who have no clue about the
* PCI device, it tries to find the PCI device first and calls the * PCI device, it tries to find the PCI device first and calls the
* above routine * above routine
*/ */

View File

@ -1,7 +0,0 @@
/* SPDX-License-Identifier: GPL-2.0 */
#ifndef _ASM_FB_H_
#define _ASM_FB_H_
#include <asm-generic/fb.h>
#endif /* _ASM_FB_H_ */

View File

@ -1,6 +1,6 @@
/* SPDX-License-Identifier: GPL-2.0 */ /* SPDX-License-Identifier: GPL-2.0 */
#ifndef _SPARC_FB_H_ #ifndef _SPARC_VIDEO_H_
#define _SPARC_FB_H_ #define _SPARC_VIDEO_H_
#include <linux/io.h> #include <linux/io.h>
#include <linux/types.h> #include <linux/types.h>
@ -40,6 +40,6 @@ static inline void fb_memset_io(volatile void __iomem *addr, int c, size_t n)
} }
#define fb_memset fb_memset_io #define fb_memset fb_memset_io
#include <asm-generic/fb.h> #include <asm-generic/video.h>
#endif /* _SPARC_FB_H_ */ #endif /* _SPARC_VIDEO_H_ */

View File

@ -1,3 +1,3 @@
# SPDX-License-Identifier: GPL-2.0-only # SPDX-License-Identifier: GPL-2.0-only
obj-y += fbdev.o obj-y += video.o

View File

@ -4,8 +4,8 @@
#include <linux/device.h> #include <linux/device.h>
#include <linux/module.h> #include <linux/module.h>
#include <asm/fb.h>
#include <asm/prom.h> #include <asm/prom.h>
#include <asm/video.h>
bool video_is_primary_device(struct device *dev) bool video_is_primary_device(struct device *dev)
{ {
@ -21,5 +21,5 @@ bool video_is_primary_device(struct device *dev)
} }
EXPORT_SYMBOL(video_is_primary_device); EXPORT_SYMBOL(video_is_primary_device);
MODULE_DESCRIPTION("Sparc fbdev helpers"); MODULE_DESCRIPTION("Sparc video helpers");
MODULE_LICENSE("GPL"); MODULE_LICENSE("GPL");

View File

@ -8,7 +8,6 @@ generic-y += dma-mapping.h
generic-y += emergency-restart.h generic-y += emergency-restart.h
generic-y += exec.h generic-y += exec.h
generic-y += extable.h generic-y += extable.h
generic-y += fb.h
generic-y += ftrace.h generic-y += ftrace.h
generic-y += hw_irq.h generic-y += hw_irq.h
generic-y += irq_regs.h generic-y += irq_regs.h
@ -28,3 +27,4 @@ generic-y += trace_clock.h
generic-y += kprobes.h generic-y += kprobes.h
generic-y += mm_hooks.h generic-y += mm_hooks.h
generic-y += vga.h generic-y += vga.h
generic-y += video.h

View File

@ -1,6 +1,6 @@
/* SPDX-License-Identifier: GPL-2.0 */ /* SPDX-License-Identifier: GPL-2.0 */
#ifndef _ASM_X86_FB_H #ifndef _ASM_X86_VIDEO_H
#define _ASM_X86_FB_H #define _ASM_X86_VIDEO_H
#include <linux/types.h> #include <linux/types.h>
@ -16,6 +16,6 @@ pgprot_t pgprot_framebuffer(pgprot_t prot,
bool video_is_primary_device(struct device *dev); bool video_is_primary_device(struct device *dev);
#define video_is_primary_device video_is_primary_device #define video_is_primary_device video_is_primary_device
#include <asm-generic/fb.h> #include <asm-generic/video.h>
#endif /* _ASM_X86_FB_H */ #endif /* _ASM_X86_VIDEO_H */

View File

@ -1,3 +1,3 @@
# SPDX-License-Identifier: GPL-2.0-only # SPDX-License-Identifier: GPL-2.0-only
obj-y += fbdev.o obj-y += video.o

View File

@ -10,7 +10,8 @@
#include <linux/module.h> #include <linux/module.h>
#include <linux/pci.h> #include <linux/pci.h>
#include <linux/vgaarb.h> #include <linux/vgaarb.h>
#include <asm/fb.h>
#include <asm/video.h>
pgprot_t pgprot_framebuffer(pgprot_t prot, pgprot_t pgprot_framebuffer(pgprot_t prot,
unsigned long vm_start, unsigned long vm_end, unsigned long vm_start, unsigned long vm_end,

View File

@ -22,7 +22,6 @@ mandatory-y += dma-mapping.h
mandatory-y += dma.h mandatory-y += dma.h
mandatory-y += emergency-restart.h mandatory-y += emergency-restart.h
mandatory-y += exec.h mandatory-y += exec.h
mandatory-y += fb.h
mandatory-y += ftrace.h mandatory-y += ftrace.h
mandatory-y += futex.h mandatory-y += futex.h
mandatory-y += hardirq.h mandatory-y += hardirq.h
@ -62,5 +61,6 @@ mandatory-y += uaccess.h
mandatory-y += unaligned.h mandatory-y += unaligned.h
mandatory-y += vermagic.h mandatory-y += vermagic.h
mandatory-y += vga.h mandatory-y += vga.h
mandatory-y += video.h
mandatory-y += word-at-a-time.h mandatory-y += word-at-a-time.h
mandatory-y += xor.h mandatory-y += xor.h

View File

@ -1,7 +1,7 @@
/* SPDX-License-Identifier: GPL-2.0 */ /* SPDX-License-Identifier: GPL-2.0 */
#ifndef __ASM_GENERIC_FB_H_ #ifndef __ASM_GENERIC_VIDEO_H_
#define __ASM_GENERIC_FB_H_ #define __ASM_GENERIC_VIDEO_H_
/* /*
* Only include this header file from your architecture's <asm/fb.h>. * Only include this header file from your architecture's <asm/fb.h>.
@ -133,4 +133,4 @@ static inline void fb_memset_io(volatile void __iomem *addr, int c, size_t n)
#define fb_memset fb_memset_io #define fb_memset fb_memset_io
#endif #endif
#endif /* __ASM_GENERIC_FB_H_ */ #endif /* __ASM_GENERIC_VIDEO_H_ */

View File

@ -12,7 +12,7 @@
#include <linux/types.h> #include <linux/types.h>
#include <linux/workqueue.h> #include <linux/workqueue.h>
#include <asm/fb.h> #include <asm/video.h>
struct backlight_device; struct backlight_device;
struct device; struct device;