Skip to content

Commit

Permalink
Merge tag 'fbdev-3.18' of git://git.kernel.org/pub/scm/linux/kernel/g…
Browse files Browse the repository at this point in the history
…it/tomba/linux

Pull fbdev updates from Tomi Valkeinen:
 - new 6x10 font
 - various small fixes and cleanups

* tag 'fbdev-3.18' of git://git.kernel.org/pub/scm/linux/kernel/git/tomba/linux: (30 commits)
  fonts: Add 6x10 font
  videomode: provide dummy inline functions for !CONFIG_OF
  video/atmel_lcdfb: Introduce regulator support
  fbdev: sh_mobile_hdmi: Re-init regs before irq re-enable on resume
  framebuffer: fix screen corruption when copying
  framebuffer: fix border color
  arm, fbdev, omap2, LLVMLinux: Remove nested function from omapfb
  arm, fbdev, omap2, LLVMLinux: Remove nested function from omap2 dss
  video: fbdev: valkyriefb.c: use container_of to resolve fb_info_valkyrie from fb_info
  video: fbdev: pxafb.c: use container_of to resolve pxafb_info/layer from fb_info
  video: fbdev: cyber2000fb.c: use container_of to resolve cfb_info from fb_info
  video: fbdev: controlfb.c: use container_of to resolve fb_info_control from fb_info
  video: fbdev: sa1100fb.c: use container_of to resolve sa1100fb_info from fb_info
  video: fbdev: stifb.c: use container_of to resolve stifb_info from fb_info
  video: fbdev: sis: sis_main.c: Cleaning up missing null-terminate in conjunction with strncpy
  video: valkyriefb: Fix unused variable warning in set_valkyrie_clock()
  video: fbdev: use %*ph specifier to dump small buffers
  video: mx3fb: always enable BACKLIGHT_LCD_SUPPORT
  video: fbdev: au1200fb: delete double assignment
  video: fbdev: sis: delete double assignment
  ...
  • Loading branch information
torvalds committed Oct 19, 2014
2 parents 8a5de18 + 33ac9db commit 0a58282
Show file tree
Hide file tree
Showing 39 changed files with 3,421 additions and 124 deletions.
3 changes: 3 additions & 0 deletions Documentation/devicetree/bindings/video/atmel,lcdc.txt
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@ Required nodes:
- default-mode: a videomode within the display with timing parameters
as specified below.

Optional properties:
- lcd-supply: Regulator for LCD supply voltage.

Example:

