Commit 37e673af authored by David S. Miller's avatar David S. Miller

[SPARC]: Finish conversion of sbusfb drivers to new fbcon API.

parent cd2f6d46
......@@ -362,7 +362,7 @@ static char idstring[60] __initdata = { 0 };
char __init *cgfourteenfb_init(struct fb_info_sbusfb *fb)
{
struct fb_fix_screeninfo *fix = &fb->fix;
struct fb_fix_screeninfo *fix = &fb->info.fix;
struct display *disp = &fb->disp;
struct fbtype *type = &fb->type;
unsigned long rphys, phys;
......@@ -414,7 +414,7 @@ char __init *cgfourteenfb_init(struct fb_info_sbusfb *fb)
strcpy(fb->info.modename, "CGfourteen");
strcpy(fix->id, "CGfourteen");
fix->line_length = fb->var.xres_virtual;
fix->line_length = fb->info.var.xres_virtual;
fix->accel = FB_ACCEL_SUN_CG14;
disp->scrollmode = SCROLL_YREDRAW;
......
......@@ -224,14 +224,14 @@ static struct sbus_mmap_map cg6_mmap_map[] = {
static void cg6_setup(struct display *p)
{
p->next_line = sbusfbinfo(p->fb_info)->var.xres_virtual;
p->next_line = p->fb_info->var.xres_virtual;
p->next_plane = 0;
}
static void cg6_clear(struct vc_data *conp, struct display *p, int sy, int sx,
int height, int width)
{
struct fb_info_sbusfb *fb = (struct fb_info_sbusfb *)p->fb_info;
struct fb_info_sbusfb *fb = sbusfbinfo(p->fb_info);
register struct cg6_fbc *fbc = fb->s.cg6.fbc;
unsigned long flags;
int x, y, w, h;
......@@ -302,7 +302,7 @@ static void cg6_fill(struct fb_info_sbusfb *fb, struct display *p, int s,
static void cg6_putc(struct vc_data *conp, struct display *p, int c, int yy, int xx)
{
struct fb_info_sbusfb *fb = (struct fb_info_sbusfb *)p->fb_info;
struct fb_info_sbusfb *fb = sbusfbinfo(p->fb_info);
register struct cg6_fbc *fbc = fb->s.cg6.fbc;
unsigned long flags;
int i, x, y;
......@@ -359,7 +359,7 @@ static void cg6_putc(struct vc_data *conp, struct display *p, int c, int yy, int
static void cg6_putcs(struct vc_data *conp, struct display *p, const unsigned short *s,
int count, int yy, int xx)
{
struct fb_info_sbusfb *fb = (struct fb_info_sbusfb *)p->fb_info;
struct fb_info_sbusfb *fb = sbusfbinfo(p->fb_info);
register struct cg6_fbc *fbc = fb->s.cg6.fbc;
unsigned long flags;
int i, x, y;
......@@ -692,8 +692,8 @@ static char idstring[70] __initdata = { 0 };
char __init *cgsixfb_init(struct fb_info_sbusfb *fb)
{
struct fb_fix_screeninfo *fix = &fb->fix;
struct fb_var_screeninfo *var = &fb->var;
struct fb_fix_screeninfo *fix = &fb->info.fix;
struct fb_var_screeninfo *var = &fb->info.var;
struct display *disp = &fb->disp;
struct fbtype *type = &fb->type;
struct sbus_dev *sdev = fb->sbdp;
......@@ -717,7 +717,7 @@ char __init *cgsixfb_init(struct fb_info_sbusfb *fb)
fix->smem_len *= 4;
}
fix->line_length = fb->var.xres_virtual;
fix->line_length = fb->info.var.xres_virtual;
fix->accel = FB_ACCEL_SUN_CGSIX;
var->accel_flags = FB_ACCELF_TEXT;
......
......@@ -176,7 +176,7 @@ static char idstring[60] __initdata = { 0 };
char __init *cgthreefb_init(struct fb_info_sbusfb *fb)
{
struct fb_fix_screeninfo *fix = &fb->fix;
struct fb_fix_screeninfo *fix = &fb->info.fix;
struct display *disp = &fb->disp;
struct fbtype *type = &fb->type;
struct sbus_dev *sdev = fb->sbdp;
......@@ -216,7 +216,7 @@ char __init *cgthreefb_init(struct fb_info_sbusfb *fb)
strcpy(fb->info.modename, "CGthree");
strcpy(fix->id, "CGthree");
fix->line_length = fb->var.xres_virtual;
fix->line_length = fb->info.var.xres_virtual;
fix->accel = FB_ACCEL_SUN_CGTHREE;
disp->scrollmode = SCROLL_YREDRAW;
......
......@@ -360,7 +360,7 @@ static void ffb_setup(struct display *p)
static void ffb_clear(struct vc_data *conp, struct display *p, int sy, int sx,
int height, int width)
{
struct fb_info_sbusfb *fb = (struct fb_info_sbusfb *)p->fb_info;
struct fb_info_sbusfb *fb = sbusfbinfo(p->fb_info);
register struct ffb_fbc *fbc = fb->s.ffb.fbc;
unsigned long flags;
u64 yx, hw;
......@@ -417,7 +417,7 @@ static void ffb_fill(struct fb_info_sbusfb *fb, struct display *p, int s,
static void ffb_putc(struct vc_data *conp, struct display *p, int c, int yy, int xx)
{
struct fb_info_sbusfb *fb = (struct fb_info_sbusfb *)p->fb_info;
struct fb_info_sbusfb *fb = sbusfbinfo(p->fb_info);
register struct ffb_fbc *fbc = fb->s.ffb.fbc;
unsigned long flags;
int i, xy;
......@@ -470,7 +470,7 @@ static void ffb_putc(struct vc_data *conp, struct display *p, int c, int yy, int
static void ffb_putcs(struct vc_data *conp, struct display *p, const unsigned short *s,
int count, int yy, int xx)
{
struct fb_info_sbusfb *fb = (struct fb_info_sbusfb *)p->fb_info;
struct fb_info_sbusfb *fb = sbusfbinfo(p->fb_info);
register struct ffb_fbc *fbc = fb->s.ffb.fbc;
unsigned long flags;
int i, xy;
......@@ -805,8 +805,8 @@ static int __init creator_apply_upa_parent_ranges(int parent, struct linux_prom6
char __init *creatorfb_init(struct fb_info_sbusfb *fb)
{
struct fb_fix_screeninfo *fix = &fb->fix;
struct fb_var_screeninfo *var = &fb->var;
struct fb_fix_screeninfo *fix = &fb->info.fix;
struct fb_var_screeninfo *var = &fb->info.var;
struct display *disp = &fb->disp;
struct fbtype *type = &fb->type;
struct linux_prom64_registers regs[2*PROMREG_MAX];
......@@ -861,7 +861,7 @@ char __init *creatorfb_init(struct fb_info_sbusfb *fb)
var->accel_flags = FB_ACCELF_TEXT;
disp->scrollmode = SCROLL_YREDRAW;
fb->info.screen_base = (char *)__va(regs[0].phys_addr) + FFB_DFB24_POFF + 8192 * fb->y_margin + 4 * fb->x_margin;
fb->info.screen_base = (char *)(regs[0].phys_addr) + FFB_DFB24_POFF + 8192 * fb->y_margin + 4 * fb->x_margin;
fb->s.ffb.xy_margin = (fb->y_margin << 16) + fb->x_margin;
fb->s.ffb.yx_margin = (((u64)fb->y_margin) << 32) + fb->x_margin;
fb->s.ffb.fbc = (struct ffb_fbc *)(regs[0].phys_addr + FFB_FBC_REGS_POFF);
......
......@@ -242,48 +242,49 @@ static void sbusfb_clear_margin(struct display *p, int s)
rects [0] = 0;
rects [1] = 0;
rects [2] = fb->var.xres_virtual;
rects [2] = fb->info.var.xres_virtual;
rects [3] = fb->y_margin;
rects [4] = 0;
rects [5] = fb->y_margin;
rects [6] = fb->x_margin;
rects [7] = fb->var.yres_virtual;
rects [8] = fb->var.xres_virtual - fb->x_margin;
rects [7] = fb->info.var.yres_virtual;
rects [8] = fb->info.var.xres_virtual - fb->x_margin;
rects [9] = fb->y_margin;
rects [10] = fb->var.xres_virtual;
rects [11] = fb->var.yres_virtual;
rects [10] = fb->info.var.xres_virtual;
rects [11] = fb->info.var.yres_virtual;
rects [12] = fb->x_margin;
rects [13] = fb->var.yres_virtual - fb->y_margin;
rects [14] = fb->var.xres_virtual - fb->x_margin;
rects [15] = fb->var.yres_virtual;
rects [13] = fb->info.var.yres_virtual - fb->y_margin;
rects [14] = fb->info.var.xres_virtual - fb->x_margin;
rects [15] = fb->info.var.yres_virtual;
(*fb->fill)(fb, p, s, 4, rects);
} else {
unsigned char *fb_base = fb->info.screen_base, *q;
int skip_bytes = fb->y_margin * fb->var.xres_virtual;
int scr_size = fb->var.xres_virtual * fb->var.yres_virtual;
int skip_bytes = fb->y_margin * fb->info.var.xres_virtual;
int scr_size = fb->info.var.xres_virtual
* fb->info.var.yres_virtual;
int h, he, incr, size;
he = fb->var.yres;
if (fb->var.bits_per_pixel == 1) {
he = fb->info.var.yres;
if (fb->info.var.bits_per_pixel == 1) {
fb_base -= (skip_bytes + fb->x_margin) / 8;
skip_bytes /= 8;
scr_size /= 8;
fb_memset255 (fb_base, skip_bytes - fb->x_margin / 8);
fb_memset255 (fb_base + scr_size - skip_bytes + fb->x_margin / 8, skip_bytes - fb->x_margin / 8);
incr = fb->var.xres_virtual / 8;
incr = fb->info.var.xres_virtual / 8;
size = fb->x_margin / 8 * 2;
for (q = fb_base + skip_bytes - fb->x_margin / 8, h = 0;
h <= he; q += incr, h++)
fb_memset255 (q, size);
} else {
fb_base -= (skip_bytes + fb->x_margin);
memset (fb_base, attr_bgcol(p,s), skip_bytes - fb->x_margin);
memset (fb_base + scr_size - skip_bytes + fb->x_margin, attr_bgcol(p,s), skip_bytes - fb->x_margin);
incr = fb->var.xres_virtual;
fb_memset (fb_base, attr_bgcol(p,s), skip_bytes - fb->x_margin);
fb_memset (fb_base + scr_size - skip_bytes + fb->x_margin, attr_bgcol(p,s), skip_bytes - fb->x_margin);
incr = fb->info.var.xres_virtual;
size = fb->x_margin * 2;
for (q = fb_base + skip_bytes - fb->x_margin, h = 0;
h <= he; q += incr, h++)
memset (q, attr_bgcol(p,s), size);
fb_memset (q, attr_bgcol(p,s), size);
}
}
}
......@@ -913,8 +914,8 @@ static void __init sbusfb_init_fb(int node, int parent, int fbtype,
prom_palette = sbusfb_palette;
memset(fb, 0, sizeof(struct fb_info_sbusfb));
fix = &fb->fix;
var = &fb->var;
fix = &fb->info.fix;
var = &fb->info.var;
disp = &fb->disp;
type = &fb->type;
......@@ -929,7 +930,7 @@ static void __init sbusfb_init_fb(int node, int parent, int fbtype,
memset(&fb->emulations, 0xff, sizeof(fb->emulations));
fb->emulations[0] = fbtype;
#ifndef __sparc_v9__
#ifdef CONFIG_SPARC32
fb->info.screen_base = (unsigned char *)prom_getintdefault(node, "address", 0);
#endif
......
......@@ -85,8 +85,6 @@ struct sbus_mmap_map {
struct fb_info_sbusfb {
struct fb_info info;
struct fb_fix_screeninfo fix;
struct fb_var_screeninfo var;
struct display disp;
struct display_switch dispsw;
struct fbtype type;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment