Skip to content

Commit

Permalink
Merge tag 'fbdev-v4.15' of git://github.com/bzolnier/linux
Browse files Browse the repository at this point in the history
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
  ...
  • Loading branch information
torvalds committed Nov 21, 2017
2 parents c633e89 + 5f215d2 commit e1d1ea5
Show file tree
Hide file tree
Showing 28 changed files with 164 additions and 748 deletions.
17 changes: 17 additions & 0 deletions Documentation/devicetree/bindings/display/google,goldfish-fb.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
Android Goldfish framebuffer

Android Goldfish framebuffer device used by Android emulator.

Required properties:

- compatible : should contain "google,goldfish-fb"
- reg : <registers mapping>
- interrupts : <interrupt mapping>

Example:

display-controller@1f008000 {
compatible = "google,goldfish-fb";
interrupts = <0x10>;
reg = <0x1f008000 0x100>;
};
10 changes: 0 additions & 10 deletions drivers/video/fbdev/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -905,16 +905,6 @@ config FB_LEO
This is the frame buffer device driver for the SBUS-based Sun ZX
(leo) frame buffer cards.

config FB_IGA
bool "IGA 168x display support"
depends on (FB = y) && SPARC32
select FB_CFB_FILLRECT
select FB_CFB_COPYAREA
select FB_CFB_IMAGEBLIT
help
This is the framebuffer device for the INTERGRAPHICS 1680 and
successor frame buffer cards.

config FB_XVR500
bool "Sun XVR-500 3DLABS Wildcat support"
depends on (FB = y) && PCI && SPARC64
Expand Down
1 change: 0 additions & 1 deletion drivers/video/fbdev/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,6 @@ obj-$(CONFIG_FB_HGA) += hgafb.o
obj-$(CONFIG_FB_XVR500) += sunxvr500.o
obj-$(CONFIG_FB_XVR2500) += sunxvr2500.o
obj-$(CONFIG_FB_XVR1000) += sunxvr1000.o
obj-$(CONFIG_FB_IGA) += igafb.o
obj-$(CONFIG_FB_APOLLO) += dnfb.o
obj-$(CONFIG_FB_Q40) += q40fb.o
obj-$(CONFIG_FB_TGA) += tgafb.o
Expand Down
4 changes: 2 additions & 2 deletions drivers/video/fbdev/aty/atyfb_base.c
Original file line number Diff line number Diff line change
Expand Up @@ -2272,10 +2272,10 @@ static void aty_bl_exit(struct backlight_device *bd)

