Skip to content

Commit e1d1ea5

Browse files
committed
Merge tag 'fbdev-v4.15' of git://github.com/bzolnier/linux
Pull fbdev updates from Bartlomiej Zolnierkiewicz: "There is nothing really major here (though removal of the dead igafb driver stands out in diffstat). Summary: - convert timers to use timer_setup() (Kees Cook, Thierry Reding) - fix panels support on iMX boards in mxsfb driver (Stefan Agner) - fix timeout on EDID read in udlfb driver (Ladislav Michl) - add missing modes to fix out of bounds access in controlfb driver (Geert Uytterhoeven) - update initialisation paths in sa1100fb driver to be more robust (Russell King) - fix error handling path of ->probe method in au1200fb driver (Christophe JAILLET) - fix handling of cases when either panel or crt is defined in sm501fb driver (Sudip Mukherjee, Colin Ian King) - add ability to the Goldfish FB driver to be recognized by OS via DT (Aleksandar Markovic) - structures constifications (Bhumika Goyal) - misc fixes (Allen Pais, Gustavo A. R. Silva, Dan Carpenter) - misc cleanups (Colin Ian King, Himanshu Jha, Markus Elfring) - remove dead igafb driver" * tag 'fbdev-v4.15' of git://github.com/bzolnier/linux: (42 commits) OMAPFB: prevent buffer underflow in omapfb_parse_vram_param() video: fbdev: sm501fb: fix potential null pointer dereference on fbi fbcon: Initialize ops->info early video: fbdev: Convert timers to use timer_setup() video: fbdev: pxa3xx_gcu: Convert timers to use timer_setup() fbdev: controlfb: Add missing modes to fix out of bounds access video: fbdev: sis_main: mark expected switch fall-throughs video: fbdev: cirrusfb: mark expected switch fall-throughs video: fbdev: aty: radeon_pm: mark expected switch fall-throughs video: fbdev: sm501fb: mark expected switch fall-through in sm501fb_blank_crt video: fbdev: intelfb: remove redundant variables video/fbdev/dnfb: Use common error handling code in dnfb_probe() sm501fb: suspend and resume fb if it exists sm501fb: unregister framebuffer only if registered sm501fb: deallocate colormap only if allocated video: goldfishfb: Add support for device tree bindings Documentation: Add device tree binding for Goldfish FB driver video: udlfb: Fix read EDID timeout video: fbdev: remove dead igafb driver video: fbdev: mxsfb: fix pixelclock polarity ...
2 parents c633e89 + 5f215d2 commit e1d1ea5

File tree

28 files changed

+164
-748
lines changed

28 files changed

+164
-748
lines changed
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
Android Goldfish framebuffer
2+
3+
Android Goldfish framebuffer device used by Android emulator.
4+
5+
Required properties:
6+
7+
- compatible : should contain "google,goldfish-fb"
8+
- reg : <registers mapping>
9+
- interrupts : <interrupt mapping>
10+
11+
Example:
12+
13+
display-controller@1f008000 {
14+
compatible = "google,goldfish-fb";
15+
interrupts = <0x10>;
16+
reg = <0x1f008000 0x100>;
17+
};

drivers/video/fbdev/Kconfig

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -905,16 +905,6 @@ config FB_LEO
905905
This is the frame buffer device driver for the SBUS-based Sun ZX
906906
(leo) frame buffer cards.
907907

908-
config FB_IGA
909-
bool "IGA 168x display support"
910-
depends on (FB = y) && SPARC32
911-
select FB_CFB_FILLRECT
912-
select FB_CFB_COPYAREA
913-
select FB_CFB_IMAGEBLIT
914-
help
915-
This is the framebuffer device for the INTERGRAPHICS 1680 and
916-
successor frame buffer cards.
917-
918908
config FB_XVR500
919909
bool "Sun XVR-500 3DLABS Wildcat support"
920910
depends on (FB = y) && PCI && SPARC64

