Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

arch: Remove struct fb_info from video helpers

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>
Reviewed-by: Sam Ravnborg <sam@ravnborg.org>
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>
Signed-off-by: Arnd Bergmann <arnd@arndb.de>

authored by

Thomas Zimmermann and committed by
Arnd Bergmann
f178e96d f25eae2c

+41 -39
+5 -3
arch/parisc/include/asm/fb.h
··· 2 2 #ifndef _ASM_FB_H_ 3 3 #define _ASM_FB_H_ 4 4 5 - struct fb_info; 5 + #include <linux/types.h> 6 + 7 + struct device; 6 8 7 9 #if defined(CONFIG_STI_CORE) 8 - int fb_is_primary_device(struct fb_info *info); 9 - #define fb_is_primary_device fb_is_primary_device 10 + bool video_is_primary_device(struct device *dev); 11 + #define video_is_primary_device video_is_primary_device 10 12 #endif 11 13 12 14 #include <asm-generic/fb.h>
+5 -4
arch/parisc/video/fbdev.c
··· 5 5 * Copyright (C) 2001-2002 Thomas Bogendoerfer <tsbogend@alpha.franken.de> 6 6 */ 7 7 8 - #include <linux/fb.h> 9 8 #include <linux/module.h> 10 9 11 10 #include <video/sticore.h> 12 11 13 - int fb_is_primary_device(struct fb_info *info) 12 + #include <asm/fb.h> 13 + 14 + bool video_is_primary_device(struct device *dev) 14 15 { 15 16 struct sti_struct *sti; 16 17 ··· 22 21 return true; 23 22 24 23 /* return true if it's the default built-in framebuffer driver */ 25 - return (sti->dev == info->device); 24 + return (sti->dev == dev); 26 25 } 27 - EXPORT_SYMBOL(fb_is_primary_device); 26 + EXPORT_SYMBOL(video_is_primary_device);
+4 -3
arch/sparc/include/asm/fb.h
··· 3 3 #define _SPARC_FB_H_ 4 4 5 5 #include <linux/io.h> 6 + #include <linux/types.h> 6 7 7 8 #include <asm/page.h> 8 9 9 - struct fb_info; 10 + struct device; 10 11 11 12 #ifdef CONFIG_SPARC32 12 13 static inline pgprot_t pgprot_framebuffer(pgprot_t prot, ··· 19 18 #define pgprot_framebuffer pgprot_framebuffer 20 19 #endif 21 20 22 - int fb_is_primary_device(struct fb_info *info); 23 - #define fb_is_primary_device fb_is_primary_device 21 + bool video_is_primary_device(struct device *dev); 22 + #define video_is_primary_device video_is_primary_device 24 23 25 24 static inline void fb_memcpy_fromio(void *to, const volatile void __iomem *from, size_t n) 26 25 {
+8 -9
arch/sparc/video/fbdev.c
··· 1 1 // SPDX-License-Identifier: GPL-2.0 2 2 3 3 #include <linux/console.h> 4 - #include <linux/fb.h> 4 + #include <linux/device.h> 5 5 #include <linux/module.h> 6 6 7 + #include <asm/fb.h> 7 8 #include <asm/prom.h> 8 9 9 - int fb_is_primary_device(struct fb_info *info) 10 + bool video_is_primary_device(struct device *dev) 10 11 { 11 - struct device *dev = info->device; 12 - struct device_node *node; 12 + struct device_node *node = dev->of_node; 13 13 14 14 if (console_set_on_cmdline) 15 - return 0; 15 + return false; 16 16 17 - node = dev->of_node; 18 17 if (node && node == of_console_device) 19 - return 1; 18 + return true; 20 19 21 - return 0; 20 + return false; 22 21 } 23 - EXPORT_SYMBOL(fb_is_primary_device); 22 + EXPORT_SYMBOL(video_is_primary_device); 24 23 25 24 MODULE_DESCRIPTION("Sparc fbdev helpers"); 26 25 MODULE_LICENSE("GPL");
+5 -3
arch/x86/include/asm/fb.h
··· 2 2 #ifndef _ASM_X86_FB_H 3 3 #define _ASM_X86_FB_H 4 4 5 + #include <linux/types.h> 6 + 5 7 #include <asm/page.h> 6 8 7 - struct fb_info; 9 + struct device; 8 10 9 11 pgprot_t pgprot_framebuffer(pgprot_t prot, 10 12 unsigned long vm_start, unsigned long vm_end, 11 13 unsigned long offset); 12 14 #define pgprot_framebuffer pgprot_framebuffer 13 15 14 - int fb_is_primary_device(struct fb_info *info); 15 - #define fb_is_primary_device fb_is_primary_device 16 + bool video_is_primary_device(struct device *dev); 17 + #define video_is_primary_device video_is_primary_device 16 18 17 19 #include <asm-generic/fb.h> 18 20
+7 -11
arch/x86/video/fbdev.c
··· 7 7 * 8 8 */ 9 9 10 - #include <linux/fb.h> 11 10 #include <linux/module.h> 12 11 #include <linux/pci.h> 13 12 #include <linux/vgaarb.h> ··· 24 25 } 25 26 EXPORT_SYMBOL(pgprot_framebuffer); 26 27 27 - int fb_is_primary_device(struct fb_info *info) 28 + bool video_is_primary_device(struct device *dev) 28 29 { 29 - struct device *device = info->device; 30 - struct pci_dev *pci_dev; 30 + struct pci_dev *pdev; 31 31 32 - if (!device || !dev_is_pci(device)) 33 - return 0; 32 + if (!dev_is_pci(dev)) 33 + return false; 34 34 35 - pci_dev = to_pci_dev(device); 35 + pdev = to_pci_dev(dev); 36 36 37 - if (pci_dev == vga_default_device()) 38 - return 1; 39 - return 0; 37 + return (pdev == vga_default_device()); 40 38 } 41 - EXPORT_SYMBOL(fb_is_primary_device); 39 + EXPORT_SYMBOL(video_is_primary_device); 42 40 43 41 MODULE_LICENSE("GPL");
+1 -1
drivers/video/fbdev/core/fbcon.c
··· 2907 2907 static void fbcon_select_primary(struct fb_info *info) 2908 2908 { 2909 2909 if (!map_override && primary_device == -1 && 2910 - fb_is_primary_device(info)) { 2910 + video_is_primary_device(info->device)) { 2911 2911 int i; 2912 2912 2913 2913 printk(KERN_INFO "fbcon: %s (fb%i) is primary device\n",
+6 -5
include/asm-generic/fb.h
··· 10 10 #include <linux/io.h> 11 11 #include <linux/mm_types.h> 12 12 #include <linux/pgtable.h> 13 + #include <linux/types.h> 13 14 14 - struct fb_info; 15 + struct device; 15 16 16 17 #ifndef pgprot_framebuffer 17 18 #define pgprot_framebuffer pgprot_framebuffer ··· 24 23 } 25 24 #endif 26 25 27 - #ifndef fb_is_primary_device 28 - #define fb_is_primary_device fb_is_primary_device 29 - static inline int fb_is_primary_device(struct fb_info *info) 26 + #ifndef video_is_primary_device 27 + #define video_is_primary_device video_is_primary_device 28 + static inline bool video_is_primary_device(struct device *dev) 30 29 { 31 - return 0; 30 + return false; 32 31 } 33 32 #endif 34 33