static void aty_calc_mem_refresh(struct atyfb_par *par, int xclk)
{
const int ragepro_tbl[] = {
static const int ragepro_tbl[] = {
44, 50, 55, 66, 75, 80, 100
};
const int ragexl_tbl[] = {
static const int ragexl_tbl[] = {
50, 66, 75, 83, 90, 95, 100, 105,
110, 115, 120, 125, 133, 143, 166
};
Expand Down
10 changes: 4 additions & 6 deletions drivers/video/fbdev/aty/radeon_base.c
Original file line number Diff line number Diff line change
Expand Up @@ -1454,9 +1454,9 @@ static void radeon_write_pll_regs(struct radeonfb_info *rinfo, struct radeon_reg
/*
* Timer function for delayed LVDS panel power up/down
*/
static void radeon_lvds_timer_func(unsigned long data)
static void radeon_lvds_timer_func(struct timer_list *t)
{
struct radeonfb_info *rinfo = (struct radeonfb_info *)data;
struct radeonfb_info *rinfo = from_timer(rinfo, t, lvds_timer);

radeon_engine_idle();

Expand Down Expand Up @@ -1534,7 +1534,7 @@ void radeon_write_mode (struct radeonfb_info *rinfo, struct radeon_regs *mode,
static void radeon_calc_pll_regs(struct radeonfb_info *rinfo, struct radeon_regs *regs,
unsigned long freq)
{
const struct {
static const struct {
int divider;
int bitvalue;
} *post_div,
Expand Down Expand Up @@ -2291,9 +2291,7 @@ static int radeonfb_pci_register(struct pci_dev *pdev,
rinfo->pdev = pdev;

spin_lock_init(&rinfo->reg_lock);
init_timer(&rinfo->lvds_timer);
rinfo->lvds_timer.function = radeon_lvds_timer_func;
rinfo->lvds_timer.data = (unsigned long)rinfo;
timer_setup(&rinfo->lvds_timer, radeon_lvds_timer_func, 0);

c1 = ent->device >> 8;
c2 = ent->device & 0xff;
Expand Down
3 changes: 3 additions & 0 deletions drivers/video/fbdev/aty/radeon_pm.c
Original file line number Diff line number Diff line change
Expand Up @@ -1208,9 +1208,11 @@ static void radeon_pm_enable_dll_m10(struct radeonfb_info *rinfo)
case 1:
if (mc & 0x4)
break;
/* fall through */
case 2:
dll_sleep_mask |= MDLL_R300_RDCK__MRDCKB_SLEEP;
dll_reset_mask |= MDLL_R300_RDCK__MRDCKB_RESET;
/* fall through */
case 0:
dll_sleep_mask |= MDLL_R300_RDCK__MRDCKA_SLEEP;
dll_reset_mask |= MDLL_R300_RDCK__MRDCKA_RESET;
Expand All @@ -1219,6 +1221,7 @@ static void radeon_pm_enable_dll_m10(struct radeonfb_info *rinfo)
case 1:
if (!(mc & 0x4))
break;
/* fall through */
case 2:
dll_sleep_mask |= MDLL_R300_RDCK__MRDCKD_SLEEP;
dll_reset_mask |= MDLL_R300_RDCK__MRDCKD_RESET;
Expand Down
43 changes: 23 additions & 20 deletions drivers/video/fbdev/au1200fb.c
Original file line number Diff line number Diff line change
Expand Up @@ -1518,7 +1518,7 @@ static irqreturn_t au1200fb_handle_irq(int irq, void* dev_id)
static int au1200fb_init_fbinfo(struct au1200fb_device *fbdev)
{
struct fb_info *fbi = fbdev->fb_info;
int bpp;
int bpp, ret;

fbi->fbops = &au1200fb_fb_ops;

Expand Down Expand Up @@ -1546,15 +1546,14 @@ static int au1200fb_init_fbinfo(struct au1200fb_device *fbdev)
}

fbi->pseudo_palette = kcalloc(16, sizeof(u32), GFP_KERNEL);
if (!fbi->pseudo_palette) {
if (!fbi->pseudo_palette)
return -ENOMEM;
}

if (fb_alloc_cmap(&fbi->cmap, AU1200_LCD_NBR_PALETTE_ENTRIES, 0) < 0) {
ret = fb_alloc_cmap(&fbi->cmap, AU1200_LCD_NBR_PALETTE_ENTRIES, 0);
if (ret < 0) {
print_err("Fail to allocate colormap (%d entries)",
AU1200_LCD_NBR_PALETTE_ENTRIES);
kfree(fbi->pseudo_palette);
return -EFAULT;
AU1200_LCD_NBR_PALETTE_ENTRIES);
return ret;
}

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

/* shut gcc up */
ret = 0;
fbdev = NULL;

for (plane = 0; plane < device_count; ++plane) {
bpp = winbpp(win->w[plane].mode_winctrl1);
if (win->w[plane].xres == 0)
Expand All @@ -1681,8 +1676,10 @@ static int au1200fb_drv_probe(struct platform_device *dev)

fbi = framebuffer_alloc(sizeof(struct au1200fb_device),
&dev->dev);
if (!fbi)
if (!fbi) {
ret = -ENOMEM;
goto failed;
}

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

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

/* Init FB data */
if ((ret = au1200fb_init_fbinfo(fbdev)) < 0)
ret = au1200fb_init_fbinfo(fbdev);
if (ret < 0)
goto failed;

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

failed:
/* NOTE: This only does the current plane/window that failed; others are still active */
if (fbi) {
for (plane = 0; plane < device_count; ++plane) {
fbi = _au1200fb_infos[plane];
if (!fbi)
break;

/* Clean up all probe data */
unregister_framebuffer(fbi);
if (fbi->cmap.len != 0)
fb_dealloc_cmap(&fbi->cmap);
kfree(fbi->pseudo_palette);

framebuffer_release(fbi);
_au1200fb_infos[plane] = NULL;
}
if (plane == 0)
free_irq(AU1200_LCD_INT, (void*)dev);
return ret;
}

static int au1200fb_drv_remove(struct platform_device *dev)
{
struct au1200fb_platdata *pd = platform_get_drvdata(dev);
struct au1200fb_device *fbdev;
struct fb_info *fbi;
int plane;

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

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

/* Clean up all probe data */
unregister_framebuffer(fbi);
Expand Down
6 changes: 4 additions & 2 deletions drivers/video/fbdev/cirrusfb.c
Original file line number Diff line number Diff line change
Expand Up @@ -1477,10 +1477,12 @@ static void init_vgachip(struct fb_info *info)
mdelay(100);
/* mode */
vga_wgfx(cinfo->regbase, CL_GR31, 0x00);
case BT_GD5480: /* fall through */
/* fall through */
case BT_GD5480:
/* from Klaus' NetBSD driver: */
vga_wgfx(cinfo->regbase, CL_GR2F, 0x00);
case BT_ALPINE: /* fall through */
/* fall through */
case BT_ALPINE:
/* put blitter into 542x compat */
vga_wgfx(cinfo->regbase, CL_GR33, 0x00);
break;
Expand Down
2 changes: 2 additions & 0 deletions drivers/video/fbdev/controlfb.h
Original file line number Diff line number Diff line change
Expand Up @@ -141,5 +141,7 @@ static struct max_cmodes control_mac_modes[] = {
{{ 1, 2}}, /* 1152x870, 75Hz */
{{ 0, 1}}, /* 1280x960, 75Hz */
{{ 0, 1}}, /* 1280x1024, 75Hz */
{{ 1, 2}}, /* 1152x768, 60Hz */
{{ 0, 1}}, /* 1600x1024, 60Hz */
};

11 changes: 6 additions & 5 deletions drivers/video/fbdev/core/fbcon.c
Original file line number Diff line number Diff line change
Expand Up @@ -395,10 +395,10 @@ static void fb_flashcursor(struct work_struct *work)
console_unlock();
}

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

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

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

if (!err) {
ops->cur_blink_jiffies = HZ / 5;
ops->info = info;
info->fbcon_par = ops;

if (vc)
Expand Down Expand Up @@ -962,6 +962,7 @@ static const char *fbcon_startup(void)
ops->graphics = 1;
ops->cur_rotate = -1;
ops->cur_blink_jiffies = HZ / 5;
ops->info = info;
info->fbcon_par = ops;
if (initial_rotation != -1)
p->con_rotate = initial_rotation;
Expand Down
1 change: 1 addition & 0 deletions drivers/video/fbdev/core/fbcon.h
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ struct fbcon_ops {
struct timer_list cursor_timer; /* Cursor timer */
struct fb_cursor cursor_state;
struct display *p;
struct fb_info *info;
int currcon; /* Current VC. */
int cur_blink_jiffies;
int cursor_flash;
Expand Down
15 changes: 8 additions & 7 deletions drivers/video/fbdev/dnfb.c
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ static struct fb_ops dn_fb_ops = {
.fb_imageblit = cfb_imageblit,
};

struct fb_var_screeninfo dnfb_var = {
static const struct fb_var_screeninfo dnfb_var = {
.xres = 1280,
.yres = 1024,
.xres_virtual = 2048,
Expand Down Expand Up @@ -242,16 +242,13 @@ static int dnfb_probe(struct platform_device *dev)
info->screen_base = (u_char *) info->fix.smem_start;

err = fb_alloc_cmap(&info->cmap, 2, 0);
if (err < 0) {
framebuffer_release(info);
return err;
}
if (err < 0)
goto release_framebuffer;

err = register_framebuffer(info);
if (err < 0) {
fb_dealloc_cmap(&info->cmap);
framebuffer_release(info);
return err;
goto release_framebuffer;
}
platform_set_drvdata(dev, info);

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

printk("apollo frame buffer alive and kicking !\n");
return err;

release_framebuffer:
framebuffer_release(info);
return err;
}

static struct platform_driver dnfb_driver = {
Expand Down
8 changes: 7 additions & 1 deletion drivers/video/fbdev/goldfishfb.c
Original file line number Diff line number Diff line change
Expand Up @@ -304,12 +304,18 @@ static int goldfish_fb_remove(struct platform_device *pdev)
return 0;
}

static const struct of_device_id goldfish_fb_of_match[] = {
{ .compatible = "google,goldfish-fb", },
{},
};
MODULE_DEVICE_TABLE(of, goldfish_fb_of_match);

static struct platform_driver goldfish_fb_driver = {
.probe = goldfish_fb_probe,
.remove = goldfish_fb_remove,
.driver = {
.name = "goldfish_fb"
.name = "goldfish_fb",
.of_match_table = goldfish_fb_of_match,
}
};

Expand Down
Loading

0 comments on commit e1d1ea5

Please sign in to comment.