Commit f9d7da1c authored by James Simmons's avatar James Simmons

Further api porting. Almost done. Here we eliminate get[set]_cmap from struct...

Further api porting. Almost done. Here we eliminate get[set]_cmap from struct fb_ops. Also set_disp has ben moved into fbcon.c instead of the drivers.
parent a49520cb
......@@ -20,11 +20,8 @@
#include <asm/io.h>
#include <video/fbcon.h>
static u32 colreg[16];
static struct fb_info fb_info;
static struct display display;
static struct fb_var_screeninfo anakinfb_var = {
.xres = 400,
......@@ -66,8 +63,6 @@ anakinfb_setcolreg(u_int regno, u_int red, u_int green, u_int blue,
static struct fb_ops anakinfb_ops = {
.owner = THIS_MODULE,
.fb_set_var = gen_set_var,
.fb_get_cmap = gen_get_cmap,
.fb_set_cmap = gen_set_cmap,
.fb_setcolreg = anakinfb_setcolreg,
.fb_fillrect = cfb_fillrect,
.fb_copyarea = cfb_copyarea,
......@@ -78,7 +73,6 @@ int __init
anakinfb_init(void)
{
memset(&fb_info, 0, sizeof(struct fb_info));
memset(&display, 0, sizeof(struct display));
strcpy(fb_info.modename, anakinfb_fix.id);
fb_info.node = NODEV;
......@@ -87,10 +81,7 @@ anakinfb_init(void)
fb_info.fbops = &anakinfb_ops;
fb_info.var = anakinfb_var;
fb_info.fix = anakinfb_fix;
fb_info.disp = &display;
strcpy(fb_info.fontname, "VGA8x16");
fb_info.changevar = NULL;
fb_info.switch_con = gen_switch_con;
fb_info.updatevar = gen_update_var;
if (!(request_mem_region(VGA_START, VGA_SIZE, "vga")))
return -ENOMEM;
......@@ -100,10 +91,9 @@ anakinfb_init(void)
}
fb_alloc_cmap(&fb_info.cmap, 16, 0);
gen_set_disp(-1, &fb_info);
if (register_framebuffer(&fb_info) < 0) {
iounmap(display.screen_base);
iounmap(fb_info.screen_base);
release_mem_region(VGA_START, VGA_SIZE);
return -EINVAL;
}
......
......@@ -65,9 +65,6 @@
#include <asm/io.h>
#include <asm/uaccess.h>
#include <video/fbcon.h>
#include "../fbcon-accel.h"
#include <video/mach64.h>
#include "atyfb.h"
......@@ -211,8 +208,6 @@ static struct fb_ops atyfb_ops = {
.fb_set_var = gen_set_var,
.fb_check_var = atyfb_check_var,
.fb_set_par = atyfb_set_par,
.fb_get_cmap = gen_get_cmap,
.fb_set_cmap = gen_set_cmap,
.fb_setcolreg = atyfb_setcolreg,
.fb_pan_display = atyfb_pan_display,
.fb_blank = atyfb_blank,
......@@ -1843,17 +1838,12 @@ static int __init aty_init(struct fb_info *info, const char *name)
fb_memset((void *) info->screen_base, 0,
info->fix.smem_len);
disp = info->disp;
strcpy(info->modename, info->fix.id);
info->node = NODEV;
info->fbops = &atyfb_ops;
info->disp = disp;
info->pseudo_palette = pseudo_palette;
info->currcon = -1;
strcpy(info->fontname, fontname);
info->changevar = NULL;
info->switch_con = gen_switch;
info->updatevar = gen_update_var;
info->flags = FBINFO_FLAG_DEFAULT;
......@@ -2029,18 +2019,17 @@ int __init atyfb_init(void)
info =
kmalloc(sizeof(struct fb_info) +
sizeof(struct display), GFP_ATOMIC);
sizeof(struct atyfb_par), GFP_ATOMIC);
if (!info) {
printk
("atyfb_init: can't alloc fb_info\n");
return -ENXIO;
}
memset(info, 0,
sizeof(struct fb_info) +
sizeof(struct display));
memset(info, 0, sizeof(struct fb_info) +
sizeof(struct atyfb_par));
default_par = (struct atyfb_par *) (info + 1);
default_par =
kmalloc(sizeof(struct atyfb_par), GFP_ATOMIC);
if (!default_par) {
printk
("atyfb_init: can't alloc atyfb_par\n");
......
......@@ -20,7 +20,6 @@
#include <linux/string.h>
#include <linux/fb.h>
#include <asm/types.h>
#include <video/fbcon.h>
#if BITS_PER_LONG == 32
#define FB_READ fb_readl
......
......@@ -31,8 +31,6 @@
#include <linux/fb.h>
#include <asm/types.h>
#include <video/fbcon.h>
#define DEBUG
#ifdef DEBUG
......
......@@ -26,8 +26,6 @@
#include <linux/init.h>
#include <linux/proc_fs.h>
#include <video/fbcon.h>
#include <asm/hardware.h>
#include <asm/mach-types.h>
#include <asm/uaccess.h>
......@@ -197,8 +195,6 @@ static struct fb_ops clps7111fb_ops = {
.fb_check_var = clps7111fb_check_var,
.fb_set_par = clps7111fb_set_par,
.fb_set_var = gen_set_var,
.fb_set_cmap = gen_set_cmap,
.fb_get_cmap = gen_get_cmap,
.fb_setcolreg = clps7111fb_setcolreg,
.fb_blank = clps7111fb_blank,
.fb_fillrect = cfb_fillrect,
......@@ -261,11 +257,11 @@ int __init clps711xfb_init(void)
{
int err = -ENOMEM;
cfb = kmalloc(sizeof(*cfb) + sizeof(struct display), GFP_KERNEL);
cfb = kmalloc(sizeof(*cfb), GFP_KERNEL);
if (!cfb)
goto out;
memset(cfb, 0, sizeof(*cfb) + sizeof(struct display));
memset(cfb, 0, sizeof(*cfb));
memset((void *)PAGE_OFFSET, 0, 0x14000);
cfb->currcon = -1;
......@@ -276,22 +272,19 @@ int __init clps711xfb_init(void)
cfb->fix.smem_len = 0x14000;
cfb->fix.type = FB_TYPE_PACKED_PIXELS;
cfb->var.xres = 640;
cfb->var.xres_virtual = 640;
cfb->var.yres = 240;
cfb->var.yres_virtual = 240;
cfb->var.xres = 640;
cfb->var.xres_virtual = 640;
cfb->var.yres = 240;
cfb->var.yres_virtual = 240;
cfb->var.bits_per_pixel = 4;
cfb->var.grayscale = 1;
cfb->var.grayscale = 1;
cfb->var.activate = FB_ACTIVATE_NOW;
cfb->var.height = -1;
cfb->var.width = -1;
cfb->var.height = -1;
cfb->var.width = -1;
cfb->fbops = &clps7111fb_ops;
cfb->changevar = NULL;
cfb->switch_con = gen_switch;
cfb->updatevar = gen_update_var;
cfb->updatevar = gen_update_var;
cfb->flags = FBINFO_FLAG_DEFAULT;
cfb->disp = (struct display *)(cfb + 1);
fb_alloc_cmap(&cfb->cmap, CMAP_SIZE, 0);
......
......@@ -1114,8 +1114,6 @@ static struct fb_ops cyber2000fb_ops = {
.fb_setcolreg = cyber2000fb_setcolreg,
.fb_pan_display = cyber2000fb_pan_display,
.fb_blank = cyber2000fb_blank,
.fb_get_cmap = gen_get_cmap,
.fb_set_cmap = gen_set_cmap,
};
/*
......
......@@ -15,8 +15,6 @@
#include <linux/fb.h>
#include <linux/module.h>
#include <video/fbcon.h>
/* apollo video HW definitions */
/*
......@@ -111,7 +109,6 @@
#endif
static struct fb_info fb_info;
static struct display disp;
/* frame buffer operations */
......@@ -121,8 +118,6 @@ static void dnfb_copyarea(struct fb_info *info, struct fb_copyarea *area);
static struct fb_ops dn_fb_ops = {
.owner = THIS_MODULE,
.fb_set_var = gen_set_var,
.fb_get_cmap = gen_get_cmap,
.fb_set_cmap = gen_set_cmap,
.fb_blank = dnfb_blank,
.fb_fillrect = cfb_fillrect,
.fb_copyarea = dnfb_copyarea,
......@@ -240,21 +235,16 @@ unsigned long __init dnfb_init(unsigned long mem_start)
int err;
strcpy(fb_info.modename, dnfb_fix.id);
fb_info.changevar = NULL;
fb_info.fontname[0] = 0;
fb_info.disp = &disp;
fb_info.switch_con = gen_switch;
fb_info.updatevar = gen_update_var;
fb_info.node = NODEV;
fb_info.fbops = &dn_fb_ops;
fb_info.currcon = -1;
fb_info.fix = dnfb_fix;
fb_info.var = dnfb_var;
fb_info.screen_base = (u_char *) fb_info.fix.smem_start;
fb_alloc_cmap(&fb_info.cmap, 2, 0);
gen_set_disp(-1, &fb_info);
fb_info.screen_base = (u_char *) fb_info.fix.smem_start;
err = register_framebuffer(&fb_info);
if (err < 0)
......
......@@ -27,7 +27,7 @@ void fbcon_cfb24_setup(struct display *p)
{
struct fb_info *info = p->fb_info;
p->next_line = info->fix.line_length ? info->fix.line_length : p->var.xres_virtual*3;
p->next_line = info->fix.line_length ? info->fix.line_length : info->var.xres_virtual*3;
p->next_plane = 0;
}
......@@ -272,6 +272,7 @@ void fbcon_cfb24_revc(struct display *p, int xx, int yy)
void fbcon_cfb24_clear_margins(struct vc_data *conp, struct display *p,
int bottom_only)
{
struct fb_info *info = p->fb_info;
int bytes = p->next_line;
u32 bgx;
......@@ -281,15 +282,14 @@ void fbcon_cfb24_clear_margins(struct vc_data *conp, struct display *p,
bgx = ((u32 *)p->dispsw_data)[attr_bgcol_ec(p, conp)];
if (!bottom_only && (right_width = p->var.xres-right_start))
rectfill(p->fb_info->screen_base+right_start*3, right_width,
p->var.yres_virtual, bgx, bytes);
if ((bottom_width = p->var.yres-bottom_start))
rectfill(p->fb_info->screen_base+(p->var.yoffset+bottom_start)*bytes,
if (!bottom_only && (right_width = info->var.xres-right_start))
rectfill(info->screen_base + right_start*3, right_width,
info->var.yres_virtual, bgx, bytes);
if ((bottom_width = info->var.yres-bottom_start))
rectfill(info->screen_base + (info->var.yoffset+bottom_start)*bytes,
right_start, bottom_width, bgx, bytes);
}
/*
* `switch' for the low level operations
*/
......
This diff is collapsed.
......@@ -21,14 +21,6 @@
#include <asm/io.h>
#include <video/fbcon.h>
#include <video/fbcon-mfb.h>
#include <video/fbcon-cfb2.h>
#include <video/fbcon-cfb4.h>
#include <video/fbcon-cfb8.h>
#include <video/fbcon-cfb16.h>
#include <video/fbcon-cfb24.h>
#include <video/fbcon-cfb32.h>
#include "fbcon-accel.h"
int gen_set_var(struct fb_var_screeninfo *var, int con, struct fb_info *info)
{
......@@ -52,49 +44,13 @@ int gen_set_var(struct fb_var_screeninfo *var, int con, struct fb_info *info)
if (info->fbops->fb_pan_display)
info->fbops->fb_pan_display(&info->var, con, info);
gen_set_disp(con, info);
fb_set_cmap(&info->cmap, 1, info);
}
if (info->changevar)
info->changevar(con);
}
}
return 0;
}
int gen_get_cmap(struct fb_cmap *cmap, int kspc, int con, struct fb_info *info)
{
fb_copy_cmap (&info->cmap, cmap, kspc ? 0 : 2);
return 0;
}
int gen_set_cmap(struct fb_cmap *cmap, int kspc, int con,
struct fb_info *info)
{
struct display *disp = (con < 0) ? info->disp : (fb_display + con);
struct fb_cmap *dcmap = &disp->cmap;
int err = 0;
/* No colormap allocated ? */
if (!dcmap->len) {
int size = info->cmap.len;
err = fb_alloc_cmap(dcmap, size, 0);
}
if (!err && con == info->currcon) {
err = fb_set_cmap(cmap, kspc, info);
dcmap = &info->cmap;
}
if (!err)
fb_copy_cmap(cmap, dcmap, kspc ? 0 : 1);
return err;
}
int fbgen_pan_display(struct fb_var_screeninfo *var, int con,
struct fb_info *info)
{
......@@ -125,75 +81,11 @@ int fbgen_pan_display(struct fb_var_screeninfo *var, int con,
/* ---- Helper functions --------------------------------------------------- */
void gen_set_disp(int con, struct fb_info *info)
{
struct display *display = (con < 0) ? info->disp : (fb_display + con);
if (info->fix.visual == FB_VISUAL_PSEUDOCOLOR ||
info->fix.visual == FB_VISUAL_DIRECTCOLOR) {
display->can_soft_blank = info->fbops->fb_blank ? 1 : 0;
display->dispsw_data = NULL;
} else {
display->can_soft_blank = 0;
display->dispsw_data = info->pseudo_palette;
}
display->var = info->var;
/*
* If we are setting all the virtual consoles, also set
* the defaults used to create new consoles.
*/
if (con < 0 || info->var.activate & FB_ACTIVATE_ALL)
info->disp->var = info->var;
if (info->var.bits_per_pixel == 24) {
#ifdef FBCON_HAS_CFB24
display->scrollmode = SCROLL_YREDRAW;
display->dispsw = &fbcon_cfb24;
return;
#endif
}
#ifdef FBCON_HAS_ACCEL
display->scrollmode = SCROLL_YNOMOVE;
display->dispsw = &fbcon_accel;
#else
display->dispsw = &fbcon_dummy;
#endif
return;
}
/**
* do_install_cmap - install the current colormap
* @con: virtual console number
* @info: generic frame buffer info structure
*
* Installs the current colormap for virtual console @con on
* device @info.
*
*/
void do_install_cmap(int con, struct fb_info *info)
{
if (con != info->currcon)
return;
if (fb_display[con].cmap.len)
fb_set_cmap(&fb_display[con].cmap, 1, info);
else {
int size = fb_display[con].var.bits_per_pixel == 16 ? 64 : 256;
fb_set_cmap(fb_default_cmap(size), 1, info);
}
}
int gen_update_var(int con, struct fb_info *info)
{
struct display *disp = (con < 0) ? info->disp : (fb_display + con);
int err;
if (con == info->currcon) {
info->var.xoffset = disp->var.xoffset;
info->var.yoffset = disp->var.yoffset;
info->var.vmode = disp->var.vmode;
if (info->fbops->fb_pan_display) {
if ((err = info->fbops->fb_pan_display(&info->var, con, info)))
return err;
......@@ -202,46 +94,6 @@ int gen_update_var(int con, struct fb_info *info)
return 0;
}
int gen_switch(int con, struct fb_info *info)
{
struct display *disp;
struct fb_cmap *cmap;
if (info->currcon >= 0) {
disp = fb_display + info->currcon;
/*
* Save the old colormap and graphics mode.
*/
disp->var = info->var;
if (disp->cmap.len)
fb_copy_cmap(&info->cmap, &disp->cmap, 0);
}
info->currcon = con;
disp = fb_display + con;
/*
* Install the new colormap and change the graphics mode. By default
* fbcon sets all the colormaps and graphics modes to the default
* values at bootup.
*
* Really, we want to set the colormap size depending on the
* depth of the new grpahics mode. For now, we leave it as its
* default 256 entry.
*/
if (disp->cmap.len)
cmap = &disp->cmap;
else
cmap = fb_default_cmap(1 << disp->var.bits_per_pixel);
fb_copy_cmap(cmap, &info->cmap, 0);
disp->var.activate = FB_ACTIVATE_NOW;
info->fbops->fb_set_var(&disp->var, con, info);
return 0;
}
/**
* fbgen_blank - blank the screen
* @blank: boolean, 0 unblank, 1 blank
......@@ -267,20 +119,22 @@ int fbgen_blank(int blank, struct fb_info *info)
cmap.start = 0;
cmap.len = 16;
fb_set_cmap(&cmap, 1, info);
} else
do_install_cmap(info->currcon, info);
} else {
if (info->cmap.len)
fb_set_cmap(&info->cmap, 1, info);
else {
int size = info->var.bits_per_pixel == 16 ? 64 : 256;
fb_set_cmap(fb_default_cmap(size), 1, info);
}
}
return 0;
}
/* generic frame buffer operations */
EXPORT_SYMBOL(gen_set_var);
EXPORT_SYMBOL(gen_get_cmap);
EXPORT_SYMBOL(gen_set_cmap);
EXPORT_SYMBOL(fbgen_pan_display);
/* helper functions */
EXPORT_SYMBOL(do_install_cmap);
EXPORT_SYMBOL(gen_update_var);
EXPORT_SYMBOL(gen_switch);
EXPORT_SYMBOL(fbgen_blank);
MODULE_LICENSE("GPL");
......@@ -481,11 +481,14 @@ fb_ioctl(struct inode *inode, struct file *file, unsigned int cmd,
case FBIOPUT_VSCREENINFO:
if (copy_from_user(&var, (void *) arg, sizeof(var)))
return -EFAULT;
i = var.activate & FB_ACTIVATE_ALL
? set_all_vcs(fbidx, fb, &var, info)
: fb->fb_set_var(&var, PROC_CONSOLE(info), info);
if (i)
return i;
if (var.activate & FB_ACTIVATE_ALL) {
i = set_all_vcs(fbidx, fb, &var, info);
if (i) return i;
} else {
i = fb->fb_set_var(&var, PROC_CONSOLE(info), info);
if (i) return i;
gen_set_disp(PROC_CONSOLE(info), info);
}
if (copy_to_user((void *) arg, &var, sizeof(var)))
return -EFAULT;
return 0;
......@@ -494,11 +497,11 @@ fb_ioctl(struct inode *inode, struct file *file, unsigned int cmd,
case FBIOPUTCMAP:
if (copy_from_user(&cmap, (void *) arg, sizeof(cmap)))
return -EFAULT;
return (fb->fb_set_cmap(&cmap, 0, PROC_CONSOLE(info), info));
return (fb_set_cmap(&cmap, 0, info));
case FBIOGETCMAP:
if (copy_from_user(&cmap, (void *) arg, sizeof(cmap)))
return -EFAULT;
return (fb->fb_get_cmap(&cmap, 0, PROC_CONSOLE(info), info));
fb_copy_cmap(&info->cmap, &cmap, 0);
case FBIOPAN_DISPLAY:
if (copy_from_user(&var, (void *) arg, sizeof(var)))
return -EFAULT;
......
......@@ -21,8 +21,6 @@
#include <linux/zorro.h>
#include <asm/io.h>
#include <video/fbcon.h>
/*
* Some technical notes:
*
......@@ -133,7 +131,6 @@ static volatile unsigned char *fm2fb_reg;
static struct fb_info fb_info;
static u32 pseudo_palette[17];
static struct display display;
static struct fb_fix_screeninfo fb_fix __initdata = {
.smem_len = FRAMEMASTER_REG,
......@@ -177,8 +174,6 @@ static int fm2fb_blank(int blank, struct fb_info *info);
static struct fb_ops fm2fb_ops = {
.owner = THIS_MODULE,
.fb_set_var = gen_set_var,
.fb_get_cmap = gen_get_cmap,
.fb_set_cmap = gen_set_cmap,
.fb_setcolreg = fm2fb_setcolreg,
.fb_blank = fm2fb_blank,
.fb_fillrect = cfb_fillrect,
......@@ -276,13 +271,9 @@ int __init fm2fb_init(void)
/* The below feilds will go away !!!! */
fb_info.currcon = -1;
strcpy(fb_info.modename, fb_info.fix.id);
fb_info.disp = &display;
fb_info.switch_con = gen_switch;
fb_info.updatevar = gen_update_var;
fb_alloc_cmap(&fb_info.cmap, 16, 0);
gen_set_disp(-1, &fb_info);
if (register_framebuffer(&fb_info) < 0)
return -EINVAL;
......
......@@ -74,7 +74,6 @@
#define MON_ID_REG 0xe4100000 /* unused */
#define RESET_REG 0xe4180000 /* Write only */
static struct display disp;
static struct fb_info fb_info;
static struct fb_fix_screeninfo fb_fix __initdata = {
......@@ -119,8 +118,6 @@ static int g364fb_blank(int blank, struct fb_info *info);
static struct fb_ops g364fb_ops = {
.owner = THIS_MODULE,
.fb_set_var = gen_set_var,
.fb_get_cmap = gen_get_cmap,
.fb_set_cmap = gen_set_cmap,
.fb_setcolreg = g364fb_setcolreg,
.fb_pan_display = g364fb_pan_display,
.fb_blank = g364fb_blank,
......@@ -247,15 +244,10 @@ int __init g364fb_init(void)
fb_info.fix = fb_fix;
fb_info.flags = FBINFO_FLAG_DEFAULT;
fb_info.disp = &disp;
fb_info.currcon = -1;
fb_info.fontname[0] = '\0';
fb_info.changevar = NULL;
fb_info.switch_con = gen_switch;
fb_info.updatevar = gen_update_var;
fb_alloc_cmap(&fb_info.cmap, 255, 0);
gen_set_disp(-1, &fb_info);
if (register_framebuffer(&fb_info) < 0)
return -EINVAL;
......
......@@ -29,8 +29,6 @@
#include <asm/io.h>
#include <asm/hd64461.h>
#include <video/fbcon.h>
static struct fb_var_screeninfo hitfb_var __initdata = {
.activate = FB_ACTIVATE_NOW,
.height = -1,
......@@ -46,7 +44,6 @@ static struct fb_fix_screeninfo hitfb_fix __initdata = {
};
static u16 pseudo_palette[17];
static struct display display;
struct fb_info fb_info;
static int hitfb_check_var(struct fb_var_screeninfo *var, struct fb_info *info)
......@@ -126,8 +123,6 @@ static int hitfb_setcolreg(unsigned regno, unsigned red, unsigned green,
static struct fb_ops hitfb_ops = {
.owner = THIS_MODULE,
.fb_set_var = gen_set_var,
.fb_get_cmap = gen_get_cmap,
.fb_set_cmap = gen_set_cmap,
.fb_check_var = hitfb_check_var,
.fb_set_par = hitfb_set_par,
.fb_setcolreg = hitfb_setcolreg,
......@@ -169,9 +164,6 @@ int __init hitfb_init(void)
strcpy(fb_info.modename, fb_info.fix.id);
fb_info.currcon = -1;
fb_info.disp = &display;
fb_info.changevar = NULL;
fb_info.switch_con = gen_switch;
fb_info.updatevar = gen_update_var;
fb_info.screen_base = (void *) hitfb_fix.smem_start;
......
......@@ -19,8 +19,6 @@
#include <asm/blinken.h>
#include <asm/hwtest.h>
#include <video/fbcon.h>
static struct fb_info fb_info;
unsigned long fb_regs;
......@@ -67,8 +65,6 @@ static struct fb_var_screeninfo hpfb_defined = {
.vmode = FB_VMODE_NONINTERLACED,
};
static struct display display;
/*
* Set the palette. This may not work on all boards but only experimentation
* will tell.
......@@ -106,8 +102,6 @@ void hpfb_copyarea(struct fb_info *info, struct fb_copyarea *area)
static struct fb_ops hpfb_ops = {
.owner = THIS_MODULE,
.fb_set_var = gen_set_var,
.fb_get_cmap = gen_get_cmap,
.fb_set_cmap = gen_set_cmap,
.fb_setcolreg = hpfb_setcolreg,
.fb_fillrect = cfb_fillrect,
.fb_copyarea = hpfb_copyarea,
......@@ -167,13 +161,9 @@ int __init hpfb_init_one(unsigned long base)
/* The below feilds will go away !!!! */
fb_info.currcon = -1;
strcpy(fb_info.modename, fb_info.fix.id);
fb_info.disp = &display;
fb_info.switch_con = gen_switch;
fb_info.updatevar = gen_update_var;
fb_alloc_cmap(&fb_info.cmap, 256, 0);
gen_set_disp(-1, &fb_info);
if (register_framebuffer(&fb_info) < 0)
return 1;
return 0;
......
......@@ -40,8 +40,6 @@
#include <asm/io.h>
#include <asm/machw.h>
#include <video/fbcon.h>
/* Common DAC base address for the LC, RBV, Valkyrie, and IIvx */
#define DAC_BASE 0x50f24000
......@@ -173,7 +171,6 @@ static struct fb_fix_screeninfo macfb_fix = {
.accel = FB_ACCEL_NONE,
};
static struct display disp;
static struct fb_info fb_info;
static u32 pseudo_palette[17];
static int inverse = 0;
......@@ -589,8 +586,6 @@ static int macfb_setcolreg(unsigned regno, unsigned red, unsigned green,
static struct fb_ops macfb_ops = {
.owner = THIS_MODULE,
.fb_set_var = gen_set_var,
.fb_get_cmap = gen_get_cmap,
.fb_set_cmap = gen_set_cmap,
.fb_setcolreg = macfb_setcolreg,
.fb_fillrect = cfb_fillrect,
.fb_copyarea = cfb_copyarea,
......@@ -953,20 +948,16 @@ void __init macfb_init(void)
}
strcpy(fb_info.modename, macfb_fix.id);
fb_info.changevar = NULL;
fb_info.node = NODEV;
fb_info.fbops = &macfb_ops;
fb_info.var = macfb_defined;
fb_info.fix = macfb_fix;
fb_info.currcon = -1;
fb_info.disp = &disp;
fb_info.switch_con = gen_switch;
fb_info.updatevar = gen_update_var;
fb_info.pseudo_palette = pseudo_palette;
fb_info.flags = FBINFO_FLAG_DEFAULT;
fb_alloc_cmap(&fb_info.cmap, video_cmap_len, 0);
gen_set_disp(-1, &fb_info);
if (register_framebuffer(&fb_info) < 0)
return;
......
......@@ -42,7 +42,6 @@
#include <asm/bootinfo.h>
static struct fb_info fb_info;
static struct display disp;
static struct fb_var_screeninfo maxinefb_defined = {
.xres = 1024,
......@@ -113,8 +112,6 @@ static int maxinefb_setcolreg(unsigned regno, unsigned red, unsigned green,
static struct fb_ops maxinefb_ops = {
.owner = THIS_MODULE,
.fb_set_var = gen_set_var,
.fb_get_cmap = gen_get_cmap,
.fb_set_cmap = gen_set_cmap,
.fb_setcolreg = maxinefb_setcolreg,
.fb_fillrect = cfb_fillrect,
.fb_copyarea = cfb_copyarea,
......@@ -159,20 +156,16 @@ int __init maxinefb_init(void)
/* Let there be consoles... */
strcpy(fb_info.modename, "Maxine onboard graphics 1024x768x8");
fb_info.changevar = NULL;
fb_info.node = NODEV;
fb_info.fbops = &maxinefb_ops;
fb_info.screen_base = (char *) maxinefb_fix.smem_start;
fb_info.var = maxinefb_defined;
fb_info.fix = maxinefb_fix;
fb_info.disp = &disp;
fb_info.currcon = -1;
fb_info.switch_con = gen_switch;
fb_info.updatevar = gen_update_var;
fb_info.flags = FBINFO_FLAG_DEFAULT;
fb_alloc_cmap(&fb_info.cmap, 256, 0);
gen_set_disp(-1, &fb_info);
if (register_framebuffer(&fb_info) < 0)
return 1;
......
......@@ -300,6 +300,7 @@ int __fb_try_mode(struct fb_var_screeninfo *var, struct fb_info *info,
var->vmode = mode->vmode;
err = info->fbops->fb_set_var(var, PROC_CONSOLE(info), info);
var->activate &= ~FB_ACTIVATE_TEST;
gen_set_disp(PROC_CONSOLE(info), info);
return !err;
}
......
......@@ -67,7 +67,6 @@
#include <asm/mtrr.h>
#endif
#include <video/fbcon.h>
#include <video/neomagic.h>
#define NEOFB_VERSION "0.3.3"
......@@ -1390,8 +1389,6 @@ static struct fb_ops neofb_ops = {
.fb_check_var = neofb_check_var,
.fb_set_par = neofb_set_par,
.fb_set_var = gen_set_var,
.fb_get_cmap = gen_get_cmap,
.fb_set_cmap = gen_set_cmap,
.fb_setcolreg = neofb_setcolreg,
.fb_pan_display = neofb_pan_display,
.fb_blank = neofb_blank,
......@@ -1750,13 +1747,13 @@ static struct fb_info *__devinit neo_alloc_fb_info(struct pci_dev *dev, const st
struct fb_info *info;
struct neofb_par *par;
info = kmalloc(sizeof(struct fb_info) + sizeof(struct display) +
sizeof(u32) * 16, GFP_KERNEL);
info = kmalloc(sizeof(struct fb_info) +
sizeof(u32) * 17, GFP_KERNEL);
if (!info)
return NULL;
memset(info, 0, sizeof(struct fb_info) + sizeof(struct display));
memset(info, 0, sizeof(struct fb_info) + sizeof(u32) * 17);
par = &default_par;
memset(par, 0, sizeof(struct neofb_par));
......@@ -1821,13 +1818,10 @@ static struct fb_info *__devinit neo_alloc_fb_info(struct pci_dev *dev, const st
strcpy(info->modename, info->fix.id);
info->fbops = &neofb_ops;
info->changevar = NULL;
info->switch_con = gen_switch;
info->updatevar = gen_update_var;
info->flags = FBINFO_FLAG_DEFAULT;
info->par = par;
info->disp = (struct display *) (info + 1);
info->pseudo_palette = (void *) (info->disp + 1);
info->pseudo_palette = (void *) (info + 1);
fb_alloc_cmap(&info->cmap, NR_PALETTE, 0);
......
......@@ -33,7 +33,6 @@
#include <asm/bootx.h>
#endif
#include <video/fbcon.h>
#include <video/macmodes.h>
/* Supported palette hacks */
......@@ -84,8 +83,6 @@ static void offb_init_fb(const char *name, const char *full_name,
static struct fb_ops offb_ops = {
.owner = THIS_MODULE,
.fb_set_var = gen_set_var,
.fb_get_cmap = gen_get_cmap,
.fb_set_cmap = gen_set_cmap,
.fb_setcolreg = offb_setcolreg,
.fb_blank = offb_blank,
.fb_fillrect = cfb_fillrect,
......@@ -411,7 +408,7 @@ static void __init offb_init_fb(const char *name, const char *full_name,
return;
}
size = sizeof(struct fb_info) + sizeof(struct display) + sizeof(u32) * 17;
size = sizeof(struct fb_info) + sizeof(u32) * 17;
info = kmalloc(size, GFP_ATOMIC);
......@@ -533,19 +530,14 @@ static void __init offb_init_fb(const char *name, const char *full_name,
info->fbops = &offb_ops;
info->screen_base = ioremap(address, fix->smem_len);
info->par = par;
info->disp = (struct display *) (info + 1);
info->pseudo_palette = (void *) (info->disp + 1);
info->pseudo_palette = (void *) (info + 1);
info->currcon = -1;
info->fontname[0] = '\0';
info->changevar = NULL;
info->switch_con = gen_switch;
info->updatevar = gen_update_var;
info->flags = FBINFO_FLAG_DEFAULT;
fb_alloc_cmap(&info->cmap, 256, 0);
gen_set_disp(-1, info);
if (register_framebuffer(info) < 0) {
kfree(info);
release_mem_region(res_start, res_size);
......
......@@ -52,7 +52,6 @@ struct pmag_ba_ramdac_regs {
* Max 3 TURBOchannel slots -> max 3 PMAG-BA :)
*/
static struct fb_info pmagba_fb_info[3];
static struct display pmagba_disp[3];
static struct fb_var_screeninfo pmagbafb_defined = {
.xres = 1024,
......@@ -112,8 +111,6 @@ static int pmagbafb_setcolreg(unsigned regno, unsigned red, unsigned green,
static struct fb_ops pmagbafb_ops = {
.owner = THIS_MODULE,
.fb_set_var = gen_set_var,
.fb_get_cmap = gen_get_cmap,
.fb_set_cmap = gen_set_cmap,
.fb_setcolreg = pmagbafb_setcolreg,
.fb_fillrect = cfb_fillrect,
.fb_copyarea = cfb_copyarea,
......@@ -124,7 +121,6 @@ int __init pmagbafb_init_one(int slot)
{
unsigned long base_addr = get_tc_base_addr(slot);
struct fb_info *info = &pmagba_fb_info[slot];
struct display *disp = &pmagba_disp[slot];
printk("PMAG-BA framebuffer in slot %d\n", slot);
/*
......@@ -142,20 +138,16 @@ int __init pmagbafb_init_one(int slot)
* Let there be consoles..
*/
strcpy(info->modename, pmagbafb_fix.id);
info->changevar = NULL;
info->node = NODEV;
info->fbops = &pmagbafb_ops;
info->var = pmagbafb_defined;
info->fix = pmagbafb_fix;
info->screen_base = pmagbafb_fix.smem_start;
info->disp = &disp;
info->currcon = -1;
info->switch_con = gen_switch;
info->updatevar = gen_update_var;
info->flags = FBINFO_FLAG_DEFAULT;
fb_alloc_cmap(&fb_info.cmap, 256, 0);
gen_set_disp(-1, info);
if (register_framebuffer(info) < 0)
return 1;
......
......@@ -39,8 +39,6 @@
#include <asm/dec/tc.h>
#include "pmagb-b-fb.h"
#include <video/fbcon.h>
struct pmagb_b_ramdac_regs {
unsigned char addr_low;
unsigned char pad0[3];
......@@ -55,7 +53,6 @@ struct pmagb_b_ramdac_regs {
* Max 3 TURBOchannel slots -> max 3 PMAGB-B :)
*/
static struct fb_info pmagbb_fb_info[3];
static struct display pmagbb_disp[3];
static struct fb_var_screeninfo pmagbbfb_defined = {
.xres = 1280,
......@@ -115,8 +112,6 @@ static int pmagbbfb_setcolreg(unsigned regno, unsigned red, unsigned green,
static struct fb_ops pmagbbfb_ops = {
.owner = THIS_MODULE,
.fb_set_var = gen_set_var,
.fb_get_cmap = gen_get_cmap,
.fb_set_cmap = gen_set_cmap,
.fb_setcolreg = pmagbbfb_setcolreg,
.fb_fillrect = cfb_fillrect,
.fb_copyarea = cfb_copyarea,
......@@ -127,7 +122,6 @@ int __init pmagbbfb_init_one(int slot)
{
unsigned long base_addr = get_tc_base_addr(slot);
struct fb_info *info = &pmagbb_fb_info[slot];
struct display *disp = &pmagbb_disp[slot];
printk("PMAGB-BA framebuffer in slot %d\n", slot);
/*
......@@ -145,20 +139,16 @@ int __init pmagbbfb_init_one(int slot)
* Let there be consoles..
*/
strcpy(info->modename, pmagbbfb_fix.id);
info->changevar = NULL;
info->node = NODEV;
info->fbops = &pmagbbfb_ops;
info->var = pmagbbfb_defined;
info->fix = pmagbbfb_fix;
info->screen_base = pmagbbfb_fix.smem_start;
info->disp = &disp;
info->currcon = -1;
info->switch_con = gen_switch;
info->updatevar = gen_update_var;
info->flags = FBINFO_FLAG_DEFAULT;
fb_alloc_cmap(&fb_info.cmap, 256, 0);
gen_set_disp(-1, info);
if (register_framebuffer(info) < 0)
return 1;
......
......@@ -28,13 +28,10 @@
#include <linux/module.h>
#include <asm/pgtable.h>
#include <video/fbcon.h>
#define Q40_PHYS_SCREEN_ADDR 0xFE800000
static u32 pseudo_palette[17];
static struct fb_info fb_info;
static struct display display;
static struct fb_fix_screeninfo q40fb_fix __initdata = {
.id = "Q40",
......@@ -70,8 +67,6 @@ static int q40fb_setcolreg(unsigned regno, unsigned red, unsigned green,
static struct fb_ops q40fb_ops = {
.owner = THIS_MODULE,
.fb_set_var = gen_set_var,
.fb_get_cmap = gen_get_cmap,
.fb_set_cmap = gen_set_cmap,
.fb_setcolreg = q40fb_setcolreg,
.fb_fillrect = cfb_fillrect,
.fb_copyarea = cfb_copyarea,
......@@ -119,13 +114,9 @@ int q40fb_init(void)
/* The below feilds will go away !!!! */
fb_info.currcon = -1;
strcpy(fb_info.modename, fb_info.fix.id);
fb_info.disp = &display;
fb_info.switch_con = gen_switch;
fb_info.updatevar = gen_update_var;
fb_alloc_cmap(&fb_info.cmap, 16, 0);
gen_set_disp(-1, &fb_info);
master_outb(3, DISPLAY_CONTROL_REG);
if (register_framebuffer(&fb_info) < 0) {
......
......@@ -1753,7 +1753,7 @@ static void sa1100fb_disable_controller(struct sa1100fb_info *fbi)
LCCR0 &= ~LCCR0_LEN; /* Disable LCD Controller */
schedule_timeout(20 * HZ / 1000);
current->state = TASK_RUNNING;
set_current_state(TASK_RUNNING);
remove_wait_queue(&fbi->ctrlr_wait, &wait);
}
......
......@@ -26,8 +26,6 @@
#include <asm/io.h>
#include <asm/mtrr.h>
#include <video/fbcon.h>
#define INCLUDE_TIMING_TABLE_DATA
#define DBE_REG_BASE regs
#include <video/sgivw.h>
......@@ -85,9 +83,6 @@ static struct fb_var_screeninfo sgivwfb_var __initdata = {
.vmode = FB_VMODE_NONINTERLACED
};
/* console related variables */
static struct display disp;
/*
* Interface used by the world
*/
......@@ -105,8 +100,6 @@ static int sgivwfb_mmap(struct fb_info *info, struct file *file,
static struct fb_ops sgivwfb_ops = {
.owner = THIS_MODULE,
.fb_set_var = gen_set_var,
.fb_get_cmap = gen_get_cmap,
.fb_set_cmap = gen_set_cmap,
.fb_check_var = sgivwfb_check_var,
.fb_set_par = sgivwfb_set_par,
.fb_setcolreg = sgivwfb_setcolreg,
......@@ -240,8 +233,8 @@ static int sgivwfb_check_var(struct fb_var_screeninfo *var,
if (var->vmode & FB_VMODE_CONUPDATE) {
var->vmode |= FB_VMODE_YWRAP;
var->xoffset = display->var.xoffset;
var->yoffset = display->var.yoffset;
var->xoffset = info->var.xoffset;
var->yoffset = info->var.yoffset;
}
/* XXX FIXME - forcing var's */
......@@ -721,16 +714,13 @@ int __init sgivwfb_init(void)
sgivwfb_fix.ypanstep = ypan;
strcpy(fb_info.modename, sgivwfb_fix.id);
fb_info.changevar = NULL;
fb_info.node = NODEV;
fb_info.fix = sgivwfb_fix;
fb_info.var = sgivwfb_var;
fb_info.fbops = &sgivwfb_ops;
fb_info.pseudo_palette = pseudo_palette;
fb_info.par = &default_par;
fb_info.disp = &disp;
fb_info.currcon = -1;
fb_info.switch_con = gen_switch;
fb_info.updatevar = gen_update_var;
fb_info.flags = FBINFO_FLAG_DEFAULT;
......
......@@ -450,7 +450,6 @@ int __init xxxfb_init(void)
* mode. If we are setting the mode ourselves we don't call this.
*/
info.var = xxxfb_var;
gen_set_disp(-1, &fb_info);
if (register_framebuffer(&info) < 0)
return -EINVAL;
......@@ -512,8 +511,6 @@ static struct fb_ops xxxfb_ops = {
.fb_release = xxxfb_release, /* only if you need it to do something */
/* Stuff to go away. Use generic functions for now */
.fb_set_var = gen_set_var,
.fb_get_cmap = gen_get_cmap,
.fb_set_cmap = gen_set_cmap,
.fb_check_var = xxxfb_check_var,
.fb_set_par = xxxfb_set_par, /* optional */
......
......@@ -170,8 +170,6 @@ static void tdfxfb_imageblit(struct fb_info *info, struct fb_image *image);
static struct fb_ops tdfxfb_ops = {
.owner = THIS_MODULE,
.fb_set_var = gen_set_var,
.fb_get_cmap = gen_get_cmap,
.fb_set_cmap = gen_set_cmap,
.fb_check_var = tdfxfb_check_var,
.fb_set_par = tdfxfb_set_par,
.fb_setcolreg = tdfxfb_setcolreg,
......@@ -192,8 +190,6 @@ static unsigned long do_lfb_size(unsigned short);
/*
* Driver data
*/
static struct tdfx_par default_par;
static int nopan = 0;
static int nowrap = 1; // not implemented (yet)
static int inverse = 0;
......@@ -204,59 +200,59 @@ static char *mode_option __initdata = NULL;
* ------------------------------------------------------------------------- */
#ifdef VGA_REG_IO
static inline u8 vga_inb(u32 reg) { return inb(reg); }
static inline u16 vga_inw(u32 reg) { return inw(reg); }
static inline u16 vga_inl(u32 reg) { return inl(reg); }
static inline u8 vga_inb(struct tdfx_par *par, u32 reg) { return inb(reg); }
static inline u16 vga_inw(struct tdfx_par *par, u32 reg) { return inw(reg); }
static inline u16 vga_inl(struct tdfx_par *par, u32 reg) { return inl(reg); }
static inline void vga_outb(u32 reg, u8 val) { outb(val, reg); }
static inline void vga_outw(u32 reg, u16 val) { outw(val, reg); }
static inline void vga_outl(u32 reg, u32 val) { outl(val, reg); }
static inline void vga_outb(struct tdfx_par *par, u32 reg, u8 val) { outb(val, reg); }
static inline void vga_outw(struct tdfx_par *par, u32 reg, u16 val) { outw(val, reg); }
static inline void vga_outl(struct tdfx_par *par, u32 reg, u32 val) { outl(val, reg); }
#else
static inline u8 vga_inb(u32 reg) {
return inb(default_par.iobase + reg - 0x300);
static inline u8 vga_inb(struct tdfx_par *par, u32 reg) {
return inb(par->iobase + reg - 0x300);
}
static inline u16 vga_inw(u32 reg) {
return inw(default_par.iobase + reg - 0x300);
static inline u16 vga_inw(struct tdfx_par *par, u32 reg) {
return inw(par->iobase + reg - 0x300);
}
static inline u16 vga_inl(u32 reg) {
return inl(default_par.iobase + reg - 0x300);
static inline u16 vga_inl(struct tdfx_par *par, u32 reg) {
return inl(par->iobase + reg - 0x300);
}
static inline void vga_outb(u32 reg, u8 val) {
outb(val, default_par.iobase + reg - 0x300);
static inline void vga_outb(struct tdfx_par *par, u32 reg, u8 val) {
outb(val, par->iobase + reg - 0x300);
}
static inline void vga_outw(u32 reg, u16 val) {
outw(val, default_par.iobase + reg - 0x300);
static inline void vga_outw(struct tdfx_par *par, u32 reg, u16 val) {
outw(val, par->iobase + reg - 0x300);
}
static inline void vga_outl(u32 reg, u32 val) {
outl(val, default_par.iobase + reg - 0x300);
static inline void vga_outl(struct tdfx_par *par, u32 reg, u32 val) {
outl(val, par->iobase + reg - 0x300);
}
#endif
static inline void gra_outb(u32 idx, u8 val) {
static inline void gra_outb(struct tdfx_par *par, u32 idx, u8 val) {
vga_outb(GRA_I, idx); vga_outb(GRA_D, val);
}
static inline u8 gra_inb(u32 idx) {
static inline u8 gra_inb(struct tdfx_par *par, u32 idx) {
vga_outb(GRA_I, idx); return vga_inb(GRA_D);
}
static inline void seq_outb(u32 idx, u8 val) {
static inline void seq_outb(struct tdfx_par *par, u32 idx, u8 val) {
vga_outb(SEQ_I, idx); vga_outb(SEQ_D, val);
}
static inline u8 seq_inb(u32 idx) {
static inline u8 seq_inb(struct tdfx_par *par, u32 idx) {
vga_outb(SEQ_I, idx); return vga_inb(SEQ_D);
}
static inline void crt_outb(u32 idx, u8 val) {
static inline void crt_outb(struct tdfx_par *par, u32 idx, u8 val) {
vga_outb(CRT_I, idx); vga_outb(CRT_D, val);
}
static inline u8 crt_inb(u32 idx) {
static inline u8 crt_inb(struct tdfx_par *par, u32 idx) {
vga_outb(CRT_I, idx); return vga_inb(CRT_D);
}
static inline void att_outb(u32 idx, u8 val)
static inline void att_outb(struct tdfx_par *par, u32 idx, u8 val)
{
unsigned char tmp;
......@@ -265,7 +261,7 @@ static inline void att_outb(u32 idx, u8 val)
vga_outb(ATT_IW, val);
}
static inline u8 att_inb(u32 idx)
static inline u8 att_inb(struct tdfx_par *par, u32 idx)
{
unsigned char tmp;
......@@ -300,36 +296,36 @@ static inline void vga_disable_palette(void)
vga_outb(ATT_IW, 0x00);
}
static inline void vga_enable_palette(void)
static inline void vga_enable_palette(struct tdfx_par *par)
{
vga_inb(IS1_R);
vga_outb(ATT_IW, 0x20);
}
static inline u32 tdfx_inl(unsigned int reg)
static inline u32 tdfx_inl(struct tdfx_par *par, unsigned int reg)
{
return readl(default_par.regbase_virt + reg);
return readl(par->regbase_virt + reg);
}
static inline void tdfx_outl(unsigned int reg, u32 val)
static inline void tdfx_outl(struct tdfx_par *par, unsigned int reg, u32 val)
{
writel(val, default_par.regbase_virt + reg);
writel(val, par->regbase_virt + reg);
}
static inline void banshee_make_room(int size)
static inline void banshee_make_room(struct tdfx_par *par, int size)
{
while((tdfx_inl(STATUS) & 0x1f) < size);
while((tdfx_inl(par, STATUS) & 0x1f) < size);
}
static inline void banshee_wait_idle(void)
static inline void banshee_wait_idle(struct tdfx_par *par)
{
int i = 0;
banshee_make_room(1);
tdfx_outl(COMMAND_3D, COMMAND_3D_NOP);
tdfx_outl(par, COMMAND_3D, COMMAND_3D_NOP);
while(1) {
i = (tdfx_inl(STATUS) & STATUS_BUSY) ? 0 : i + 1;
i = (tdfx_inl(par, STATUS) & STATUS_BUSY) ? 0 : i + 1;
if(i == 3) break;
}
}
......@@ -337,11 +333,11 @@ static inline void banshee_wait_idle(void)
/*
* Set the color of a palette entry in 8bpp mode
*/
static inline void do_setpalentry(unsigned regno, u32 c)
static inline void do_setpalentry(struct tdfx_par *par, unsigned regno, u32 c)
{
banshee_make_room(2);
tdfx_outl(DACADDR, regno);
tdfx_outl(DACDATA, c);
tdfx_outl(par, DACADDR, regno);
tdfx_outl(par, DACDATA, c);
}
static u32 do_calc_pll(int freq, int* freq_out)
......@@ -979,6 +975,7 @@ static int __devinit tdfxfb_probe(struct pci_dev *pdev,
const struct pci_device_id *id)
{
struct fb_info *info;
struct tdfx_par *par;
int size, err;
if ((err = pci_enable_device(pdev))) {
......@@ -986,33 +983,33 @@ static int __devinit tdfxfb_probe(struct pci_dev *pdev,
return err;
}
info = kmalloc(sizeof(struct fb_info) + sizeof(struct display) +
sizeof(u32) * 16, GFP_KERNEL);
info = kmalloc(sizeof(struct fb_info) + sizeof(struct tdfx_par) +
sizeof(u32) * 17, GFP_KERNEL);
if (!info) return -ENOMEM;
memset(info, 0, sizeof(info) + sizeof(struct display) + sizeof(u32) * 16);
memset(info, 0, sizeof(info) + sizeof(struct tdfx_par) + sizeof(u32) * 17);
/* Configure the default fb_fix_screeninfo first */
switch (pdev->device) {
case PCI_DEVICE_ID_3DFX_BANSHEE:
strcat(tdfx_fix.id, " Banshee");
default_par.max_pixclock = BANSHEE_MAX_PIXCLOCK;
par->max_pixclock = BANSHEE_MAX_PIXCLOCK;
break;
case PCI_DEVICE_ID_3DFX_VOODOO3:
strcat(tdfx_fix.id, " Voodoo3");
default_par.max_pixclock = VOODOO3_MAX_PIXCLOCK;
par->max_pixclock = VOODOO3_MAX_PIXCLOCK;
break;
case PCI_DEVICE_ID_3DFX_VOODOO5:
strcat(tdfx_fix.id, " Voodoo5");
default_par.max_pixclock = VOODOO5_MAX_PIXCLOCK;
par->max_pixclock = VOODOO5_MAX_PIXCLOCK;
break;
}
tdfx_fix.mmio_start = pci_resource_start(pdev, 0);
tdfx_fix.mmio_len = pci_resource_len(pdev, 0);
default_par.regbase_virt = ioremap_nocache(tdfx_fix.mmio_start, tdfx_fix.mmio_len);
if (!default_par.regbase_virt) {
par->regbase_virt = ioremap_nocache(tdfx_fix.mmio_start, tdfx_fix.mmio_len);
if (!par->regbase_virt) {
printk("fb: Can't remap %s register area.\n", tdfx_fix.id);
goto out_err;
}
......@@ -1050,7 +1047,7 @@ static int __devinit tdfxfb_probe(struct pci_dev *pdev,
goto out_err;
}
default_par.iobase = pci_resource_start(pdev, 2);
par->iobase = pci_resource_start(pdev, 2);
if (!request_region(pci_resource_start(pdev, 2),
pci_resource_len(pdev, 2), "tdfx iobase")) {
......@@ -1073,15 +1070,13 @@ static int __devinit tdfxfb_probe(struct pci_dev *pdev,
info->node = NODEV;
info->fbops = &tdfxfb_ops;
info->fix = tdfx_fix;
info->par = &default_par;
info->disp = (struct display *)(info + 1);
info->pseudo_palette = (void *)(info->disp + 1);
info->par = (struct tdfx_par *)(info + 1);
info->pseudo_palette = (void *)(info->par + 1);
info->flags = FBINFO_FLAG_DEFAULT;
/* The below feilds will go away !!!! */
/* The below fields will go away !!!! */
strcpy(info->modename, info->fix.id);
info->currcon = -1;
info->switch_con = gen_switch;
info->updatevar = gen_update_var;
if (!mode_option)
......@@ -1110,10 +1105,11 @@ static int __devinit tdfxfb_probe(struct pci_dev *pdev,
/*
* Cleanup after anything that was remapped/allocated.
*/
if (default_par.regbase_virt)
iounmap(default_par.regbase_virt);
if (par->regbase_virt)
iounmap(par->regbase_virt);
if (info->screen_base)
iounmap(info->screen_base);
kfree(par);
kfree(info);
return -ENXIO;
}
......
......@@ -21,7 +21,6 @@
#include <linux/init.h>
#include <linux/pm.h>
#include <linux/fb.h>
#include <video/fbcon.h>
#include <asm/io.h>
#include <asm/bootinfo.h>
#include <asm/uaccess.h>
......@@ -33,7 +32,6 @@
*/
static struct fb_info fb_info;
static u32 cfb8[16];
static struct display disp;
static struct fb_fix_screeninfo tx3912fb_fix __initdata = {
.id = "tx3912fb",
......@@ -97,8 +95,6 @@ static int tx3912fb_setcolreg(u_int regno, u_int red, u_int green,
static struct fb_ops tx3912fb_ops = {
.owner = THIS_MODULE,
.fb_set_var = gen_set_var,
.fb_get_cmap = gen_get_cmap,
.fb_set_cmap = gen_set_cmap,
.fb_setcolreg = tx3912fb_setcolreg,
.fb_fillrect = cfb_fillrect,
.fb_copyarea = cfb_copyarea,
......@@ -296,15 +292,12 @@ int __init tx3912fb_init(void)
return -ENOMEM;
strcpy(fb_info.modename, tx3912fb_fix.id);
fb_info.changevar = NULL;
fb_info.node = NODEV;
fb_info.currcon = -1;
fb_info.fbops = &tx3912fb_ops;
fb_info.var = tx3912fb_var;
fb_info.fix = tx3912fb_fix;
fb_info.pseudo_palette = pseudo_palette;
fb_info.disp = &disp;
fb_info.switch_con = gen_switch;
fb_info.updatevar = gen_update_var;
fb_info.flags = FBINFO_FLAG_DEFAULT;
......@@ -313,7 +306,6 @@ int __init tx3912fb_init(void)
udelay(200);
fb_alloc_cmap(&info->cmap, size, 0);
gen_set_disp(-1, &disp);
if (register_framebuffer(&fb_info) < 0)
return -1;
......
......@@ -17,16 +17,12 @@
#include <linux/slab.h>
#include <linux/delay.h>
#include <linux/fb.h>
#include <linux/console.h>
#include <linux/selection.h>
#include <linux/ioport.h>
#include <linux/init.h>
#include <asm/io.h>
#include <asm/mtrr.h>
#include <video/fbcon.h>
#define dac_reg (0x3c8)
#define dac_val (0x3c9)
......@@ -49,7 +45,6 @@ static struct fb_fix_screeninfo vesafb_fix __initdata = {
.accel = FB_ACCEL_NONE,
};
static struct display disp;
static struct fb_info fb_info;
static u32 pseudo_palette[17];
......@@ -176,8 +171,6 @@ static int vesafb_setcolreg(unsigned regno, unsigned red, unsigned green,
static struct fb_ops vesafb_ops = {
.owner = THIS_MODULE,
.fb_set_var = gen_set_var,
.fb_get_cmap = gen_get_cmap,
.fb_set_cmap = gen_set_cmap,
.fb_setcolreg = vesafb_setcolreg,
.fb_pan_display = vesafb_pan_display,
.fb_fillrect = cfb_fillrect,
......@@ -352,20 +345,16 @@ int __init vesafb_init(void)
}
strcpy(fb_info.modename, vesafb_fix.id);
fb_info.changevar = NULL;
fb_info.node = NODEV;
fb_info.fbops = &vesafb_ops;
fb_info.var = vesafb_defined;
fb_info.fix = vesafb_fix;
fb_info.currcon = -1;
fb_info.disp = &disp;
fb_info.switch_con = gen_switch;
fb_info.updatevar = gen_update_var;
fb_info.pseudo_palette = pseudo_palette;
fb_info.flags = FBINFO_FLAG_DEFAULT;
fb_alloc_cmap(&fb_info.cmap, video_cmap_len, 0);
gen_set_disp(-1, &fb_info);
if (register_framebuffer(&fb_info)<0)
return -EINVAL;
......
......@@ -24,8 +24,6 @@
#include <linux/fb.h>
#include <linux/init.h>
#include <video/fbcon.h>
/*
* RAM we reserve for the frame buffer. This defines the maximum screen
* size
......@@ -42,7 +40,6 @@ static const char *mode_option __initdata = NULL;
static struct fb_info fb_info;
static u32 vfb_pseudo_palette[17];
static struct display disp;
static struct fb_var_screeninfo vfb_default __initdata = {
.xres = 640,
......@@ -445,10 +442,7 @@ int __init vfb_init(void)
fb_info.flags = FBINFO_FLAG_DEFAULT;
strcpy(fb_info.modename, vfb_fix.id);
fb_info.changevar = NULL;
fb_info.currcon = -1;
fb_info.disp = &disp;
fb_info.switch_con = gen_switch;
fb_info.updatevar = gen_update_var;
fb_alloc_cmap(&fb_info.cmap, 256, 0);
......
......@@ -3,6 +3,7 @@
#include <linux/tty.h>
#include <asm/types.h>
#include <asm/io.h>
/* Definitions of frame buffers */
......@@ -319,12 +320,6 @@ struct fb_ops {
/* set settable parameters */
int (*fb_set_var)(struct fb_var_screeninfo *var, int con,
struct fb_info *info);
/* get colormap */
int (*fb_get_cmap)(struct fb_cmap *cmap, int kspc, int con,
struct fb_info *info);
/* set colormap */
int (*fb_set_cmap)(struct fb_cmap *cmap, int kspc, int con,
struct fb_info *info);
/* checks var and creates a par based on it */
int (*fb_check_var)(struct fb_var_screeninfo *var, struct fb_info *info);
/* set the video mode according to par */
......@@ -365,15 +360,11 @@ struct fb_info {
struct fb_cmap cmap; /* Current cmap */
struct fb_ops *fbops;
char *screen_base; /* Virtual address */
struct display *disp; /* initial display variable */
struct vc_data *display_fg; /* Console visible on this display */
int currcon; /* Current VC. */
char fontname[40]; /* default font name */
devfs_handle_t devfs_handle; /* Devfs handle for new name */
devfs_handle_t devfs_lhandle; /* Devfs handle for compat. symlink */
int (*changevar)(int); /* tell console var has changed */
int (*switch_con)(int, struct fb_info*);
/* tell fb to switch consoles */
int (*updatevar)(int, struct fb_info*);
/* tell fb to update the vars */
void *pseudo_palette; /* Fake palette of 16 colors and
......@@ -387,6 +378,42 @@ struct fb_info {
#define FBINFO_FLAG_DEFAULT FBINFO_FLAG_MODULE
#else
#define FBINFO_FLAG_DEFAULT 0
#endif
#if defined(__sparc__)
/* We map all of our framebuffers such that big-endian accesses
* are what we want, so the following is sufficient.
*/
#define fb_readb sbus_readb
#define fb_readw sbus_readw
#define fb_readl sbus_readl
#define fb_writeb sbus_writeb
#define fb_writew sbus_writew
#define fb_writel sbus_writel
#define fb_memset sbus_memset_io
#elif defined(__i386__) || defined(__alpha__) || defined(__x86_64__)
#define fb_readb __raw_readb
#define fb_readw __raw_readw
#define fb_readl __raw_readl
#define fb_writeb __raw_writeb
#define fb_writew __raw_writew
#define fb_writel __raw_writel
#define fb_memset memset_io
#else
#define fb_readb(addr) (*(volatile u8 *) (addr))
#define fb_readw(addr) (*(volatile u16 *) (addr))
#define fb_readl(addr) (*(volatile u32 *) (addr))
#define fb_writeb(b,addr) (*(volatile u8 *) (addr) = (b))
#define fb_writew(b,addr) (*(volatile u16 *) (addr) = (b))
#define fb_writel(b,addr) (*(volatile u32 *) (addr) = (b))
#define fb_memset memset
#endif
/*
......@@ -395,14 +422,10 @@ struct fb_info {
extern int gen_set_var(struct fb_var_screeninfo *var, int con,
struct fb_info *info);
extern int gen_get_cmap(struct fb_cmap *cmap, int kspc, int con,
struct fb_info *info);
extern int gen_set_cmap(struct fb_cmap *cmap, int kspc, int con,
struct fb_info *info);
extern int fb_pan_display(struct fb_var_screeninfo *var, int con,
struct fb_info *info);
extern void cfb_fillrect(struct fb_info *info, struct fb_fillrect *rect);
extern void cfb_copyarea(struct fb_info *info, struct fb_copyarea *region);
extern void cfb_copyarea(struct fb_info *info, struct fb_copyarea *area);
extern void cfb_imageblit(struct fb_info *info, struct fb_image *image);
/*
......@@ -411,7 +434,6 @@ extern void cfb_imageblit(struct fb_info *info, struct fb_image *image);
extern int gen_update_var(int con, struct fb_info *info);
extern int fb_blank(int blank, struct fb_info *info);
extern int gen_switch(int con, struct fb_info *info);
extern void gen_set_disp(int con, struct fb_info *info);
/* drivers/video/fbmem.c */
......
/*
* FBcon low-level driver for Mac variable bpp packed pixels (mac)
*/
#ifndef _VIDEO_FBCON_MAC_H
#define _VIDEO_FBCON_MAC_H
#include <linux/config.h>
#ifdef MODULE
#if defined(CONFIG_FBCON_MAC) || defined(CONFIG_FBCON_MAC_MODULE)
#define FBCON_HAS_MAC
#endif
#else
#if defined(CONFIG_FBCON_MAC)
#define FBCON_HAS_MAC
#endif
#endif
extern struct display_switch fbcon_mac;
extern void fbcon_mac_setup(struct display *p);
extern void fbcon_mac_bmove(struct display *p, int sy, int sx, int dy, int dx,
int height, int width);
extern void fbcon_mac_clear(struct vc_data *conp, struct display *p, int sy,
int sx, int height, int width);
extern void fbcon_mac_putc(struct vc_data *conp, struct display *p, int c,
int yy, int xx);
extern void fbcon_mac_putcs(struct vc_data *conp, struct display *p,
const unsigned short *s, int count, int yy, int xx);
extern void fbcon_mac_revc(struct display *p, int xx, int yy);
#endif /* _VIDEO_FBCON_MAC_H */
......@@ -18,6 +18,7 @@
#include <asm/io.h>
struct display;
/*
* `switch' for the Low Level Operations
......@@ -51,10 +52,6 @@ extern struct display_switch fbcon_dummy;
struct display {
/* Filled in by the frame buffer device */
struct fb_var_screeninfo var; /* variable infos. yoffset and vmode */
/* are updated by fbcon.c */
struct fb_cmap cmap; /* colormap */
u_short can_soft_blank; /* zero if no hardware blanking */
u_short inverse; /* != 0 text black on white as default */
struct display_switch *dispsw; /* low level operations */
......@@ -184,44 +181,6 @@ extern int set_all_vcs(int fbidx, struct fb_ops *fb,
/* Namespace consistency */
#define SCROLL_YNOPARTIAL __SCROLL_YNOPARTIAL
#if defined(__sparc__)
/* We map all of our framebuffers such that big-endian accesses
* are what we want, so the following is sufficient.
*/
#define fb_readb sbus_readb
#define fb_readw sbus_readw
#define fb_readl sbus_readl
#define fb_writeb sbus_writeb
#define fb_writew sbus_writew
#define fb_writel sbus_writel
#define fb_memset sbus_memset_io
#elif defined(__i386__) || defined(__alpha__) || defined(__x86_64__)
#define fb_readb __raw_readb
#define fb_readw __raw_readw
#define fb_readl __raw_readl
#define fb_writeb __raw_writeb
#define fb_writew __raw_writew
#define fb_writel __raw_writel
#define fb_memset memset_io
#else
#define fb_readb(addr) (*(volatile u8 *) (addr))
#define fb_readw(addr) (*(volatile u16 *) (addr))
#define fb_readl(addr) (*(volatile u32 *) (addr))
#define fb_writeb(b,addr) (*(volatile u8 *) (addr) = (b))
#define fb_writew(b,addr) (*(volatile u16 *) (addr) = (b))
#define fb_writel(b,addr) (*(volatile u32 *) (addr) = (b))
#define fb_memset memset
#endif
extern void fbcon_redraw_clear(struct vc_data *, struct display *, int, int, int, int);
extern void fbcon_redraw_bmove(struct display *, int, int, int, int, int, int);
......
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