Skip to content

Commit 2b9c272

Browse files
committed
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"
2 parents 51b1ac0 + 9a9f1d1 commit 2b9c272

File tree

24 files changed

+72
-117
lines changed

24 files changed

+72
-117
lines changed

Documentation/devicetree/bindings/display/ssd1307fb.txt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,15 +36,13 @@ ssd1307: oled@3c {
3636
reg = <0x3c>;
3737
pwms = <&pwm 4 3000>;
3838
reset-gpios = <&gpio2 7>;
39-
reset-active-low;
4039
};
4140

4241
ssd1306: oled@3c {
4342
compatible = "solomon,ssd1306fb-i2c";
4443
reg = <0x3c>;
4544
pwms = <&pwm 4 3000>;
4645
reset-gpios = <&gpio2 7>;
47-
reset-active-low;
4846
solomon,com-lrremap;
4947
solomon,com-invdir;
5048
solomon,com-offset = <32>;

arch/arm/boot/dts/imx28-cfa10036.dts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111

1212
/dts-v1/;
1313
#include "imx28.dtsi"
14+
#include <dt-bindings/gpio/gpio.h>
1415

1516
/ {
1617
model = "Crystalfontz CFA-10036 Board";
@@ -96,7 +97,7 @@
9697
pinctrl-names = "default";
9798
pinctrl-0 = <&ssd1306_cfa10036>;
9899
reg = <0x3c>;
99-
reset-gpios = <&gpio2 7 0>;
100+
reset-gpios = <&gpio2 7 GPIO_ACTIVE_LOW>;
100101
solomon,height = <32>;
101102
solomon,width = <128>;
102103
solomon,page-offset = <0>;

drivers/video/fbdev/aty/radeon_pm.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2844,8 +2844,8 @@ void radeonfb_pm_init(struct radeonfb_info *rinfo, int dynclk, int ignore_devlis
28442844
* in some desktop G4s), Via (M9+ chip on iBook G4) and
28452845
* Snowy (M11 chip on iBook G4 manufactured after July 2005)
28462846
*/
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")) {
28492849
rinfo->reinit_func = radeon_reinitialize_M10;
28502850
rinfo->pm_mode |= radeon_pm_off;
28512851
}
@@ -2855,7 +2855,7 @@ void radeonfb_pm_init(struct radeonfb_info *rinfo, int dynclk, int ignore_devlis
28552855
rinfo->pm_mode |= radeon_pm_off;
28562856
}
28572857
#endif
2858-
if (!strcmp(rinfo->of_node->name, "ATY,ViaParent")) {
2858+
if (of_node_name_eq(rinfo->of_node, "ATY,ViaParent")) {
28592859
rinfo->reinit_func = radeon_reinitialize_M9P;
28602860
rinfo->pm_mode |= radeon_pm_off;
28612861
}

drivers/video/fbdev/cg14.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -486,8 +486,8 @@ static int cg14_probe(struct platform_device *op)
486486
info->var.xres);
487487
info->fix.smem_len = PAGE_ALIGN(linebytes * info->var.yres);
488488

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")) {
491491
info->fix.smem_start = op->resource[0].start;
492492
par->iospace = op->resource[0].flags & IORESOURCE_BITS;
493493
} else {

drivers/video/fbdev/cg3.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -369,7 +369,7 @@ static int cg3_probe(struct platform_device *op)
369369
info->var.red.length = 8;
370370
info->var.green.length = 8;
371371
info->var.blue.length = 8;
372-
if (!strcmp(dp->name, "cgRDI"))
372+
if (of_node_name_eq(dp, "cgRDI"))
373373
par->flags |= CG3_FLAG_RDI;
374374
if (par->flags & CG3_FLAG_RDI)
375375
cg3_rdi_maybe_fixup_var(&info->var, dp);

drivers/video/fbdev/chipsfb.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -349,7 +349,7 @@ static void init_chips(struct fb_info *p, unsigned long addr)
349349
static int chipsfb_pci_init(struct pci_dev *dp, const struct pci_device_id *ent)
350350
{
351351
struct fb_info *p;
352-
unsigned long addr, size;
352+
unsigned long addr;
353353
unsigned short cmd;
354354
int rc = -ENODEV;
355355

@@ -361,7 +361,6 @@ static int chipsfb_pci_init(struct pci_dev *dp, const struct pci_device_id *ent)
361361
if ((dp->resource[0].flags & IORESOURCE_MEM) == 0)
362362
goto err_disable;
363363
addr = pci_resource_start(dp, 0);
364-
size = pci_resource_len(dp, 0);
365364
if (addr == 0)
366365
goto err_disable;
367366

drivers/video/fbdev/core/fb_cmdline.c

Lines changed: 10 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -75,36 +75,33 @@ EXPORT_SYMBOL(fb_get_options);
7575
* NOTE: This function is a __setup and __init function.
7676
* It only stores the options. Drivers have to call
7777
* fb_get_options() as necessary.
78-
*
79-
* Returns zero.
80-
*
8178
*/
8279
static int __init video_setup(char *options)
8380
{
84-
int i, global = 0;
85-
8681
if (!options || !*options)
87-
global = 1;
82+
goto out;
8883

89-
if (!global && !strncmp(options, "ofonly", 6)) {
84+
if (!strncmp(options, "ofonly", 6)) {
9085
ofonly = 1;
91-
global = 1;
86+
goto out;
9287
}
9388

94-
if (!global && !strchr(options, ':')) {
95-
fb_mode_option = options;
96-
global = 1;
97-
}
89+
if (strchr(options, ':')) {
90+
/* named */
91+
int i;
9892

99-
if (!global) {
10093
for (i = 0; i < FB_MAX; i++) {
10194
if (video_options[i] == NULL) {
10295
video_options[i] = options;
10396
break;
10497
}
10598
}
99+
} else {
100+
/* global */
101+
fb_mode_option = options;
106102
}
107103

104+
out:
108105
return 1;
109106
}
110107
__setup("video=", video_setup);

drivers/video/fbdev/core/fbcon.c

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -656,11 +656,14 @@ static void fbcon_prepare_logo(struct vc_data *vc, struct fb_info *info,
656656
kfree(save);
657657
}
658658

659+
if (logo_shown == FBCON_LOGO_DONTSHOW)
660+
return;
661+
659662
if (logo_lines > vc->vc_bottom) {
660663
logo_shown = FBCON_LOGO_CANSHOW;
661664
printk(KERN_INFO
662665
"fbcon_init: disable boot-logo (boot-logo bigger than screen).\n");
663-
} else if (logo_shown != FBCON_LOGO_DONTSHOW) {
666+
} else {
664667
logo_shown = FBCON_LOGO_DRAW;
665668
vc->vc_top = logo_lines;
666669
}
@@ -999,7 +1002,7 @@ static const char *fbcon_startup(void)
9991002
if (!softback_buf) {
10001003
softback_buf =
10011004
(unsigned long)
1002-
kmalloc(fbcon_softback_size,
1005+
kvmalloc(fbcon_softback_size,
10031006
GFP_KERNEL);
10041007
if (!softback_buf) {
10051008
fbcon_softback_size = 0;
@@ -1008,7 +1011,7 @@ static const char *fbcon_startup(void)
10081011
}
10091012
} else {
10101013
if (softback_buf) {
1011-
kfree((void *) softback_buf);
1014+
kvfree((void *) softback_buf);
10121015
softback_buf = 0;
10131016
softback_top = 0;
10141017
}
@@ -1066,6 +1069,9 @@ static void fbcon_init(struct vc_data *vc, int init)
10661069

10671070
cap = info->flags;
10681071

1072+
if (console_loglevel <= CONSOLE_LOGLEVEL_QUIET)
1073+
logo_shown = FBCON_LOGO_DONTSHOW;
1074+
10691075
if (vc != svc || logo_shown == FBCON_LOGO_DONTSHOW ||
10701076
(info->fix.type == FB_TYPE_TEXT))
10711077
logo = 0;
@@ -3672,7 +3678,7 @@ static void fbcon_exit(void)
36723678
}
36733679
#endif
36743680

3675-
kfree((void *)softback_buf);
3681+
kvfree((void *)softback_buf);
36763682
softback_buf = 0UL;
36773683

36783684
for_each_registered_fb(i) {

drivers/video/fbdev/core/fbmem.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -431,6 +431,9 @@ static void fb_do_show_logo(struct fb_info *info, struct fb_image *image,
431431
{
432432
unsigned int x;
433433

434+
if (image->width > info->var.xres || image->height > info->var.yres)
435+
return;
436+
434437
if (rotate == FB_ROTATE_UR) {
435438
for (x = 0;
436439
x < num && image->dx + image->width <= info->var.xres;

drivers/video/fbdev/core/fbmon.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -978,6 +978,8 @@ void fb_edid_to_monspecs(unsigned char *edid, struct fb_monspecs *specs)
978978
get_monspecs(edid, specs);
979979

980980
specs->modedb = fb_create_modedb(edid, &specs->modedb_len, specs);
981+
if (!specs->modedb)
982+
return;
981983

982984
/*
983985
* Workaround for buggy EDIDs that sets that the first

drivers/video/fbdev/ffb.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -944,7 +944,7 @@ static int ffb_probe(struct platform_device *op)
944944

945945
info->var.accel_flags = FB_ACCELF_TEXT;
946946

947-
if (!strcmp(dp->name, "SUNW,afb"))
947+
if (of_node_name_eq(dp, "SUNW,afb"))
948948
par->flags |= FFB_FLAG_AFB;
949949

950950
par->board_type = of_getintprop_default(dp, "board_type", 0);

drivers/video/fbdev/geode/gxfb_core.c

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@
3333
#include <linux/pci.h>
3434
#include <linux/cs5535.h>
3535

36+
#include <asm/olpc.h>
37+
3638
#include "gxfb.h"
3739

3840
static char *mode_option;
@@ -107,9 +109,6 @@ static struct fb_videomode gx_modedb[] = {
107109
FB_VMODE_NONINTERLACED, FB_MODE_IS_VESA },
108110
};
109111

110-
#ifdef CONFIG_OLPC
111-
#include <asm/olpc.h>
112-
113112
static struct fb_videomode gx_dcon_modedb[] = {
114113
/* The only mode the DCON has is 1200x900 */
115114
{ NULL, 50, 1200, 900, 17460, 24, 8, 4, 5, 8, 3,
@@ -128,14 +127,6 @@ static void get_modedb(struct fb_videomode **modedb, unsigned int *size)
128127
}
129128
}
130129

131-
#else
132-
static void get_modedb(struct fb_videomode **modedb, unsigned int *size)
133-
{
134-
*modedb = (struct fb_videomode *) gx_modedb;
135-
*size = ARRAY_SIZE(gx_modedb);
136-
}
137-
#endif
138-
139130
static int gxfb_check_var(struct fb_var_screeninfo *var, struct fb_info *info)
140131
{
141132
if (var->xres > 1600 || var->yres > 1200)

drivers/video/fbdev/geode/lxfb_core.c

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@
2323
#include <linux/pci.h>
2424
#include <linux/uaccess.h>
2525

26+
#include <asm/olpc.h>
27+
2628
#include "lxfb.h"
2729

2830
static char *mode_option;
@@ -216,9 +218,6 @@ static struct fb_videomode geode_modedb[] = {
216218
0, FB_VMODE_NONINTERLACED, 0 },
217219
};
218220

219-
#ifdef CONFIG_OLPC
220-
#include <asm/olpc.h>
221-
222221
static struct fb_videomode olpc_dcon_modedb[] = {
223222
/* The only mode the DCON has is 1200x900 */
224223
{ NULL, 50, 1200, 900, 17460, 24, 8, 4, 5, 8, 3,
@@ -237,14 +236,6 @@ static void get_modedb(struct fb_videomode **modedb, unsigned int *size)
237236
}
238237
}
239238

240-
#else
241-
static void get_modedb(struct fb_videomode **modedb, unsigned int *size)
242-
{
243-
*modedb = (struct fb_videomode *) geode_modedb;
244-
*size = ARRAY_SIZE(geode_modedb);
245-
}
246-
#endif
247-
248239
static int lxfb_check_var(struct fb_var_screeninfo *var, struct fb_info *info)
249240
{
250241
if (var->xres > 1920 || var->yres > 1440)

drivers/video/fbdev/imsttfb.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1497,8 +1497,8 @@ static int imsttfb_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
14971497
switch (pdev->device) {
14981498
case PCI_DEVICE_ID_IMS_TT128: /* IMS,tt128mbA */
14991499
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"))
15021502
par->ramdac = TVP;
15031503
break;
15041504
case PCI_DEVICE_ID_IMS_TT3D: /* IMS,tt3d */

drivers/video/fbdev/mbx/mbxdebugfs.c

Lines changed: 13 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -211,36 +211,22 @@ static const struct file_operations misc_fops = {
211211
static void mbxfb_debugfs_init(struct fb_info *fbi)
212212
{
213213
struct mbxfb_info *mfbi = fbi->par;
214-
struct mbxfb_debugfs_data *dbg;
215-
216-
dbg = kzalloc(sizeof(struct mbxfb_debugfs_data), GFP_KERNEL);
217-
mfbi->debugfs_data = dbg;
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);
214+
struct dentry *dir;
215+
216+
dir = debugfs_create_dir("mbxfb", NULL);
217+
mfbi->debugfs_dir = dir;
218+
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);
232225
}
233226

234227
static void mbxfb_debugfs_remove(struct fb_info *fbi)
235228
{
236229
struct mbxfb_info *mfbi = fbi->par;
237-
struct mbxfb_debugfs_data *dbg = mfbi->debugfs_data;
238-
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);
230+
231+
debugfs_remove_recursive(mfbi->debugfs_dir);
246232
}

drivers/video/fbdev/mbx/mbxfb.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ struct mbxfb_info {
7474

7575
u32 pseudo_palette[MAX_PALETTES];
7676
#ifdef CONFIG_FB_MBX_DEBUG
77-
void *debugfs_data;
77+
struct dentry *debugfs_dir;
7878
#endif
7979

8080
};

drivers/video/fbdev/offb.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,7 @@ static int offb_setcolreg(u_int regno, u_int red, u_int green, u_int blue,
141141
/* Clear PALETTE_ACCESS_CNTL in DAC_CNTL */
142142
out_le32(par->cmap_adr + 0x58,
143143
in_le32(par->cmap_adr + 0x58) & ~0x20);
144+
/* fall through */
144145
case cmap_r128:
145146
/* Set palette index & data */
146147
out_8(par->cmap_adr + 0xb0, regno);
@@ -210,6 +211,7 @@ static int offb_blank(int blank, struct fb_info *info)
210211
/* Clear PALETTE_ACCESS_CNTL in DAC_CNTL */
211212
out_le32(par->cmap_adr + 0x58,
212213
in_le32(par->cmap_adr + 0x58) & ~0x20);
214+
/* fall through */
213215
case cmap_r128:
214216
/* Set palette index & data */
215217
out_8(par->cmap_adr + 0xb0, i);
@@ -646,7 +648,7 @@ static void __init offb_init_nodriver(struct device_node *dp, int no_real_node)
646648
}
647649
#endif
648650
/* kludge for valkyrie */
649-
if (strcmp(dp->name, "valkyrie") == 0)
651+
if (of_node_name_eq(dp, "valkyrie"))
650652
address += 0x1000;
651653
offb_init_fb(no_real_node ? "bootx" : NULL,
652654
width, height, depth, pitch, address,

0 commit comments

Comments
 (0)