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

Merge tag 'fbdev-v5.1' of git://github.com/bzolnier/linux

Pull fbdev updates from Bartlomiej Zolnierkiewicz:
"Just a couple of small fixes and cleanups:

- fix memory access if logo is bigger than the screen (Manfred
Schlaegl)

- silence fbcon logo on 'quiet' boots (Prarit Bhargava)

- use kvmalloc() for scrollback buffer in fbcon (Konstantin Khorenko)

- misc fixes (Colin Ian King, YueHaibing, Matteo Croce, Mathieu
Malaterre, Anders Roxell, Arnd Bergmann)

- misc cleanups (Rob Herring, Lubomir Rintel, Greg Kroah-Hartman,
Jani Nikula, Michal Vokáč)"

* tag 'fbdev-v5.1' of git://github.com/bzolnier/linux:
fbdev: mbx: fix a misspelled variable name
fbdev: omap2: fix warnings in dss core
video: fbdev: Fix potential NULL pointer dereference
fbcon: Silence fbcon logo on 'quiet' boots
printk: Export console_printk
ARM: dts: imx28-cfa10036: Fix the reset gpio signal polarity
video: ssd1307fb: Do not hard code active-low reset sequence
dt-bindings: display: ssd1307fb: Remove reset-active-low from examples
fbdev: fbmem: fix memory access if logo is bigger than the screen
video/fbdev: refactor video= cmdline parsing
fbdev: mbx: fix up debugfs file creation
fbdev: omap2: no need to check return value of debugfs_create functions
video: fbdev: geode: remove ifdef OLPC noise
video: offb: annotate implicit fall throughs
omapfb: fix typo
fbdev: Use of_node_name_eq for node name comparisons
fbcon: use kvmalloc() for scrollback buffer
fbdev: chipsfb: remove set but not used variable 'size'
fbdev/via: fix spelling mistake "Expandsion" -> "Expansion"

