linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 0/3] arch: Remove fbdev dependency from video helpers
@ 2024-03-27 20:41 Thomas Zimmermann
  2024-03-27 20:41 ` [PATCH v2 1/3] arch: Select fbdev helpers with CONFIG_VIDEO Thomas Zimmermann
                   ` (2 more replies)
  0 siblings, 3 replies; 16+ messages in thread
From: Thomas Zimmermann @ 2024-03-27 20:41 UTC (permalink / raw)
  To: arnd, javierm, deller, sui.jingfeng
  Cc: linux-arch, linux-fbdev, Thomas Zimmermann, linux-parisc,
	linux-sh, linux-mips, dri-devel, linux-kernel, linux-m68k,
	loongarch, sparclinux, linux-snps-arc, linuxppc-dev,
	linux-arm-kernel

Make architecture helpers for display functionality depend on general
video functionality instead of fbdev. This avoids the dependency on
fbdev and makes the functionality available for non-fbdev code.

Patch 1 replaces the variety of Kconfig options that control the
Makefiles with CONFIG_VIDEO. More fine-grained control of the build
can then be done within each video/ directory; see parisc for an
example.

Patch 2 replaces fb_is_primary_device() with video_is_primary_device(),
which has no dependencies on fbdev. The implementation remains identical
on all affected platforms. There's one minor change in fbcon, which is
the only caller of fb_is_primary_device().

Patch 3 renames the source and files from fbdev to video.

v2:
- improve cover letter
- rebase onto v6.9-rc1

Thomas Zimmermann (3):
  arch: Select fbdev helpers with CONFIG_VIDEO
  arch: Remove struct fb_info from video helpers
  arch: Rename fbdev header and source files

 arch/arc/include/asm/fb.h                    |  8 ------
 arch/arc/include/asm/video.h                 |  8 ++++++
 arch/arm/include/asm/fb.h                    |  6 -----
 arch/arm/include/asm/video.h                 |  6 +++++
 arch/arm64/include/asm/fb.h                  | 10 --------
 arch/arm64/include/asm/video.h               | 10 ++++++++
 arch/loongarch/include/asm/{fb.h => video.h} |  8 +++---
 arch/m68k/include/asm/{fb.h => video.h}      |  8 +++---
 arch/mips/include/asm/{fb.h => video.h}      | 12 ++++-----
 arch/parisc/Makefile                         |  2 +-
 arch/parisc/include/asm/fb.h                 | 14 -----------
 arch/parisc/include/asm/video.h              | 16 ++++++++++++
 arch/parisc/video/Makefile                   |  2 +-
 arch/parisc/video/{fbdev.c => video-sti.c}   |  9 ++++---
 arch/powerpc/include/asm/{fb.h => video.h}   |  8 +++---
 arch/powerpc/kernel/pci-common.c             |  2 +-
 arch/sh/include/asm/fb.h                     |  7 ------
 arch/sh/include/asm/video.h                  |  7 ++++++
 arch/sparc/Makefile                          |  4 +--
 arch/sparc/include/asm/{fb.h => video.h}     | 15 +++++------
 arch/sparc/video/Makefile                    |  2 +-
 arch/sparc/video/fbdev.c                     | 26 --------------------
 arch/sparc/video/video.c                     | 25 +++++++++++++++++++
 arch/x86/Makefile                            |  2 +-
 arch/x86/include/asm/fb.h                    | 19 --------------
 arch/x86/include/asm/video.h                 | 21 ++++++++++++++++
 arch/x86/video/Makefile                      |  3 ++-
 arch/x86/video/{fbdev.c => video.c}          | 21 +++++++---------
 drivers/video/fbdev/core/fbcon.c             |  2 +-
 include/asm-generic/Kbuild                   |  2 +-
 include/asm-generic/{fb.h => video.h}        | 17 +++++++------
 include/linux/fb.h                           |  2 +-
 32 files changed, 154 insertions(+), 150 deletions(-)
 delete mode 100644 arch/arc/include/asm/fb.h
 create mode 100644 arch/arc/include/asm/video.h
 delete mode 100644 arch/arm/include/asm/fb.h
 create mode 100644 arch/arm/include/asm/video.h
 delete mode 100644 arch/arm64/include/asm/fb.h
 create mode 100644 arch/arm64/include/asm/video.h
 rename arch/loongarch/include/asm/{fb.h => video.h} (86%)
 rename arch/m68k/include/asm/{fb.h => video.h} (86%)
 rename arch/mips/include/asm/{fb.h => video.h} (76%)
 delete mode 100644 arch/parisc/include/asm/fb.h
 create mode 100644 arch/parisc/include/asm/video.h
 rename arch/parisc/video/{fbdev.c => video-sti.c} (78%)
 rename arch/powerpc/include/asm/{fb.h => video.h} (76%)
 delete mode 100644 arch/sh/include/asm/fb.h
 create mode 100644 arch/sh/include/asm/video.h
 rename arch/sparc/include/asm/{fb.h => video.h} (75%)
 delete mode 100644 arch/sparc/video/fbdev.c
 create mode 100644 arch/sparc/video/video.c
 delete mode 100644 arch/x86/include/asm/fb.h
 create mode 100644 arch/x86/include/asm/video.h
 rename arch/x86/video/{fbdev.c => video.c} (66%)
 rename include/asm-generic/{fb.h => video.h} (89%)

-- 
2.44.0


^ permalink raw reply	[flat|nested] 16+ messages in thread

* [PATCH v2 1/3] arch: Select fbdev helpers with CONFIG_VIDEO
  2024-03-27 20:41 [PATCH v2 0/3] arch: Remove fbdev dependency from video helpers Thomas Zimmermann
@ 2024-03-27 20:41 ` Thomas Zimmermann
  2024-03-28  7:24   ` Sam Ravnborg
  2024-03-28 12:39   ` Helge Deller
  2024-03-27 20:41 ` [PATCH v2 2/3] arch: Remove struct fb_info from video helpers Thomas Zimmermann
  2024-03-27 20:41 ` [PATCH v2 3/3] arch: Rename fbdev header and source files Thomas Zimmermann
  2 siblings, 2 replies; 16+ messages in thread
From: Thomas Zimmermann @ 2024-03-27 20:41 UTC (permalink / raw)
  To: arnd, javierm, deller, sui.jingfeng
  Cc: Andreas Larsson, linux-fbdev, linux-sh, Dave Hansen, dri-devel,
	linux-kernel, James E.J. Bottomley, H. Peter Anvin, sparclinux,
	linux-arch, x86, Ingo Molnar, linux-snps-arc, linux-m68k,
	Borislav Petkov, loongarch, Thomas Gleixner, linux-arm-kernel,
	linux-parisc, linux-mips, Thomas Zimmermann, linuxppc-dev,
	David S. Miller

Various Kconfig options selected the per-architecture helpers for
fbdev. But none of the contained code depends on fbdev. Standardize
on CONFIG_VIDEO, which will allow to add more general helpers for
video functionality.

CONFIG_VIDEO protects each architecture's video/ directory. This
allows for the use of more fine-grained control for each directory's
files, such as the use of CONFIG_STI_CORE on parisc.

v2:
- sparc: rebased onto Makefile changes

Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Cc: "James E.J. Bottomley" <James.Bottomley@HansenPartnership.com>
Cc: Helge Deller <deller@gmx.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>
---
 arch/parisc/Makefile      | 2 +-
 arch/sparc/Makefile       | 4 ++--
 arch/sparc/video/Makefile | 2 +-
 arch/x86/Makefile         | 2 +-
 arch/x86/video/Makefile   | 3 ++-
 5 files changed, 7 insertions(+), 6 deletions(-)

diff --git a/arch/parisc/Makefile b/arch/parisc/Makefile
index 316f84f1d15c8..21b8166a68839 100644
--- a/arch/parisc/Makefile
+++ b/arch/parisc/Makefile
@@ -119,7 +119,7 @@ export LIBGCC
 
 libs-y	+= arch/parisc/lib/ $(LIBGCC)
 
-drivers-y += arch/parisc/video/
+drivers-$(CONFIG_VIDEO) += arch/parisc/video/
 
 boot	:= arch/parisc/boot
 
diff --git a/arch/sparc/Makefile b/arch/sparc/Makefile
index 2a03daa68f285..757451c3ea1df 100644
--- a/arch/sparc/Makefile
+++ b/arch/sparc/Makefile
@@ -59,8 +59,8 @@ endif
 libs-y                 += arch/sparc/prom/
 libs-y                 += arch/sparc/lib/
 
-drivers-$(CONFIG_PM) += arch/sparc/power/
-drivers-$(CONFIG_FB_CORE) += arch/sparc/video/
+drivers-$(CONFIG_PM)    += arch/sparc/power/
+drivers-$(CONFIG_VIDEO) += arch/sparc/video/
 
 boot := arch/sparc/boot
 
diff --git a/arch/sparc/video/Makefile b/arch/sparc/video/Makefile
index d4d83f1702c61..9dd82880a027a 100644
--- a/arch/sparc/video/Makefile
+++ b/arch/sparc/video/Makefile
@@ -1,3 +1,3 @@
 # SPDX-License-Identifier: GPL-2.0-only
 
-obj-$(CONFIG_FB_CORE) += fbdev.o
+obj-y	+= fbdev.o
diff --git a/arch/x86/Makefile b/arch/x86/Makefile
index 15a5f4f2ff0aa..c0ea612c62ebe 100644
--- a/arch/x86/Makefile
+++ b/arch/x86/Makefile
@@ -265,7 +265,7 @@ drivers-$(CONFIG_PCI)            += arch/x86/pci/
 # suspend and hibernation support
 drivers-$(CONFIG_PM) += arch/x86/power/
 
-drivers-$(CONFIG_FB_CORE) += arch/x86/video/
+drivers-$(CONFIG_VIDEO) += arch/x86/video/
 
 ####
 # boot loader support. Several targets are kept for legacy purposes
diff --git a/arch/x86/video/Makefile b/arch/x86/video/Makefile
index 5ebe48752ffc4..9dd82880a027a 100644
--- a/arch/x86/video/Makefile
+++ b/arch/x86/video/Makefile
@@ -1,2 +1,3 @@
 # SPDX-License-Identifier: GPL-2.0-only
-obj-$(CONFIG_FB_CORE)		+= fbdev.o
+
+obj-y	+= fbdev.o
-- 
2.44.0


^ permalink raw reply related	[flat|nested] 16+ messages in thread

* [PATCH v2 2/3] arch: Remove struct fb_info from video helpers
  2024-03-27 20:41 [PATCH v2 0/3] arch: Remove fbdev dependency from video helpers Thomas Zimmermann
  2024-03-27 20:41 ` [PATCH v2 1/3] arch: Select fbdev helpers with CONFIG_VIDEO Thomas Zimmermann
@ 2024-03-27 20:41 ` Thomas Zimmermann
  2024-03-28  7:25   ` Sam Ravnborg
  2024-03-28 11:04   ` Helge Deller
  2024-03-27 20:41 ` [PATCH v2 3/3] arch: Rename fbdev header and source files Thomas Zimmermann
  2 siblings, 2 replies; 16+ messages in thread
From: Thomas Zimmermann @ 2024-03-27 20:41 UTC (permalink / raw)
  To: arnd, javierm, deller, sui.jingfeng
  Cc: Andreas Larsson, linux-fbdev, linux-sh, Dave Hansen, dri-devel,
	linux-kernel, James E.J. Bottomley, H. Peter Anvin, sparclinux,
	linux-arch, x86, Ingo Molnar, linux-snps-arc, linux-m68k,
	Borislav Petkov, loongarch, Thomas Gleixner, linux-arm-kernel,
	linux-parisc, linux-mips, Thomas Zimmermann, linuxppc-dev,
	David S. Miller

The per-architecture video helpers do not depend on struct fb_info
or anything else from fbdev. Remove it from the interface and replace
fb_is_primary_device() with video_is_primary_device(). The new helper
is similar in functionality, but can operate on non-fbdev devices.

Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Cc: "James E.J. Bottomley" <James.Bottomley@HansenPartnership.com>
Cc: Helge Deller <deller@gmx.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>
---
 arch/parisc/include/asm/fb.h     |  8 +++++---
 arch/parisc/video/fbdev.c        |  9 +++++----
 arch/sparc/include/asm/fb.h      |  7 ++++---
 arch/sparc/video/fbdev.c         | 17 ++++++++---------
 arch/x86/include/asm/fb.h        |  8 +++++---
 arch/x86/video/fbdev.c           | 18 +++++++-----------
 drivers/video/fbdev/core/fbcon.c |  2 +-
 include/asm-generic/fb.h         | 11 ++++++-----
 8 files changed, 41 insertions(+), 39 deletions(-)

diff --git a/arch/parisc/include/asm/fb.h b/arch/parisc/include/asm/fb.h
index 658a8a7dc5312..ed2a195a3e762 100644
--- a/arch/parisc/include/asm/fb.h
+++ b/arch/parisc/include/asm/fb.h
@@ -2,11 +2,13 @@
 #ifndef _ASM_FB_H_
 #define _ASM_FB_H_
 
-struct fb_info;
+#include <linux/types.h>
+
+struct device;
 
 #if defined(CONFIG_STI_CORE)
-int fb_is_primary_device(struct fb_info *info);
-#define fb_is_primary_device fb_is_primary_device
+bool video_is_primary_device(struct device *dev);
+#define video_is_primary_device video_is_primary_device
 #endif
 
 #include <asm-generic/fb.h>
diff --git a/arch/parisc/video/fbdev.c b/arch/parisc/video/fbdev.c
index e4f8ac99fc9e0..540fa0c919d59 100644
--- a/arch/parisc/video/fbdev.c
+++ b/arch/parisc/video/fbdev.c
@@ -5,12 +5,13 @@
  * Copyright (C) 2001-2002 Thomas Bogendoerfer <tsbogend@alpha.franken.de>
  */
 
-#include <linux/fb.h>
 #include <linux/module.h>
 
 #include <video/sticore.h>
 
-int fb_is_primary_device(struct fb_info *info)
+#include <asm/fb.h>
+
+bool video_is_primary_device(struct device *dev)
 {
 	struct sti_struct *sti;
 
@@ -21,6 +22,6 @@ int fb_is_primary_device(struct fb_info *info)
 		return true;
 
 	/* return true if it's the default built-in framebuffer driver */
-	return (sti->dev == info->device);
+	return (sti->dev == dev);
 }
-EXPORT_SYMBOL(fb_is_primary_device);
+EXPORT_SYMBOL(video_is_primary_device);
diff --git a/arch/sparc/include/asm/fb.h b/arch/sparc/include/asm/fb.h
index 24440c0fda490..07f0325d6921c 100644
--- a/arch/sparc/include/asm/fb.h
+++ b/arch/sparc/include/asm/fb.h
@@ -3,10 +3,11 @@
 #define _SPARC_FB_H_
 
 #include <linux/io.h>
+#include <linux/types.h>
 
 #include <asm/page.h>
 
