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

parisc/stifb: Implement fb_is_primary_device()

Implement fb_is_primary_device() function, so that fbcon detects if this
framebuffer belongs to the default graphics card which was used to start
the system.

Signed-off-by: Helge Deller <deller@gmx.de>
Cc: stable@vger.kernel.org # v5.10+

+23 -2
+4
arch/parisc/include/asm/fb.h
··· 12 12 pgprot_val(vma->vm_page_prot) |= _PAGE_NO_CACHE; 13 13 } 14 14 15 + #if defined(CONFIG_STI_CONSOLE) || defined(CONFIG_FB_STI) 16 + int fb_is_primary_device(struct fb_info *info); 17 + #else 15 18 static inline int fb_is_primary_device(struct fb_info *info) 16 19 { 17 20 return 0; 18 21 } 22 + #endif 19 23 20 24 #endif /* _ASM_FB_H_ */
+17
drivers/video/console/sticore.c
··· 30 30 #include <asm/pdc.h> 31 31 #include <asm/cacheflush.h> 32 32 #include <asm/grfioctl.h> 33 + #include <asm/fb.h> 33 34 34 35 #include "../fbdev/sticore.h" 35 36 ··· 1127 1126 1128 1127 return ret; 1129 1128 } 1129 + 1130 + /* check if given fb_info is the primary device */ 1131 + int fb_is_primary_device(struct fb_info *info) 1132 + { 1133 + struct sti_struct *sti; 1134 + 1135 + sti = sti_get_rom(0); 1136 + 1137 + /* if no built-in graphics card found, allow any fb driver as default */ 1138 + if (!sti) 1139 + return true; 1140 + 1141 + /* return true if it's the default built-in framebuffer driver */ 1142 + return (sti->info == info); 1143 + } 1144 + EXPORT_SYMBOL(fb_is_primary_device); 1130 1145 1131 1146 MODULE_AUTHOR("Philipp Rumpf, Helge Deller, Thomas Bogendoerfer"); 1132 1147 MODULE_DESCRIPTION("Core STI driver for HP's NGLE series graphics cards in HP PARISC machines");
+2 -2
drivers/video/fbdev/stifb.c
··· 1358 1358 goto out_err3; 1359 1359 } 1360 1360 1361 + /* save for primary gfx device detection & unregister_framebuffer() */ 1362 + sti->info = info; 1361 1363 if (register_framebuffer(&fb->info) < 0) 1362 1364 goto out_err4; 1363 - 1364 - sti->info = info; /* save for unregister_framebuffer() */ 1365 1365 1366 1366 fb_info(&fb->info, "%s %dx%d-%d frame buffer device, %s, id: %04x, mmio: 0x%04lx\n", 1367 1367 fix->id,