drivers/video/fbdev/Makefile

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,6 @@ obj-$(CONFIG_FB_HGA) += hgafb.o
6565
obj-$(CONFIG_FB_XVR500) += sunxvr500.o
6666
obj-$(CONFIG_FB_XVR2500) += sunxvr2500.o
6767
obj-$(CONFIG_FB_XVR1000) += sunxvr1000.o
68-
obj-$(CONFIG_FB_IGA) += igafb.o
6968
obj-$(CONFIG_FB_APOLLO) += dnfb.o
7069
obj-$(CONFIG_FB_Q40) += q40fb.o
7170
obj-$(CONFIG_FB_TGA) += tgafb.o

drivers/video/fbdev/aty/atyfb_base.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2272,10 +2272,10 @@ static void aty_bl_exit(struct backlight_device *bd)
22722272

22732273
static void aty_calc_mem_refresh(struct atyfb_par *par, int xclk)
22742274
{
2275-
const int ragepro_tbl[] = {
2275+
static const int ragepro_tbl[] = {
22762276
44, 50, 55, 66, 75, 80, 100
22772277
};
2278-
const int ragexl_tbl[] = {
2278+
static const int ragexl_tbl[] = {
22792279
50, 66, 75, 83, 90, 95, 100, 105,
22802280
110, 115, 120, 125, 133, 143, 166
22812281
};

drivers/video/fbdev/aty/radeon_base.c

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1454,9 +1454,9 @@ static void radeon_write_pll_regs(struct radeonfb_info *rinfo, struct radeon_reg
14541454
/*
14551455
* Timer function for delayed LVDS panel power up/down
14561456
*/
1457-
static void radeon_lvds_timer_func(unsigned long data)
1457+
static void radeon_lvds_timer_func(struct timer_list *t)
14581458
{
1459-
struct radeonfb_info *rinfo = (struct radeonfb_info *)data;
1459+
struct radeonfb_info *rinfo = from_timer(rinfo, t, lvds_timer);
14601460

14611461
radeon_engine_idle();
14621462

@@ -1534,7 +1534,7 @@ void radeon_write_mode (struct radeonfb_info *rinfo, struct radeon_regs *mode,
15341534
static void radeon_calc_pll_regs(struct radeonfb_info *rinfo, struct radeon_regs *regs,
15351535
unsigned long freq)
15361536
{
1537-
const struct {
1537+
static const struct {
15381538
int divider;
15391539
int bitvalue;
15401540
} *post_div,
@@ -2291,9 +2291,7 @@ static int radeonfb_pci_register(struct pci_dev *pdev,
22912291
rinfo->pdev = pdev;
22922292

22932293
spin_lock_init(&rinfo->reg_lock);
2294-
init_timer(&rinfo->lvds_timer);
2295-
rinfo->lvds_timer.function = radeon_lvds_timer_func;
2296-
rinfo->lvds_timer.data = (unsigned long)rinfo;
2294+
timer_setup(&rinfo->lvds_timer, radeon_lvds_timer_func, 0);
22972295

22982296
c1 = ent->device >> 8;
22992297
c2 = ent->device & 0xff;

drivers/video/fbdev/aty/radeon_pm.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1208,9 +1208,11 @@ static void radeon_pm_enable_dll_m10(struct radeonfb_info *rinfo)
12081208
case 1:
12091209
if (mc & 0x4)
12101210
break;
1211+
/* fall through */
12111212
case 2:
12121213
dll_sleep_mask |= MDLL_R300_RDCK__MRDCKB_SLEEP;
12131214
dll_reset_mask |= MDLL_R300_RDCK__MRDCKB_RESET;
1215+
/* fall through */
12141216
case 0:
12151217
dll_sleep_mask |= MDLL_R300_RDCK__MRDCKA_SLEEP;
12161218
dll_reset_mask |= MDLL_R300_RDCK__MRDCKA_RESET;
@@ -1219,6 +1221,7 @@ static void radeon_pm_enable_dll_m10(struct radeonfb_info *rinfo)
12191221
case 1:
12201222
if (!(mc & 0x4))
12211223
break;
1224+
/* fall through */
12221225
case 2:
12231226
dll_sleep_mask |= MDLL_R300_RDCK__MRDCKD_SLEEP;
12241227
dll_reset_mask |= MDLL_R300_RDCK__MRDCKD_RESET;

drivers/video/fbdev/au1200fb.c

Lines changed: 23 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1518,7 +1518,7 @@ static irqreturn_t au1200fb_handle_irq(int irq, void* dev_id)
15181518
static int au1200fb_init_fbinfo(struct au1200fb_device *fbdev)
15191519
{
15201520
struct fb_info *fbi = fbdev->fb_info;
1521-
int bpp;
1521+
int bpp, ret;
15221522

15231523
fbi->fbops = &au1200fb_fb_ops;
15241524

@@ -1546,15 +1546,14 @@ static int au1200fb_init_fbinfo(struct au1200fb_device *fbdev)
15461546
}
15471547

15481548
fbi->pseudo_palette = kcalloc(16, sizeof(u32), GFP_KERNEL);
1549-
if (!fbi->pseudo_palette) {
1549+
if (!fbi->pseudo_palette)
15501550
return -ENOMEM;
1551-
}
15521551

1553-
if (fb_alloc_cmap(&fbi->cmap, AU1200_LCD_NBR_PALETTE_ENTRIES, 0) < 0) {
1552+
ret = fb_alloc_cmap(&fbi->cmap, AU1200_LCD_NBR_PALETTE_ENTRIES, 0);
1553+
if (ret < 0) {
15541554
print_err("Fail to allocate colormap (%d entries)",
1555-
AU1200_LCD_NBR_PALETTE_ENTRIES);
1556-
kfree(fbi->pseudo_palette);
1557-
return -EFAULT;
1555+
AU1200_LCD_NBR_PALETTE_ENTRIES);
1556+
return ret;
15581557
}
15591558

15601559
strncpy(fbi->fix.id, "AU1200", sizeof(fbi->fix.id));
@@ -1668,10 +1667,6 @@ static int au1200fb_drv_probe(struct platform_device *dev)
16681667
printk(DRIVER_NAME ": Panel %d %s\n", panel_index, panel->name);
16691668
printk(DRIVER_NAME ": Win %d %s\n", window_index, win->name);
16701669

1671-
/* shut gcc up */
1672-
ret = 0;
1673-
fbdev = NULL;
1674-
16751670
for (plane = 0; plane < device_count; ++plane) {
16761671
bpp = winbpp(win->w[plane].mode_winctrl1);
16771672
if (win->w[plane].xres == 0)
@@ -1681,8 +1676,10 @@ static int au1200fb_drv_probe(struct platform_device *dev)
16811676

16821677
fbi = framebuffer_alloc(sizeof(struct au1200fb_device),
16831678
&dev->dev);
1684-
if (!fbi)
1679+
if (!fbi) {
1680+
ret = -ENOMEM;
16851681
goto failed;
1682+
}
16861683

16871684
_au1200fb_infos[plane] = fbi;
16881685
fbdev = fbi->par;
@@ -1701,7 +1698,8 @@ static int au1200fb_drv_probe(struct platform_device *dev)
17011698
if (!fbdev->fb_mem) {
17021699
print_err("fail to allocate frambuffer (size: %dK))",
17031700
fbdev->fb_len / 1024);
1704-
return -ENOMEM;
1701+
ret = -ENOMEM;
1702+
goto failed;
17051703
}
17061704

17071705
/*
@@ -1718,7 +1716,8 @@ static int au1200fb_drv_probe(struct platform_device *dev)
17181716
print_dbg("phys=0x%08x, size=%dK", fbdev->fb_phys, fbdev->fb_len / 1024);
17191717

17201718
/* Init FB data */
1721-
if ((ret = au1200fb_init_fbinfo(fbdev)) < 0)
1719+
ret = au1200fb_init_fbinfo(fbdev);
1720+
if (ret < 0)
17221721
goto failed;
17231722

17241723
/* Register new framebuffer */
@@ -1758,21 +1757,26 @@ static int au1200fb_drv_probe(struct platform_device *dev)
17581757
return 0;
17591758

17601759
failed:
1761-
/* NOTE: This only does the current plane/window that failed; others are still active */
1762-
if (fbi) {
1760+
for (plane = 0; plane < device_count; ++plane) {
1761+
fbi = _au1200fb_infos[plane];
1762+
if (!fbi)
1763+
break;
1764+
1765+
/* Clean up all probe data */
1766+
unregister_framebuffer(fbi);
17631767
if (fbi->cmap.len != 0)
17641768
fb_dealloc_cmap(&fbi->cmap);
17651769
kfree(fbi->pseudo_palette);
1770+
1771+
framebuffer_release(fbi);
1772+
_au1200fb_infos[plane] = NULL;
17661773
}
1767-
if (plane == 0)
1768-
free_irq(AU1200_LCD_INT, (void*)dev);
17691774
return ret;
17701775
}
17711776

17721777
static int au1200fb_drv_remove(struct platform_device *dev)
17731778
{
17741779
struct au1200fb_platdata *pd = platform_get_drvdata(dev);
1775-
struct au1200fb_device *fbdev;
17761780
struct fb_info *fbi;
17771781
int plane;
17781782

@@ -1781,7 +1785,6 @@ static int au1200fb_drv_remove(struct platform_device *dev)
17811785

17821786
for (plane = 0; plane < device_count; ++plane) {
17831787
fbi = _au1200fb_infos[plane];
1784-
fbdev = fbi->par;
17851788

17861789
/* Clean up all probe data */
17871790
unregister_framebuffer(fbi);

drivers/video/fbdev/cirrusfb.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1477,10 +1477,12 @@ static void init_vgachip(struct fb_info *info)
14771477
mdelay(100);
14781478
/* mode */
14791479
vga_wgfx(cinfo->regbase, CL_GR31, 0x00);
1480-
case BT_GD5480: /* fall through */
1480+
/* fall through */
1481+
case BT_GD5480:
14811482
/* from Klaus' NetBSD driver: */
14821483
vga_wgfx(cinfo->regbase, CL_GR2F, 0x00);
1483-
case BT_ALPINE: /* fall through */
1484+
/* fall through */
1485+
case BT_ALPINE:
14841486
/* put blitter into 542x compat */
14851487
vga_wgfx(cinfo->regbase, CL_GR33, 0x00);
14861488
break;

drivers/video/fbdev/controlfb.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,5 +141,7 @@ static struct max_cmodes control_mac_modes[] = {
141141
{{ 1, 2}}, /* 1152x870, 75Hz */
142142
{{ 0, 1}}, /* 1280x960, 75Hz */
143143
{{ 0, 1}}, /* 1280x1024, 75Hz */
144+
{{ 1, 2}}, /* 1152x768, 60Hz */
145+
{{ 0, 1}}, /* 1600x1024, 60Hz */
144146
};
145147

drivers/video/fbdev/core/fbcon.c

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -395,10 +395,10 @@ static void fb_flashcursor(struct work_struct *work)
395395
console_unlock();
396396
}
397397

398-
static void cursor_timer_handler(unsigned long dev_addr)
398+
static void cursor_timer_handler(struct timer_list *t)
399399
{
400-
struct fb_info *info = (struct fb_info *) dev_addr;
401-
struct fbcon_ops *ops = info->fbcon_par;
400+
struct fbcon_ops *ops = from_timer(ops, t, cursor_timer);
401+
struct fb_info *info = ops->info;
402402

403403
queue_work(system_power_efficient_wq, &info->queue);
404404
mod_timer(&ops->cursor_timer, jiffies + ops->cur_blink_jiffies);
@@ -414,8 +414,7 @@ static void fbcon_add_cursor_timer(struct fb_info *info)
414414
if (!info->queue.func)
415415
INIT_WORK(&info->queue, fb_flashcursor);
416416

417-
setup_timer(&ops->cursor_timer, cursor_timer_handler,
418-
(unsigned long) info);
417+
timer_setup(&ops->cursor_timer, cursor_timer_handler, 0);
419418
mod_timer(&ops->cursor_timer, jiffies + ops->cur_blink_jiffies);
420419
ops->flags |= FBCON_FLAGS_CURSOR_TIMER;
421420
}
@@ -714,6 +713,7 @@ static int con2fb_acquire_newinfo(struct vc_data *vc, struct fb_info *info,
714713

715714
if (!err) {
716715
ops->cur_blink_jiffies = HZ / 5;
716+
ops->info = info;
717717
info->fbcon_par = ops;
718718

719719
if (vc)
@@ -962,6 +962,7 @@ static const char *fbcon_startup(void)
962962
ops->graphics = 1;
963963
ops->cur_rotate = -1;
964964
ops->cur_blink_jiffies = HZ / 5;
965+
ops->info = info;
965966
info->fbcon_par = ops;
966967
if (initial_rotation != -1)
967968
p->con_rotate = initial_rotation;

drivers/video/fbdev/core/fbcon.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@ struct fbcon_ops {
6969
struct timer_list cursor_timer; /* Cursor timer */
7070
struct fb_cursor cursor_state;
7171
struct display *p;
72+
struct fb_info *info;
7273
int currcon; /* Current VC. */
7374
int cur_blink_jiffies;
7475
int cursor_flash;

drivers/video/fbdev/dnfb.c

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ static struct fb_ops dn_fb_ops = {
115115
.fb_imageblit = cfb_imageblit,
116116
};
117117

118-
struct fb_var_screeninfo dnfb_var = {
118+
static const struct fb_var_screeninfo dnfb_var = {
119119
.xres = 1280,
120120
.yres = 1024,
121121
.xres_virtual = 2048,
@@ -242,16 +242,13 @@ static int dnfb_probe(struct platform_device *dev)
242242
info->screen_base = (u_char *) info->fix.smem_start;
243243

244244
err = fb_alloc_cmap(&info->cmap, 2, 0);
245-
if (err < 0) {
246-
framebuffer_release(info);
247-
return err;
248-
}
245+
if (err < 0)
246+
goto release_framebuffer;
249247

250248
err = register_framebuffer(info);
251249
if (err < 0) {
252250
fb_dealloc_cmap(&info->cmap);
253-
framebuffer_release(info);
254-
return err;
251+
goto release_framebuffer;
255252
}
256253
platform_set_drvdata(dev, info);
257254

@@ -265,6 +262,10 @@ static int dnfb_probe(struct platform_device *dev)
265262

266263
printk("apollo frame buffer alive and kicking !\n");
267264
return err;
265+
266+
release_framebuffer:
267+
framebuffer_release(info);
268+
return err;
268269
}
269270

270271
static struct platform_driver dnfb_driver = {

drivers/video/fbdev/goldfishfb.c

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -304,12 +304,18 @@ static int goldfish_fb_remove(struct platform_device *pdev)
304304
return 0;
305305
}
306306

307+
static const struct of_device_id goldfish_fb_of_match[] = {
308+
{ .compatible = "google,goldfish-fb", },
309+
{},
310+
};
311+
MODULE_DEVICE_TABLE(of, goldfish_fb_of_match);
307312

308313
static struct platform_driver goldfish_fb_driver = {
309314
.probe = goldfish_fb_probe,
310315
.remove = goldfish_fb_remove,
311316
.driver = {
312-
.name = "goldfish_fb"
317+
.name = "goldfish_fb",
318+
.of_match_table = goldfish_fb_of_match,
313319
}
314320
};
315321

0 commit comments

Comments
 (0)