Commit 5eff1a23 authored by James Simmons's avatar James Simmons

Bug fixes for NeoMagic and 3Dfx driver

parent 209d0f77
...@@ -1194,6 +1194,48 @@ static int neofb_pan_display(struct fb_var_screeninfo *var, int con, ...@@ -1194,6 +1194,48 @@ static int neofb_pan_display(struct fb_var_screeninfo *var, int con,
return 0; return 0;
} }
static int neofb_setcolreg(u_int regno, u_int red, u_int green, u_int blue,
u_int transp, struct fb_info *fb)
{
if (regno >= NR_PALETTE)
return -EINVAL;
switch (fb->var.bits_per_pixel) {
case 8:
outb(regno, 0x3c8);
outb(red >> 10, 0x3c9);
outb(green >> 10, 0x3c9);
outb(blue >> 10, 0x3c9);
break;
case 16:
if (regno < 16)
((u16 *) fb->pseudo_palette)[regno] =
((red & 0xf800)) | ((green & 0xfc00) >> 5) |
((blue & 0xf800) >> 11);
break;
case 24:
if (regno < 16)
((u32 *) fb->pseudo_palette)[regno] =
((red & 0xff00) << 8) | ((green & 0xff00)) |
((blue & 0xff00) >> 8);
break;
#ifdef NO_32BIT_SUPPORT_YET
case 32:
if (regno < 16)
((u32 *) fb->pseudo_palette)[regno] =
((transp & 0xff00) << 16) | ((red & 0xff00) <<
8) | ((green &
0xff00)) |
((blue & 0xff00) >> 8);
break;
#endif
default:
return 1;
}
return 0;
}
/* /*
* (Un)Blank the display. * (Un)Blank the display.
*/ */
...@@ -1376,7 +1418,6 @@ static struct fb_var_screeninfo __devinitdata neofb_var640x480x8 = { ...@@ -1376,7 +1418,6 @@ static struct fb_var_screeninfo __devinitdata neofb_var640x480x8 = {
lower_margin: 10, lower_margin: 10,
hsync_len: 96, hsync_len: 96,
vsync_len: 2, vsync_len: 2,
sync: 0,
vmode: FB_VMODE_NONINTERLACED vmode: FB_VMODE_NONINTERLACED
}; };
...@@ -1948,10 +1989,10 @@ static struct pci_device_id neofb_devices[] __devinitdata = { ...@@ -1948,10 +1989,10 @@ static struct pci_device_id neofb_devices[] __devinitdata = {
MODULE_DEVICE_TABLE(pci, neofb_devices); MODULE_DEVICE_TABLE(pci, neofb_devices);
static struct pci_driver neofb_driver = { static struct pci_driver neofb_driver = {
name:"neofb", name: "neofb",
id_table:neofb_devices, id_table: neofb_devices,
probe:neofb_probe, probe: neofb_probe,
remove:__devexit_p(neofb_remove) remove: __devexit_p(neofb_remove)
}; };
/* **************************** init-time only **************************** */ /* **************************** init-time only **************************** */
......
...@@ -1090,9 +1090,6 @@ static int __devinit tdfxfb_probe(struct pci_dev *pdev, ...@@ -1090,9 +1090,6 @@ static int __devinit tdfxfb_probe(struct pci_dev *pdev,
info->switch_con = gen_switch; info->switch_con = gen_switch;
info->updatevar = gen_update_var; info->updatevar = gen_update_var;
size = (info->var.bits_per_pixel == 8) ? 256 : 16;
fb_alloc_cmap(&info->cmap, size, 0);
if (!mode_option) if (!mode_option)
mode_option = "640x480@60"; mode_option = "640x480@60";
...@@ -1100,6 +1097,9 @@ static int __devinit tdfxfb_probe(struct pci_dev *pdev, ...@@ -1100,6 +1097,9 @@ static int __devinit tdfxfb_probe(struct pci_dev *pdev,
if (!err || err == 4) if (!err || err == 4)
info->var = tdfx_var; info->var = tdfx_var;
size = (info->var.bits_per_pixel == 8) ? 256 : 16;
fb_alloc_cmap(&info->cmap, size, 0);
gen_set_var(&info->var, -1, info); gen_set_var(&info->var, -1, info);
if (register_framebuffer(info) < 0) { if (register_framebuffer(info) < 0) {
......
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