-struct fb_info;
+struct device;
 
 #ifdef CONFIG_SPARC32
 static inline pgprot_t pgprot_framebuffer(pgprot_t prot,
@@ -18,8 +19,8 @@ static inline pgprot_t pgprot_framebuffer(pgprot_t prot,
 #define pgprot_framebuffer pgprot_framebuffer
 #endif
 
-int fb_is_primary_device(struct fb_info *info);
-#define fb_is_primary_device fb_is_primary_device
+bool video_is_primary_device(struct device *dev);
+#define video_is_primary_device video_is_primary_device
 
 static inline void fb_memcpy_fromio(void *to, const volatile void __iomem *from, size_t n)
 {
diff --git a/arch/sparc/video/fbdev.c b/arch/sparc/video/fbdev.c
index bff66dd1909a4..e46f0499c2774 100644
--- a/arch/sparc/video/fbdev.c
+++ b/arch/sparc/video/fbdev.c
@@ -1,26 +1,25 @@
 // SPDX-License-Identifier: GPL-2.0
 
 #include <linux/console.h>
-#include <linux/fb.h>
+#include <linux/device.h>
 #include <linux/module.h>
 
+#include <asm/fb.h>
 #include <asm/prom.h>
 
-int fb_is_primary_device(struct fb_info *info)
+bool video_is_primary_device(struct device *dev)
 {
-	struct device *dev = info->device;
-	struct device_node *node;
+	struct device_node *node = dev->of_node;
 
 	if (console_set_on_cmdline)
-		return 0;
+		return false;
 
-	node = dev->of_node;
 	if (node && node == of_console_device)
-		return 1;
+		return true;
 
-	return 0;
+	return false;
 }
-EXPORT_SYMBOL(fb_is_primary_device);
+EXPORT_SYMBOL(video_is_primary_device);
 
 MODULE_DESCRIPTION("Sparc fbdev helpers");
 MODULE_LICENSE("GPL");
diff --git a/arch/x86/include/asm/fb.h b/arch/x86/include/asm/fb.h
index c3b9582de7efd..999db33792869 100644
--- a/arch/x86/include/asm/fb.h
+++ b/arch/x86/include/asm/fb.h
@@ -2,17 +2,19 @@
 #ifndef _ASM_X86_FB_H
 #define _ASM_X86_FB_H
 
+#include <linux/types.h>
+
 #include <asm/page.h>
 
-struct fb_info;
+struct device;
 
 pgprot_t pgprot_framebuffer(pgprot_t prot,
 			    unsigned long vm_start, unsigned long vm_end,
 			    unsigned long offset);
 #define pgprot_framebuffer pgprot_framebuffer
 
-int fb_is_primary_device(struct fb_info *info);
-#define fb_is_primary_device fb_is_primary_device
+bool video_is_primary_device(struct device *dev);
+#define video_is_primary_device video_is_primary_device
 
 #include <asm-generic/fb.h>
 
diff --git a/arch/x86/video/fbdev.c b/arch/x86/video/fbdev.c
index 1dd6528cc947c..4d87ce8e257fe 100644
--- a/arch/x86/video/fbdev.c
+++ b/arch/x86/video/fbdev.c
@@ -7,7 +7,6 @@
  *
  */
 
-#include <linux/fb.h>
 #include <linux/module.h>
 #include <linux/pci.h>
 #include <linux/vgaarb.h>
@@ -25,20 +24,17 @@ pgprot_t pgprot_framebuffer(pgprot_t prot,
 }
 EXPORT_SYMBOL(pgprot_framebuffer);
 
-int fb_is_primary_device(struct fb_info *info)
+bool video_is_primary_device(struct device *dev)
 {
-	struct device *device = info->device;
-	struct pci_dev *pci_dev;
+	struct pci_dev *pdev;
 
-	if (!device || !dev_is_pci(device))
-		return 0;
+	if (!dev_is_pci(dev))
+		return false;
 
-	pci_dev = to_pci_dev(device);
+	pdev = to_pci_dev(dev);
 
-	if (pci_dev == vga_default_device())
-		return 1;
-	return 0;
+	return (pdev == vga_default_device());
 }
-EXPORT_SYMBOL(fb_is_primary_device);
+EXPORT_SYMBOL(video_is_primary_device);
 
 MODULE_LICENSE("GPL");
diff --git a/drivers/video/fbdev/core/fbcon.c b/drivers/video/fbdev/core/fbcon.c
index 46823c2e2ba12..85c5c8cbc680a 100644
--- a/drivers/video/fbdev/core/fbcon.c
+++ b/drivers/video/fbdev/core/fbcon.c
@@ -2939,7 +2939,7 @@ void fbcon_remap_all(struct fb_info *info)
 static void fbcon_select_primary(struct fb_info *info)
 {
 	if (!map_override && primary_device == -1 &&
-	    fb_is_primary_device(info)) {
+	    video_is_primary_device(info->device)) {
 		int i;
 
 		printk(KERN_INFO "fbcon: %s (fb%i) is primary device\n",
diff --git a/include/asm-generic/fb.h b/include/asm-generic/fb.h
index 6ccabb400aa66..4788c1e1c6bc0 100644
--- a/include/asm-generic/fb.h
+++ b/include/asm-generic/fb.h
@@ -10,8 +10,9 @@
 #include <linux/io.h>
 #include <linux/mm_types.h>
 #include <linux/pgtable.h>
+#include <linux/types.h>
 
-struct fb_info;
+struct device;
 
 #ifndef pgprot_framebuffer
 #define pgprot_framebuffer pgprot_framebuffer
@@ -23,11 +24,11 @@ static inline pgprot_t pgprot_framebuffer(pgprot_t prot,
 }
 #endif
 
-#ifndef fb_is_primary_device
-#define fb_is_primary_device fb_is_primary_device
-static inline int fb_is_primary_device(struct fb_info *info)
+#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 0;
+	return false;
 }
 #endif
 
-- 
2.44.0


^ permalink raw reply related	[flat|nested] 16+ messages in thread

* [PATCH v2 3/3] arch: Rename fbdev header and source files
  2024-03-27 20:41 [PATCH v2 0/3] arch: Remove fbdev dependency from video helpers Thomas Zimmermann
  2024-03-27 20:41 ` [PATCH v2 1/3] arch: Select fbdev helpers with CONFIG_VIDEO Thomas Zimmermann
  2024-03-27 20:41 ` [PATCH v2 2/3] arch: Remove struct fb_info from video helpers Thomas Zimmermann
@ 2024-03-27 20:41 ` Thomas Zimmermann
  2024-03-28  7:23   ` Sam Ravnborg
                     ` (2 more replies)
  2 siblings, 3 replies; 16+ messages in thread
From: Thomas Zimmermann @ 2024-03-27 20:41 UTC (permalink / raw)
  To: arnd, javierm, deller, sui.jingfeng
  Cc: Andreas Larsson, linux-fbdev, Rich Felker, linux-sh,
	Catalin Marinas, Dave Hansen, x86, dri-devel, linux-kernel,
	James E.J. Bottomley, H. Peter Anvin, sparclinux, WANG Xuerui,
	Will Deacon, linux-arch, Yoshinori Sato, Huacai Chen, Ingo Molnar,
	Geert Uytterhoeven, Vineet Gupta, linux-snps-arc, Nicholas Piggin,
	linux-m68k, Borislav Petkov, loongarch, John Paul Adrian Glaubitz,
	Thomas Gleixner, linux-arm-kernel

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.

Further update all includes statements, includ guards, and Makefiles.
Also update a few strings and comments to refer to video instead of
fbdev.

Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
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>
---
 arch/arc/include/asm/fb.h                    |  8 --------
 arch/arc/include/asm/video.h                 |  8 ++++++++
 arch/arm/include/asm/fb.h                    |  6 ------
 arch/arm/include/asm/video.h                 |  6 ++++++
 arch/arm64/include/asm/fb.h                  | 10 ----------
 arch/arm64/include/asm/video.h               | 10 ++++++++++
 arch/loongarch/include/asm/{fb.h => video.h} |  8 ++++----
 arch/m68k/include/asm/{fb.h => video.h}      |  8 ++++----
 arch/mips/include/asm/{fb.h => video.h}      | 12 ++++++------
 arch/parisc/include/asm/{fb.h => video.h}    |  8 ++++----
 arch/parisc/video/Makefile                   |  2 +-
 arch/parisc/video/{fbdev.c => video-sti.c}   |  2 +-
 arch/powerpc/include/asm/{fb.h => video.h}   |  8 ++++----
 arch/powerpc/kernel/pci-common.c             |  2 +-
 arch/sh/include/asm/fb.h                     |  7 -------
 arch/sh/include/asm/video.h                  |  7 +++++++
 arch/sparc/include/asm/{fb.h => video.h}     |  8 ++++----
 arch/sparc/video/Makefile                    |  2 +-
 arch/sparc/video/{fbdev.c => video.c}        |  4 ++--
 arch/x86/include/asm/{fb.h => video.h}       |  8 ++++----
 arch/x86/video/Makefile                      |  2 +-
 arch/x86/video/{fbdev.c => video.c}          |  3 ++-
 include/asm-generic/Kbuild                   |  2 +-
 include/asm-generic/{fb.h => video.h}        |  6 +++---
 include/linux/fb.h                           |  2 +-
 25 files changed, 75 insertions(+), 74 deletions(-)
 delete mode 100644 arch/arc/include/asm/fb.h
 create mode 100644 arch/arc/include/asm/video.h
 delete mode 100644 arch/arm/include/asm/fb.h
 create mode 100644 arch/arm/include/asm/video.h
 delete mode 100644 arch/arm64/include/asm/fb.h
 create mode 100644 arch/arm64/include/asm/video.h
 rename arch/loongarch/include/asm/{fb.h => video.h} (86%)
 rename arch/m68k/include/asm/{fb.h => video.h} (86%)
 rename arch/mips/include/asm/{fb.h => video.h} (76%)
 rename arch/parisc/include/asm/{fb.h => video.h} (68%)
 rename arch/parisc/video/{fbdev.c => video-sti.c} (96%)
 rename arch/powerpc/include/asm/{fb.h => video.h} (76%)
 delete mode 100644 arch/sh/include/asm/fb.h
 create mode 100644 arch/sh/include/asm/video.h
 rename arch/sparc/include/asm/{fb.h => video.h} (89%)
 rename arch/sparc/video/{fbdev.c => video.c} (86%)
 rename arch/x86/include/asm/{fb.h => video.h} (77%)
 rename arch/x86/video/{fbdev.c => video.c} (97%)
 rename include/asm-generic/{fb.h => video.h} (96%)

diff --git a/arch/arc/include/asm/fb.h b/arch/arc/include/asm/fb.h
deleted file mode 100644
index 9c2383d29cbb9..0000000000000
--- a/arch/arc/include/asm/fb.h
+++ /dev/null
@@ -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_ */
diff --git a/arch/arc/include/asm/video.h b/arch/arc/include/asm/video.h
new file mode 100644
index 0000000000000..8ff7263727fe7
--- /dev/null
+++ b/arch/arc/include/asm/video.h
@@ -0,0 +1,8 @@
+/* SPDX-License-Identifier: GPL-2.0 */
+
+#ifndef _ASM_VIDEO_H_
+#define _ASM_VIDEO_H_
+
+#include <asm-generic/video.h>
+
+#endif /* _ASM_VIDEO_H_ */
diff --git a/arch/arm/include/asm/fb.h b/arch/arm/include/asm/fb.h
deleted file mode 100644
index ce20a43c30339..0000000000000
--- a/arch/arm/include/asm/fb.h
+++ /dev/null
@@ -1,6 +0,0 @@
-#ifndef _ASM_FB_H_
-#define _ASM_FB_H_
-
-#include <asm-generic/fb.h>
-
-#endif /* _ASM_FB_H_ */
diff --git a/arch/arm/include/asm/video.h b/arch/arm/include/asm/video.h
new file mode 100644
index 0000000000000..f570565366e67
--- /dev/null
+++ b/arch/arm/include/asm/video.h
@@ -0,0 +1,6 @@
+#ifndef _ASM_VIDEO_H_
+#define _ASM_VIDEO_H_
+
+#include <asm-generic/video.h>
+
+#endif /* _ASM_VIDEO_H_ */
diff --git a/arch/arm64/include/asm/fb.h b/arch/arm64/include/asm/fb.h
deleted file mode 100644
index 1a495d8fb2ce0..0000000000000
--- a/arch/arm64/include/asm/fb.h
+++ /dev/null
@@ -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_ */
diff --git a/arch/arm64/include/asm/video.h b/arch/arm64/include/asm/video.h
new file mode 100644
index 0000000000000..fe0e74983f4d9
--- /dev/null
+++ b/arch/arm64/include/asm/video.h
@@ -0,0 +1,10 @@
+/* SPDX-License-Identifier: GPL-2.0-only */
+/*
+ * Copyright (C) 2012 ARM Ltd.
+ */
+#ifndef __ASM_VIDEO_H_
+#define __ASM_VIDEO_H_
+
+#include <asm-generic/video.h>
+
+#endif /* __ASM_VIDEO_H_ */
diff --git a/arch/loongarch/include/asm/fb.h b/arch/loongarch/include/asm/video.h
similarity index 86%
rename from arch/loongarch/include/asm/fb.h
rename to arch/loongarch/include/asm/video.h
index 0b218b10a9ec3..9f76845f2d4fd 100644
--- a/arch/loongarch/include/asm/fb.h
+++ b/arch/loongarch/include/asm/video.h
@@ -2,8 +2,8 @@
 /*
  * Copyright (C) 2020-2022 Loongson Technology Corporation Limited
  */
-#ifndef _ASM_FB_H_
-#define _ASM_FB_H_
+#ifndef _ASM_VIDEO_H_
+#define _ASM_VIDEO_H_
 
 #include <linux/compiler.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
 
-#include <asm-generic/fb.h>
+#include <asm-generic/video.h>
 
-#endif /* _ASM_FB_H_ */
+#endif /* _ASM_VIDEO_H_ */
diff --git a/arch/m68k/include/asm/fb.h b/arch/m68k/include/asm/video.h
similarity index 86%
rename from arch/m68k/include/asm/fb.h
rename to arch/m68k/include/asm/video.h
index 9941b7434b696..6cf2194c413d8 100644
--- a/arch/m68k/include/asm/fb.h
+++ b/arch/m68k/include/asm/video.h
@@ -1,6 +1,6 @@
 /* SPDX-License-Identifier: GPL-2.0 */
-#ifndef _ASM_FB_H_
-#define _ASM_FB_H_
+#ifndef _ASM_VIDEO_H_
+#define _ASM_VIDEO_H_
 
 #include <asm/page.h>
 #include <asm/setup.h>
@@ -27,6 +27,6 @@ static inline pgprot_t pgprot_framebuffer(pgprot_t prot,
 }
 #define pgprot_framebuffer pgprot_framebuffer
 
-#include <asm-generic/fb.h>
+#include <asm-generic/video.h>
 
-#endif /* _ASM_FB_H_ */
+#endif /* _ASM_VIDEO_H_ */
diff --git a/arch/mips/include/asm/fb.h b/arch/mips/include/asm/video.h
similarity index 76%
rename from arch/mips/include/asm/fb.h
rename to arch/mips/include/asm/video.h
index d98d6681d64ec..007c106d980fd 100644
--- a/arch/mips/include/asm/fb.h
+++ b/arch/mips/include/asm/video.h
@@ -1,5 +1,5 @@
-#ifndef _ASM_FB_H_
-#define _ASM_FB_H_
+#ifndef _ASM_VIDEO_H_
+#define _ASM_VIDEO_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
- * in <asm-generic/fb.h> don't generate fb_readq() and
- * fb_write(). We have to provide them here.
+ * in <asm-generic/video.h> don't generate fb_readq() and
+ * fb_writeq(). We have to provide them here.
  *
  * TODO: Convert MIPS to generic I/O. The helpers below can
  *       then be removed.
@@ -33,6 +33,6 @@ static inline void fb_writeq(u64 b, volatile void __iomem *addr)
 #define fb_writeq fb_writeq
 #endif
 
-#include <asm-generic/fb.h>
+#include <asm-generic/video.h>
 
-#endif /* _ASM_FB_H_ */
+#endif /* _ASM_VIDEO_H_ */
diff --git a/arch/parisc/include/asm/fb.h b/arch/parisc/include/asm/video.h
similarity index 68%
rename from arch/parisc/include/asm/fb.h
rename to arch/parisc/include/asm/video.h
index ed2a195a3e762..c5dff3223194a 100644
--- a/arch/parisc/include/asm/fb.h
+++ b/arch/parisc/include/asm/video.h
@@ -1,6 +1,6 @@
 /* SPDX-License-Identifier: GPL-2.0 */
-#ifndef _ASM_FB_H_
-#define _ASM_FB_H_
+#ifndef _ASM_VIDEO_H_
+#define _ASM_VIDEO_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
 #endif
 
-#include <asm-generic/fb.h>
+#include <asm-generic/video.h>
 
-#endif /* _ASM_FB_H_ */
+#endif /* _ASM_VIDEO_H_ */
diff --git a/arch/parisc/video/Makefile b/arch/parisc/video/Makefile
index 16a73cce46612..b5db5b42880f8 100644
--- a/arch/parisc/video/Makefile
+++ b/arch/parisc/video/Makefile
@@ -1,3 +1,3 @@
 # SPDX-License-Identifier: GPL-2.0-only
 
-obj-$(CONFIG_STI_CORE) += fbdev.o
+obj-$(CONFIG_STI_CORE) += video-sti.o
diff --git a/arch/parisc/video/fbdev.c b/arch/parisc/video/video-sti.c
similarity index 96%
rename from arch/parisc/video/fbdev.c
rename to arch/parisc/video/video-sti.c
index 540fa0c919d59..564661e87093c 100644
--- a/arch/parisc/video/fbdev.c
+++ b/arch/parisc/video/video-sti.c
@@ -9,7 +9,7 @@
 
 #include <video/sticore.h>
 
-#include <asm/fb.h>
+#include <asm/video.h>
 
 bool video_is_primary_device(struct device *dev)
 {
diff --git a/arch/powerpc/include/asm/fb.h b/arch/powerpc/include/asm/video.h
similarity index 76%
rename from arch/powerpc/include/asm/fb.h
rename to arch/powerpc/include/asm/video.h
index c0c5d1df7ad1e..e1770114ffc36 100644
--- a/arch/powerpc/include/asm/fb.h
+++ b/arch/powerpc/include/asm/video.h
@@ -1,6 +1,6 @@
 /* SPDX-License-Identifier: GPL-2.0 */
-#ifndef _ASM_FB_H_
-#define _ASM_FB_H_
+#ifndef _ASM_VIDEO_H_
+#define _ASM_VIDEO_H_
 
 #include <asm/page.h>
 
@@ -12,6 +12,6 @@ static inline pgprot_t pgprot_framebuffer(pgprot_t prot,
 }
 #define pgprot_framebuffer pgprot_framebuffer
 
-#include <asm-generic/fb.h>
+#include <asm-generic/video.h>
 
-#endif /* _ASM_FB_H_ */
+#endif /* _ASM_VIDEO_H_ */
diff --git a/arch/powerpc/kernel/pci-common.c b/arch/powerpc/kernel/pci-common.c
index d95a48eff412e..eac84d687b53f 100644
--- a/arch/powerpc/kernel/pci-common.c
+++ b/arch/powerpc/kernel/pci-common.c
@@ -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
  * above routine
  */
diff --git a/arch/sh/include/asm/fb.h b/arch/sh/include/asm/fb.h
deleted file mode 100644
index 19df13ee9ca73..0000000000000
--- a/arch/sh/include/asm/fb.h
+++ /dev/null
@@ -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_ */
diff --git a/arch/sh/include/asm/video.h b/arch/sh/include/asm/video.h
new file mode 100644
index 0000000000000..14f49934a247a
--- /dev/null
+++ b/arch/sh/include/asm/video.h
@@ -0,0 +1,7 @@
+/* SPDX-License-Identifier: GPL-2.0 */
+#ifndef _ASM_VIDEO_H_
+#define _ASM_VIDEO_H_
+
+#include <asm-generic/video.h>
+
+#endif /* _ASM_VIDEO_H_ */
diff --git a/arch/sparc/include/asm/fb.h b/arch/sparc/include/asm/video.h
similarity index 89%
rename from arch/sparc/include/asm/fb.h
rename to arch/sparc/include/asm/video.h
index 07f0325d6921c..a6f48f52db584 100644
--- a/arch/sparc/include/asm/fb.h
+++ b/arch/sparc/include/asm/video.h
@@ -1,6 +1,6 @@
 /* SPDX-License-Identifier: GPL-2.0 */
-#ifndef _SPARC_FB_H_
-#define _SPARC_FB_H_
+#ifndef _SPARC_VIDEO_H_
+#define _SPARC_VIDEO_H_
 
 #include <linux/io.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
 
-#include <asm-generic/fb.h>
+#include <asm-generic/video.h>
 
-#endif /* _SPARC_FB_H_ */
+#endif /* _SPARC_VIDEO_H_ */
diff --git a/arch/sparc/video/Makefile b/arch/sparc/video/Makefile
index 9dd82880a027a..fdf83a408d750 100644
--- a/arch/sparc/video/Makefile
+++ b/arch/sparc/video/Makefile
@@ -1,3 +1,3 @@
 # SPDX-License-Identifier: GPL-2.0-only
 
-obj-y	+= fbdev.o
+obj-y	+= video.o
diff --git a/arch/sparc/video/fbdev.c b/arch/sparc/video/video.c
similarity index 86%
rename from arch/sparc/video/fbdev.c
rename to arch/sparc/video/video.c
index e46f0499c2774..2414380caadc9 100644
--- a/arch/sparc/video/fbdev.c
+++ b/arch/sparc/video/video.c
@@ -4,8 +4,8 @@
 #include <linux/device.h>
 #include <linux/module.h>
 
-#include <asm/fb.h>
 #include <asm/prom.h>
+#include <asm/video.h>
 
 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);
 
-MODULE_DESCRIPTION("Sparc fbdev helpers");
+MODULE_DESCRIPTION("Sparc video helpers");
 MODULE_LICENSE("GPL");
diff --git a/arch/x86/include/asm/fb.h b/arch/x86/include/asm/video.h
similarity index 77%
rename from arch/x86/include/asm/fb.h
rename to arch/x86/include/asm/video.h
index 999db33792869..0950c9535fae9 100644
--- a/arch/x86/include/asm/fb.h
+++ b/arch/x86/include/asm/video.h
@@ -1,6 +1,6 @@
 /* SPDX-License-Identifier: GPL-2.0 */
-#ifndef _ASM_X86_FB_H
-#define _ASM_X86_FB_H
+#ifndef _ASM_X86_VIDEO_H
+#define _ASM_X86_VIDEO_H
 
 #include <linux/types.h>
 
@@ -16,6 +16,6 @@ pgprot_t pgprot_framebuffer(pgprot_t prot,
 bool video_is_primary_device(struct device *dev);
 #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 */
diff --git a/arch/x86/video/Makefile b/arch/x86/video/Makefile
index 9dd82880a027a..fdf83a408d750 100644
--- a/arch/x86/video/Makefile
+++ b/arch/x86/video/Makefile
@@ -1,3 +1,3 @@
 # SPDX-License-Identifier: GPL-2.0-only
 
-obj-y	+= fbdev.o
+obj-y	+= video.o
diff --git a/arch/x86/video/fbdev.c b/arch/x86/video/video.c
similarity index 97%
rename from arch/x86/video/fbdev.c
rename to arch/x86/video/video.c
index 4d87ce8e257fe..81fc97a2a837a 100644
--- a/arch/x86/video/fbdev.c
+++ b/arch/x86/video/video.c
@@ -10,7 +10,8 @@
 #include <linux/module.h>
 #include <linux/pci.h>
 #include <linux/vgaarb.h>
-#include <asm/fb.h>
+
+#include <asm/video.h>
 
 pgprot_t pgprot_framebuffer(pgprot_t prot,
 			    unsigned long vm_start, unsigned long vm_end,
diff --git a/include/asm-generic/Kbuild b/include/asm-generic/Kbuild
index d436bee4d129d..b20fa25a7e8d8 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/video.h
similarity index 96%
rename from include/asm-generic/fb.h
rename to include/asm-generic/video.h
index 4788c1e1c6bc0..b1da2309d9434 100644
--- a/include/asm-generic/fb.h
+++ b/include/asm-generic/video.h
@@ -1,7 +1,7 @@
 /* SPDX-License-Identifier: GPL-2.0 */
 
-#ifndef __ASM_GENERIC_FB_H_
-#define __ASM_GENERIC_FB_H_
+#ifndef __ASM_GENERIC_VIDEO_H_
+#define __ASM_GENERIC_VIDEO_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
 #endif
 
-#endif /* __ASM_GENERIC_FB_H_ */
+#endif /* __ASM_GENERIC_VIDEO_H_ */
diff --git a/include/linux/fb.h b/include/linux/fb.h
index 708e6a177b1be..1f23e0c505424 100644
--- a/include/linux/fb.h
+++ b/include/linux/fb.h
@@ -12,7 +12,7 @@
 #include <linux/types.h>
 #include <linux/workqueue.h>
 
-#include <asm/fb.h>
+#include <asm/video.h>
 
 struct backlight_device;
 struct device;
-- 
2.44.0


^ permalink raw reply related	[flat|nested] 16+ messages in thread

* Re: [PATCH v2 3/3] arch: Rename fbdev header and source files
  2024-03-27 20:41 ` [PATCH v2 3/3] arch: Rename fbdev header and source files Thomas Zimmermann
@ 2024-03-28  7:23   ` Sam Ravnborg
  2024-03-28 12:46   ` Helge Deller
  2024-03-28 13:15   ` kernel test robot
  2 siblings, 0 replies; 16+ messages in thread
From: Sam Ravnborg @ 2024-03-28  7:23 UTC (permalink / raw)
  To: Thomas Zimmermann
  Cc: Andreas Larsson, sui.jingfeng, Rich Felker, linux-sh,
	Catalin Marinas, Dave Hansen, linux-fbdev, dri-devel, linux-mips,
	James E.J. Bottomley, H. Peter Anvin, sparclinux, WANG Xuerui,
	Will Deacon, linux-arch, Yoshinori Sato, deller, Huacai Chen,
	javierm, Ingo Molnar, Geert Uytterhoeven, Vineet Gupta,
	linux-snps-arc, arnd, Nicholas Piggin, linux-m68k,
	Borislav Petkov, loongarch, John Paul Adrian Glaubitz,
	Thomas Gleixner, linux-arm-kernel, x86, Thomas Bogendoerfer,
	linux-parisc, linux-kernel, linuxppc-dev, David S. Miller

Hi Thomas,

On Wed, Mar 27, 2024 at 09:41:31PM +0100, Thomas Zimmermann wrote:
> 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.
> 
> Further update all includes statements, includ guards, and Makefiles.
                                                ^ missing 'e' 

> Also update a few strings and comments to refer to video instead of
> fbdev.
> 
> Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
> 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>

If the patch is changed to use the Kbuild file to pick the generic
variant of video.h then it is:

Reviewed-by: Sam Ravnborg <sam@ravnborg.org>

I also added an unrelated sparc comment, that can be addressed another
time.

	Sam

> ---
>  arch/arc/include/asm/fb.h                    |  8 --------
>  arch/arc/include/asm/video.h                 |  8 ++++++++
>  arch/arm/include/asm/fb.h                    |  6 ------
>  arch/arm/include/asm/video.h                 |  6 ++++++
>  arch/arm64/include/asm/fb.h                  | 10 ----------
>  arch/arm64/include/asm/video.h               | 10 ++++++++++
>  arch/loongarch/include/asm/{fb.h => video.h} |  8 ++++----
>  arch/m68k/include/asm/{fb.h => video.h}      |  8 ++++----
>  arch/mips/include/asm/{fb.h => video.h}      | 12 ++++++------
>  arch/parisc/include/asm/{fb.h => video.h}    |  8 ++++----
>  arch/parisc/video/Makefile                   |  2 +-
>  arch/parisc/video/{fbdev.c => video-sti.c}   |  2 +-
>  arch/powerpc/include/asm/{fb.h => video.h}   |  8 ++++----
>  arch/powerpc/kernel/pci-common.c             |  2 +-
>  arch/sh/include/asm/fb.h                     |  7 -------
>  arch/sh/include/asm/video.h                  |  7 +++++++
>  arch/sparc/include/asm/{fb.h => video.h}     |  8 ++++----
>  arch/sparc/video/Makefile                    |  2 +-
>  arch/sparc/video/{fbdev.c => video.c}        |  4 ++--
>  arch/x86/include/asm/{fb.h => video.h}       |  8 ++++----
>  arch/x86/video/Makefile                      |  2 +-
>  arch/x86/video/{fbdev.c => video.c}          |  3 ++-
>  include/asm-generic/Kbuild                   |  2 +-
>  include/asm-generic/{fb.h => video.h}        |  6 +++---
>  include/linux/fb.h                           |  2 +-
>  25 files changed, 75 insertions(+), 74 deletions(-)
>  delete mode 100644 arch/arc/include/asm/fb.h
>  create mode 100644 arch/arc/include/asm/video.h
>  delete mode 100644 arch/arm/include/asm/fb.h
>  create mode 100644 arch/arm/include/asm/video.h
>  delete mode 100644 arch/arm64/include/asm/fb.h
>  create mode 100644 arch/arm64/include/asm/video.h
>  rename arch/loongarch/include/asm/{fb.h => video.h} (86%)
>  rename arch/m68k/include/asm/{fb.h => video.h} (86%)
>  rename arch/mips/include/asm/{fb.h => video.h} (76%)
>  rename arch/parisc/include/asm/{fb.h => video.h} (68%)
>  rename arch/parisc/video/{fbdev.c => video-sti.c} (96%)
>  rename arch/powerpc/include/asm/{fb.h => video.h} (76%)
>  delete mode 100644 arch/sh/include/asm/fb.h
>  create mode 100644 arch/sh/include/asm/video.h
>  rename arch/sparc/include/asm/{fb.h => video.h} (89%)
>  rename arch/sparc/video/{fbdev.c => video.c} (86%)
>  rename arch/x86/include/asm/{fb.h => video.h} (77%)
>  rename arch/x86/video/{fbdev.c => video.c} (97%)
>  rename include/asm-generic/{fb.h => video.h} (96%)
> 
> diff --git a/arch/arc/include/asm/fb.h b/arch/arc/include/asm/fb.h
> deleted file mode 100644
> index 9c2383d29cbb9..0000000000000
> --- a/arch/arc/include/asm/fb.h
> +++ /dev/null
> @@ -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_ */
> diff --git a/arch/arc/include/asm/video.h b/arch/arc/include/asm/video.h
> new file mode 100644
> index 0000000000000..8ff7263727fe7
> --- /dev/null
> +++ b/arch/arc/include/asm/video.h
> @@ -0,0 +1,8 @@
> +/* SPDX-License-Identifier: GPL-2.0 */
> +
> +#ifndef _ASM_VIDEO_H_
> +#define _ASM_VIDEO_H_
> +
> +#include <asm-generic/video.h>
> +
> +#endif /* _ASM_VIDEO_H_ */

arch/arc/include/asm/video.h only exists to pick
include/asm-generic/video.h.

The simpler way to do this is to add a line to:
arch/arc/include/asm/Kbuild:
+ generic-y += video.h

While touching the file I suggest to move to the simpler way using the
Kbuild file.

The same goes for all the other video.h files that only picks the
asm-generic variant.




> diff --git a/arch/arm/include/asm/fb.h b/arch/arm/include/asm/fb.h
> deleted file mode 100644
> index ce20a43c30339..0000000000000
> --- a/arch/arm/include/asm/fb.h
> +++ /dev/null
> @@ -1,6 +0,0 @@
> -#ifndef _ASM_FB_H_
> -#define _ASM_FB_H_
> -
> -#include <asm-generic/fb.h>
> -
> -#endif /* _ASM_FB_H_ */
> diff --git a/arch/arm/include/asm/video.h b/arch/arm/include/asm/video.h
> new file mode 100644
> index 0000000000000..f570565366e67
> --- /dev/null
> +++ b/arch/arm/include/asm/video.h
> @@ -0,0 +1,6 @@
> +#ifndef _ASM_VIDEO_H_
> +#define _ASM_VIDEO_H_
> +
> +#include <asm-generic/video.h>
> +
> +#endif /* _ASM_VIDEO_H_ */
> diff --git a/arch/arm64/include/asm/fb.h b/arch/arm64/include/asm/fb.h
> deleted file mode 100644
> index 1a495d8fb2ce0..0000000000000
> --- a/arch/arm64/include/asm/fb.h
> +++ /dev/null
> @@ -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_ */
> diff --git a/arch/arm64/include/asm/video.h b/arch/arm64/include/asm/video.h
> new file mode 100644
> index 0000000000000..fe0e74983f4d9
> --- /dev/null
> +++ b/arch/arm64/include/asm/video.h
> @@ -0,0 +1,10 @@
> +/* SPDX-License-Identifier: GPL-2.0-only */
> +/*
> + * Copyright (C) 2012 ARM Ltd.
> + */
> +#ifndef __ASM_VIDEO_H_
> +#define __ASM_VIDEO_H_
> +
> +#include <asm-generic/video.h>
> +
> +#endif /* __ASM_VIDEO_H_ */
> diff --git a/arch/loongarch/include/asm/fb.h b/arch/loongarch/include/asm/video.h
> similarity index 86%
> rename from arch/loongarch/include/asm/fb.h
> rename to arch/loongarch/include/asm/video.h
> index 0b218b10a9ec3..9f76845f2d4fd 100644
> --- a/arch/loongarch/include/asm/fb.h
> +++ b/arch/loongarch/include/asm/video.h
> @@ -2,8 +2,8 @@
>  /*
>   * Copyright (C) 2020-2022 Loongson Technology Corporation Limited
>   */
> -#ifndef _ASM_FB_H_
> -#define _ASM_FB_H_
> +#ifndef _ASM_VIDEO_H_
> +#define _ASM_VIDEO_H_
>  
>  #include <linux/compiler.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
>  
> -#include <asm-generic/fb.h>
> +#include <asm-generic/video.h>
>  
> -#endif /* _ASM_FB_H_ */
> +#endif /* _ASM_VIDEO_H_ */
> diff --git a/arch/m68k/include/asm/fb.h b/arch/m68k/include/asm/video.h
> similarity index 86%
> rename from arch/m68k/include/asm/fb.h
> rename to arch/m68k/include/asm/video.h
> index 9941b7434b696..6cf2194c413d8 100644
> --- a/arch/m68k/include/asm/fb.h
> +++ b/arch/m68k/include/asm/video.h
> @@ -1,6 +1,6 @@
>  /* SPDX-License-Identifier: GPL-2.0 */
> -#ifndef _ASM_FB_H_
> -#define _ASM_FB_H_
> +#ifndef _ASM_VIDEO_H_
> +#define _ASM_VIDEO_H_
>  
>  #include <asm/page.h>
>  #include <asm/setup.h>
> @@ -27,6 +27,6 @@ static inline pgprot_t pgprot_framebuffer(pgprot_t prot,
>  }
>  #define pgprot_framebuffer pgprot_framebuffer
>  
> -#include <asm-generic/fb.h>
> +#include <asm-generic/video.h>
>  
> -#endif /* _ASM_FB_H_ */
> +#endif /* _ASM_VIDEO_H_ */
> diff --git a/arch/mips/include/asm/fb.h b/arch/mips/include/asm/video.h
> similarity index 76%
> rename from arch/mips/include/asm/fb.h
> rename to arch/mips/include/asm/video.h
> index d98d6681d64ec..007c106d980fd 100644
> --- a/arch/mips/include/asm/fb.h
> +++ b/arch/mips/include/asm/video.h
> @@ -1,5 +1,5 @@
> -#ifndef _ASM_FB_H_
> -#define _ASM_FB_H_
> +#ifndef _ASM_VIDEO_H_
> +#define _ASM_VIDEO_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
> - * in <asm-generic/fb.h> don't generate fb_readq() and
> - * fb_write(). We have to provide them here.
> + * in <asm-generic/video.h> don't generate fb_readq() and
> + * fb_writeq(). We have to provide them here.
>   *
>   * TODO: Convert MIPS to generic I/O. The helpers below can
>   *       then be removed.
> @@ -33,6 +33,6 @@ static inline void fb_writeq(u64 b, volatile void __iomem *addr)
>  #define fb_writeq fb_writeq
>  #endif
>  
> -#include <asm-generic/fb.h>
> +#include <asm-generic/video.h>
>  
> -#endif /* _ASM_FB_H_ */
> +#endif /* _ASM_VIDEO_H_ */
> diff --git a/arch/parisc/include/asm/fb.h b/arch/parisc/include/asm/video.h
> similarity index 68%
> rename from arch/parisc/include/asm/fb.h
> rename to arch/parisc/include/asm/video.h
> index ed2a195a3e762..c5dff3223194a 100644
> --- a/arch/parisc/include/asm/fb.h
> +++ b/arch/parisc/include/asm/video.h
> @@ -1,6 +1,6 @@
>  /* SPDX-License-Identifier: GPL-2.0 */
> -#ifndef _ASM_FB_H_
> -#define _ASM_FB_H_
> +#ifndef _ASM_VIDEO_H_
> +#define _ASM_VIDEO_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
>  #endif
>  
> -#include <asm-generic/fb.h>
> +#include <asm-generic/video.h>
>  
> -#endif /* _ASM_FB_H_ */
> +#endif /* _ASM_VIDEO_H_ */
> diff --git a/arch/parisc/video/Makefile b/arch/parisc/video/Makefile
> index 16a73cce46612..b5db5b42880f8 100644
> --- a/arch/parisc/video/Makefile
> +++ b/arch/parisc/video/Makefile
> @@ -1,3 +1,3 @@
>  # SPDX-License-Identifier: GPL-2.0-only
>  
> -obj-$(CONFIG_STI_CORE) += fbdev.o
> +obj-$(CONFIG_STI_CORE) += video-sti.o
> diff --git a/arch/parisc/video/fbdev.c b/arch/parisc/video/video-sti.c
> similarity index 96%
> rename from arch/parisc/video/fbdev.c
> rename to arch/parisc/video/video-sti.c
> index 540fa0c919d59..564661e87093c 100644
> --- a/arch/parisc/video/fbdev.c
> +++ b/arch/parisc/video/video-sti.c
> @@ -9,7 +9,7 @@
>  
>  #include <video/sticore.h>
>  
> -#include <asm/fb.h>
> +#include <asm/video.h>
>  
>  bool video_is_primary_device(struct device *dev)
>  {
> diff --git a/arch/powerpc/include/asm/fb.h b/arch/powerpc/include/asm/video.h
> similarity index 76%
> rename from arch/powerpc/include/asm/fb.h
> rename to arch/powerpc/include/asm/video.h
> index c0c5d1df7ad1e..e1770114ffc36 100644
> --- a/arch/powerpc/include/asm/fb.h
> +++ b/arch/powerpc/include/asm/video.h
> @@ -1,6 +1,6 @@
>  /* SPDX-License-Identifier: GPL-2.0 */
> -#ifndef _ASM_FB_H_
> -#define _ASM_FB_H_
> +#ifndef _ASM_VIDEO_H_
> +#define _ASM_VIDEO_H_
>  
>  #include <asm/page.h>
>  
> @@ -12,6 +12,6 @@ static inline pgprot_t pgprot_framebuffer(pgprot_t prot,
>  }
>  #define pgprot_framebuffer pgprot_framebuffer
>  
> -#include <asm-generic/fb.h>
> +#include <asm-generic/video.h>
>  
> -#endif /* _ASM_FB_H_ */
> +#endif /* _ASM_VIDEO_H_ */
> diff --git a/arch/powerpc/kernel/pci-common.c b/arch/powerpc/kernel/pci-common.c
> index d95a48eff412e..eac84d687b53f 100644
> --- a/arch/powerpc/kernel/pci-common.c
> +++ b/arch/powerpc/kernel/pci-common.c
> @@ -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
>   * above routine
>   */
> diff --git a/arch/sh/include/asm/fb.h b/arch/sh/include/asm/fb.h
> deleted file mode 100644
> index 19df13ee9ca73..0000000000000
> --- a/arch/sh/include/asm/fb.h
> +++ /dev/null
> @@ -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_ */
> diff --git a/arch/sh/include/asm/video.h b/arch/sh/include/asm/video.h
> new file mode 100644
> index 0000000000000..14f49934a247a
> --- /dev/null
> +++ b/arch/sh/include/asm/video.h
> @@ -0,0 +1,7 @@
> +/* SPDX-License-Identifier: GPL-2.0 */
> +#ifndef _ASM_VIDEO_H_
> +#define _ASM_VIDEO_H_
> +
> +#include <asm-generic/video.h>
> +
> +#endif /* _ASM_VIDEO_H_ */
> diff --git a/arch/sparc/include/asm/fb.h b/arch/sparc/include/asm/video.h
> similarity index 89%
> rename from arch/sparc/include/asm/fb.h
> rename to arch/sparc/include/asm/video.h
> index 07f0325d6921c..a6f48f52db584 100644
> --- a/arch/sparc/include/asm/fb.h
> +++ b/arch/sparc/include/asm/video.h
> @@ -1,6 +1,6 @@
>  /* SPDX-License-Identifier: GPL-2.0 */
> -#ifndef _SPARC_FB_H_
> -#define _SPARC_FB_H_
> +#ifndef _SPARC_VIDEO_H_
> +#define _SPARC_VIDEO_H_
>  
>  #include <linux/io.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
>  
> -#include <asm-generic/fb.h>
> +#include <asm-generic/video.h>
>  
> -#endif /* _SPARC_FB_H_ */
> +#endif /* _SPARC_VIDEO_H_ */
> diff --git a/arch/sparc/video/Makefile b/arch/sparc/video/Makefile
> index 9dd82880a027a..fdf83a408d750 100644
> --- a/arch/sparc/video/Makefile
> +++ b/arch/sparc/video/Makefile
> @@ -1,3 +1,3 @@
>  # SPDX-License-Identifier: GPL-2.0-only
>  
> -obj-y	+= fbdev.o
> +obj-y	+= video.o
> diff --git a/arch/sparc/video/fbdev.c b/arch/sparc/video/video.c
> similarity index 86%
> rename from arch/sparc/video/fbdev.c
> rename to arch/sparc/video/video.c
> index e46f0499c2774..2414380caadc9 100644
> --- a/arch/sparc/video/fbdev.c
> +++ b/arch/sparc/video/video.c
> @@ -4,8 +4,8 @@
>  #include <linux/device.h>
>  #include <linux/module.h>
>  
> -#include <asm/fb.h>
>  #include <asm/prom.h>
> +#include <asm/video.h>
>  
>  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);
>  
> -MODULE_DESCRIPTION("Sparc fbdev helpers");
> +MODULE_DESCRIPTION("Sparc video helpers");
>  MODULE_LICENSE("GPL");
video.c is always built-in, so the MODULE_ things can be dropped.
That is an unrelated clean-up so should not be part of this patch.


> diff --git a/arch/x86/include/asm/fb.h b/arch/x86/include/asm/video.h
> similarity index 77%
> rename from arch/x86/include/asm/fb.h
> rename to arch/x86/include/asm/video.h
> index 999db33792869..0950c9535fae9 100644
> --- a/arch/x86/include/asm/fb.h
> +++ b/arch/x86/include/asm/video.h
> @@ -1,6 +1,6 @@
>  /* SPDX-License-Identifier: GPL-2.0 */
> -#ifndef _ASM_X86_FB_H
> -#define _ASM_X86_FB_H
> +#ifndef _ASM_X86_VIDEO_H
> +#define _ASM_X86_VIDEO_H
>  
>  #include <linux/types.h>
>  
> @@ -16,6 +16,6 @@ pgprot_t pgprot_framebuffer(pgprot_t prot,
>  bool video_is_primary_device(struct device *dev);
>  #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 */
> diff --git a/arch/x86/video/Makefile b/arch/x86/video/Makefile
> index 9dd82880a027a..fdf83a408d750 100644
> --- a/arch/x86/video/Makefile
> +++ b/arch/x86/video/Makefile
> @@ -1,3 +1,3 @@
>  # SPDX-License-Identifier: GPL-2.0-only
>  
> -obj-y	+= fbdev.o
> +obj-y	+= video.o
> diff --git a/arch/x86/video/fbdev.c b/arch/x86/video/video.c
> similarity index 97%
> rename from arch/x86/video/fbdev.c
> rename to arch/x86/video/video.c
> index 4d87ce8e257fe..81fc97a2a837a 100644
> --- a/arch/x86/video/fbdev.c
> +++ b/arch/x86/video/video.c
> @@ -10,7 +10,8 @@
>  #include <linux/module.h>
>  #include <linux/pci.h>
>  #include <linux/vgaarb.h>
> -#include <asm/fb.h>
> +
> +#include <asm/video.h>
>  
>  pgprot_t pgprot_framebuffer(pgprot_t prot,
>  			    unsigned long vm_start, unsigned long vm_end,
> diff --git a/include/asm-generic/Kbuild b/include/asm-generic/Kbuild
> index d436bee4d129d..b20fa25a7e8d8 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/video.h
> similarity index 96%
> rename from include/asm-generic/fb.h
> rename to include/asm-generic/video.h
> index 4788c1e1c6bc0..b1da2309d9434 100644
> --- a/include/asm-generic/fb.h
> +++ b/include/asm-generic/video.h
> @@ -1,7 +1,7 @@
>  /* SPDX-License-Identifier: GPL-2.0 */
>  
> -#ifndef __ASM_GENERIC_FB_H_
> -#define __ASM_GENERIC_FB_H_
> +#ifndef __ASM_GENERIC_VIDEO_H_
> +#define __ASM_GENERIC_VIDEO_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
>  #endif
>  
> -#endif /* __ASM_GENERIC_FB_H_ */
> +#endif /* __ASM_GENERIC_VIDEO_H_ */
> diff --git a/include/linux/fb.h b/include/linux/fb.h
> index 708e6a177b1be..1f23e0c505424 100644
> --- a/include/linux/fb.h
> +++ b/include/linux/fb.h
> @@ -12,7 +12,7 @@
>  #include <linux/types.h>
>  #include <linux/workqueue.h>
>  
> -#include <asm/fb.h>
> +#include <asm/video.h>
>  
>  struct backlight_device;
>  struct device;
> -- 
> 2.44.0
> 

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [PATCH v2 1/3] arch: Select fbdev helpers with CONFIG_VIDEO
  2024-03-27 20:41 ` [PATCH v2 1/3] arch: Select fbdev helpers with CONFIG_VIDEO Thomas Zimmermann
@ 2024-03-28  7:24   ` Sam Ravnborg
  2024-03-28 12:39   ` Helge Deller
  1 sibling, 0 replies; 16+ messages in thread
From: Sam Ravnborg @ 2024-03-28  7:24 UTC (permalink / raw)
  To: Thomas Zimmermann
  Cc: sui.jingfeng, x86, linux-sh, Dave Hansen, linux-fbdev, dri-devel,
	linux-mips, James E.J. Bottomley, H. Peter Anvin, sparclinux,
	linux-arch, deller, Andreas Larsson, javierm, Ingo Molnar,
	linux-snps-arc, arnd, linux-m68k, Borislav Petkov, loongarch,
	Thomas Gleixner, linux-arm-kernel, linux-parisc, linux-kernel,
	linuxppc-dev, David S. Miller

On Wed, Mar 27, 2024 at 09:41:29PM +0100, Thomas Zimmermann wrote:
> Various Kconfig options selected the per-architecture helpers for
> fbdev. But none of the contained code depends on fbdev. Standardize
> on CONFIG_VIDEO, which will allow to add more general helpers for
> video functionality.
> 
> CONFIG_VIDEO protects each architecture's video/ directory. This
> allows for the use of more fine-grained control for each directory's
> files, such as the use of CONFIG_STI_CORE on parisc.
> 
> v2:
> - sparc: rebased onto Makefile changes
> 
> Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
> Cc: "James E.J. Bottomley" <James.Bottomley@HansenPartnership.com>
> Cc: Helge Deller <deller@gmx.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>

Reviewed-by: Sam Ravnborg <sam@ravnborg.org>

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [PATCH v2 2/3] arch: Remove struct fb_info from video helpers
  2024-03-27 20:41 ` [PATCH v2 2/3] arch: Remove struct fb_info from video helpers Thomas Zimmermann
@ 2024-03-28  7:25   ` Sam Ravnborg
  2024-03-28 11:04   ` Helge Deller
  1 sibling, 0 replies; 16+ messages in thread
From: Sam Ravnborg @ 2024-03-28  7:25 UTC (permalink / raw)
  To: Thomas Zimmermann
  Cc: sui.jingfeng, x86, linux-sh, Dave Hansen, linux-fbdev, dri-devel,
	linux-mips, James E.J. Bottomley, H. Peter Anvin, sparclinux,
	linux-arch, deller, Andreas Larsson, javierm, Ingo Molnar,
	linux-snps-arc, arnd, linux-m68k, Borislav Petkov, loongarch,
	Thomas Gleixner, linux-arm-kernel, linux-parisc, linux-kernel,
	linuxppc-dev, David S. Miller

Hi Thomas,
On Wed, Mar 27, 2024 at 09:41:30PM +0100, Thomas Zimmermann wrote:
> The per-architecture video helpers do not depend on struct fb_info
> or anything else from fbdev. Remove it from the interface and replace
> fb_is_primary_device() with video_is_primary_device(). The new helper
> is similar in functionality, but can operate on non-fbdev devices.
> 
> Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
> Cc: "James E.J. Bottomley" <James.Bottomley@HansenPartnership.com>
> Cc: Helge Deller <deller@gmx.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>
Reviewed-by: Sam Ravnborg <sam@ravnborg.org>

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [PATCH v2 2/3] arch: Remove struct fb_info from video helpers
  2024-03-27 20:41 ` [PATCH v2 2/3] arch: Remove struct fb_info from video helpers Thomas Zimmermann
  2024-03-28  7:25   ` Sam Ravnborg
@ 2024-03-28 11:04   ` Helge Deller
  2024-03-28 13:33     ` Thomas Zimmermann
  1 sibling, 1 reply; 16+ messages in thread
From: Helge Deller @ 2024-03-28 11:04 UTC (permalink / raw)
  To: Thomas Zimmermann, arnd, javierm, sui.jingfeng
  Cc: Andreas Larsson, linux-fbdev, linux-sh, Dave Hansen, dri-devel,
	linux-kernel, James E.J. Bottomley, H. Peter Anvin, sparclinux,
	linux-arch, x86, Ingo Molnar, linux-snps-arc, linux-m68k,
	Borislav Petkov, loongarch, Thomas Gleixner, linux-arm-kernel,
	linux-parisc, linux-mips, linuxppc-dev, David S. Miller

On 3/27/24 21:41, Thomas Zimmermann wrote:
> The per-architecture video helpers do not depend on struct fb_info
> or anything else from fbdev. Remove it from the interface and replace
> fb_is_primary_device() with video_is_primary_device(). The new helper

Since you rename this function, wouldn't something similar to

device_is_primary_display()
	or
device_is_primary_console()
	or
is_primary_graphics_device()
	or
is_primary_display_device()

be a better name?

Helge

> is similar in functionality, but can operate on non-fbdev devices.
>
> Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
> Cc: "James E.J. Bottomley" <James.Bottomley@HansenPartnership.com>
> Cc: Helge Deller <deller@gmx.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>
> ---
>   arch/parisc/include/asm/fb.h     |  8 +++++---
>   arch/parisc/video/fbdev.c        |  9 +++++----
>   arch/sparc/include/asm/fb.h      |  7 ++++---
>   arch/sparc/video/fbdev.c         | 17 ++++++++---------
>   arch/x86/include/asm/fb.h        |  8 +++++---
>   arch/x86/video/fbdev.c           | 18 +++++++-----------
>   drivers/video/fbdev/core/fbcon.c |  2 +-
>   include/asm-generic/fb.h         | 11 ++++++-----
>   8 files changed, 41 insertions(+), 39 deletions(-)
>
> diff --git a/arch/parisc/include/asm/fb.h b/arch/parisc/include/asm/fb.h
> index 658a8a7dc5312..ed2a195a3e762 100644
> --- a/arch/parisc/include/asm/fb.h
> +++ b/arch/parisc/include/asm/fb.h
> @@ -2,11 +2,13 @@
>   #ifndef _ASM_FB_H_
>   #define _ASM_FB_H_
>
> -struct fb_info;
> +#include <linux/types.h>
> +
> +struct device;
>
>   #if defined(CONFIG_STI_CORE)
> -int fb_is_primary_device(struct fb_info *info);
> -#define fb_is_primary_device fb_is_primary_device
> +bool video_is_primary_device(struct device *dev);
> +#define video_is_primary_device video_is_primary_device
>   #endif
>
>   #include <asm-generic/fb.h>
> diff --git a/arch/parisc/video/fbdev.c b/arch/parisc/video/fbdev.c
> index e4f8ac99fc9e0..540fa0c919d59 100644
> --- a/arch/parisc/video/fbdev.c
> +++ b/arch/parisc/video/fbdev.c
> @@ -5,12 +5,13 @@
>    * Copyright (C) 2001-2002 Thomas Bogendoerfer <tsbogend@alpha.franken.de>
>    */
>
> -#include <linux/fb.h>
>   #include <linux/module.h>
>
>   #include <video/sticore.h>
>
> -int fb_is_primary_device(struct fb_info *info)
> +#include <asm/fb.h>
> +
> +bool video_is_primary_device(struct device *dev)
>   {
>   	struct sti_struct *sti;
>
> @@ -21,6 +22,6 @@ int fb_is_primary_device(struct fb_info *info)
>   		return true;
>
>   	/* return true if it's the default built-in framebuffer driver */
> -	return (sti->dev == info->device);
> +	return (sti->dev == dev);
>   }
> -EXPORT_SYMBOL(fb_is_primary_device);
> +EXPORT_SYMBOL(video_is_primary_device);
> diff --git a/arch/sparc/include/asm/fb.h b/arch/sparc/include/asm/fb.h
> index 24440c0fda490..07f0325d6921c 100644
> --- a/arch/sparc/include/asm/fb.h
> +++ b/arch/sparc/include/asm/fb.h
> @@ -3,10 +3,11 @@
>   #define _SPARC_FB_H_
>
>   #include <linux/io.h>
> +#include <linux/types.h>
>
>   #include <asm/page.h>
>
> -struct fb_info;
> +struct device;
>
>   #ifdef CONFIG_SPARC32
>   static inline pgprot_t pgprot_framebuffer(pgprot_t prot,
> @@ -18,8 +19,8 @@ static inline pgprot_t pgprot_framebuffer(pgprot_t prot,
>   #define pgprot_framebuffer pgprot_framebuffer
>   #endif
>
> -int fb_is_primary_device(struct fb_info *info);
> -#define fb_is_primary_device fb_is_primary_device
> +bool video_is_primary_device(struct device *dev);
> +#define video_is_primary_device video_is_primary_device
>
>   static inline void fb_memcpy_fromio(void *to, const volatile void __iomem *from, size_t n)
>   {
> diff --git a/arch/sparc/video/fbdev.c b/arch/sparc/video/fbdev.c
> index bff66dd1909a4..e46f0499c2774 100644
> --- a/arch/sparc/video/fbdev.c
> +++ b/arch/sparc/video/fbdev.c
> @@ -1,26 +1,25 @@
>   // SPDX-License-Identifier: GPL-2.0
>
>   #include <linux/console.h>
> -#include <linux/fb.h>
> +#include <linux/device.h>
>   #include <linux/module.h>
>
> +#include <asm/fb.h>
>   #include <asm/prom.h>
>
> -int fb_is_primary_device(struct fb_info *info)
> +bool video_is_primary_device(struct device *dev)
>   {
> -	struct device *dev = info->device;
> -	struct device_node *node;
> +	struct device_node *node = dev->of_node;
>
>   	if (console_set_on_cmdline)
> -		return 0;
> +		return false;
>
> -	node = dev->of_node;
>   	if (node && node == of_console_device)
> -		return 1;
> +		return true;
>
> -	return 0;
> +	return false;
>   }
> -EXPORT_SYMBOL(fb_is_primary_device);
> +EXPORT_SYMBOL(video_is_primary_device);
>
>   MODULE_DESCRIPTION("Sparc fbdev helpers");
>   MODULE_LICENSE("GPL");
> diff --git a/arch/x86/include/asm/fb.h b/arch/x86/include/asm/fb.h
> index c3b9582de7efd..999db33792869 100644
> --- a/arch/x86/include/asm/fb.h
> +++ b/arch/x86/include/asm/fb.h
> @@ -2,17 +2,19 @@
>   #ifndef _ASM_X86_FB_H
>   #define _ASM_X86_FB_H
>
> +#include <linux/types.h>
> +
>   #include <asm/page.h>
>
> -struct fb_info;
> +struct device;
>
>   pgprot_t pgprot_framebuffer(pgprot_t prot,
>   			    unsigned long vm_start, unsigned long vm_end,
>   			    unsigned long offset);
>   #define pgprot_framebuffer pgprot_framebuffer
>
> -int fb_is_primary_device(struct fb_info *info);
> -#define fb_is_primary_device fb_is_primary_device
> +bool video_is_primary_device(struct device *dev);
> +#define video_is_primary_device video_is_primary_device
>
>   #include <asm-generic/fb.h>
>
> diff --git a/arch/x86/video/fbdev.c b/arch/x86/video/fbdev.c
> index 1dd6528cc947c..4d87ce8e257fe 100644
> --- a/arch/x86/video/fbdev.c
> +++ b/arch/x86/video/fbdev.c
> @@ -7,7 +7,6 @@
>    *
>    */
>
> -#include <linux/fb.h>
>   #include <linux/module.h>
>   #include <linux/pci.h>
>   #include <linux/vgaarb.h>
> @@ -25,20 +24,17 @@ pgprot_t pgprot_framebuffer(pgprot_t prot,
>   }
>   EXPORT_SYMBOL(pgprot_framebuffer);
>
> -int fb_is_primary_device(struct fb_info *info)
> +bool video_is_primary_device(struct device *dev)
>   {
> -	struct device *device = info->device;
> -	struct pci_dev *pci_dev;
> +	struct pci_dev *pdev;
>
> -	if (!device || !dev_is_pci(device))
> -		return 0;
> +	if (!dev_is_pci(dev))
> +		return false;
>
> -	pci_dev = to_pci_dev(device);
> +	pdev = to_pci_dev(dev);
>
> -	if (pci_dev == vga_default_device())
> -		return 1;
> -	return 0;
> +	return (pdev == vga_default_device());
>   }
> -EXPORT_SYMBOL(fb_is_primary_device);
> +EXPORT_SYMBOL(video_is_primary_device);
>
>   MODULE_LICENSE("GPL");
> diff --git a/drivers/video/fbdev/core/fbcon.c b/drivers/video/fbdev/core/fbcon.c
> index 46823c2e2ba12..85c5c8cbc680a 100644
> --- a/drivers/video/fbdev/core/fbcon.c
> +++ b/drivers/video/fbdev/core/fbcon.c
> @@ -2939,7 +2939,7 @@ void fbcon_remap_all(struct fb_info *info)
>   static void fbcon_select_primary(struct fb_info *info)
>   {
>   	if (!map_override && primary_device == -1 &&
> -	    fb_is_primary_device(info)) {
> +	    video_is_primary_device(info->device)) {
>   		int i;
>
>   		printk(KERN_INFO "fbcon: %s (fb%i) is primary device\n",
> diff --git a/include/asm-generic/fb.h b/include/asm-generic/fb.h
> index 6ccabb400aa66..4788c1e1c6bc0 100644
> --- a/include/asm-generic/fb.h
> +++ b/include/asm-generic/fb.h
> @@ -10,8 +10,9 @@
>   #include <linux/io.h>
>   #include <linux/mm_types.h>
>   #include <linux/pgtable.h>
> +#include <linux/types.h>
>
> -struct fb_info;
> +struct device;
>
>   #ifndef pgprot_framebuffer
>   #define pgprot_framebuffer pgprot_framebuffer
> @@ -23,11 +24,11 @@ static inline pgprot_t pgprot_framebuffer(pgprot_t prot,
>   }
>   #endif
>
> -#ifndef fb_is_primary_device
> -#define fb_is_primary_device fb_is_primary_device
> -static inline int fb_is_primary_device(struct fb_info *info)
> +#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 0;
> +	return false;
>   }
>   #endif
>


^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [PATCH v2 1/3] arch: Select fbdev helpers with CONFIG_VIDEO
  2024-03-27 20:41 ` [PATCH v2 1/3] arch: Select fbdev helpers with CONFIG_VIDEO Thomas Zimmermann
  2024-03-28  7:24   ` Sam Ravnborg
@ 2024-03-28 12:39   ` Helge Deller
  2024-03-28 13:21     ` Thomas Zimmermann
  1 sibling, 1 reply; 16+ messages in thread
From: Helge Deller @ 2024-03-28 12:39 UTC (permalink / raw)
  To: Thomas Zimmermann, arnd, javierm, sui.jingfeng
  Cc: Andreas Larsson, linux-fbdev, linux-sh, Dave Hansen, dri-devel,
	linux-kernel, James E.J. Bottomley, H. Peter Anvin, sparclinux,
	linux-arch, x86, Ingo Molnar, linux-snps-arc, linux-m68k,
	Borislav Petkov, loongarch, Thomas Gleixner, linux-arm-kernel,
	linux-parisc, linux-mips, linuxppc-dev, David S. Miller

On 3/27/24 21:41, Thomas Zimmermann wrote:
> Various Kconfig options selected the per-architecture helpers for
> fbdev. But none of the contained code depends on fbdev. Standardize
> on CONFIG_VIDEO, which will allow to add more general helpers for
> video functionality.
>
> CONFIG_VIDEO protects each architecture's video/ directory.

Your patch in general looks good.
But is renaming the config option from CONFIG_FB_CORE to CONFIG_VIDEO
the best choice?
CONFIG_VIDEO might be mixed up with multimedia/video-streaming.

Why not e.g. CONFIG_GRAPHICS_CORE?
I'm fine with CONFIG_VIDEO as well, but if someone has a better idea
we maybe should go with that instead now?

Helge

> This
> allows for the use of more fine-grained control for each directory's
> files, such as the use of CONFIG_STI_CORE on parisc.
>
> v2:
> - sparc: rebased onto Makefile changes
>
> Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
> Cc: "James E.J. Bottomley" <James.Bottomley@HansenPartnership.com>
> Cc: Helge Deller <deller@gmx.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>
> ---
>   arch/parisc/Makefile      | 2 +-
>   arch/sparc/Makefile       | 4 ++--
>   arch/sparc/video/Makefile | 2 +-
>   arch/x86/Makefile         | 2 +-
>   arch/x86/video/Makefile   | 3 ++-
>   5 files changed, 7 insertions(+), 6 deletions(-)
>
> diff --git a/arch/parisc/Makefile b/arch/parisc/Makefile
> index 316f84f1d15c8..21b8166a68839 100644
> --- a/arch/parisc/Makefile
> +++ b/arch/parisc/Makefile
> @@ -119,7 +119,7 @@ export LIBGCC
>
>   libs-y	+= arch/parisc/lib/ $(LIBGCC)
>
> -drivers-y += arch/parisc/video/
> +drivers-$(CONFIG_VIDEO) += arch/parisc/video/
>
>   boot	:= arch/parisc/boot
>
> diff --git a/arch/sparc/Makefile b/arch/sparc/Makefile
> index 2a03daa68f285..757451c3ea1df 100644
> --- a/arch/sparc/Makefile
> +++ b/arch/sparc/Makefile
> @@ -59,8 +59,8 @@ endif
>   libs-y                 += arch/sparc/prom/
>   libs-y                 += arch/sparc/lib/
>
> -drivers-$(CONFIG_PM) += arch/sparc/power/
> -drivers-$(CONFIG_FB_CORE) += arch/sparc/video/
> +drivers-$(CONFIG_PM)    += arch/sparc/power/
> +drivers-$(CONFIG_VIDEO) += arch/sparc/video/
>
>   boot := arch/sparc/boot
>
> diff --git a/arch/sparc/video/Makefile b/arch/sparc/video/Makefile
> index d4d83f1702c61..9dd82880a027a 100644
> --- a/arch/sparc/video/Makefile
> +++ b/arch/sparc/video/Makefile
> @@ -1,3 +1,3 @@
>   # SPDX-License-Identifier: GPL-2.0-only
>
> -obj-$(CONFIG_FB_CORE) += fbdev.o
> +obj-y	+= fbdev.o
> diff --git a/arch/x86/Makefile b/arch/x86/Makefile
> index 15a5f4f2ff0aa..c0ea612c62ebe 100644
> --- a/arch/x86/Makefile
> +++ b/arch/x86/Makefile
> @@ -265,7 +265,7 @@ drivers-$(CONFIG_PCI)            += arch/x86/pci/
>   # suspend and hibernation support
>   drivers-$(CONFIG_PM) += arch/x86/power/
>
> -drivers-$(CONFIG_FB_CORE) += arch/x86/video/
> +drivers-$(CONFIG_VIDEO) += arch/x86/video/
>
>   ####
>   # boot loader support. Several targets are kept for legacy purposes
> diff --git a/arch/x86/video/Makefile b/arch/x86/video/Makefile
> index 5ebe48752ffc4..9dd82880a027a 100644
> --- a/arch/x86/video/Makefile
> +++ b/arch/x86/video/Makefile
> @@ -1,2 +1,3 @@
>   # SPDX-License-Identifier: GPL-2.0-only
> -obj-$(CONFIG_FB_CORE)		+= fbdev.o
> +
> +obj-y	+= fbdev.o


^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [PATCH v2 3/3] arch: Rename fbdev header and source files
  2024-03-27 20:41 ` [PATCH v2 3/3] arch: Rename fbdev header and source files Thomas Zimmermann
  2024-03-28  7:23   ` Sam Ravnborg
@ 2024-03-28 12:46   ` Helge Deller
  2024-03-28 12:51     ` Arnd Bergmann
  2024-03-28 13:15   ` kernel test robot
  2 siblings, 1 reply; 16+ messages in thread
From: Helge Deller @ 2024-03-28 12:46 UTC (permalink / raw)
  To: Thomas Zimmermann, arnd, javierm, sui.jingfeng
  Cc: Andreas Larsson, linux-fbdev, Rich Felker, linux-sh,
	Catalin Marinas, Dave Hansen, x86, dri-devel, linux-kernel,
	James E.J. Bottomley, H. Peter Anvin, sparclinux, WANG Xuerui,
	Will Deacon, linux-arch, Yoshinori Sato, Huacai Chen, Ingo Molnar,
	Geert Uytterhoeven, Vineet Gupta, linux-snps-arc, Nicholas Piggin,
	linux-m68k, Borislav Petkov, loongarch, John Paul Adrian Glaubitz,
	Thomas Gleixner, linux-arm-kernel

On 3/27/24 21:41, Thomas Zimmermann wrote:
> 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.
>
> Further update all includes statements, includ guards, and Makefiles.
> Also update a few strings and comments to refer to video instead of
> fbdev.
>
> Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
> 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>
> ---
>   arch/arc/include/asm/fb.h                    |  8 --------
>   arch/arc/include/asm/video.h                 |  8 ++++++++
>   arch/arm/include/asm/fb.h                    |  6 ------
>   arch/arm/include/asm/video.h                 |  6 ++++++
>   arch/arm64/include/asm/fb.h                  | 10 ----------
>   arch/arm64/include/asm/video.h               | 10 ++++++++++
>   arch/loongarch/include/asm/{fb.h => video.h} |  8 ++++----
>   arch/m68k/include/asm/{fb.h => video.h}      |  8 ++++----
>   arch/mips/include/asm/{fb.h => video.h}      | 12 ++++++------
>   arch/parisc/include/asm/{fb.h => video.h}    |  8 ++++----
>   arch/parisc/video/Makefile                   |  2 +-
>   arch/parisc/video/{fbdev.c => video-sti.c}   |  2 +-
>   arch/powerpc/include/asm/{fb.h => video.h}   |  8 ++++----
>   arch/powerpc/kernel/pci-common.c             |  2 +-
>   arch/sh/include/asm/fb.h                     |  7 -------
>   arch/sh/include/asm/video.h                  |  7 +++++++
>   arch/sparc/include/asm/{fb.h => video.h}     |  8 ++++----
>   arch/sparc/video/Makefile                    |  2 +-
>   arch/sparc/video/{fbdev.c => video.c}        |  4 ++--
>   arch/x86/include/asm/{fb.h => video.h}       |  8 ++++----
>   arch/x86/video/Makefile                      |  2 +-
>   arch/x86/video/{fbdev.c => video.c}          |  3 ++-
>   include/asm-generic/Kbuild                   |  2 +-
>   include/asm-generic/{fb.h => video.h}        |  6 +++---
>   include/linux/fb.h                           |  2 +-
>   25 files changed, 75 insertions(+), 74 deletions(-)
>   delete mode 100644 arch/arc/include/asm/fb.h
>   create mode 100644 arch/arc/include/asm/video.h
>   delete mode 100644 arch/arm/include/asm/fb.h
>   create mode 100644 arch/arm/include/asm/video.h
>   delete mode 100644 arch/arm64/include/asm/fb.h
>   create mode 100644 arch/arm64/include/asm/video.h
>   rename arch/loongarch/include/asm/{fb.h => video.h} (86%)
>   rename arch/m68k/include/asm/{fb.h => video.h} (86%)
>   rename arch/mips/include/asm/{fb.h => video.h} (76%)
>   rename arch/parisc/include/asm/{fb.h => video.h} (68%)
>   rename arch/parisc/video/{fbdev.c => video-sti.c} (96%)
>   rename arch/powerpc/include/asm/{fb.h => video.h} (76%)
>   delete mode 100644 arch/sh/include/asm/fb.h
>   create mode 100644 arch/sh/include/asm/video.h
>   rename arch/sparc/include/asm/{fb.h => video.h} (89%)
>   rename arch/sparc/video/{fbdev.c => video.c} (86%)
>   rename arch/x86/include/asm/{fb.h => video.h} (77%)
>   rename arch/x86/video/{fbdev.c => video.c} (97%)
>   rename include/asm-generic/{fb.h => video.h} (96%)
>
> diff --git a/arch/arc/include/asm/fb.h b/arch/arc/include/asm/fb.h
> deleted file mode 100644
> index 9c2383d29cbb9..0000000000000
> --- a/arch/arc/include/asm/fb.h
> +++ /dev/null
> @@ -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_ */
> diff --git a/arch/arc/include/asm/video.h b/arch/arc/include/asm/video.h
> new file mode 100644
> index 0000000000000..8ff7263727fe7
> --- /dev/null
> +++ b/arch/arc/include/asm/video.h
> @@ -0,0 +1,8 @@
> +/* SPDX-License-Identifier: GPL-2.0 */
> +
> +#ifndef _ASM_VIDEO_H_
> +#define _ASM_VIDEO_H_
> +
> +#include <asm-generic/video.h>
> +
> +#endif /* _ASM_VIDEO_H_ */

I wonder, since that file simply #includes the generic version,
wasn't there a possibility that kbuild could symlink
the generic version for us?
Does it need to be mandatory in include/asm-generic/Kbuild ?
Same applies to a few other files below.

Helge



> diff --git a/arch/arm/include/asm/fb.h b/arch/arm/include/asm/fb.h
> deleted file mode 100644
> index ce20a43c30339..0000000000000
> --- a/arch/arm/include/asm/fb.h
> +++ /dev/null
> @@ -1,6 +0,0 @@
> -#ifndef _ASM_FB_H_
> -#define _ASM_FB_H_
> -
> -#include <asm-generic/fb.h>
> -
> -#endif /* _ASM_FB_H_ */
> diff --git a/arch/arm/include/asm/video.h b/arch/arm/include/asm/video.h
> new file mode 100644
> index 0000000000000..f570565366e67
> --- /dev/null
> +++ b/arch/arm/include/asm/video.h
> @@ -0,0 +1,6 @@
> +#ifndef _ASM_VIDEO_H_
> +#define _ASM_VIDEO_H_
> +
> +#include <asm-generic/video.h>
> +
> +#endif /* _ASM_VIDEO_H_ */
> diff --git a/arch/arm64/include/asm/fb.h b/arch/arm64/include/asm/fb.h
> deleted file mode 100644
> index 1a495d8fb2ce0..0000000000000
> --- a/arch/arm64/include/asm/fb.h
> +++ /dev/null
> @@ -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_ */
> diff --git a/arch/arm64/include/asm/video.h b/arch/arm64/include/asm/video.h
> new file mode 100644
> index 0000000000000..fe0e74983f4d9
> --- /dev/null
> +++ b/arch/arm64/include/asm/video.h
> @@ -0,0 +1,10 @@
> +/* SPDX-License-Identifier: GPL-2.0-only */
> +/*
> + * Copyright (C) 2012 ARM Ltd.
> + */
> +#ifndef __ASM_VIDEO_H_
> +#define __ASM_VIDEO_H_
> +
> +#include <asm-generic/video.h>
> +
> +#endif /* __ASM_VIDEO_H_ */
> diff --git a/arch/loongarch/include/asm/fb.h b/arch/loongarch/include/asm/video.h
> similarity index 86%
> rename from arch/loongarch/include/asm/fb.h
> rename to arch/loongarch/include/asm/video.h
> index 0b218b10a9ec3..9f76845f2d4fd 100644
> --- a/arch/loongarch/include/asm/fb.h
> +++ b/arch/loongarch/include/asm/video.h
> @@ -2,8 +2,8 @@
>   /*
>    * Copyright (C) 2020-2022 Loongson Technology Corporation Limited
>    */
> -#ifndef _ASM_FB_H_
> -#define _ASM_FB_H_
> +#ifndef _ASM_VIDEO_H_
> +#define _ASM_VIDEO_H_
>
>   #include <linux/compiler.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
>
> -#include <asm-generic/fb.h>
> +#include <asm-generic/video.h>
>
> -#endif /* _ASM_FB_H_ */
> +#endif /* _ASM_VIDEO_H_ */
> diff --git a/arch/m68k/include/asm/fb.h b/arch/m68k/include/asm/video.h
> similarity index 86%
> rename from arch/m68k/include/asm/fb.h
> rename to arch/m68k/include/asm/video.h
> index 9941b7434b696..6cf2194c413d8 100644
> --- a/arch/m68k/include/asm/fb.h
> +++ b/arch/m68k/include/asm/video.h
> @@ -1,6 +1,6 @@
>   /* SPDX-License-Identifier: GPL-2.0 */
> -#ifndef _ASM_FB_H_
> -#define _ASM_FB_H_
> +#ifndef _ASM_VIDEO_H_
> +#define _ASM_VIDEO_H_
>
>   #include <asm/page.h>
>   #include <asm/setup.h>
> @@ -27,6 +27,6 @@ static inline pgprot_t pgprot_framebuffer(pgprot_t prot,
>   }
>   #define pgprot_framebuffer pgprot_framebuffer
>
> -#include <asm-generic/fb.h>
> +#include <asm-generic/video.h>
>
> -#endif /* _ASM_FB_H_ */
> +#endif /* _ASM_VIDEO_H_ */
> diff --git a/arch/mips/include/asm/fb.h b/arch/mips/include/asm/video.h
> similarity index 76%
> rename from arch/mips/include/asm/fb.h
> rename to arch/mips/include/asm/video.h
> index d98d6681d64ec..007c106d980fd 100644
> --- a/arch/mips/include/asm/fb.h
> +++ b/arch/mips/include/asm/video.h
> @@ -1,5 +1,5 @@
> -#ifndef _ASM_FB_H_
> -#define _ASM_FB_H_
> +#ifndef _ASM_VIDEO_H_
> +#define _ASM_VIDEO_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
> - * in <asm-generic/fb.h> don't generate fb_readq() and
> - * fb_write(). We have to provide them here.
> + * in <asm-generic/video.h> don't generate fb_readq() and
> + * fb_writeq(). We have to provide them here.
>    *
>    * TODO: Convert MIPS to generic I/O. The helpers below can
>    *       then be removed.
> @@ -33,6 +33,6 @@ static inline void fb_writeq(u64 b, volatile void __iomem *addr)
>   #define fb_writeq fb_writeq
>   #endif
>
> -#include <asm-generic/fb.h>
> +#include <asm-generic/video.h>
>
> -#endif /* _ASM_FB_H_ */
> +#endif /* _ASM_VIDEO_H_ */
> diff --git a/arch/parisc/include/asm/fb.h b/arch/parisc/include/asm/video.h
> similarity index 68%
> rename from arch/parisc/include/asm/fb.h
> rename to arch/parisc/include/asm/video.h
> index ed2a195a3e762..c5dff3223194a 100644
> --- a/arch/parisc/include/asm/fb.h
> +++ b/arch/parisc/include/asm/video.h
> @@ -1,6 +1,6 @@
>   /* SPDX-License-Identifier: GPL-2.0 */
> -#ifndef _ASM_FB_H_
> -#define _ASM_FB_H_
> +#ifndef _ASM_VIDEO_H_
> +#define _ASM_VIDEO_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
>   #endif
>
> -#include <asm-generic/fb.h>
> +#include <asm-generic/video.h>
>
> -#endif /* _ASM_FB_H_ */
> +#endif /* _ASM_VIDEO_H_ */
> diff --git a/arch/parisc/video/Makefile b/arch/parisc/video/Makefile
> index 16a73cce46612..b5db5b42880f8 100644
> --- a/arch/parisc/video/Makefile
> +++ b/arch/parisc/video/Makefile
> @@ -1,3 +1,3 @@
>   # SPDX-License-Identifier: GPL-2.0-only
>
> -obj-$(CONFIG_STI_CORE) += fbdev.o
> +obj-$(CONFIG_STI_CORE) += video-sti.o
> diff --git a/arch/parisc/video/fbdev.c b/arch/parisc/video/video-sti.c
> similarity index 96%
> rename from arch/parisc/video/fbdev.c
> rename to arch/parisc/video/video-sti.c
> index 540fa0c919d59..564661e87093c 100644
> --- a/arch/parisc/video/fbdev.c
> +++ b/arch/parisc/video/video-sti.c
> @@ -9,7 +9,7 @@
>
>   #include <video/sticore.h>
>
> -#include <asm/fb.h>
> +#include <asm/video.h>
>
>   bool video_is_primary_device(struct device *dev)
>   {
> diff --git a/arch/powerpc/include/asm/fb.h b/arch/powerpc/include/asm/video.h
> similarity index 76%
> rename from arch/powerpc/include/asm/fb.h
> rename to arch/powerpc/include/asm/video.h
> index c0c5d1df7ad1e..e1770114ffc36 100644
> --- a/arch/powerpc/include/asm/fb.h
> +++ b/arch/powerpc/include/asm/video.h
> @@ -1,6 +1,6 @@
>   /* SPDX-License-Identifier: GPL-2.0 */
> -#ifndef _ASM_FB_H_
> -#define _ASM_FB_H_
> +#ifndef _ASM_VIDEO_H_
> +#define _ASM_VIDEO_H_
>
>   #include <asm/page.h>
>
> @@ -12,6 +12,6 @@ static inline pgprot_t pgprot_framebuffer(pgprot_t prot,
>   }
>   #define pgprot_framebuffer pgprot_framebuffer
>
> -#include <asm-generic/fb.h>
> +#include <asm-generic/video.h>
>
> -#endif /* _ASM_FB_H_ */
> +#endif /* _ASM_VIDEO_H_ */
> diff --git a/arch/powerpc/kernel/pci-common.c b/arch/powerpc/kernel/pci-common.c
> index d95a48eff412e..eac84d687b53f 100644
> --- a/arch/powerpc/kernel/pci-common.c
> +++ b/arch/powerpc/kernel/pci-common.c
> @@ -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
>    * above routine
>    */
> diff --git a/arch/sh/include/asm/fb.h b/arch/sh/include/asm/fb.h
> deleted file mode 100644
> index 19df13ee9ca73..0000000000000
> --- a/arch/sh/include/asm/fb.h
> +++ /dev/null
> @@ -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_ */
> diff --git a/arch/sh/include/asm/video.h b/arch/sh/include/asm/video.h
> new file mode 100644
> index 0000000000000..14f49934a247a
> --- /dev/null
> +++ b/arch/sh/include/asm/video.h
> @@ -0,0 +1,7 @@
> +/* SPDX-License-Identifier: GPL-2.0 */
> +#ifndef _ASM_VIDEO_H_
> +#define _ASM_VIDEO_H_
> +
> +#include <asm-generic/video.h>
> +
> +#endif /* _ASM_VIDEO_H_ */
> diff --git a/arch/sparc/include/asm/fb.h b/arch/sparc/include/asm/video.h
> similarity index 89%
> rename from arch/sparc/include/asm/fb.h
> rename to arch/sparc/include/asm/video.h
> index 07f0325d6921c..a6f48f52db584 100644
> --- a/arch/sparc/include/asm/fb.h
> +++ b/arch/sparc/include/asm/video.h
> @@ -1,6 +1,6 @@
>   /* SPDX-License-Identifier: GPL-2.0 */
> -#ifndef _SPARC_FB_H_
> -#define _SPARC_FB_H_
> +#ifndef _SPARC_VIDEO_H_
> +#define _SPARC_VIDEO_H_
>
>   #include <linux/io.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
>
> -#include <asm-generic/fb.h>
> +#include <asm-generic/video.h>
>
> -#endif /* _SPARC_FB_H_ */
> +#endif /* _SPARC_VIDEO_H_ */
> diff --git a/arch/sparc/video/Makefile b/arch/sparc/video/Makefile
> index 9dd82880a027a..fdf83a408d750 100644
> --- a/arch/sparc/video/Makefile
> +++ b/arch/sparc/video/Makefile
> @@ -1,3 +1,3 @@
>   # SPDX-License-Identifier: GPL-2.0-only
>
> -obj-y	+= fbdev.o
> +obj-y	+= video.o
> diff --git a/arch/sparc/video/fbdev.c b/arch/sparc/video/video.c
> similarity index 86%
> rename from arch/sparc/video/fbdev.c
> rename to arch/sparc/video/video.c
> index e46f0499c2774..2414380caadc9 100644
> --- a/arch/sparc/video/fbdev.c
> +++ b/arch/sparc/video/video.c
> @@ -4,8 +4,8 @@
>   #include <linux/device.h>
>   #include <linux/module.h>
>
> -#include <asm/fb.h>
>   #include <asm/prom.h>
> +#include <asm/video.h>
>
>   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);
>
> -MODULE_DESCRIPTION("Sparc fbdev helpers");
> +MODULE_DESCRIPTION("Sparc video helpers");
>   MODULE_LICENSE("GPL");
> diff --git a/arch/x86/include/asm/fb.h b/arch/x86/include/asm/video.h
> similarity index 77%
> rename from arch/x86/include/asm/fb.h
> rename to arch/x86/include/asm/video.h
> index 999db33792869..0950c9535fae9 100644
> --- a/arch/x86/include/asm/fb.h
> +++ b/arch/x86/include/asm/video.h
> @@ -1,6 +1,6 @@
>   /* SPDX-License-Identifier: GPL-2.0 */
> -#ifndef _ASM_X86_FB_H
> -#define _ASM_X86_FB_H
> +#ifndef _ASM_X86_VIDEO_H
> +#define _ASM_X86_VIDEO_H
>
>   #include <linux/types.h>
>
> @@ -16,6 +16,6 @@ pgprot_t pgprot_framebuffer(pgprot_t prot,
>   bool video_is_primary_device(struct device *dev);
>   #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 */
> diff --git a/arch/x86/video/Makefile b/arch/x86/video/Makefile
> index 9dd82880a027a..fdf83a408d750 100644
> --- a/arch/x86/video/Makefile
> +++ b/arch/x86/video/Makefile
> @@ -1,3 +1,3 @@
>   # SPDX-License-Identifier: GPL-2.0-only
>
> -obj-y	+= fbdev.o
> +obj-y	+= video.o
> diff --git a/arch/x86/video/fbdev.c b/arch/x86/video/video.c
> similarity index 97%
> rename from arch/x86/video/fbdev.c
> rename to arch/x86/video/video.c
> index 4d87ce8e257fe..81fc97a2a837a 100644
> --- a/arch/x86/video/fbdev.c
> +++ b/arch/x86/video/video.c
> @@ -10,7 +10,8 @@
>   #include <linux/module.h>
>   #include <linux/pci.h>
>   #include <linux/vgaarb.h>
> -#include <asm/fb.h>
> +
> +#include <asm/video.h>
>
>   pgprot_t pgprot_framebuffer(pgprot_t prot,
>   			    unsigned long vm_start, unsigned long vm_end,
> diff --git a/include/asm-generic/Kbuild b/include/asm-generic/Kbuild
> index d436bee4d129d..b20fa25a7e8d8 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/video.h
> similarity index 96%
> rename from include/asm-generic/fb.h
> rename to include/asm-generic/video.h
> index 4788c1e1c6bc0..b1da2309d9434 100644
> --- a/include/asm-generic/fb.h
> +++ b/include/asm-generic/video.h
> @@ -1,7 +1,7 @@
>   /* SPDX-License-Identifier: GPL-2.0 */
>
> -#ifndef __ASM_GENERIC_FB_H_
> -#define __ASM_GENERIC_FB_H_
> +#ifndef __ASM_GENERIC_VIDEO_H_
> +#define __ASM_GENERIC_VIDEO_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
>   #endif
>
> -#endif /* __ASM_GENERIC_FB_H_ */
> +#endif /* __ASM_GENERIC_VIDEO_H_ */
> diff --git a/include/linux/fb.h b/include/linux/fb.h
> index 708e6a177b1be..1f23e0c505424 100644
> --- a/include/linux/fb.h
> +++ b/include/linux/fb.h
> @@ -12,7 +12,7 @@
>   #include <linux/types.h>
>   #include <linux/workqueue.h>
>
> -#include <asm/fb.h>
> +#include <asm/video.h>
>
>   struct backlight_device;
>   struct device;


^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [PATCH v2 3/3] arch: Rename fbdev header and source files
  2024-03-28 12:46   ` Helge Deller
@ 2024-03-28 12:51     ` Arnd Bergmann
  2024-03-28 13:23       ` Thomas Zimmermann
  0 siblings, 1 reply; 16+ messages in thread
From: Arnd Bergmann @ 2024-03-28 12:51 UTC (permalink / raw)
  To: Helge Deller, Thomas Zimmermann, Javier Martinez Canillas,
	sui.jingfeng
  Cc: Andreas Larsson, linux-fbdev, Rich Felker, linux-sh,
	Catalin Marinas, Dave Hansen, x86, dri-devel, linux-kernel,
	James E . J . Bottomley, H. Peter Anvin, sparclinux, WANG Xuerui,
	Will Deacon, Linux-Arch, Yoshinori Sato, Huacai Chen, Ingo Molnar,
	Geert Uytterhoeven, Vineet Gupta, linux-snps-arc, Nicholas Piggin,
	linux-m68k, Borislav Petkov, loongarch, John Paul Adrian Glaubitz,
	Thomas Gleixner, linux-arm-kernel

On Thu, Mar 28, 2024, at 13:46, Helge Deller wrote:
> On 3/27/24 21:41, Thomas Zimmermann wrote:

>> +++ b/arch/arc/include/asm/video.h
>> @@ -0,0 +1,8 @@
>> +/* SPDX-License-Identifier: GPL-2.0 */
>> +
>> +#ifndef _ASM_VIDEO_H_
>> +#define _ASM_VIDEO_H_
>> +
>> +#include <asm-generic/video.h>
>> +
>> +#endif /* _ASM_VIDEO_H_ */
>
> I wonder, since that file simply #includes the generic version,
> wasn't there a possibility that kbuild could symlink
> the generic version for us?
> Does it need to be mandatory in include/asm-generic/Kbuild ?
> Same applies to a few other files below.

It should be enough to just remove the files entirely,
as kbuild will generate the same wrappers for mandatory files.

     Arnd

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [PATCH v2 3/3] arch: Rename fbdev header and source files
  2024-03-27 20:41 ` [PATCH v2 3/3] arch: Rename fbdev header and source files Thomas Zimmermann
  2024-03-28  7:23   ` Sam Ravnborg
  2024-03-28 12:46   ` Helge Deller
@ 2024-03-28 13:15   ` kernel test robot
  2 siblings, 0 replies; 16+ messages in thread
From: kernel test robot @ 2024-03-28 13:15 UTC (permalink / raw)
  To: Thomas Zimmermann, arnd, javierm, deller, sui.jingfeng
  Cc: linux-fbdev, Rich Felker, linux-sh, Catalin Marinas, dri-devel,
	linux-kernel, James E.J. Bottomley, sparclinux, WANG Xuerui,
	Will Deacon, linux-arch, Yoshinori Sato, Huacai Chen,
	Geert Uytterhoeven, Vineet Gupta, linux-snps-arc, Nicholas Piggin,
	linux-m68k, loongarch, oe-kbuild-all, linux-arm-kernel,
	Thomas Bogendoerfer, linux-parisc, linux-mips, Thomas Zimmermann,
	linuxppc-dev

Hi Thomas,

kernel test robot noticed the following build errors:

[auto build test ERROR on linus/master]
[also build test ERROR on v6.9-rc1 next-20240328]
[cannot apply to tip/x86/core deller-parisc/for-next arnd-asm-generic/master]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]

url:    https://github.com/intel-lab-lkp/linux/commits/Thomas-Zimmermann/arch-Select-fbdev-helpers-with-CONFIG_VIDEO/20240328-044735
base:   linus/master
patch link:    https://lore.kernel.org/r/20240327204450.14914-4-tzimmermann%40suse.de
patch subject: [PATCH v2 3/3] arch: Rename fbdev header and source files
config: um-randconfig-001-20240328 (https://download.01.org/0day-ci/archive/20240328/202403282102.OEKoBT3H-lkp@intel.com/config)
compiler: gcc-12 (Ubuntu 12.3.0-9ubuntu2) 12.3.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20240328/202403282102.OEKoBT3H-lkp@intel.com/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202403282102.OEKoBT3H-lkp@intel.com/

All errors (new ones prefixed by >>):

   /usr/bin/ld: drivers/video/fbdev/core/fb_io_fops.o: in function `fb_io_mmap':
>> fb_io_fops.c:(.text+0x251): undefined reference to `pgprot_framebuffer'
   collect2: error: ld returned 1 exit status

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [PATCH v2 1/3] arch: Select fbdev helpers with CONFIG_VIDEO
  2024-03-28 12:39   ` Helge Deller
@ 2024-03-28 13:21     ` Thomas Zimmermann
  0 siblings, 0 replies; 16+ messages in thread
From: Thomas Zimmermann @ 2024-03-28 13:21 UTC (permalink / raw)
  To: Helge Deller, arnd, javierm, sui.jingfeng
  Cc: Andreas Larsson, linux-fbdev, linux-sh, Dave Hansen, dri-devel,
	linux-kernel, James E.J. Bottomley, H. Peter Anvin, sparclinux,
	linux-arch, x86, Ingo Molnar, linux-snps-arc, linux-m68k,
	Borislav Petkov, loongarch, Thomas Gleixner, linux-arm-kernel,
	linux-parisc, linux-mips, linuxppc-dev, David S. Miller

Hi

Am 28.03.24 um 13:39 schrieb Helge Deller:
> On 3/27/24 21:41, Thomas Zimmermann wrote:
>> Various Kconfig options selected the per-architecture helpers for
>> fbdev. But none of the contained code depends on fbdev. Standardize
>> on CONFIG_VIDEO, which will allow to add more general helpers for
>> video functionality.
>>
>> CONFIG_VIDEO protects each architecture's video/ directory.
>
> Your patch in general looks good.
> But is renaming the config option from CONFIG_FB_CORE to CONFIG_VIDEO
> the best choice?
> CONFIG_VIDEO might be mixed up with multimedia/video-streaming.
>
> Why not e.g. CONFIG_GRAPHICS_CORE?
> I'm fine with CONFIG_VIDEO as well, but if someone has a better idea
> we maybe should go with that instead now?

We already have CONFIG_VIDEO in drivers/video/Kconfig specifically for 
such low-level graphics code. For generic multimedia, we could have 
CONFIG_MEDIA, CONFIG_STREAMING, etc. rather than renaming an established 
Kconfig symbol.

Best regards
Thomas

>
> Helge
>
>> This
>> allows for the use of more fine-grained control for each directory's
>> files, such as the use of CONFIG_STI_CORE on parisc.
>>
>> v2:
>> - sparc: rebased onto Makefile changes
>>
>> Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
>> Cc: "James E.J. Bottomley" <James.Bottomley@HansenPartnership.com>
>> Cc: Helge Deller <deller@gmx.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>
>> ---
>>   arch/parisc/Makefile      | 2 +-
>>   arch/sparc/Makefile       | 4 ++--
>>   arch/sparc/video/Makefile | 2 +-
>>   arch/x86/Makefile         | 2 +-
>>   arch/x86/video/Makefile   | 3 ++-
>>   5 files changed, 7 insertions(+), 6 deletions(-)
>>
>> diff --git a/arch/parisc/Makefile b/arch/parisc/Makefile
>> index 316f84f1d15c8..21b8166a68839 100644
>> --- a/arch/parisc/Makefile
>> +++ b/arch/parisc/Makefile
>> @@ -119,7 +119,7 @@ export LIBGCC
>>
>>   libs-y    += arch/parisc/lib/ $(LIBGCC)
>>
>> -drivers-y += arch/parisc/video/
>> +drivers-$(CONFIG_VIDEO) += arch/parisc/video/
>>
>>   boot    := arch/parisc/boot
>>
>> diff --git a/arch/sparc/Makefile b/arch/sparc/Makefile
>> index 2a03daa68f285..757451c3ea1df 100644
>> --- a/arch/sparc/Makefile
>> +++ b/arch/sparc/Makefile
>> @@ -59,8 +59,8 @@ endif
>>   libs-y                 += arch/sparc/prom/
>>   libs-y                 += arch/sparc/lib/
>>
>> -drivers-$(CONFIG_PM) += arch/sparc/power/
>> -drivers-$(CONFIG_FB_CORE) += arch/sparc/video/
>> +drivers-$(CONFIG_PM)    += arch/sparc/power/
>> +drivers-$(CONFIG_VIDEO) += arch/sparc/video/
>>
>>   boot := arch/sparc/boot
>>
>> diff --git a/arch/sparc/video/Makefile b/arch/sparc/video/Makefile
>> index d4d83f1702c61..9dd82880a027a 100644
>> --- a/arch/sparc/video/Makefile
>> +++ b/arch/sparc/video/Makefile
>> @@ -1,3 +1,3 @@
>>   # SPDX-License-Identifier: GPL-2.0-only
>>
>> -obj-$(CONFIG_FB_CORE) += fbdev.o
>> +obj-y    += fbdev.o
>> diff --git a/arch/x86/Makefile b/arch/x86/Makefile
>> index 15a5f4f2ff0aa..c0ea612c62ebe 100644
>> --- a/arch/x86/Makefile
>> +++ b/arch/x86/Makefile
>> @@ -265,7 +265,7 @@ drivers-$(CONFIG_PCI)            += arch/x86/pci/
>>   # suspend and hibernation support
>>   drivers-$(CONFIG_PM) += arch/x86/power/
>>
>> -drivers-$(CONFIG_FB_CORE) += arch/x86/video/
>> +drivers-$(CONFIG_VIDEO) += arch/x86/video/
>>
>>   ####
>>   # boot loader support. Several targets are kept for legacy purposes
>> diff --git a/arch/x86/video/Makefile b/arch/x86/video/Makefile
>> index 5ebe48752ffc4..9dd82880a027a 100644
>> --- a/arch/x86/video/Makefile
>> +++ b/arch/x86/video/Makefile
>> @@ -1,2 +1,3 @@
>>   # SPDX-License-Identifier: GPL-2.0-only
>> -obj-$(CONFIG_FB_CORE)        += fbdev.o
>> +
>> +obj-y    += fbdev.o
>

-- 
--
Thomas Zimmermann
Graphics Driver Developer
SUSE Software Solutions Germany GmbH
Frankenstrasse 146, 90461 Nuernberg, Germany
GF: Ivo Totev, Andrew Myers, Andrew McDonald, Boudien Moerman
HRB 36809 (AG Nuernberg)


^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [PATCH v2 3/3] arch: Rename fbdev header and source files
  2024-03-28 12:51     ` Arnd Bergmann
@ 2024-03-28 13:23       ` Thomas Zimmermann
  0 siblings, 0 replies; 16+ messages in thread
From: Thomas Zimmermann @ 2024-03-28 13:23 UTC (permalink / raw)
  To: Arnd Bergmann, Helge Deller, Javier Martinez Canillas,
	sui.jingfeng
  Cc: Andreas Larsson, linux-fbdev, Rich Felker, linux-sh,
	Catalin Marinas, Dave Hansen, x86, dri-devel, linux-kernel,
	James E . J . Bottomley, H. Peter Anvin, sparclinux, WANG Xuerui,
	Will Deacon, Linux-Arch, Yoshinori Sato, Huacai Chen, Ingo Molnar,
	Geert Uytterhoeven, Vineet Gupta, linux-snps-arc, Nicholas Piggin,
	linux-m68k, Borislav Petkov, loongarch, John Paul Adrian Glaubitz,
	Thomas Gleixner, linux-arm-kernel

Hi

Am 28.03.24 um 13:51 schrieb Arnd Bergmann:
> On Thu, Mar 28, 2024, at 13:46, Helge Deller wrote:
>> On 3/27/24 21:41, Thomas Zimmermann wrote:
>>> +++ b/arch/arc/include/asm/video.h
>>> @@ -0,0 +1,8 @@
>>> +/* SPDX-License-Identifier: GPL-2.0 */
>>> +
>>> +#ifndef _ASM_VIDEO_H_
>>> +#define _ASM_VIDEO_H_
>>> +
>>> +#include <asm-generic/video.h>
>>> +
>>> +#endif /* _ASM_VIDEO_H_ */
>> I wonder, since that file simply #includes the generic version,
>> wasn't there a possibility that kbuild could symlink
>> the generic version for us?
>> Does it need to be mandatory in include/asm-generic/Kbuild ?
>> Same applies to a few other files below.
> It should be enough to just remove the files entirely,
> as kbuild will generate the same wrappers for mandatory files.

If that works, I'm happy to remove these wrapper files.

Best regards
Thomas

>
>       Arnd

-- 
--
Thomas Zimmermann
Graphics Driver Developer
SUSE Software Solutions Germany GmbH
Frankenstrasse 146, 90461 Nuernberg, Germany
GF: Ivo Totev, Andrew Myers, Andrew McDonald, Boudien Moerman
HRB 36809 (AG Nuernberg)


^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [PATCH v2 2/3] arch: Remove struct fb_info from video helpers
  2024-03-28 11:04   ` Helge Deller
@ 2024-03-28 13:33     ` Thomas Zimmermann
  2024-03-28 14:59       ` Helge Deller
  0 siblings, 1 reply; 16+ messages in thread
From: Thomas Zimmermann @ 2024-03-28 13:33 UTC (permalink / raw)
  To: Helge Deller, arnd, javierm, sui.jingfeng
  Cc: Andreas Larsson, linux-fbdev, linux-sh, Dave Hansen, dri-devel,
	linux-kernel, James E.J. Bottomley, H. Peter Anvin, sparclinux,
	linux-arch, x86, Ingo Molnar, linux-snps-arc, linux-m68k,
	Borislav Petkov, loongarch, Thomas Gleixner, linux-arm-kernel,
	linux-parisc, linux-mips, linuxppc-dev, David S. Miller

Hi

Am 28.03.24 um 12:04 schrieb Helge Deller:
> On 3/27/24 21:41, Thomas Zimmermann wrote:
>> The per-architecture video helpers do not depend on struct fb_info
>> or anything else from fbdev. Remove it from the interface and replace
>> fb_is_primary_device() with video_is_primary_device(). The new helper
>
> Since you rename this function, wouldn't something similar to
>
> device_is_primary_display()
>     or
> device_is_primary_console()
>     or
> is_primary_graphics_device()
>     or
> is_primary_display_device()
>
> be a better name?

The video_ prefix is there to signal that the code is part of the video 
subsystem.

But there's too much code that tried to figure out a default video 
device. So I actually have different plans for this function. I'd like 
to replace it with a helper that returns the default device instead of 
just testing for it. Sample code for x86 is already in vgaarb.c. [1] The 
function's name would then be video_default_device() and return the 
appropriate struct device*. video_is_primary device() will be removed. 
This rename here is the easiest step towards the new helper. Ok?

Best regards
Thomas

[1] https://elixir.bootlin.com/linux/v6.8/source/drivers/pci/vgaarb.c#L559

>
> Helge
>
>> is similar in functionality, but can operate on non-fbdev devices.
>>
>> Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
>> Cc: "James E.J. Bottomley" <James.Bottomley@HansenPartnership.com>
>> Cc: Helge Deller <deller@gmx.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>
>> ---
>>   arch/parisc/include/asm/fb.h     |  8 +++++---
>>   arch/parisc/video/fbdev.c        |  9 +++++----
>>   arch/sparc/include/asm/fb.h      |  7 ++++---
>>   arch/sparc/video/fbdev.c         | 17 ++++++++---------
>>   arch/x86/include/asm/fb.h        |  8 +++++---
>>   arch/x86/video/fbdev.c           | 18 +++++++-----------
>>   drivers/video/fbdev/core/fbcon.c |  2 +-
>>   include/asm-generic/fb.h         | 11 ++++++-----
>>   8 files changed, 41 insertions(+), 39 deletions(-)
>>
>> diff --git a/arch/parisc/include/asm/fb.h b/arch/parisc/include/asm/fb.h
>> index 658a8a7dc5312..ed2a195a3e762 100644
>> --- a/arch/parisc/include/asm/fb.h
>> +++ b/arch/parisc/include/asm/fb.h
>> @@ -2,11 +2,13 @@
>>   #ifndef _ASM_FB_H_
>>   #define _ASM_FB_H_
>>
>> -struct fb_info;
>> +#include <linux/types.h>
>> +
>> +struct device;
>>
>>   #if defined(CONFIG_STI_CORE)
>> -int fb_is_primary_device(struct fb_info *info);
>> -#define fb_is_primary_device fb_is_primary_device
>> +bool video_is_primary_device(struct device *dev);
>> +#define video_is_primary_device video_is_primary_device
>>   #endif
>>
>>   #include <asm-generic/fb.h>
>> diff --git a/arch/parisc/video/fbdev.c b/arch/parisc/video/fbdev.c
>> index e4f8ac99fc9e0..540fa0c919d59 100644
>> --- a/arch/parisc/video/fbdev.c
>> +++ b/arch/parisc/video/fbdev.c
>> @@ -5,12 +5,13 @@
>>    * Copyright (C) 2001-2002 Thomas Bogendoerfer 
>> <tsbogend@alpha.franken.de>
>>    */
>>
>> -#include <linux/fb.h>
>>   #include <linux/module.h>
>>
>>   #include <video/sticore.h>
>>
>> -int fb_is_primary_device(struct fb_info *info)
>> +#include <asm/fb.h>
>> +
>> +bool video_is_primary_device(struct device *dev)
>>   {
>>       struct sti_struct *sti;
>>
>> @@ -21,6 +22,6 @@ int fb_is_primary_device(struct fb_info *info)
>>           return true;
>>
>>       /* return true if it's the default built-in framebuffer driver */
>> -    return (sti->dev == info->device);
>> +    return (sti->dev == dev);
>>   }
>> -EXPORT_SYMBOL(fb_is_primary_device);
>> +EXPORT_SYMBOL(video_is_primary_device);
>> diff --git a/arch/sparc/include/asm/fb.h b/arch/sparc/include/asm/fb.h
>> index 24440c0fda490..07f0325d6921c 100644
>> --- a/arch/sparc/include/asm/fb.h
>> +++ b/arch/sparc/include/asm/fb.h
>> @@ -3,10 +3,11 @@
>>   #define _SPARC_FB_H_
>>
>>   #include <linux/io.h>
>> +#include <linux/types.h>
>>
>>   #include <asm/page.h>
>>
>> -struct fb_info;
>> +struct device;
>>
>>   #ifdef CONFIG_SPARC32
>>   static inline pgprot_t pgprot_framebuffer(pgprot_t prot,
>> @@ -18,8 +19,8 @@ static inline pgprot_t pgprot_framebuffer(pgprot_t 
>> prot,
>>   #define pgprot_framebuffer pgprot_framebuffer
>>   #endif
>>
>> -int fb_is_primary_device(struct fb_info *info);
>> -#define fb_is_primary_device fb_is_primary_device
>> +bool video_is_primary_device(struct device *dev);
>> +#define video_is_primary_device video_is_primary_device
>>
>>   static inline void fb_memcpy_fromio(void *to, const volatile void 
>> __iomem *from, size_t n)
>>   {
>> diff --git a/arch/sparc/video/fbdev.c b/arch/sparc/video/fbdev.c
>> index bff66dd1909a4..e46f0499c2774 100644
>> --- a/arch/sparc/video/fbdev.c
>> +++ b/arch/sparc/video/fbdev.c
>> @@ -1,26 +1,25 @@
>>   // SPDX-License-Identifier: GPL-2.0
>>
>>   #include <linux/console.h>
>> -#include <linux/fb.h>
>> +#include <linux/device.h>
>>   #include <linux/module.h>
>>
>> +#include <asm/fb.h>
>>   #include <asm/prom.h>
>>
>> -int fb_is_primary_device(struct fb_info *info)
>> +bool video_is_primary_device(struct device *dev)
>>   {
>> -    struct device *dev = info->device;
>> -    struct device_node *node;
>> +    struct device_node *node = dev->of_node;
>>
>>       if (console_set_on_cmdline)
>> -        return 0;
>> +        return false;
>>
>> -    node = dev->of_node;
>>       if (node && node == of_console_device)
>> -        return 1;
>> +        return true;
>>
>> -    return 0;
>> +    return false;
>>   }
>> -EXPORT_SYMBOL(fb_is_primary_device);
>> +EXPORT_SYMBOL(video_is_primary_device);
>>
>>   MODULE_DESCRIPTION("Sparc fbdev helpers");
>>   MODULE_LICENSE("GPL");
>> diff --git a/arch/x86/include/asm/fb.h b/arch/x86/include/asm/fb.h
>> index c3b9582de7efd..999db33792869 100644
>> --- a/arch/x86/include/asm/fb.h
>> +++ b/arch/x86/include/asm/fb.h
>> @@ -2,17 +2,19 @@
>>   #ifndef _ASM_X86_FB_H
>>   #define _ASM_X86_FB_H
>>
>> +#include <linux/types.h>
>> +
>>   #include <asm/page.h>
>>
>> -struct fb_info;
>> +struct device;
>>
>>   pgprot_t pgprot_framebuffer(pgprot_t prot,
>>                   unsigned long vm_start, unsigned long vm_end,
>>                   unsigned long offset);
>>   #define pgprot_framebuffer pgprot_framebuffer
>>
>> -int fb_is_primary_device(struct fb_info *info);
>> -#define fb_is_primary_device fb_is_primary_device
>> +bool video_is_primary_device(struct device *dev);
>> +#define video_is_primary_device video_is_primary_device
>>
>>   #include <asm-generic/fb.h>
>>
>> diff --git a/arch/x86/video/fbdev.c b/arch/x86/video/fbdev.c
>> index 1dd6528cc947c..4d87ce8e257fe 100644
>> --- a/arch/x86/video/fbdev.c
>> +++ b/arch/x86/video/fbdev.c
>> @@ -7,7 +7,6 @@
>>    *
>>    */
>>
>> -#include <linux/fb.h>
>>   #include <linux/module.h>
>>   #include <linux/pci.h>
>>   #include <linux/vgaarb.h>
>> @@ -25,20 +24,17 @@ pgprot_t pgprot_framebuffer(pgprot_t prot,
>>   }
>>   EXPORT_SYMBOL(pgprot_framebuffer);
>>
>> -int fb_is_primary_device(struct fb_info *info)
>> +bool video_is_primary_device(struct device *dev)
>>   {
>> -    struct device *device = info->device;
>> -    struct pci_dev *pci_dev;
>> +    struct pci_dev *pdev;
>>
>> -    if (!device || !dev_is_pci(device))
>> -        return 0;
>> +    if (!dev_is_pci(dev))
>> +        return false;
>>
>> -    pci_dev = to_pci_dev(device);
>> +    pdev = to_pci_dev(dev);
>>
>> -    if (pci_dev == vga_default_device())
>> -        return 1;
>> -    return 0;
>> +    return (pdev == vga_default_device());
>>   }
>> -EXPORT_SYMBOL(fb_is_primary_device);
>> +EXPORT_SYMBOL(video_is_primary_device);
>>
>>   MODULE_LICENSE("GPL");
>> diff --git a/drivers/video/fbdev/core/fbcon.c 
>> b/drivers/video/fbdev/core/fbcon.c
>> index 46823c2e2ba12..85c5c8cbc680a 100644
>> --- a/drivers/video/fbdev/core/fbcon.c
>> +++ b/drivers/video/fbdev/core/fbcon.c
>> @@ -2939,7 +2939,7 @@ void fbcon_remap_all(struct fb_info *info)
>>   static void fbcon_select_primary(struct fb_info *info)
>>   {
>>       if (!map_override && primary_device == -1 &&
>> -        fb_is_primary_device(info)) {
>> +        video_is_primary_device(info->device)) {
>>           int i;
>>
>>           printk(KERN_INFO "fbcon: %s (fb%i) is primary device\n",
>> diff --git a/include/asm-generic/fb.h b/include/asm-generic/fb.h
>> index 6ccabb400aa66..4788c1e1c6bc0 100644
>> --- a/include/asm-generic/fb.h
>> +++ b/include/asm-generic/fb.h
>> @@ -10,8 +10,9 @@
>>   #include <linux/io.h>
>>   #include <linux/mm_types.h>
>>   #include <linux/pgtable.h>
>> +#include <linux/types.h>
>>
>> -struct fb_info;
>> +struct device;
>>
>>   #ifndef pgprot_framebuffer
>>   #define pgprot_framebuffer pgprot_framebuffer
>> @@ -23,11 +24,11 @@ static inline pgprot_t 
>> pgprot_framebuffer(pgprot_t prot,
>>   }
>>   #endif
>>
>> -#ifndef fb_is_primary_device
>> -#define fb_is_primary_device fb_is_primary_device
>> -static inline int fb_is_primary_device(struct fb_info *info)
>> +#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 0;
>> +    return false;
>>   }
>>   #endif
>>
>

-- 
--
Thomas Zimmermann
Graphics Driver Developer
SUSE Software Solutions Germany GmbH
Frankenstrasse 146, 90461 Nuernberg, Germany
GF: Ivo Totev, Andrew Myers, Andrew McDonald, Boudien Moerman
HRB 36809 (AG Nuernberg)


^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [PATCH v2 2/3] arch: Remove struct fb_info from video helpers
  2024-03-28 13:33     ` Thomas Zimmermann
@ 2024-03-28 14:59       ` Helge Deller
  0 siblings, 0 replies; 16+ messages in thread
From: Helge Deller @ 2024-03-28 14:59 UTC (permalink / raw)
  To: Thomas Zimmermann, arnd, javierm, sui.jingfeng
  Cc: Andreas Larsson, linux-fbdev, linux-sh, Dave Hansen, dri-devel,
	linux-kernel, James E.J. Bottomley, H. Peter Anvin, sparclinux,
	linux-arch, x86, Ingo Molnar, linux-snps-arc, linux-m68k,
	Borislav Petkov, loongarch, Thomas Gleixner, linux-arm-kernel,
	linux-parisc, linux-mips, linuxppc-dev, David S. Miller

On 3/28/24 14:33, Thomas Zimmermann wrote:
> Am 28.03.24 um 12:04 schrieb Helge Deller:
>> On 3/27/24 21:41, Thomas Zimmermann wrote:
>>> The per-architecture video helpers do not depend on struct fb_info
>>> or anything else from fbdev. Remove it from the interface and replace
>>> fb_is_primary_device() with video_is_primary_device(). The new helper
>>
>> Since you rename this function, wouldn't something similar to
>>
>> device_is_primary_display()
>>     or
>> device_is_primary_console()
>>     or
>> is_primary_graphics_device()
>>     or
>> is_primary_display_device()
>>
>> be a better name?
>
> The video_ prefix is there to signal that the code is part of the video subsystem.
>
> But there's too much code that tried to figure out a default video
> device. So I actually have different plans for this function. I'd
> like to replace it with a helper that returns the default device
> instead of just testing for it. Sample code for x86 is already in
> vgaarb.c. [1] The function's name would then be
> video_default_device() and return the appropriate struct device*.
> video_is_primary device() will be removed. This rename here is the
> easiest step towards the new helper. Ok?
Sounds ok.

Helge

^ permalink raw reply	[flat|nested] 16+ messages in thread

end of thread, other threads:[~2024-03-28 15:01 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-03-27 20:41 [PATCH v2 0/3] arch: Remove fbdev dependency from video helpers Thomas Zimmermann
2024-03-27 20:41 ` [PATCH v2 1/3] arch: Select fbdev helpers with CONFIG_VIDEO Thomas Zimmermann
2024-03-28  7:24   ` Sam Ravnborg
2024-03-28 12:39   ` Helge Deller
2024-03-28 13:21     ` Thomas Zimmermann
2024-03-27 20:41 ` [PATCH v2 2/3] arch: Remove struct fb_info from video helpers Thomas Zimmermann
2024-03-28  7:25   ` Sam Ravnborg
2024-03-28 11:04   ` Helge Deller
2024-03-28 13:33     ` Thomas Zimmermann
2024-03-28 14:59       ` Helge Deller
2024-03-27 20:41 ` [PATCH v2 3/3] arch: Rename fbdev header and source files Thomas Zimmermann
2024-03-28  7:23   ` Sam Ravnborg
2024-03-28 12:46   ` Helge Deller
2024-03-28 12:51     ` Arnd Bergmann
2024-03-28 13:23       ` Thomas Zimmermann
2024-03-28 13:15   ` kernel test robot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).