+69 -114
-2
Documentation/devicetree/bindings/display/ssd1307fb.txt
··· 36 36 reg = <0x3c>; 37 37 pwms = <&pwm 4 3000>; 38 38 reset-gpios = <&gpio2 7>; 39 - reset-active-low; 40 39 }; 41 40 42 41 ssd1306: oled@3c { ··· 43 44 reg = <0x3c>; 44 45 pwms = <&pwm 4 3000>; 45 46 reset-gpios = <&gpio2 7>; 46 - reset-active-low; 47 47 solomon,com-lrremap; 48 48 solomon,com-invdir; 49 49 solomon,com-offset = <32>;
+2 -1
arch/arm/boot/dts/imx28-cfa10036.dts
··· 11 11 12 12 /dts-v1/; 13 13 #include "imx28.dtsi" 14 + #include <dt-bindings/gpio/gpio.h> 14 15 15 16 / { 16 17 model = "Crystalfontz CFA-10036 Board"; ··· 97 96 pinctrl-names = "default"; 98 97 pinctrl-0 = <&ssd1306_cfa10036>; 99 98 reg = <0x3c>; 100 - reset-gpios = <&gpio2 7 0>; 99 + reset-gpios = <&gpio2 7 GPIO_ACTIVE_LOW>; 101 100 solomon,height = <32>; 102 101 solomon,width = <128>; 103 102 solomon,page-offset = <0>;
+3 -3
drivers/video/fbdev/aty/radeon_pm.c
··· 2844 2844 * in some desktop G4s), Via (M9+ chip on iBook G4) and 2845 2845 * Snowy (M11 chip on iBook G4 manufactured after July 2005) 2846 2846 */ 2847 - if (!strcmp(rinfo->of_node->name, "ATY,JasperParent") || 2848 - !strcmp(rinfo->of_node->name, "ATY,SnowyParent")) { 2847 + if (of_node_name_eq(rinfo->of_node, "ATY,JasperParent") || 2848 + of_node_name_eq(rinfo->of_node, "ATY,SnowyParent")) { 2849 2849 rinfo->reinit_func = radeon_reinitialize_M10; 2850 2850 rinfo->pm_mode |= radeon_pm_off; 2851 2851 } ··· 2855 2855 rinfo->pm_mode |= radeon_pm_off; 2856 2856 } 2857 2857 #endif 2858 - if (!strcmp(rinfo->of_node->name, "ATY,ViaParent")) { 2858 + if (of_node_name_eq(rinfo->of_node, "ATY,ViaParent")) { 2859 2859 rinfo->reinit_func = radeon_reinitialize_M9P; 2860 2860 rinfo->pm_mode |= radeon_pm_off; 2861 2861 }
+2 -2
drivers/video/fbdev/cg14.c
··· 486 486 info->var.xres); 487 487 info->fix.smem_len = PAGE_ALIGN(linebytes * info->var.yres); 488 488 489 - if (!strcmp(dp->parent->name, "sbus") || 490 - !strcmp(dp->parent->name, "sbi")) { 489 + if (of_node_name_eq(dp->parent, "sbus") || 490 + of_node_name_eq(dp->parent, "sbi")) { 491 491 info->fix.smem_start = op->resource[0].start; 492 492 par->iospace = op->resource[0].flags & IORESOURCE_BITS; 493 493 } else {
+1 -1
drivers/video/fbdev/cg3.c
··· 369 369 info->var.red.length = 8; 370 370 info->var.green.length = 8; 371 371 info->var.blue.length = 8; 372 - if (!strcmp(dp->name, "cgRDI")) 372 + if (of_node_name_eq(dp, "cgRDI")) 373 373 par->flags |= CG3_FLAG_RDI; 374 374 if (par->flags & CG3_FLAG_RDI) 375 375 cg3_rdi_maybe_fixup_var(&info->var, dp);
+1 -2
drivers/video/fbdev/chipsfb.c
··· 349 349 static int chipsfb_pci_init(struct pci_dev *dp, const struct pci_device_id *ent) 350 350 { 351 351 struct fb_info *p; 352 - unsigned long addr, size; 352 + unsigned long addr; 353 353 unsigned short cmd; 354 354 int rc = -ENODEV; 355 355 ··· 361 361 if ((dp->resource[0].flags & IORESOURCE_MEM) == 0) 362 362 goto err_disable; 363 363 addr = pci_resource_start(dp, 0); 364 - size = pci_resource_len(dp, 0); 365 364 if (addr == 0) 366 365 goto err_disable; 367 366
+10 -13
drivers/video/fbdev/core/fb_cmdline.c
··· 75 75 * NOTE: This function is a __setup and __init function. 76 76 * It only stores the options. Drivers have to call 77 77 * fb_get_options() as necessary. 78 - * 79 - * Returns zero. 80 - * 81 78 */ 82 79 static int __init video_setup(char *options) 83 80 { 84 - int i, global = 0; 85 - 86 81 if (!options || !*options) 87 - global = 1; 82 + goto out; 88 83 89 - if (!global && !strncmp(options, "ofonly", 6)) { 84 + if (!strncmp(options, "ofonly", 6)) { 90 85 ofonly = 1; 91 - global = 1; 86 + goto out; 92 87 } 93 88 94 - if (!global && !strchr(options, ':')) { 95 - fb_mode_option = options; 96 - global = 1; 97 - } 89 + if (strchr(options, ':')) { 90 + /* named */ 91 + int i; 98 92 99 - if (!global) { 100 93 for (i = 0; i < FB_MAX; i++) { 101 94 if (video_options[i] == NULL) { 102 95 video_options[i] = options; 103 96 break; 104 97 } 105 98 } 99 + } else { 100 + /* global */ 101 + fb_mode_option = options; 106 102 } 107 103 104 + out: 108 105 return 1; 109 106 } 110 107 __setup("video=", video_setup);
+10 -4
drivers/video/fbdev/core/fbcon.c
··· 656 656 kfree(save); 657 657 } 658 658 659 + if (logo_shown == FBCON_LOGO_DONTSHOW) 660 + return; 661 + 659 662 if (logo_lines > vc->vc_bottom) { 660 663 logo_shown = FBCON_LOGO_CANSHOW; 661 664 printk(KERN_INFO 662 665 "fbcon_init: disable boot-logo (boot-logo bigger than screen).\n"); 663 - } else if (logo_shown != FBCON_LOGO_DONTSHOW) { 666 + } else { 664 667 logo_shown = FBCON_LOGO_DRAW; 665 668 vc->vc_top = logo_lines; 666 669 } ··· 1002 999 if (!softback_buf) { 1003 1000 softback_buf = 1004 1001 (unsigned long) 1005 - kmalloc(fbcon_softback_size, 1002 + kvmalloc(fbcon_softback_size, 1006 1003 GFP_KERNEL); 1007 1004 if (!softback_buf) { 1008 1005 fbcon_softback_size = 0; ··· 1011 1008 } 1012 1009 } else { 1013 1010 if (softback_buf) { 1014 - kfree((void *) softback_buf); 1011 + kvfree((void *) softback_buf); 1015 1012 softback_buf = 0; 1016 1013 softback_top = 0; 1017 1014 } ··· 1068 1065 return; 1069 1066 1070 1067 cap = info->flags; 1068 + 1069 + if (console_loglevel <= CONSOLE_LOGLEVEL_QUIET) 1070 + logo_shown = FBCON_LOGO_DONTSHOW; 1071 1071 1072 1072 if (vc != svc || logo_shown == FBCON_LOGO_DONTSHOW || 1073 1073 (info->fix.type == FB_TYPE_TEXT)) ··· 3678 3672 } 3679 3673 #endif 3680 3674 3681 - kfree((void *)softback_buf); 3675 + kvfree((void *)softback_buf); 3682 3676 softback_buf = 0UL; 3683 3677 3684 3678 for_each_registered_fb(i) {
+3
drivers/video/fbdev/core/fbmem.c
··· 431 431 { 432 432 unsigned int x; 433 433 434 + if (image->width > info->var.xres || image->height > info->var.yres) 435 + return; 436 + 434 437 if (rotate == FB_ROTATE_UR) { 435 438 for (x = 0; 436 439 x < num && image->dx + image->width <= info->var.xres;
+2
drivers/video/fbdev/core/fbmon.c
··· 978 978 get_monspecs(edid, specs); 979 979 980 980 specs->modedb = fb_create_modedb(edid, &specs->modedb_len, specs); 981 + if (!specs->modedb) 982 + return; 981 983 982 984 /* 983 985 * Workaround for buggy EDIDs that sets that the first
+1 -1
drivers/video/fbdev/ffb.c
··· 944 944 945 945 info->var.accel_flags = FB_ACCELF_TEXT; 946 946 947 - if (!strcmp(dp->name, "SUNW,afb")) 947 + if (of_node_name_eq(dp, "SUNW,afb")) 948 948 par->flags |= FFB_FLAG_AFB; 949 949 950 950 par->board_type = of_getintprop_default(dp, "board_type", 0);
+2 -11
drivers/video/fbdev/geode/gxfb_core.c
··· 33 33 #include <linux/pci.h> 34 34 #include <linux/cs5535.h> 35 35 36 + #include <asm/olpc.h> 37 + 36 38 #include "gxfb.h" 37 39 38 40 static char *mode_option; ··· 109 107 FB_VMODE_NONINTERLACED, FB_MODE_IS_VESA }, 110 108 }; 111 109 112 - #ifdef CONFIG_OLPC 113 - #include <asm/olpc.h> 114 - 115 110 static struct fb_videomode gx_dcon_modedb[] = { 116 111 /* The only mode the DCON has is 1200x900 */ 117 112 { NULL, 50, 1200, 900, 17460, 24, 8, 4, 5, 8, 3, ··· 126 127 *size = ARRAY_SIZE(gx_modedb); 127 128 } 128 129 } 129 - 130 - #else 131 - static void get_modedb(struct fb_videomode **modedb, unsigned int *size) 132 - { 133 - *modedb = (struct fb_videomode *) gx_modedb; 134 - *size = ARRAY_SIZE(gx_modedb); 135 - } 136 - #endif 137 130 138 131 static int gxfb_check_var(struct fb_var_screeninfo *var, struct fb_info *info) 139 132 {
+2 -11
drivers/video/fbdev/geode/lxfb_core.c
··· 23 23 #include <linux/pci.h> 24 24 #include <linux/uaccess.h> 25 25 26 + #include <asm/olpc.h> 27 + 26 28 #include "lxfb.h" 27 29 28 30 static char *mode_option; ··· 218 216 0, FB_VMODE_NONINTERLACED, 0 }, 219 217 }; 220 218 221 - #ifdef CONFIG_OLPC 222 - #include <asm/olpc.h> 223 - 224 219 static struct fb_videomode olpc_dcon_modedb[] = { 225 220 /* The only mode the DCON has is 1200x900 */ 226 221 { NULL, 50, 1200, 900, 17460, 24, 8, 4, 5, 8, 3, ··· 235 236 *size = ARRAY_SIZE(geode_modedb); 236 237 } 237 238 } 238 - 239 - #else 240 - static void get_modedb(struct fb_videomode **modedb, unsigned int *size) 241 - { 242 - *modedb = (struct fb_videomode *) geode_modedb; 243 - *size = ARRAY_SIZE(geode_modedb); 244 - } 245 - #endif 246 239 247 240 static int lxfb_check_var(struct fb_var_screeninfo *var, struct fb_info *info) 248 241 {
+2 -2
drivers/video/fbdev/imsttfb.c
··· 1497 1497 switch (pdev->device) { 1498 1498 case PCI_DEVICE_ID_IMS_TT128: /* IMS,tt128mbA */ 1499 1499 par->ramdac = IBM; 1500 - if (dp && ((strcmp(dp->name, "IMS,tt128mb8") == 0) || 1501 - (strcmp(dp->name, "IMS,tt128mb8A") == 0))) 1500 + if (of_node_name_eq(dp, "IMS,tt128mb8") || 1501 + of_node_name_eq(dp, "IMS,tt128mb8A")) 1502 1502 par->ramdac = TVP; 1503 1503 break; 1504 1504 case PCI_DEVICE_ID_IMS_TT3D: /* IMS,tt3d */
+10 -24
drivers/video/fbdev/mbx/mbxdebugfs.c
··· 211 211 static void mbxfb_debugfs_init(struct fb_info *fbi) 212 212 { 213 213 struct mbxfb_info *mfbi = fbi->par; 214 - struct mbxfb_debugfs_data *dbg; 214 + struct dentry *dir; 215 215 216 - dbg = kzalloc(sizeof(struct mbxfb_debugfs_data), GFP_KERNEL); 217 - mfbi->debugfs_data = dbg; 216 + dir = debugfs_create_dir("mbxfb", NULL); 217 + mfbi->debugfs_dir = dir; 218 218 219 - dbg->dir = debugfs_create_dir("mbxfb", NULL); 220 - dbg->sysconf = debugfs_create_file("sysconf", 0444, dbg->dir, 221 - fbi, &sysconf_fops); 222 - dbg->clock = debugfs_create_file("clock", 0444, dbg->dir, 223 - fbi, &clock_fops); 224 - dbg->display = debugfs_create_file("display", 0444, dbg->dir, 225 - fbi, &display_fops); 226 - dbg->gsctl = debugfs_create_file("gsctl", 0444, dbg->dir, 227 - fbi, &gsctl_fops); 228 - dbg->sdram = debugfs_create_file("sdram", 0444, dbg->dir, 229 - fbi, &sdram_fops); 230 - dbg->misc = debugfs_create_file("misc", 0444, dbg->dir, 231 - fbi, &misc_fops); 219 + debugfs_create_file("sysconf", 0444, dir, fbi, &sysconf_fops); 220 + debugfs_create_file("clock", 0444, dir, fbi, &clock_fops); 221 + debugfs_create_file("display", 0444, dir, fbi, &display_fops); 222 + debugfs_create_file("gsctl", 0444, dir, fbi, &gsctl_fops); 223 + debugfs_create_file("sdram", 0444, dir, fbi, &sdram_fops); 224 + debugfs_create_file("misc", 0444, dir, fbi, &misc_fops); 232 225 } 233 226 234 227 static void mbxfb_debugfs_remove(struct fb_info *fbi) 235 228 { 236 229 struct mbxfb_info *mfbi = fbi->par; 237 - struct mbxfb_debugfs_data *dbg = mfbi->debugfs_data; 238 230 239 - debugfs_remove(dbg->misc); 240 - debugfs_remove(dbg->sdram); 241 - debugfs_remove(dbg->gsctl); 242 - debugfs_remove(dbg->display); 243 - debugfs_remove(dbg->clock); 244 - debugfs_remove(dbg->sysconf); 245 - debugfs_remove(dbg->dir); 231 + debugfs_remove_recursive(mfbi->debugfs_dir); 246 232 }
+1 -1
drivers/video/fbdev/mbx/mbxfb.c
··· 74 74 75 75 u32 pseudo_palette[MAX_PALETTES]; 76 76 #ifdef CONFIG_FB_MBX_DEBUG 77 - void *debugfs_data; 77 + struct dentry *debugfs_dir; 78 78 #endif 79 79 80 80 };
+3 -1
drivers/video/fbdev/offb.c
··· 141 141 /* Clear PALETTE_ACCESS_CNTL in DAC_CNTL */ 142 142 out_le32(par->cmap_adr + 0x58, 143 143 in_le32(par->cmap_adr + 0x58) & ~0x20); 144 + /* fall through */ 144 145 case cmap_r128: 145 146 /* Set palette index & data */ 146 147 out_8(par->cmap_adr + 0xb0, regno); ··· 211 210 /* Clear PALETTE_ACCESS_CNTL in DAC_CNTL */ 212 211 out_le32(par->cmap_adr + 0x58, 213 212 in_le32(par->cmap_adr + 0x58) & ~0x20); 213 + /* fall through */ 214 214 case cmap_r128: 215 215 /* Set palette index & data */ 216 216 out_8(par->cmap_adr + 0xb0, i); ··· 648 646 } 649 647 #endif 650 648 /* kludge for valkyrie */ 651 - if (strcmp(dp->name, "valkyrie") == 0) 649 + if (of_node_name_eq(dp, "valkyrie")) 652 650 address += 0x1000; 653 651 offb_init_fb(no_real_node ? "bootx" : NULL, 654 652 width, height, depth, pitch, address,
+6 -28
drivers/video/fbdev/omap2/omapfb/dss/core.c
··· 110 110 111 111 static struct dentry *dss_debugfs_dir; 112 112 113 - static int dss_initialize_debugfs(void) 113 + static void dss_initialize_debugfs(void) 114 114 { 115 115 dss_debugfs_dir = debugfs_create_dir("omapdss", NULL); 116 - if (IS_ERR(dss_debugfs_dir)) { 117 - int err = PTR_ERR(dss_debugfs_dir); 118 - dss_debugfs_dir = NULL; 119 - return err; 120 - } 121 116 122 117 debugfs_create_file("clk", S_IRUGO, dss_debugfs_dir, 123 118 &dss_debug_dump_clocks, &dss_fops); 124 - 125 - return 0; 126 119 } 127 120 128 121 static void dss_uninitialize_debugfs(void) ··· 123 130 debugfs_remove_recursive(dss_debugfs_dir); 124 131 } 125 132 126 - int dss_debugfs_create_file(const char *name, void (*write)(struct seq_file *)) 133 + void dss_debugfs_create_file(const char *name, void (*write)(struct seq_file *)) 127 134 { 128 - struct dentry *d; 129 - 130 - d = debugfs_create_file(name, S_IRUGO, dss_debugfs_dir, 131 - write, &dss_fops); 132 - 133 - return PTR_ERR_OR_ZERO(d); 135 + debugfs_create_file(name, S_IRUGO, dss_debugfs_dir, write, &dss_fops); 134 136 } 135 137 #else /* CONFIG_FB_OMAP2_DSS_DEBUGFS */ 136 - static inline int dss_initialize_debugfs(void) 138 + static inline void dss_initialize_debugfs(void) 137 139 { 138 - return 0; 139 140 } 140 141 static inline void dss_uninitialize_debugfs(void) 141 142 { 142 143 } 143 - int dss_debugfs_create_file(const char *name, void (*write)(struct seq_file *)) 144 + void dss_debugfs_create_file(const char *name, void (*write)(struct seq_file *)) 144 145 { 145 - return 0; 146 146 } 147 147 #endif /* CONFIG_FB_OMAP2_DSS_DEBUGFS */ 148 148 ··· 168 182 169 183 static int __init omap_dss_probe(struct platform_device *pdev) 170 184 { 171 - int r; 172 - 173 185 core.pdev = pdev; 174 186 175 187 dss_features_init(omapdss_get_version()); 176 188 177 - r = dss_initialize_debugfs(); 178 - if (r) 179 - goto err_debugfs; 189 + dss_initialize_debugfs(); 180 190 181 191 if (def_disp_name) 182 192 core.default_display_name = def_disp_name; ··· 180 198 register_pm_notifier(&omap_dss_pm_notif_block); 181 199 182 200 return 0; 183 - 184 - err_debugfs: 185 - 186 - return r; 187 201 } 188 202 189 203 static int omap_dss_remove(struct platform_device *pdev)
+2 -2
drivers/video/fbdev/omap2/omapfb/dss/dss-of.c
··· 60 60 return NULL; 61 61 } 62 62 prev = port; 63 - } while (of_node_cmp(port->name, "port") != 0); 63 + } while (!of_node_name_eq(port, "port")); 64 64 65 65 of_node_put(ports); 66 66 } ··· 83 83 if (!ep) 84 84 return NULL; 85 85 prev = ep; 86 - } while (of_node_cmp(ep->name, "endpoint") != 0); 86 + } while (!of_node_name_eq(ep, "endpoint")); 87 87 88 88 return ep; 89 89 }
+1 -1
drivers/video/fbdev/omap2/omapfb/dss/dss.h
··· 214 214 int dss_dsi_enable_pads(int dsi_id, unsigned lane_mask); 215 215 void dss_dsi_disable_pads(int dsi_id, unsigned lane_mask); 216 216 int dss_set_min_bus_tput(struct device *dev, unsigned long tput); 217 - int dss_debugfs_create_file(const char *name, void (*write)(struct seq_file *)); 217 + void dss_debugfs_create_file(const char *name, void (*write)(struct seq_file *)); 218 218 219 219 /* display */ 220 220 int dss_suspend_all_devices(void);
+1 -1
drivers/video/fbdev/omap2/omapfb/dss/hdmi4_core.c
··· 712 712 else 713 713 acore.i2s_cfg.justification = HDMI_AUDIO_JUSTIFY_RIGHT; 714 714 /* 715 - * The I2S input word length is twice the lenght given in the IEC-60958 715 + * The I2S input word length is twice the length given in the IEC-60958 716 716 * status word. If the word size is greater than 717 717 * 20 bits, increment by one. 718 718 */
+2 -2
drivers/video/fbdev/ssd1307fb.c
··· 667 667 668 668 if (par->reset) { 669 669 /* Reset the screen */ 670 - gpiod_set_value_cansleep(par->reset, 0); 671 - udelay(4); 672 670 gpiod_set_value_cansleep(par->reset, 1); 671 + udelay(4); 672 + gpiod_set_value_cansleep(par->reset, 0); 673 673 udelay(4); 674 674 } 675 675
+1 -1
drivers/video/fbdev/via/viafbdev.c
··· 2110 2110 2111 2111 module_param(viafb_lcd_dsp_method, int, S_IRUSR); 2112 2112 MODULE_PARM_DESC(viafb_lcd_dsp_method, 2113 - "Set Flat Panel display scaling method.(Default=Expandsion)"); 2113 + "Set Flat Panel display scaling method.(Default=Expansion)"); 2114 2114 2115 2115 module_param(viafb_SAMM_ON, int, S_IRUSR); 2116 2116 MODULE_PARM_DESC(viafb_SAMM_ON,
+1
kernel/printk/printk.c
··· 65 65 CONSOLE_LOGLEVEL_MIN, /* minimum_console_loglevel */ 66 66 CONSOLE_LOGLEVEL_DEFAULT, /* default_console_loglevel */ 67 67 }; 68 + EXPORT_SYMBOL_GPL(console_printk); 68 69 69 70 atomic_t ignore_console_lock_warning __read_mostly = ATOMIC_INIT(0); 70 71 EXPORT_SYMBOL(ignore_console_lock_warning);