fb0: fb@0x00500000 {
Expand Down
3 changes: 1 addition & 2 deletions drivers/video/console/bitblit.c
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,6 @@ static void bit_putcs(struct vc_data *vc, struct fb_info *info,
static void bit_clear_margins(struct vc_data *vc, struct fb_info *info,
int bottom_only)
{
int bgshift = (vc->vc_hi_font_mask) ? 13 : 12;
unsigned int cw = vc->vc_font.width;
unsigned int ch = vc->vc_font.height;
unsigned int rw = info->var.xres - (vc->vc_cols*cw);
Expand All @@ -214,7 +213,7 @@ static void bit_clear_margins(struct vc_data *vc, struct fb_info *info,
unsigned int bs = info->var.yres - bh;
struct fb_fillrect region;

region.color = attr_bgcol_ec(bgshift, vc, info);
region.color = 0;
region.rop = ROP_COPY;

if (rw && !bottom_only) {
Expand Down
3 changes: 1 addition & 2 deletions drivers/video/console/fbcon_ccw.c
Original file line number Diff line number Diff line change
Expand Up @@ -197,9 +197,8 @@ static void ccw_clear_margins(struct vc_data *vc, struct fb_info *info,
unsigned int bh = info->var.xres - (vc->vc_rows*ch);
unsigned int bs = vc->vc_rows*ch;
struct fb_fillrect region;
int bgshift = (vc->vc_hi_font_mask) ? 13 : 12;

region.color = attr_bgcol_ec(bgshift,vc,info);
region.color = 0;
region.rop = ROP_COPY;

if (rw && !bottom_only) {
Expand Down
3 changes: 1 addition & 2 deletions drivers/video/console/fbcon_cw.c
Original file line number Diff line number Diff line change
Expand Up @@ -180,9 +180,8 @@ static void cw_clear_margins(struct vc_data *vc, struct fb_info *info,
unsigned int bh = info->var.xres - (vc->vc_rows*ch);
unsigned int rs = info->var.yres - rw;
struct fb_fillrect region;
int bgshift = (vc->vc_hi_font_mask) ? 13 : 12;

region.color = attr_bgcol_ec(bgshift,vc,info);
region.color = 0;
region.rop = ROP_COPY;

if (rw && !bottom_only) {
Expand Down
3 changes: 1 addition & 2 deletions drivers/video/console/fbcon_ud.c
Original file line number Diff line number Diff line change
Expand Up @@ -227,9 +227,8 @@ static void ud_clear_margins(struct vc_data *vc, struct fb_info *info,
unsigned int rw = info->var.xres - (vc->vc_cols*cw);
unsigned int bh = info->var.yres - (vc->vc_rows*ch);
struct fb_fillrect region;
int bgshift = (vc->vc_hi_font_mask) ? 13 : 12;

region.color = attr_bgcol_ec(bgshift,vc,info);
region.color = 0;
region.rop = ROP_COPY;

if (rw && !bottom_only) {
Expand Down
3 changes: 2 additions & 1 deletion drivers/video/fbdev/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -2356,10 +2356,11 @@ config FB_MSM
config FB_MX3
tristate "MX3 Framebuffer support"
depends on FB && MX3_IPU
select BACKLIGHT_CLASS_DEVICE
select BACKLIGHT_LCD_SUPPORT
select FB_CFB_FILLRECT
select FB_CFB_COPYAREA
select FB_CFB_IMAGEBLIT
select BACKLIGHT_CLASS_DEVICE
default y
help
This is a framebuffer device for the i.MX31 LCD Controller. So
Expand Down
20 changes: 20 additions & 0 deletions drivers/video/fbdev/atmel_lcdfb.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
#include <linux/of_device.h>
#include <linux/of_gpio.h>
#include <video/of_display_timing.h>
#include <linux/regulator/consumer.h>
#include <video/videomode.h>

#include <mach/cpu.h>
Expand Down Expand Up @@ -60,6 +61,7 @@ struct atmel_lcdfb_info {
struct atmel_lcdfb_pdata pdata;

struct atmel_lcdfb_config *config;
struct regulator *reg_lcd;
};

struct atmel_lcdfb_power_ctrl_gpio {
Expand Down Expand Up @@ -302,10 +304,24 @@ static void init_contrast(struct atmel_lcdfb_info *sinfo)

static inline void atmel_lcdfb_power_control(struct atmel_lcdfb_info *sinfo, int on)
{
int ret;
struct atmel_lcdfb_pdata *pdata = &sinfo->pdata;

if (pdata->atmel_lcdfb_power_control)
pdata->atmel_lcdfb_power_control(pdata, on);
else if (sinfo->reg_lcd) {
if (on) {
ret = regulator_enable(sinfo->reg_lcd);
if (ret)
dev_err(&sinfo->pdev->dev,
"lcd regulator enable failed: %d\n", ret);
} else {
ret = regulator_disable(sinfo->reg_lcd);
if (ret)
dev_err(&sinfo->pdev->dev,
"lcd regulator disable failed: %d\n", ret);
}
}
}

static struct fb_fix_screeninfo atmel_lcdfb_fix __initdata = {
Expand Down Expand Up @@ -1195,6 +1211,10 @@ static int __init atmel_lcdfb_probe(struct platform_device *pdev)
if (!sinfo->config)
goto free_info;

sinfo->reg_lcd = devm_regulator_get(&pdev->dev, "lcd");
if (IS_ERR(sinfo->reg_lcd))
sinfo->reg_lcd = NULL;

info->flags = ATMEL_LCDFB_FBINFO_DEFAULT;
info->pseudo_palette = sinfo->pseudo_palette;
info->fbops = &atmel_lcdfb_ops;
Expand Down
63 changes: 55 additions & 8 deletions drivers/video/fbdev/aty/aty128fb.c
Original file line number Diff line number Diff line change
Expand Up @@ -324,14 +324,61 @@ struct aty128_meminfo {
};

/* various memory configurations */
static const struct aty128_meminfo sdr_128 =
{ 4, 4, 3, 3, 1, 3, 1, 16, 30, 16, "128-bit SDR SGRAM (1:1)" };
static const struct aty128_meminfo sdr_64 =
{ 4, 8, 3, 3, 1, 3, 1, 17, 46, 17, "64-bit SDR SGRAM (1:1)" };
static const struct aty128_meminfo sdr_sgram =
{ 4, 4, 1, 2, 1, 2, 1, 16, 24, 16, "64-bit SDR SGRAM (2:1)" };
static const struct aty128_meminfo ddr_sgram =
{ 4, 4, 3, 3, 2, 3, 1, 16, 31, 16, "64-bit DDR SGRAM" };
static const struct aty128_meminfo sdr_128 = {
.ML = 4,
.MB = 4,
.Trcd = 3,
.Trp = 3,
.Twr = 1,
.CL = 3,
.Tr2w = 1,
.LoopLatency = 16,
.DspOn = 30,
.Rloop = 16,
.name = "128-bit SDR SGRAM (1:1)",
};

static const struct aty128_meminfo sdr_64 = {
.ML = 4,
.MB = 8,
.Trcd = 3,
.Trp = 3,
.Twr = 1,
.CL = 3,
.Tr2w = 1,
.LoopLatency = 17,
.DspOn = 46,
.Rloop = 17,
.name = "64-bit SDR SGRAM (1:1)",
};

static const struct aty128_meminfo sdr_sgram = {
.ML = 4,
.MB = 4,
.Trcd = 1,
.Trp = 2,
.Twr = 1,
.CL = 2,
.Tr2w = 1,
.LoopLatency = 16,
.DspOn = 24,
.Rloop = 16,
.name = "64-bit SDR SGRAM (2:1)",
};

static const struct aty128_meminfo ddr_sgram = {
.ML = 4,
.MB = 4,
.Trcd = 3,
.Trp = 3,
.Twr = 2,
.CL = 3,
.Tr2w = 1,
.LoopLatency = 16,
.DspOn = 31,
.Rloop = 16,
.name = "64-bit DDR SGRAM",
};

static struct fb_fix_screeninfo aty128fb_fix = {
.id = "ATY Rage128",
Expand Down
1 change: 0 additions & 1 deletion drivers/video/fbdev/au1200fb.c
Original file line number Diff line number Diff line change
Expand Up @@ -1254,7 +1254,6 @@ static void set_global(u_int cmd, struct au1200_lcd_global_regs_t *pdata)
pdata->brightness = 30;
}
divider = (lcd->pwmdiv & 0x3FFFF) + 1;
hi1 = (lcd->pwmhi >> 16) + 1;
hi1 = (((pdata->brightness & 0xFF)+1) * divider >> 8);
lcd->pwmhi &= 0xFFFF;
lcd->pwmhi |= (hi1 << 16);
Expand Down
15 changes: 10 additions & 5 deletions drivers/video/fbdev/controlfb.c
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,8 @@ static int controlfb_check_var (struct fb_var_screeninfo *var, struct fb_info *i
*/
static int controlfb_set_par (struct fb_info *info)
{
struct fb_info_control *p = (struct fb_info_control *) info;
struct fb_info_control *p =
container_of(info, struct fb_info_control, info);
struct fb_par_control par;
int err;

Expand Down Expand Up @@ -258,7 +259,8 @@ static int controlfb_pan_display(struct fb_var_screeninfo *var,
struct fb_info *info)
{
unsigned int xoffset, hstep;
struct fb_info_control *p = (struct fb_info_control *)info;
struct fb_info_control *p =
container_of(info, struct fb_info_control, info);
struct fb_par_control *par = &p->par;

/*
Expand Down Expand Up @@ -309,7 +311,8 @@ static int controlfb_mmap(struct fb_info *info,

static int controlfb_blank(int blank_mode, struct fb_info *info)
{
struct fb_info_control *p = (struct fb_info_control *) info;
struct fb_info_control *p =
container_of(info, struct fb_info_control, info);
unsigned ctrl;

ctrl = ld_le32(CNTRL_REG(p,ctrl));
Expand Down Expand Up @@ -342,7 +345,8 @@ static int controlfb_blank(int blank_mode, struct fb_info *info)
static int controlfb_setcolreg(u_int regno, u_int red, u_int green, u_int blue,
u_int transp, struct fb_info *info)
{
struct fb_info_control *p = (struct fb_info_control *) info;
struct fb_info_control *p =
container_of(info, struct fb_info_control, info);
__u8 r, g, b;

if (regno > 255)
Expand Down Expand Up @@ -833,7 +837,8 @@ static int control_var_to_par(struct fb_var_screeninfo *var,
unsigned hperiod, hssync, hsblank, hesync, heblank, piped, heq, hlfln,
hserr, vperiod, vssync, vesync, veblank, vsblank, vswin, vewin;
unsigned long pixclock;
struct fb_info_control *p = (struct fb_info_control *) fb_info;
struct fb_info_control *p =
container_of(fb_info, struct fb_info_control, info);
struct control_regvals *r = &par->regvals;

switch (var->bits_per_pixel) {
Expand Down
13 changes: 8 additions & 5 deletions drivers/video/fbdev/core/cfbcopyarea.c
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,8 @@ bitcpy(struct fb_info *p, unsigned long __iomem *dst, unsigned dst_idx,
* If you suspect bug in this function, compare it with this simple
* memmove implementation.
*/
fb_memmove((char *)dst + ((dst_idx & (bits - 1))) / 8,
(char *)src + ((src_idx & (bits - 1))) / 8, n / 8);
memmove((char *)dst + ((dst_idx & (bits - 1))) / 8,
(char *)src + ((src_idx & (bits - 1))) / 8, n / 8);
return;
#endif

Expand Down Expand Up @@ -221,8 +221,8 @@ bitcpy_rev(struct fb_info *p, unsigned long __iomem *dst, unsigned dst_idx,
* If you suspect bug in this function, compare it with this simple
* memmove implementation.
*/
fb_memmove((char *)dst + ((dst_idx & (bits - 1))) / 8,
(char *)src + ((src_idx & (bits - 1))) / 8, n / 8);
memmove((char *)dst + ((dst_idx & (bits - 1))) / 8,
(char *)src + ((src_idx & (bits - 1))) / 8, n / 8);
return;
#endif

Expand Down Expand Up @@ -324,7 +324,10 @@ bitcpy_rev(struct fb_info *p, unsigned long __iomem *dst, unsigned dst_idx,
d0 = d0 << left | d1 >> right;
}
d0 = fb_rev_pixels_in_long(d0, bswapmask);
FB_WRITEL(comp(d0, FB_READL(dst), first), dst);
if (!first)
FB_WRITEL(d0, dst);
else
FB_WRITEL(comp(d0, FB_READL(dst), first), dst);
d0 = d1;
dst--;
n -= dst_idx+1;
Expand Down
12 changes: 2 additions & 10 deletions drivers/video/fbdev/core/fbsysfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -485,16 +485,8 @@ static ssize_t show_bl_curve(struct device *device,

mutex_lock(&fb_info->bl_curve_mutex);
for (i = 0; i < FB_BACKLIGHT_LEVELS; i += 8)
len += snprintf(&buf[len], PAGE_SIZE,
"%02x %02x %02x %02x %02x %02x %02x %02x\n",
fb_info->bl_curve[i + 0],
fb_info->bl_curve[i + 1],
fb_info->bl_curve[i + 2],
fb_info->bl_curve[i + 3],
fb_info->bl_curve[i + 4],
fb_info->bl_curve[i + 5],
fb_info->bl_curve[i + 6],
fb_info->bl_curve[i + 7]);
len += snprintf(&buf[len], PAGE_SIZE, "%8ph\n",
fb_info->bl_curve + i);
mutex_unlock(&fb_info->bl_curve_mutex);

return len;
Expand Down
16 changes: 8 additions & 8 deletions drivers/video/fbdev/cyber2000fb.c
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ cyber2000_seqw(unsigned int reg, unsigned int val, struct cfb_info *cfb)
static void
cyber2000fb_fillrect(struct fb_info *info, const struct fb_fillrect *rect)
{
struct cfb_info *cfb = (struct cfb_info *)info;
struct cfb_info *cfb = container_of(info, struct cfb_info, fb);
unsigned long dst, col;

if (!(cfb->fb.var.accel_flags & FB_ACCELF_TEXT)) {
Expand Down Expand Up @@ -191,7 +191,7 @@ cyber2000fb_fillrect(struct fb_info *info, const struct fb_fillrect *rect)
static void
cyber2000fb_copyarea(struct fb_info *info, const struct fb_copyarea *region)
{
struct cfb_info *cfb = (struct cfb_info *)info;
struct cfb_info *cfb = container_of(info, struct cfb_info, fb);
unsigned int cmd = CO_CMD_L_PATTERN_FGCOL;
unsigned long src, dst;

Expand Down Expand Up @@ -241,7 +241,7 @@ cyber2000fb_imageblit(struct fb_info *info, const struct fb_image *image)

static int cyber2000fb_sync(struct fb_info *info)
{
struct cfb_info *cfb = (struct cfb_info *)info;
struct cfb_info *cfb = container_of(info, struct cfb_info, fb);
int count = 100000;

if (!(cfb->fb.var.accel_flags & FB_ACCELF_TEXT))
Expand Down Expand Up @@ -276,7 +276,7 @@ static int
cyber2000fb_setcolreg(u_int regno, u_int red, u_int green, u_int blue,
u_int transp, struct fb_info *info)
{
struct cfb_info *cfb = (struct cfb_info *)info;
struct cfb_info *cfb = container_of(info, struct cfb_info, fb);
struct fb_var_screeninfo *var = &cfb->fb.var;
u32 pseudo_val;
int ret = 1;
Expand Down Expand Up @@ -758,7 +758,7 @@ cyber2000fb_decode_clock(struct par_info *hw, struct cfb_info *cfb,
static int
cyber2000fb_check_var(struct fb_var_screeninfo *var, struct fb_info *info)
{
struct cfb_info *cfb = (struct cfb_info *)info;
struct cfb_info *cfb = container_of(info, struct cfb_info, fb);
struct par_info hw;
unsigned int mem;
int err;
Expand Down Expand Up @@ -861,7 +861,7 @@ cyber2000fb_check_var(struct fb_var_screeninfo *var, struct fb_info *info)

static int cyber2000fb_set_par(struct fb_info *info)
{
struct cfb_info *cfb = (struct cfb_info *)info;
struct cfb_info *cfb = container_of(info, struct cfb_info, fb);
struct fb_var_screeninfo *var = &cfb->fb.var;
struct par_info hw;
unsigned int mem;
Expand Down Expand Up @@ -971,7 +971,7 @@ static int cyber2000fb_set_par(struct fb_info *info)
static int
cyber2000fb_pan_display(struct fb_var_screeninfo *var, struct fb_info *info)
{
struct cfb_info *cfb = (struct cfb_info *)info;
struct cfb_info *cfb = container_of(info, struct cfb_info, fb);

if (cyber2000fb_update_start(cfb, var))
return -EINVAL;
Expand Down Expand Up @@ -1007,7 +1007,7 @@ cyber2000fb_pan_display(struct fb_var_screeninfo *var, struct fb_info *info)
*/
static int cyber2000fb_blank(int blank, struct fb_info *info)
{
struct cfb_info *cfb = (struct cfb_info *)info;
struct cfb_info *cfb = container_of(info, struct cfb_info, fb);
unsigned int sync = 0;
int i;

Expand Down
3 changes: 1 addition & 2 deletions drivers/video/fbdev/intelfb/intelfbhw.c
Original file line number Diff line number Diff line change
Expand Up @@ -1191,7 +1191,6 @@ int intelfbhw_mode_to_hw(struct intelfb_info *dinfo,
vsync_end = vsync_start + var->vsync_len;
vtotal = vsync_end + var->upper_margin;
vblank_start = vactive;
vblank_end = vtotal;
vblank_end = vsync_end + 1;

DBG_MSG("V: act %d, ss %d, se %d, tot %d bs %d, be %d\n",
Expand Down Expand Up @@ -1859,7 +1858,7 @@ void intelfbhw_cursor_init(struct intelfb_info *dinfo)
tmp = INREG(CURSOR_CONTROL);
tmp &= ~(CURSOR_FORMAT_MASK | CURSOR_GAMMA_ENABLE |
CURSOR_ENABLE | CURSOR_STRIDE_MASK);
tmp = CURSOR_FORMAT_3C;
tmp |= CURSOR_FORMAT_3C;
OUTREG(CURSOR_CONTROL, tmp);
OUTREG(CURSOR_A_BASEADDR, dinfo->cursor.offset << 12);
tmp = (64 << CURSOR_SIZE_H_SHIFT) |
Expand Down
Loading

0 comments on commit 0a58282

Please sign in to comment.