Commit f1547973 authored by James Simmons's avatar James Simmons

Merge http://linus.bkbits.net:8080/linux-2.5

into hostme.bitkeeper.com:/ua/repos/f/fbdev/fbdev-2.5
parents f4f8a039 c1c8c4f9
......@@ -10,7 +10,7 @@ mod-subdirs := matrox
# This list comes from 'grep -l EXPORT_SYMBOL *.[hc]'.
export-objs := fbmem.o fbcmap.o fbcon.o fbmon.o modedb.o \
fbcon-afb.o fbcon-ilbm.o fbgen.o \
fbcon-afb.o fbcon-ilbm.o \
fbcon-vga.o fbcon-iplan2p2.o fbcon-iplan2p4.o \
fbcon-iplan2p8.o fbcon-vga-planes.o fbcon-cfb16.o \
fbcon-cfb2.o fbcon-cfb24.o fbcon-cfb32.o fbcon-cfb4.o \
......
......@@ -1596,7 +1596,7 @@ static int falcon_pan_display( struct fb_var_screeninfo *var,
var->xoffset = up(var->xoffset, 2);
}
par->hw.falcon.line_offset = bpp *
(fb_display[fb_info.currcon].var.xres_virtual - fb_display[currcon].var.xres) / 16;
(fb_display[fb_info.currcon].var.xres_virtual - fb_display[fb_info.currcon].var.xres) / 16;
if (par->hw.falcon.xoffset)
par->hw.falcon.line_offset -= bpp;
xoffset = var->xoffset - par->hw.falcon.xoffset;
......@@ -2841,7 +2841,7 @@ int __init atafb_setup( char *options )
if (!options || !*options)
return 0;
for(this_opt=strtok(options,","); this_opt; this_opt=strtok(NULL,",")) {
while ((this_opt = strsep(options, ",")) != NULL) {
if (!*this_opt) continue;
if ((temp=get_video_mode(this_opt)))
default_par=temp;
......
......@@ -87,6 +87,9 @@
#include <linux/adb.h>
#include <linux/pmu.h>
#endif
#ifdef CONFIG_BOOTX_TEXT
#include <asm/btext.h>
#endif
#ifdef CONFIG_NVRAM
#include <linux/nvram.h>
#endif
......@@ -815,6 +818,13 @@ static void atyfb_set_par(const struct atyfb_par *par,
display_info.disp_reg_address = info->ati_regbase_phys;
}
#endif /* CONFIG_FB_COMPAT_XPMAC */
#ifdef CONFIG_BOOTX_TEXT
btext_update_display(info->frame_buffer_phys,
(((par->crtc.h_tot_disp>>16) & 0xff)+1)*8,
((par->crtc.v_tot_disp>>16) & 0x7ff)+1,
par->crtc.bpp,
par->crtc.vxres*par->crtc.bpp/8);
#endif /* CONFIG_BOOTX_TEXT */
}
static int atyfb_decode_var(const struct fb_var_screeninfo *var,
......
......@@ -70,6 +70,9 @@
#ifdef CONFIG_FB_COMPAT_XPMAC
#include <asm/vc_ioctl.h>
#endif
#ifdef CONFIG_BOOTX_TEXT
#include <asm/btext.h>
#endif /* CONFIG_BOOTX_TEXT */
#include <video/fbcon.h>
#include <video/fbcon-cfb8.h>
......@@ -154,6 +157,7 @@ static struct aty128_chip_info aty128_pci_probe_list[] __initdata =
{"Rage128 RL (AGP)", PCI_DEVICE_ID_ATI_RAGE128_RL, rage_128},
{"Rage128 Pro PF (AGP)", PCI_DEVICE_ID_ATI_RAGE128_PF, rage_128_pro},
{"Rage128 Pro PR (PCI)", PCI_DEVICE_ID_ATI_RAGE128_PR, rage_128_pro},
{"Rage128 Pro TR (AGP)", PCI_DEVICE_ID_ATI_RAGE128_U3, rage_128_pro},
{"Rage Mobility M3 (PCI)", PCI_DEVICE_ID_ATI_RAGE128_LE, rage_M3},
{"Rage Mobility M3 (AGP)", PCI_DEVICE_ID_ATI_RAGE128_LF, rage_M3},
{NULL, 0, rage_128}
......@@ -216,9 +220,13 @@ static const char *aty128fb_name = "ATY Rage128";
static char fontname[40] __initdata = { 0 };
static int noaccel __initdata = 0;
#ifdef MODULE
static char *font __initdata = NULL;
static char *mode __initdata = NULL;
#ifdef CONFIG_MTRR
static int nomtrr __initdata = 0;
#endif
#endif /* MODULE */
static char *mode_option __initdata = NULL;
......@@ -418,6 +426,7 @@ static struct fb_ops aty128fb_ops = {
fb_set_cmap: gen_set_cmap,
fb_setcolreg: aty128fb_setcolreg,
fb_pan_display: aty128fb_pan_display,
fb_blank: aty128fb_blank,
fb_rasterimg: aty128fb_rasterimg,
};
......@@ -1243,6 +1252,13 @@ aty128_set_par(struct aty128fb_par *par,
display_info.disp_reg_address = info->regbase_phys;
}
#endif /* CONFIG_FB_COMPAT_XPMAC */
#if defined(CONFIG_BOOTX_TEXT)
btext_update_display(info->frame_buffer_phys,
(((par->crtc.h_total>>16) & 0xff)+1)*8,
((par->crtc.v_total>>16) & 0x7ff)+1,
par->crtc.bpp,
par->crtc.vxres*par->crtc.bpp/8);
#endif /* CONFIG_BOOTX_TEXT */
}
/*
......@@ -1584,7 +1600,7 @@ aty128fb_setup(char *options)
if (!options || !*options)
return 0;
while (this_opt = strsep(&options, ",")) {
while ((this_opt = strsep(&options, ",")) != NULL) {
if (!strncmp(this_opt, "font:", 5)) {
char *p;
int i;
......@@ -1687,6 +1703,29 @@ aty128_init(struct fb_info_aty128 *info, const char *name)
if (default_vmode <= 0 || default_vmode > VMODE_MAX)
default_vmode = VMODE_1024_768_60;
/* iMacs need that resolution
* PowerMac2,1 first r128 iMacs
* PowerMac2,2 summer 2000 iMacs
* PowerMac4,1 january 2001 iMacs "flower power"
*/
if (machine_is_compatible("PowerMac2,1") ||
machine_is_compatible("PowerMac2,2") ||
machine_is_compatible("PowerMac4,1"))
default_vmode = VMODE_1024_768_75;
/* iBook SE */
if (machine_is_compatible("PowerBook2,2"))
default_vmode = VMODE_800_600_60;
/* PowerBook Firewire (Pismo), iBook Dual USB */
if (machine_is_compatible("PowerBook3,1") ||
machine_is_compatible("PowerBook4,1"))
default_vmode = VMODE_1024_768_60;
/* PowerBook Titanium */
if (machine_is_compatible("PowerBook3,2"))
default_vmode = VMODE_1152_768_60;
if (default_cmode < CMODE_8 || default_cmode > CMODE_32)
default_cmode = CMODE_8;
......
......@@ -74,7 +74,7 @@ struct fb_info_chips {
#define write_ind(num, val, ap, dp) do { \
outb((num), (ap)); outb((val), (dp)); \
} while (0)
} while (0);
#define read_ind(num, var, ap, dp) do { \
outb((num), (ap)); var = inb((dp)); \
} while (0);
......@@ -312,7 +312,7 @@ static void chips_set_bitdepth(struct fb_info_chips *p, struct display* disp, in
struct fb_var_screeninfo* var = &p->var;
if (bpp == 16) {
if (con == info->currcon) {
if (con == p->info.currcon) {
write_cr(0x13, 200); // Set line length (doublewords)
write_xr(0x81, 0x14); // 15 bit (555) color mode
write_xr(0x82, 0x00); // Disable palettes
......@@ -334,7 +334,7 @@ static void chips_set_bitdepth(struct fb_info_chips *p, struct display* disp, in
disp->dispsw = &fbcon_dummy;
#endif
} else if (bpp == 8) {
if (con == info->currcon) {
if (con == p->info.currcon) {
write_cr(0x13, 100); // Set line length (doublewords)
write_xr(0x81, 0x12); // 8 bit color mode
write_xr(0x82, 0x08); // Graphics gamma enable
......
......@@ -225,7 +225,7 @@ static struct fb_ops controlfb_ops = {
fb_set_var: control_set_var,
fb_get_cmap: control_get_cmap,
fb_set_cmap: gen_set_cmap,
fb_setcolreg: control_setcolreg,
fb_setcolreg: controlfb_setcolreg,
fb_pan_display: control_pan_display,
fb_blank: controlfb_blank,
fb_mmap: control_mmap,
......@@ -1238,7 +1238,7 @@ static void control_cfb16_revc(struct display *p, int xx, int yy)
u8 *dest;
int bytes = p->next_line, rows;
dest = p->info.screen_base + yy * fontheight(p) * bytes + xx * fontwidth(p)*2;
dest = p->fb_info->screen_base + yy * fontheight(p) * bytes + xx * fontwidth(p)*2;
for (rows = fontheight(p); rows--; dest += bytes) {
switch (fontwidth(p)) {
case 16:
......@@ -1261,7 +1261,7 @@ static void control_cfb32_revc(struct display *p, int xx, int yy)
u8 *dest;
int bytes = p->next_line, rows;
dest = p->info.screen_base + yy * fontheight(p) * bytes + xx * fontwidth(p) * 4;
dest = p->fb_info->screen_base + yy * fontheight(p) * bytes + xx * fontwidth(p) * 4;
for (rows = fontheight(p); rows--; dest += bytes) {
switch (fontwidth(p)) {
case 16:
......
......@@ -1111,13 +1111,13 @@ static int cyber2000fb_blank(int blank, struct fb_info *info)
static struct fb_ops cyber2000fb_ops = {
owner: THIS_MODULE,
fb_set_var: cyber2000fb_set_var,
fb_set_cmap: gen_set_cmap,
fb_setcolreg: cyber2000fb_setcolreg,
fb_pan_display: cyber2000fb_pan_display,
fb_blank: cyber2000fb_blank,
fb_get_fix: gen_get_fix,
fb_get_var: gen_get_var,
fb_get_cmap: gen_get_cmap,
fb_set_cmap: gen_set_cmap,
};
/*
......
......@@ -604,6 +604,7 @@ static int cyberfb_blank(int blank, struct fb_info *info)
}
#endif
DPRINTK("EXIT\n");
return 0;
}
......
......@@ -522,7 +522,7 @@ fb_ioctl(struct inode *inode, struct file *file, unsigned int cmd,
set_con2fb_map(i, con2fb.framebuffer);
return 0;
case FBIOBLANK:
if (fb->fb_blank == 0)
if (fb->fb_blank == NULL)
return -EINVAL;
return fb->fb_blank(arg, info);
default:
......
......@@ -1908,7 +1908,7 @@ imsttfb_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
p->ramdac = TVP;
break;
default:
printk(KERN_INFO "imsttfb: Device 0x%lx unknown, "
printk(KERN_INFO "imsttfb: Device 0x%x unknown, "
"contact maintainer.\n", pdev->device);
return -ENODEV;
}
......
......@@ -423,7 +423,7 @@ static struct display_switch fbcon_neo2200_accel = {
/*
* Set a single color register. Return != 0 for invalid regno.
*/
static int neo_setcolreg(u_int regno, u_int red, u_int green, u_int blue,
static int neofb_setcolreg(u_int regno, u_int red, u_int green, u_int blue,
u_int transp, struct fb_info *fb)
{
struct neofb_info *info = (struct neofb_info *)fb;
......@@ -830,46 +830,6 @@ static void neofb_update_start (struct neofb_info *info, struct fb_var_screeninf
neoLock();
}
/*
* Set the Colormap
*/
static int neofb_set_cmap(struct fb_cmap *cmap, int kspc, int con,
struct fb_info *fb)
{
struct neofb_info *info = (struct neofb_info *)fb;
struct display* disp = (con < 0) ? fb->disp : (fb_display + con);
struct fb_cmap *dcmap = &disp->cmap;
int err = 0;
/* no colormap allocated? */
if (!dcmap->len)
{
int size;
if (fb->var.bits_per_pixel == 8)
size = NR_PALETTE;
else
size = 32;
err = fb_alloc_cmap (dcmap, size, 0);
}
/*
* we should be able to remove this test once fbcon has been
* "improved" --rmk
*/
if (!err && con == info->fb.currcon)
{
err = fb_set_cmap (cmap, kspc, neo_setcolreg, fb);
dcmap = &fb->cmap;
}
if (!err)
fb_copy_cmap (cmap, dcmap, kspc ? 0 : 1);
return err;
}
/*
* neoCalcVCLK --
*
......@@ -1570,7 +1530,7 @@ static int neofb_set_var (struct fb_var_screeninfo *var, int con,
neofb_set_par (info, &par);
neofb_update_start (info, var);
fb_set_cmap (&fb->cmap, 1, neo_setcolreg, fb);
fb_set_cmap (&fb->cmap, 1, fb);
if (var->accel_flags & FB_ACCELF_TEXT)
neo2200_accel_init (info, var);
......@@ -1673,7 +1633,7 @@ static int neofb_switch (int con, struct fb_info *fb)
/*
* (Un)Blank the display.
*/
static void neofb_blank (int blank, struct fb_info *fb)
static int neofb_blank (int blank, struct fb_info *fb)
{
// struct neofb_info *info = (struct neofb_info *)fb;
......@@ -1706,40 +1666,16 @@ static void neofb_blank (int blank, struct fb_info *fb)
default: /* case 0, or anything else: unblank */
break;
}
}
/*
* Get the currently displayed virtual consoles colormap.
*/
static int gen_get_cmap (struct fb_cmap *cmap, int kspc, int con, struct fb_info *fb)
{
fb_copy_cmap (&fb->cmap, cmap, kspc ? 0 : 2);
return 0;
}
/*
* Get the currently displayed virtual consoles fixed part of the display.
*/
static int gen_get_fix (struct fb_fix_screeninfo *fix, int con, struct fb_info *fb)
{
*fix = fb->fix;
return 0;
}
/*
* Get the current user defined part of the display.
*/
static int gen_get_var (struct fb_var_screeninfo *var, int con, struct fb_info *fb)
{
*var = fb->var;
return 0;
}
static struct fb_ops neofb_ops = {
owner: THIS_MODULE,
fb_set_var: neofb_set_var,
fb_set_cmap: neofb_set_cmap,
fb_set_cmap: gen_set_cmap,
fb_setcolreg: neofb_setcolreg,
fb_pan_display: neofb_pan_display,
fb_blank: neofb_blank,
fb_get_fix: gen_get_fix,
fb_get_var: gen_get_var,
fb_get_cmap: gen_get_cmap,
......@@ -2166,7 +2102,6 @@ static struct neofb_info * __devinit neo_alloc_fb_info (struct pci_dev *dev,
info->fb.changevar = NULL;
info->fb.switch_con = neofb_switch;
info->fb.updatevar = neofb_updatevar;
info->fb.blank = neofb_blank;
info->fb.flags = FBINFO_FLAG_DEFAULT;
info->fb.disp = (struct display *)(info + 1);
info->fb.pseudo_palette = (void *)(info->fb.disp + 1);
......
......@@ -49,7 +49,8 @@ enum {
cmap_r128, /* ATI Rage128 */
cmap_M3A, /* ATI Rage Mobility M3 Head A */
cmap_M3B, /* ATI Rage Mobility M3 Head B */
cmap_radeon /* ATI Radeon */
cmap_radeon, /* ATI Radeon */
cmap_gxt2000, /* IBM GXT2000 */
};
struct fb_info_offb {
......@@ -61,6 +62,7 @@ struct fb_info_offb {
volatile unsigned char *cmap_adr;
volatile unsigned char *cmap_data;
int cmap_type;
int blanked;
union {
#ifdef FBCON_HAS_CFB16
u16 cfb16[16];
......@@ -207,9 +209,11 @@ static int offb_set_var(struct fb_var_screeninfo *var, int con,
static int offb_get_cmap(struct fb_cmap *cmap, int kspc, int con,
struct fb_info *info)
{
if (con == info->currcon) /* current console? */
struct fb_info_offb *info2 = (struct fb_info_offb *)info;
if (con == info->currcon && !info2->blanked) /* current console? */
return fb_get_cmap(cmap, kspc, offb_getcolreg, info);
else if (fb_display[con].cmap.len) /* non default colormap? */
if (fb_display[con].cmap.len) /* non default colormap? */
fb_copy_cmap(&fb_display[con].cmap, cmap, kspc ? 0 : 2);
else
{
......@@ -237,7 +241,7 @@ static int offb_set_cmap(struct fb_cmap *cmap, int kspc, int con,
if ((err = fb_alloc_cmap(&fb_display[con].cmap, size, 0)))
return err;
}
if (con == info->currcon) /* current console? */
if (con == info->currcon && !info2->blanked) /* current console? */
return fb_set_cmap(cmap, kspc, info);
else
fb_copy_cmap(cmap, &fb_display[con].cmap, kspc ? 0 : 1);
......@@ -254,7 +258,17 @@ static int offb_blank(int blank, struct fb_info *info)
int i, j;
if (!info2->cmap_adr)
return;
return 0;
if (!info2->blanked) {
if (!blank)
return 0;
if (fb_display[info->currcon].cmap.len)
fb_get_cmap(&fb_display[info->currcon].cmap, 1, offb_getcolreg,info);
}
info2->blanked = blank;
if (blank)
for (i = 0; i < 256; i++) {
......@@ -288,6 +302,9 @@ static int offb_blank(int blank, struct fb_info *info)
out_8(info2->cmap_adr + 0xb0, i);
out_le32((unsigned *)(info2->cmap_adr + 0xb4), 0);
break;
case cmap_gxt2000:
out_le32((unsigned *)info2->cmap_adr + i, 0);
break;
}
}
else
......@@ -496,6 +513,10 @@ static void __init offb_init_fb(const char *name, const char *full_name,
info->cmap_adr = ioremap(base + 0x7ff000, 0x1000) + 0xcc0;
info->cmap_data = info->cmap_adr + 1;
info->cmap_type = cmap_m64;
} else if (device_is_compatible(dp, "pci1014,b7")) {
unsigned long regbase = dp->addrs[0].address;
info->cmap_adr = ioremap(regbase + 0x6000, 0x1000);
info->cmap_type = cmap_gxt2000;
}
fix->visual = info->cmap_adr ? FB_VISUAL_PSEUDOCOLOR
: FB_VISUAL_STATIC_PSEUDOCOLOR;
......@@ -664,11 +685,12 @@ static void __init offb_init_fb(const char *name, const char *full_name,
#endif /* CONFIG_FB_COMPAT_XPMAC) */
}
static int offbcon_switch(int con, struct fb_info *info)
{
struct fb_info_offb *info2 = (struct fb_info_offb *)info;
/* Do we have to save the colormap? */
if (fb_display[info->currcon].cmap.len)
if (fb_display[info->currcon].cmap.len && !info2->blanked)
fb_get_cmap(&fb_display[info->currcon].cmap, 1, offb_getcolreg, info);
info->currcon = con;
......@@ -766,6 +788,10 @@ static int offb_setcolreg(u_int regno, u_int red, u_int green, u_int blue,
out_le32((unsigned *)(info2->cmap_adr + 0xb4),
(red << 16 | green << 8 | blue));
break;
case cmap_gxt2000:
out_le32((unsigned *)info2->cmap_adr + regno,
(red << 16 | green << 8 | blue));
break;
}
if (regno < 16)
......
......@@ -329,10 +329,10 @@ static int platinum_switch(int con, struct fb_info *fb)
struct fb_info_platinum *info = (struct fb_info_platinum *) fb;
struct fb_par_platinum par;
if (fb_display[info->currcon].cmap.len)
fb_get_cmap(&fb_display[info->currcon].cmap, 1, platinum_getcolreg,
if (fb_display[fb->currcon].cmap.len)
fb_get_cmap(&fb_display[fb->currcon].cmap, 1, platinum_getcolreg,
fb);
info->currcon = con;
fb->currcon = con;
platinum_var_to_par(&fb_display[con].var, &par, info);
platinum_set_par(&par, info);
......
......@@ -260,7 +260,7 @@ static int valkyriefb_switch(int con, struct fb_info *fb)
fb);
fb->currcon = con;
#if 1
valkyrie_var_to_par(&fb_display[currcon].var, &par, fb);
valkyrie_var_to_par(&fb_display[fb->currcon].var, &par, fb);
valkyrie_set_par(&par, info);
do_install_cmap(con, fb);
#else
......
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