summaryrefslogtreecommitdiffstats
path: root/drivers/video
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/video')
-rw-r--r--drivers/video/Config.in9
-rw-r--r--drivers/video/amifb.c2
-rw-r--r--drivers/video/bwtwofb.c4
-rw-r--r--drivers/video/clgenfb.c63
-rw-r--r--drivers/video/cvisionppc.h2
-rw-r--r--drivers/video/cyberfb.c123
-rw-r--r--drivers/video/fbcon.c2
-rw-r--r--drivers/video/fbgen.c2
-rw-r--r--drivers/video/fbmem.c6
-rw-r--r--drivers/video/fm2fb.c176
-rw-r--r--drivers/video/igafb.c32
-rw-r--r--drivers/video/offb.c3
-rw-r--r--drivers/video/platinumfb.h2
-rw-r--r--drivers/video/pm2fb.c2
-rw-r--r--drivers/video/pm2fb.h2
-rw-r--r--drivers/video/retz3fb.c126
-rw-r--r--drivers/video/rivafb.c2
-rw-r--r--drivers/video/skeletonfb.c5
-rw-r--r--drivers/video/virgefb.c111
19 files changed, 339 insertions, 335 deletions
diff --git a/drivers/video/Config.in b/drivers/video/Config.in
index d8591ef17..2ccc8d4be 100644
--- a/drivers/video/Config.in
+++ b/drivers/video/Config.in
@@ -240,7 +240,7 @@ if [ "$CONFIG_FB" = "y" ]; then
"$CONFIG_FB_VIRGE" = "m" -o "$CONFIG_FB_CYBER" = "m" -o \
"$CONFIG_FB_VALKYRIE" = "m" -o "$CONFIG_FB_PLATINUM" = "m" -o \
"$CONFIG_FB_CT65550" = "m" -o "$CONFIG_FB_MATROX" = "m" -o \
- "$CONFIG_FB_PM2" = "y" -o "$CONFIG_FB_SGIVW" = "m" -o \
+ "$CONFIG_FB_PM2" = "m" -o "$CONFIG_FB_SGIVW" = "m" -o \
"$CONFIG_FB_CYBER2000" = "m" ]; then
define_tristate CONFIG_FBCON_CFB16 m
fi
@@ -316,13 +316,6 @@ if [ "$CONFIG_FB" = "y" ]; then
define_tristate CONFIG_FBCON_VGA_PLANES m
fi
fi
- if [ "$CONFIG_FB_MDA" = "y" -o "$CONFIG_FB_VGA" = "y" ]; then
- define_tristate CONFIG_FBCON_VGA y
- else
- if [ "$CONFIG_FB_MDA" = "m" -o "$CONFIG_FB_VGA" = "m" ]; then
- define_tristate CONFIG_FBCON_VGA m
- fi
- fi
fi
bool ' Support only 8 pixels wide fonts' CONFIG_FBCON_FONTWIDTH8_ONLY
if [ "$ARCH" = "sparc" -o "$ARCH" = "sparc64" ]; then
diff --git a/drivers/video/amifb.c b/drivers/video/amifb.c
index fb578ffdb..af0a0d7c8 100644
--- a/drivers/video/amifb.c
+++ b/drivers/video/amifb.c
@@ -1939,7 +1939,7 @@ static u_long __init chipalloc(u_long size)
u_long ptr;
size += PAGE_SIZE-1;
- if (!(ptr = (u_long)amiga_chip_alloc(size)))
+ if (!(ptr = (u_long)amiga_chip_alloc(size, "amifb")))
panic("No Chip RAM for frame buffer");
memset((void *)ptr, 0, size);
ptr = PAGE_ALIGN(ptr);
diff --git a/drivers/video/bwtwofb.c b/drivers/video/bwtwofb.c
index cd79cd7d2..f8c0ea52d 100644
--- a/drivers/video/bwtwofb.c
+++ b/drivers/video/bwtwofb.c
@@ -1,4 +1,4 @@
-/* $Id: bwtwofb.c,v 1.11 1999/11/19 09:56:54 davem Exp $
+/* $Id: bwtwofb.c,v 1.12 2000/01/21 03:57:05 anton Exp $
* bwtwofb.c: BWtwo frame buffer driver
*
* Copyright (C) 1998 Jakub Jelinek (jj@ultra.linux.cz)
@@ -172,7 +172,7 @@ char __init *bwtwofb_init(struct fb_info_sbusfb *fb)
#ifdef CONFIG_SUN4
res.start = phys;
res.end = res.start + BWTWO_REGISTER_OFFSET + sizeof(struct bw2_regs) - 1;
- res.flags = IORESOURE_IO | (fb->iospace & 0xff);
+ res.flags = IORESOURCE_IO | (fb->iospace & 0xff);
resp = &res;
#else
resp = &fb->sbdp->resource[0];
diff --git a/drivers/video/clgenfb.c b/drivers/video/clgenfb.c
index 58a2fbb24..98a517f9f 100644
--- a/drivers/video/clgenfb.c
+++ b/drivers/video/clgenfb.c
@@ -316,7 +316,7 @@ static const struct {
#ifdef CONFIG_ZORRO
static const struct {
clgen_board_t btype;
- int key, key2;
+ zorro_id id, id2;
} clgen_zorro_probe_list[] __initdata = {
{ BT_SD64,
ZORRO_PROD_HELFRICH_SD64_RAM,
@@ -414,8 +414,6 @@ struct clgenfb_info {
} fbcon_cmap;
#ifdef CONFIG_ZORRO
- int keyRAM; /* RAM, REG zorro board keys */
- int keyREG;
unsigned long board_addr,
board_size;
#endif
@@ -2714,22 +2712,26 @@ static int __init clgen_pci_setup (struct clgenfb_info *info,
#ifdef CONFIG_ZORRO
-static int __init clgen_zorro_find (int *key_o, int *key2_o, clgen_board_t *btype)
+static int __init clgen_zorro_find (struct zorro_dev **z_o,
+ struct zorro_dev **z2_o,
+ clgen_board_t *btype)
{
- int i, key = 0;
-
- assert (key_o != NULL);
+ struct zorro_dev *z = NULL;
+ int i;
+
+ assert (z_o != NULL);
assert (btype != NULL);
- for (i = 0; i < arraysize(clgen_zorro_probe_list) && !key; i++)
- key = zorro_find (clgen_zorro_probe_list[i].key, 0, 0);
+ for (i = 0; i < arraysize(clgen_zorro_probe_list); i++)
+ if ((z = zorro_find_device(clgen_zorro_probe_list[i].id, NULL)))
+ break;
- if (key) {
- *key_o = key;
- if (clgen_zorro_probe_list[i].key2)
- *key2_o = zorro_find (clgen_zorro_probe_list[i].key2, 0, 0);
+ if (z) {
+ *z_o = z;
+ if (clgen_zorro_probe_list[i].id2)
+ *z2_o = zorro_find_device(clgen_zorro_probe_list[i].id2, NULL);
else
- *key2_o = 0;
+ *z2_o = NULL;
*btype = clgen_zorro_probe_list[i - 1].btype;
printk (KERN_INFO "clgen: %s board detected; ",
@@ -2766,26 +2768,21 @@ static void clgen_zorro_unmap (struct clgenfb_info *info)
static int __init clgen_zorro_setup (struct clgenfb_info *info,
clgen_board_t *btype)
{
- int key = 0, key2 = 0;
- const struct ConfigDev *cd = NULL;
- const struct ConfigDev *cd2 = NULL;
+ struct zorro_dev *z = NULL, *z2 = NULL;
unsigned long board_addr, board_size;
assert (info != NULL);
assert (btype != NULL);
- if (clgen_zorro_find (&key, &key2, btype))
+ if (clgen_zorro_find (&z, &z2, btype))
return -1;
- assert (key > 0);
- assert (key2 >= 0);
+ assert (z > 0);
+ assert (z2 >= 0);
assert (*btype != BT_NONE);
- info->keyRAM = key;
- info->keyREG = key2;
- cd = zorro_get_board (key);
- info->board_addr = board_addr = (unsigned long) cd->cd_BoardAddr;
- info->board_size = board_size = (unsigned long) cd->cd_BoardSize;
+ info->board_addr = board_addr = z->resource.start;
+ info->board_size = board_size = z->resource.end-z->resource.start+1;
if (!request_mem_region(board_addr, board_size, "clgenfb")) {
printk(KERN_ERR "clgen: cannot reserve region 0x%lu, abort\n",
@@ -2810,8 +2807,7 @@ static int __init clgen_zorro_setup (struct clgenfb_info *info,
info->fbmem_phys = board_addr + 16777216;
info->fbmem = ioremap (info->fbmem_phys, 16777216);
} else {
- cd2 = zorro_get_board (key2);
- printk (" REG at $%lx\n", (unsigned long) cd2->cd_BoardAddr);
+ printk (" REG at $%lx\n", (unsigned long) z2->resource.start);
info->fbmem_phys = board_addr;
if (board_addr > 0x01000000)
@@ -2820,17 +2816,12 @@ static int __init clgen_zorro_setup (struct clgenfb_info *info,
info->fbmem = (caddr_t) ZTWO_VADDR (board_addr);
/* set address for REG area of board */
- info->regs = (caddr_t) ZTWO_VADDR (cd2->cd_BoardAddr);
- info->fbregs_phys = (unsigned long) cd2->cd_BoardAddr;
+ info->regs = (caddr_t) ZTWO_VADDR (z2->resource.start);
+ info->fbregs_phys = z2->resource.start;
DPRINTK ("clgen: Virtual address for board set to: $%p\n", info->regs);
}
- /* mark this board as "autoconfigured" */
- zorro_config_board (key, 0);
- if (*btype != BT_PICASSO4)
- zorro_config_board (key2, 0);
-
printk (KERN_INFO "Cirrus Logic chipset on Zorro bus\n");
return 0;
@@ -2968,10 +2959,6 @@ static void clgenfb_cleanup (struct clgenfb_info *info)
switch_monitor (info, 0);
clgen_zorro_unmap (info);
-
- zorro_unconfig_board (info->keyRAM, 0);
- if (info->btype != BT_PICASSO4)
- zorro_unconfig_board (info->keyREG, 0);
#else
clgen_pci_unmap (info);
#endif /* CONFIG_ZORRO */
diff --git a/drivers/video/cvisionppc.h b/drivers/video/cvisionppc.h
index 0afc0d04e..11250eee9 100644
--- a/drivers/video/cvisionppc.h
+++ b/drivers/video/cvisionppc.h
@@ -7,7 +7,7 @@
* $Id: cvisionppc.h,v 1.8 1999/01/28 13:18:07 illo Exp $
* --------------------------------------------------------------------------
* This file is subject to the terms and conditions of the GNU General Public
- * License. See the file README.legal in the main directory of this archive
+ * License. See the file COPYING in the main directory of this archive
* for more details.
*/
diff --git a/drivers/video/cyberfb.c b/drivers/video/cyberfb.c
index 7e4aea83f..deadf90b0 100644
--- a/drivers/video/cyberfb.c
+++ b/drivers/video/cyberfb.c
@@ -1104,76 +1104,75 @@ int __init cyberfb_setup(char *options)
int __init cyberfb_init(void)
{
+ unsigned long board_addr, board_size;
struct cyberfb_par par;
- unsigned long board_addr;
- unsigned long board_size;
- const struct ConfigDev *cd;
- unsigned int CyberKey = 0;
+ struct zorro_dev *z = NULL;
DPRINTK("ENTER\n");
- if (!(CyberKey = zorro_find(ZORRO_PROD_PHASE5_CYBERVISION64, 0, 0))) {
- DPRINTK("EXIT - zorro_find failed\n");
- return -ENXIO;
- }
-
- cd = zorro_get_board (CyberKey);
- zorro_config_board (CyberKey, 0);
- board_addr = (unsigned long)cd->cd_BoardAddr;
- board_size = (unsigned long)cd->cd_BoardSize;
- DPRINTK("board_addr=%08lx\n", board_addr);
- DPRINTK("board_size=%08lx\n", board_size);
-
- CyberBase = ioremap(board_addr, board_size);
- CyberRegs = CyberBase + 0x02000000;
- CyberMem = CyberBase + 0x01400000;
- DPRINTK("CyberBase=%08lx CyberRegs=%08lx CyberMem=%08lx\n",
- CyberBase, (long unsigned int)CyberRegs, CyberMem);
-
- CyberMem_phys = board_addr + 0x01400000;
- CyberRegs_phys = CyberMem_phys + 0x00c00000;
- DPRINTK("CyberMem=%08lx CyberRegs=%08lx\n", CyberMem,
- (long unsigned int)CyberRegs);
+ while ((z = zorro_find_device(ZORRO_PROD_PHASE5_CYBERVISION64, z))) {
+ board_addr = z->resource.start;
+ board_size = z->resource.end-z->resource.start+1;
+ CyberMem_phys = board_addr + 0x01400000;
+ CyberRegs_phys = CyberMem_phys + 0x00c00000;
+ if (!request_mem_region(CyberRegs_phys, 0x10000, "S3 Trio64"))
+ continue;
+ if (!request_mem_region(CyberMem_phys, 0x4000000, "RAM")) {
+ release_mem_region(CyberRegs_phys, 0x10000);
+ continue;
+ }
+ strcpy(z->name, "CyberVision64 Graphics Board");
+ DPRINTK("board_addr=%08lx\n", board_addr);
+ DPRINTK("board_size=%08lx\n", board_size);
+
+ CyberBase = ioremap(board_addr, board_size);
+ CyberRegs = CyberBase + 0x02000000;
+ CyberMem = CyberBase + 0x01400000;
+ DPRINTK("CyberBase=%08lx CyberRegs=%08lx CyberMem=%08lx\n",
+ CyberBase, (long unsigned int)CyberRegs, CyberMem);
#ifdef CYBERFBDEBUG
- DPRINTK("Register state just after mapping memory\n");
- cv64_dump();
+ DPRINTK("Register state just after mapping memory\n");
+ cv64_dump();
#endif
- strcpy(fb_info.modename, cyberfb_name);
- fb_info.changevar = NULL;
- fb_info.node = -1;
- fb_info.fbops = &cyberfb_ops;
- fb_info.disp = &disp;
- fb_info.switch_con = &Cyberfb_switch;
- fb_info.updatevar = &Cyberfb_updatevar;
- fb_info.blank = &Cyberfb_blank;
-
- Cyber_init();
- /* ++Andre: set cyberfb default mode */
- if (!cyberfb_usermode) {
- cyberfb_default = cyberfb_predefined[CYBER8_DEFMODE].var;
- DPRINTK("Use default cyber8 mode\n");
+ strcpy(fb_info.modename, cyberfb_name);
+ fb_info.changevar = NULL;
+ fb_info.node = -1;
+ fb_info.fbops = &cyberfb_ops;
+ fb_info.disp = &disp;
+ fb_info.switch_con = &Cyberfb_switch;
+ fb_info.updatevar = &Cyberfb_updatevar;
+ fb_info.blank = &Cyberfb_blank;
+
+ Cyber_init();
+ /* ++Andre: set cyberfb default mode */
+ if (!cyberfb_usermode) {
+ cyberfb_default = cyberfb_predefined[CYBER8_DEFMODE].var;
+ DPRINTK("Use default cyber8 mode\n");
+ }
+ Cyber_decode_var(&cyberfb_default, &par);
+ Cyber_encode_var(&cyberfb_default, &par);
+
+ do_fb_set_var(&cyberfb_default, 1);
+ cyberfb_get_var(&fb_display[0].var, -1, &fb_info);
+ cyberfb_set_disp(-1, &fb_info);
+ do_install_cmap(0, &fb_info);
+
+ if (register_framebuffer(&fb_info) < 0) {
+ DPRINTK("EXIT - register_framebuffer failed\n");
+ release_mem_region(board_addr, board_size);
+ return -EINVAL;
+ }
+
+ printk("fb%d: %s frame buffer device, using %ldK of video memory\n",
+ GET_FB_IDX(fb_info.node), fb_info.modename, CyberSize>>10);
+
+ /* TODO: This driver cannot be unloaded yet */
+ MOD_INC_USE_COUNT;
+ DPRINTK("EXIT\n");
+ return 0;
}
- Cyber_decode_var(&cyberfb_default, &par);
- Cyber_encode_var(&cyberfb_default, &par);
-
- do_fb_set_var(&cyberfb_default, 1);
- cyberfb_get_var(&fb_display[0].var, -1, &fb_info);
- cyberfb_set_disp(-1, &fb_info);
- do_install_cmap(0, &fb_info);
-
- if (register_framebuffer(&fb_info) < 0) {
- DPRINTK("EXIT - register_framebuffer failed\n");
- return -EINVAL;
- }
-
- printk("fb%d: %s frame buffer device, using %ldK of video memory\n",
- GET_FB_IDX(fb_info.node), fb_info.modename, CyberSize>>10);
-
- /* TODO: This driver cannot be unloaded yet */
- MOD_INC_USE_COUNT;
- DPRINTK("EXIT\n");
- return 0;
+ return -ENXIO;
}
diff --git a/drivers/video/fbcon.c b/drivers/video/fbcon.c
index a78843085..02f50a497 100644
--- a/drivers/video/fbcon.c
+++ b/drivers/video/fbcon.c
@@ -237,7 +237,7 @@ static void cursor_timer_handler(unsigned long dev_addr)
fbcon_vbl_handler(0, NULL, NULL);
cursor_timer.expires = jiffies+HZ/50;
cursor_timer.data = 0;
- cursor_timer.next = cursor_timer.next = NULL;
+ cursor_timer.next = cursor_timer.prev = NULL;
add_timer(&cursor_timer);
}
diff --git a/drivers/video/fbgen.c b/drivers/video/fbgen.c
index 7cf44a5ec..4be9b41d8 100644
--- a/drivers/video/fbgen.c
+++ b/drivers/video/fbgen.c
@@ -4,7 +4,7 @@
* Created 3 Jan 1998 by Geert Uytterhoeven
*
* This file is subject to the terms and conditions of the GNU General Public
- * License. See the file README.legal in the main directory of this archive
+ * License. See the file COPYING in the main directory of this archive
* for more details.
*/
diff --git a/drivers/video/fbmem.c b/drivers/video/fbmem.c
index f6ca52705..6e409ddb4 100644
--- a/drivers/video/fbmem.c
+++ b/drivers/video/fbmem.c
@@ -432,8 +432,7 @@ fb_mmap(struct file *file, struct vm_area_struct * vma)
/* frame buffer memory */
start = fix.smem_start;
- len = (start & ~PAGE_MASK)+fix.smem_len;
- len = (len+~PAGE_MASK) & PAGE_MASK; /* someone's on crack. */
+ len = PAGE_ALIGN((start & ~PAGE_MASK)+fix.smem_len);
if (off >= len) {
/* memory mapped io */
off -= len;
@@ -441,8 +440,7 @@ fb_mmap(struct file *file, struct vm_area_struct * vma)
if (var.accel_flags)
return -EINVAL;
start = fix.mmio_start;
- len = (start & ~PAGE_MASK)+fix.mmio_len;
- len = (len+~PAGE_MASK) & PAGE_MASK;
+ len = PAGE_ALIGN((start & ~PAGE_MASK)+fix.mmio_len);
}
start &= PAGE_MASK;
if ((vma->vm_end - vma->vm_start + off) > len)
diff --git a/drivers/video/fm2fb.c b/drivers/video/fm2fb.c
index 97f4e9ba8..9a7690d34 100644
--- a/drivers/video/fm2fb.c
+++ b/drivers/video/fm2fb.c
@@ -376,95 +376,99 @@ static int fm2fb_ioctl(struct inode *inode, struct file *file, u_int cmd,
int __init fm2fb_init(void)
{
- int key, is_fm;
- const struct ConfigDev *cd = NULL;
- unsigned long board, *ptr;
+ int is_fm;
+ struct zorro_dev *z = NULL;
+ unsigned long *ptr;
int x, y;
- if (!(key = is_fm = zorro_find(ZORRO_PROD_BSC_FRAMEMASTER_II, 0, 0)) &&
- !(key = zorro_find(ZORRO_PROD_HELFRICH_RAINBOW_II, 0, 0)))
- return -ENXIO;
- cd = zorro_get_board(key);
- if (!(board = (u_long)cd->cd_BoardAddr))
- return -ENXIO;
- zorro_config_board(key, 0);
-
- /* assigning memory to kernel space */
- fm2fb_mem_phys = board;
- fm2fb_mem = ioremap(board, FRAMEMASTER_SIZE);
- fm2fb_reg_phys = fm2fb_mem_phys+FRAMEMASTER_REG;
- fm2fb_reg = (unsigned char *)(fm2fb_mem+FRAMEMASTER_REG);
-
- /* make EBU color bars on display */
- ptr = (unsigned long *)fm2fb_mem;
- for (y = 0; y < 576; y++) {
- for (x = 0; x < 96; x++) *ptr++ = 0xffffff; /* white */
- for (x = 0; x < 96; x++) *ptr++ = 0xffff00; /* yellow */
- for (x = 0; x < 96; x++) *ptr++ = 0x00ffff; /* cyan */
- for (x = 0; x < 96; x++) *ptr++ = 0x00ff00; /* green */
- for (x = 0; x < 96; x++) *ptr++ = 0xff00ff; /* magenta */
- for (x = 0; x < 96; x++) *ptr++ = 0xff0000; /* red */
- for (x = 0; x < 96; x++) *ptr++ = 0x0000ff; /* blue */
- for (x = 0; x < 96; x++) *ptr++ = 0x000000; /* black */
- }
- fm2fbcon_blank(0, NULL);
-
- if (fm2fb_mode == -1)
- fm2fb_mode = FM2FB_MODE_PAL;
-
- fb_var = fb_var_modes[fm2fb_mode];
-
- strcpy(fb_fix.id, is_fm ? "FrameMaster II" : "Rainbow II");
- fb_fix.smem_start = fm2fb_mem_phys;
- fb_fix.smem_len = FRAMEMASTER_REG;
- fb_fix.type = FB_TYPE_PACKED_PIXELS;
- fb_fix.type_aux = 0;
- fb_fix.visual = FB_VISUAL_TRUECOLOR;
- fb_fix.line_length = 768<<2;
- fb_fix.mmio_start = fm2fb_reg_phys;
- fb_fix.mmio_len = 8;
- fb_fix.accel = FB_ACCEL_NONE;
-
- disp.var = fb_var;
- disp.cmap.start = 0;
- disp.cmap.len = 0;
- disp.cmap.red = disp.cmap.green = disp.cmap.blue = disp.cmap.transp = NULL;
- disp.screen_base = (char *)fm2fb_mem;
- disp.visual = fb_fix.visual;
- disp.type = fb_fix.type;
- disp.type_aux = fb_fix.type_aux;
- disp.ypanstep = 0;
- disp.ywrapstep = 0;
- disp.line_length = fb_fix.line_length;
- disp.can_soft_blank = 1;
- disp.inverse = 0;
-#ifdef FBCON_HAS_CFB32
- disp.dispsw = &fbcon_cfb32;
- disp.dispsw_data = &fbcon_cfb32_cmap;
-#else
- disp.dispsw = &fbcon_dummy;
-#endif
- disp.scrollmode = SCROLL_YREDRAW;
-
- strcpy(fb_info.modename, fb_fix.id);
- fb_info.node = -1;
- fb_info.fbops = &fm2fb_ops;
- fb_info.disp = &disp;
- fb_info.fontname[0] = '\0';
- fb_info.changevar = NULL;
- fb_info.switch_con = &fm2fbcon_switch;
- fb_info.updatevar = &fm2fbcon_updatevar;
- fb_info.blank = &fm2fbcon_blank;
- fb_info.flags = FBINFO_FLAG_DEFAULT;
-
- fm2fb_set_var(&fb_var, -1, &fb_info);
-
- if (register_framebuffer(&fb_info) < 0)
- return -EINVAL;
+ while ((z = zorro_find_device(ZORRO_WILDCARD, z))) {
+ if (z->id == ZORRO_PROD_BSC_FRAMEMASTER_II)
+ is_fm = 1;
+ else if (z->id == ZORRO_PROD_HELFRICH_RAINBOW_II)
+ is_fm = 0;
+ else
+ continue;
+ if (!request_mem_region(z->resource.start, FRAMEMASTER_SIZE, "fm2fb"))
+ continue;
+
+ /* assigning memory to kernel space */
+ fm2fb_mem_phys = z->resource.start;
+ fm2fb_mem = ioremap(fm2fb_mem_phys, FRAMEMASTER_SIZE);
+ fm2fb_reg_phys = fm2fb_mem_phys+FRAMEMASTER_REG;
+ fm2fb_reg = (unsigned char *)(fm2fb_mem+FRAMEMASTER_REG);
+
+ /* make EBU color bars on display */
+ ptr = (unsigned long *)fm2fb_mem;
+ for (y = 0; y < 576; y++) {
+ for (x = 0; x < 96; x++) *ptr++ = 0xffffff; /* white */
+ for (x = 0; x < 96; x++) *ptr++ = 0xffff00; /* yellow */
+ for (x = 0; x < 96; x++) *ptr++ = 0x00ffff; /* cyan */
+ for (x = 0; x < 96; x++) *ptr++ = 0x00ff00; /* green */
+ for (x = 0; x < 96; x++) *ptr++ = 0xff00ff; /* magenta */
+ for (x = 0; x < 96; x++) *ptr++ = 0xff0000; /* red */
+ for (x = 0; x < 96; x++) *ptr++ = 0x0000ff; /* blue */
+ for (x = 0; x < 96; x++) *ptr++ = 0x000000; /* black */
+ }
+ fm2fbcon_blank(0, NULL);
+
+ if (fm2fb_mode == -1)
+ fm2fb_mode = FM2FB_MODE_PAL;
- printk("fb%d: %s frame buffer device\n", GET_FB_IDX(fb_info.node),
- fb_fix.id);
- return 0;
+ fb_var = fb_var_modes[fm2fb_mode];
+
+ strcpy(fb_fix.id, is_fm ? "FrameMaster II" : "Rainbow II");
+ fb_fix.smem_start = fm2fb_mem_phys;
+ fb_fix.smem_len = FRAMEMASTER_REG;
+ fb_fix.type = FB_TYPE_PACKED_PIXELS;
+ fb_fix.type_aux = 0;
+ fb_fix.visual = FB_VISUAL_TRUECOLOR;
+ fb_fix.line_length = 768<<2;
+ fb_fix.mmio_start = fm2fb_reg_phys;
+ fb_fix.mmio_len = 8;
+ fb_fix.accel = FB_ACCEL_NONE;
+
+ disp.var = fb_var;
+ disp.cmap.start = 0;
+ disp.cmap.len = 0;
+ disp.cmap.red = disp.cmap.green = disp.cmap.blue = disp.cmap.transp = NULL;
+ disp.screen_base = (char *)fm2fb_mem;
+ disp.visual = fb_fix.visual;
+ disp.type = fb_fix.type;
+ disp.type_aux = fb_fix.type_aux;
+ disp.ypanstep = 0;
+ disp.ywrapstep = 0;
+ disp.line_length = fb_fix.line_length;
+ disp.can_soft_blank = 1;
+ disp.inverse = 0;
+ #ifdef FBCON_HAS_CFB32
+ disp.dispsw = &fbcon_cfb32;
+ disp.dispsw_data = &fbcon_cfb32_cmap;
+ #else
+ disp.dispsw = &fbcon_dummy;
+ #endif
+ disp.scrollmode = SCROLL_YREDRAW;
+
+ strcpy(fb_info.modename, fb_fix.id);
+ fb_info.node = -1;
+ fb_info.fbops = &fm2fb_ops;
+ fb_info.disp = &disp;
+ fb_info.fontname[0] = '\0';
+ fb_info.changevar = NULL;
+ fb_info.switch_con = &fm2fbcon_switch;
+ fb_info.updatevar = &fm2fbcon_updatevar;
+ fb_info.blank = &fm2fbcon_blank;
+ fb_info.flags = FBINFO_FLAG_DEFAULT;
+
+ fm2fb_set_var(&fb_var, -1, &fb_info);
+
+ if (register_framebuffer(&fb_info) < 0)
+ return -EINVAL;
+
+ printk("fb%d: %s frame buffer device\n", GET_FB_IDX(fb_info.node),
+ fb_fix.id);
+ return 0;
+ }
+ return -ENXIO;
}
int __init fm2fb_setup(char *options)
diff --git a/drivers/video/igafb.c b/drivers/video/igafb.c
index 490ad605d..e871b6a0c 100644
--- a/drivers/video/igafb.c
+++ b/drivers/video/igafb.c
@@ -623,7 +623,6 @@ static int __init iga_init(struct fb_info_iga *info)
return 1;
}
-
int __init igafb_init(void)
{
struct pci_dev *pdev;
@@ -643,10 +642,10 @@ int __init igafb_init(void)
* XXX We tried to use cyber2000fb.c for IGS 2000.
* But it does not initialize the chip in JavaStation-E, alas.
*/
- pdev = pci_find_device(PCI_VENDOR_ID_INTERG,
- 0x2000, 0);
- if(pdev == NULL)
+ pdev = pci_find_device(PCI_VENDOR_ID_INTERG, 0x2000, 0);
+ if(pdev == NULL) {
return -ENXIO;
+ }
iga2000 = 1;
}
@@ -657,15 +656,18 @@ int __init igafb_init(void)
}
memset(info, 0, sizeof(struct fb_info_iga));
- info->frame_buffer = ioremap(pdev->resource[0].start, 1024*1024*2);
- if (!info->frame_buffer) {
+ if ((addr = pdev->resource[0].start) == 0) {
+ printk("igafb_init: no memory start\n", addr);
kfree(info);
return -ENXIO;
}
- addr = pdev->resource[0].start;
- if (!addr)
+ if ((info->frame_buffer = ioremap(addr, 1024*1024*2)) == 0) {
+ printk("igafb_init: can't remap %lx[2M]\n", addr);
+ kfree(info);
return -ENXIO;
+ }
+
info->frame_buffer_phys = addr & PCI_BASE_ADDRESS_MEM_MASK;
#ifdef __sparc__
@@ -693,8 +695,9 @@ int __init igafb_init(void)
} else {
info->io_base_phys = 0x30000000; /* XXX */
}
- info->io_base = (int) ioremap(info->io_base_phys, 0x1000);
- if (!info->io_base) {
+ if ((info->io_base = (int) ioremap(info->io_base_phys, 0x1000)) == 0) {
+ printk("igafb_init: can't remap %lx[4K]\n", info->io_base_phys);
+ iounmap(info->frame_buffer);
kfree(info);
return -ENXIO;
}
@@ -709,8 +712,9 @@ int __init igafb_init(void)
info->mmap_map = kmalloc(4 * sizeof(*info->mmap_map), GFP_ATOMIC);
if (!info->mmap_map) {
- printk("igafb_init: can't alloc mmap_map\n");
- /* XXX Here we left I/O allocated */
+ printk("igafb_init: can't alloc mmap_map\n");
+ iounmap(info->io_base);
+ iounmap(info->frame_buffer);
kfree(info);
return -ENOMEM;
}
@@ -763,7 +767,9 @@ int __init igafb_init(void)
#endif
- if (!iga_init(info)) {
+ if (!iga_init(info)) {
+ iounmap(info->io_base);
+ iounmap(info->frame_buffer);
if (info->mmap_map)
kfree(info->mmap_map);
kfree(info);
diff --git a/drivers/video/offb.c b/drivers/video/offb.c
index 61ca90517..edeeae447 100644
--- a/drivers/video/offb.c
+++ b/drivers/video/offb.c
@@ -470,8 +470,7 @@ static int __init offb_init_driver(struct device_node *dp)
}
#endif /* CONFIG_FB_PLATINUM */
#ifdef CONFIG_FB_CLGEN
- if ((!strncmp(dp->name, "MacPicasso",10) ||
- (!strncmp(dp->name, "54m30",5)) {
+ if (!strncmp(dp->name, "MacPicasso",10) || !strncmp(dp->name, "54m30",5)) {
clgen_of_init(dp);
return 1;
}
diff --git a/drivers/video/platinumfb.h b/drivers/video/platinumfb.h
index d3aa5c3ef..2834fc1c3 100644
--- a/drivers/video/platinumfb.h
+++ b/drivers/video/platinumfb.h
@@ -15,7 +15,7 @@
* Created 28 Dec 1997 by Geert Uytterhoeven
*
* This file is subject to the terms and conditions of the GNU General Public
- * License. See the file README.legal in the main directory of this archive
+ * License. See the file COPYING in the main directory of this archive
* for more details.
*/
diff --git a/drivers/video/pm2fb.c b/drivers/video/pm2fb.c
index e3446858d..1619edaf9 100644
--- a/drivers/video/pm2fb.c
+++ b/drivers/video/pm2fb.c
@@ -9,7 +9,7 @@
* TODO multiple boards support
* --------------------------------------------------------------------------
* This file is subject to the terms and conditions of the GNU General Public
- * License. See the file README.legal in the main directory of this archive
+ * License. See the file COPYING in the main directory of this archive
* for more details.
*/
diff --git a/drivers/video/pm2fb.h b/drivers/video/pm2fb.h
index b3ebc5ce7..995e1990a 100644
--- a/drivers/video/pm2fb.h
+++ b/drivers/video/pm2fb.h
@@ -5,7 +5,7 @@
* $Id: pm2fb.h,v 1.21 1999/01/28 13:18:07 illo Exp $
* --------------------------------------------------------------------------
* This file is subject to the terms and conditions of the GNU General Public
- * License. See the file README.legal in the main directory of this archive
+ * License. See the file COPYING in the main directory of this archive
* for more details.
*/
diff --git a/drivers/video/retz3fb.c b/drivers/video/retz3fb.c
index dbc6eb022..caa37b185 100644
--- a/drivers/video/retz3fb.c
+++ b/drivers/video/retz3fb.c
@@ -1423,85 +1423,93 @@ int __init retz3fb_setup(char *options)
int __init retz3fb_init(void)
{
unsigned long board_addr, board_size;
- unsigned int key;
- const struct ConfigDev *cd;
+ struct zorro_dev *z = NULL;
volatile unsigned char *regs;
struct retz3fb_par par;
struct retz3_fb_info *zinfo;
struct fb_info *fb_info;
short i;
+ int res = -ENXIO;
+
+ while ((z = zorro_find_device(ZORRO_PROD_MACROSYSTEMS_RETINA_Z3, z))) {
+ board_addr = z->resource.start;
+ board_size = z->resource.end-z->resource.start+1;
+ if (!request_mem_region(board_addr, 0x0c00000,
+ "ncr77c32blt")) {
+ continue;
+ if (!request_mem_region(board_addr+VIDEO_MEM_OFFSET,
+ 0x00400000, "RAM"))
+ release_mem_region(board_addr, 0x00c00000);
+ continue;
+ }
+ strcpy(z->name, "Retina Z3 Graphics ");
+ if (!(zinfo = kmalloc(sizeof(struct retz3_fb_info),
+ GFP_KERNEL)))
+ return -ENOMEM;
+ memset(zinfo, 0, sizeof(struct retz3_fb_info));
+
+ zinfo->base = ioremap(board_addr, board_size);
+ zinfo->regs = zinfo->base;
+ zinfo->fbmem = zinfo->base + VIDEO_MEM_OFFSET;
+ /* Get memory size - for now we asume its a 4MB board */
+ zinfo->fbsize = 0x00400000; /* 4 MB */
+ zinfo->physregs = board_addr;
+ zinfo->physfbmem = board_addr + VIDEO_MEM_OFFSET;
+
+ fb_info = fbinfo(zinfo);
- if (!(key = zorro_find(ZORRO_PROD_MACROSYSTEMS_RETINA_Z3, 0, 0)))
- return -ENXIO;
-
- if (!(zinfo = kmalloc(sizeof(struct retz3_fb_info), GFP_KERNEL)))
- return -ENOMEM;
- memset(zinfo, 0, sizeof(struct retz3_fb_info));
-
- cd = zorro_get_board (key);
- zorro_config_board (key, 0);
- board_addr = (unsigned long)cd->cd_BoardAddr;
- board_size = (unsigned long)cd->cd_BoardSize;
-
- zinfo->base = ioremap(board_addr, board_size);
- zinfo->regs = zinfo->base;
- zinfo->fbmem = zinfo->base + VIDEO_MEM_OFFSET;
- /* Get memory size - for now we asume its a 4MB board */
- zinfo->fbsize = 0x00400000; /* 4 MB */
- zinfo->physregs = board_addr;
- zinfo->physfbmem = board_addr + VIDEO_MEM_OFFSET;
-
- fb_info = fbinfo(zinfo);
-
- for (i = 0; i < 256; i++){
for (i = 0; i < 256; i++){
- zinfo->color_table[i][0] = i;
- zinfo->color_table[i][1] = i;
- zinfo->color_table[i][2] = i;
+ for (i = 0; i < 256; i++){
+ zinfo->color_table[i][0] = i;
+ zinfo->color_table[i][1] = i;
+ zinfo->color_table[i][2] = i;
+ }
}
- }
- regs = zinfo->regs;
- /* Disable hardware cursor */
- seq_w(regs, SEQ_CURSOR_Y_INDEX, 0x00);
+ regs = zinfo->regs;
+ /* Disable hardware cursor */
+ seq_w(regs, SEQ_CURSOR_Y_INDEX, 0x00);
- retz3_setcolreg (255, 56<<8, 100<<8, 160<<8, 0, fb_info);
- retz3_setcolreg (254, 0, 0, 0, 0, fb_info);
+ retz3_setcolreg (255, 56<<8, 100<<8, 160<<8, 0, fb_info);
+ retz3_setcolreg (254, 0, 0, 0, 0, fb_info);
- strcpy(fb_info->modename, retz3fb_name);
- fb_info->changevar = NULL;
- fb_info->node = -1;
- fb_info->fbops = &retz3fb_ops;
- fb_info->disp = &zinfo->disp;
- fb_info->switch_con = &z3fb_switch;
- fb_info->updatevar = &z3fb_updatevar;
- fb_info->blank = &z3fb_blank;
- fb_info->flags = FBINFO_FLAG_DEFAULT;
- strncpy(fb_info->fontname, fontname, 40);
+ strcpy(fb_info->modename, retz3fb_name);
+ fb_info->changevar = NULL;
+ fb_info->node = -1;
+ fb_info->fbops = &retz3fb_ops;
+ fb_info->disp = &zinfo->disp;
+ fb_info->switch_con = &z3fb_switch;
+ fb_info->updatevar = &z3fb_updatevar;
+ fb_info->blank = &z3fb_blank;
+ fb_info->flags = FBINFO_FLAG_DEFAULT;
+ strncpy(fb_info->fontname, fontname, 40);
- if (z3fb_mode == -1)
- retz3fb_default = retz3fb_predefined[0].var;
+ if (z3fb_mode == -1)
+ retz3fb_default = retz3fb_predefined[0].var;
- retz3_decode_var(&retz3fb_default, &par);
- retz3_encode_var(&retz3fb_default, &par);
+ retz3_decode_var(&retz3fb_default, &par);
+ retz3_encode_var(&retz3fb_default, &par);
- do_fb_set_var(fb_info, &retz3fb_default, 0);
- retz3fb_get_var(&zinfo->disp.var, -1, fb_info);
+ do_fb_set_var(fb_info, &retz3fb_default, 0);
+ retz3fb_get_var(&zinfo->disp.var, -1, fb_info);
- retz3fb_set_disp(-1, fb_info);
+ retz3fb_set_disp(-1, fb_info);
- do_install_cmap(0, fb_info);
+ do_install_cmap(0, fb_info);
- if (register_framebuffer(fb_info) < 0)
- return -EINVAL;
+ if (register_framebuffer(fb_info) < 0)
+ return -EINVAL;
- printk(KERN_INFO "fb%d: %s frame buffer device, using %ldK of video memory\n",
- GET_FB_IDX(fb_info->node), fb_info->modename,zinfo->fbsize>>10);
+ printk(KERN_INFO "fb%d: %s frame buffer device, using %ldK of "
+ "video memory\n", GET_FB_IDX(fb_info->node),
+ fb_info->modename, zinfo->fbsize>>10);
- /* TODO: This driver cannot be unloaded yet */
- MOD_INC_USE_COUNT;
+ /* TODO: This driver cannot be unloaded yet */
+ MOD_INC_USE_COUNT;
- return 0;
+ res = 0;
+ }
+ return res;
}
diff --git a/drivers/video/rivafb.c b/drivers/video/rivafb.c
index 0830468f9..c48f7a08a 100644
--- a/drivers/video/rivafb.c
+++ b/drivers/video/rivafb.c
@@ -13,7 +13,7 @@
* KGI code provided the basis for state storage, init, and mode switching.
*
* This file is subject to the terms and conditions of the GNU General Public
- * License. See the file README.legal in the main directory of this archive
+ * License. See the file COPYING in the main directory of this archive
* for more details.
*/
diff --git a/drivers/video/skeletonfb.c b/drivers/video/skeletonfb.c
index 2eb7962f8..207ccaa39 100644
--- a/drivers/video/skeletonfb.c
+++ b/drivers/video/skeletonfb.c
@@ -4,7 +4,7 @@
* Created 28 Dec 1997 by Geert Uytterhoeven
*
* This file is subject to the terms and conditions of the GNU General Public
- * License. See the file README.legal in the main directory of this archive
+ * License. See the file COPYING in the main directory of this archive
* for more details.
*/
@@ -287,7 +287,8 @@ static void xxx_set_disp(const void *par, struct display *disp,
struct fbgen_hwswitch xxx_switch = {
xxx_detect, xxx_encode_fix, xxx_decode_var, xxx_encode_var, xxx_get_par,
- xxx_set_par, xxx_getcolreg, xxx_setcolreg, xxx_blank, xxx_dispsw
+ xxx_set_par, xxx_getcolreg, xxx_setcolreg, xxx_pan_display, xxx_blank,
+ xxx_set_disp
};
diff --git a/drivers/video/virgefb.c b/drivers/video/virgefb.c
index 050d34543..b4a123cd9 100644
--- a/drivers/video/virgefb.c
+++ b/drivers/video/virgefb.c
@@ -167,7 +167,6 @@ static char virgefb_name[16] = "Cybervision/3D";
#define VIRGE16_PIXCLOCK 25000 /* ++Geert: Just a guess */
-static unsigned int CyberKey = 0;
static unsigned char Cyber_colour_table [256][3];
static unsigned long CyberMem;
static unsigned long CyberSize;
@@ -1166,28 +1165,39 @@ int __init virgefb_setup(char *options)
int __init virgefb_init(void)
{
struct virgefb_par par;
- unsigned long board_addr;
- const struct ConfigDev *cd;
+ unsigned long board_addr, ramsize;
+ struct zorro_dev *z = NULL;
- if (!(CyberKey = zorro_find(ZORRO_PROD_PHASE5_CYBERVISION64_3D, 0, 0)))
- return -ENXIO;
-
- cd = zorro_get_board (CyberKey);
- zorro_config_board (CyberKey, 0);
- board_addr = (unsigned long)cd->cd_BoardAddr;
-
- /* This includes the video memory as well as the S3 register set */
- if ((unsigned long)cd->cd_BoardAddr < 0x01000000)
- {
+ while ((z = zorro_find_device(ZORRO_PROD_PHASE5_CYBERVISION64_3D, z))) {
+ board_addr = z->resource.start;
+ if (board_addr < 0x01000000) {
+ /*
+ * Ok we got the board running in Z2 space.
+ */
+ CyberRegs_phys = (unsigned long)(board_addr + 0x003e0000);
+ CyberMem_phys = board_addr;
+ ramsize = 0x00380000;
+ } else {
+ CyberRegs_phys = board_addr + 0x05000000;
+ CyberMem_phys = board_addr + 0x04000000; /* was 0x04800000 */
+ ramsize = 0x00400000;
+ }
+ if (!request_mem_region(CyberRegs_phys, 0x10000, "S3 ViRGE"))
+ continue;
+ if (!request_mem_region(CyberMem_phys, ramsize, "RAM")) {
+ release_mem_region(CyberRegs_phys, 0x10000);
+ continue;
+ }
+ strcpy(z->name, "CyberVision64-3D Graphics Board");
+
+ if (board_addr < 0x01000000) {
/*
* Ok we got the board running in Z2 space.
*/
- CyberMem_phys = board_addr;
CyberMem = ZTWO_VADDR(CyberMem_phys);
CyberVGARegs = (unsigned long) \
ZTWO_VADDR(board_addr + 0x003c0000);
- CyberRegs_phys = (unsigned long)(board_addr + 0x003e0000);
CyberRegs = (unsigned char *)ZTWO_VADDR(CyberRegs_phys);
Cyber_register_base = (unsigned long) \
ZTWO_VADDR(board_addr + 0x003c8000);
@@ -1195,50 +1205,49 @@ int __init virgefb_init(void)
ZTWO_VADDR(board_addr + 0x003a0000);
cv3d_on_zorro2 = 1;
printk(KERN_INFO "CV3D detected running in Z2 mode.\n");
- }
- else
- {
- CyberVGARegs = (unsigned long)ioremap(board_addr +0x0c000000, 0x00010000);
- CyberRegs_phys = board_addr + 0x05000000;
- CyberMem_phys = board_addr + 0x04000000; /* was 0x04800000 */
+ } else {
+ CyberVGARegs = (unsigned long)ioremap(board_addr+0x0c000000, 0x00010000);
CyberRegs = ioremap(CyberRegs_phys, 0x00010000);
CyberMem = (unsigned long)ioremap(CyberMem_phys, 0x01000000); /* was 0x00400000 */
cv3d_on_zorro2 = 0;
printk(KERN_INFO "CV3D detected running in Z3 mode.\n");
- }
-
- fbhw = &Cyber_switch;
-
- strcpy(fb_info.modename, virgefb_name);
- fb_info.changevar = NULL;
- fb_info.node = -1;
- fb_info.fbops = &virgefb_ops;
- fb_info.disp = &disp;
- fb_info.switch_con = &Cyberfb_switch;
- fb_info.updatevar = &Cyberfb_updatevar;
- fb_info.blank = &Cyberfb_blank;
- fb_info.flags = FBINFO_FLAG_DEFAULT;
-
- fbhw->init();
- fbhw->decode_var(&virgefb_default, &par);
- fbhw->encode_var(&virgefb_default, &par);
-
- do_fb_set_var(&virgefb_default, 1);
- virgefb_get_var(&fb_display[0].var, -1, &fb_info);
- virgefb_set_disp(-1, &fb_info);
- do_install_cmap(0, &fb_info);
-
- if (register_framebuffer(&fb_info) < 0) {
+ }
+
+ fbhw = &Cyber_switch;
+
+ strcpy(fb_info.modename, virgefb_name);
+ fb_info.changevar = NULL;
+ fb_info.node = -1;
+ fb_info.fbops = &virgefb_ops;
+ fb_info.disp = &disp;
+ fb_info.switch_con = &Cyberfb_switch;
+ fb_info.updatevar = &Cyberfb_updatevar;
+ fb_info.blank = &Cyberfb_blank;
+ fb_info.flags = FBINFO_FLAG_DEFAULT;
+
+ fbhw->init();
+ fbhw->decode_var(&virgefb_default, &par);
+ fbhw->encode_var(&virgefb_default, &par);
+
+ do_fb_set_var(&virgefb_default, 1);
+ virgefb_get_var(&fb_display[0].var, -1, &fb_info);
+ virgefb_set_disp(-1, &fb_info);
+ do_install_cmap(0, &fb_info);
+
+ if (register_framebuffer(&fb_info) < 0) {
printk(KERN_ERR "virgefb.c: register_framebuffer failed\n");
return -EINVAL;
- }
+ }
- printk(KERN_INFO "fb%d: %s frame buffer device, using %ldK of video memory\n",
- GET_FB_IDX(fb_info.node), fb_info.modename, CyberSize>>10);
+ printk(KERN_INFO "fb%d: %s frame buffer device, using %ldK of "
+ "video memory\n", GET_FB_IDX(fb_info.node),
+ fb_info.modename, CyberSize>>10);
- /* TODO: This driver cannot be unloaded yet */
- MOD_INC_USE_COUNT;
- return 0;
+ /* TODO: This driver cannot be unloaded yet */
+ MOD_INC_USE_COUNT;
+ return 0;
+ }
+ return -ENODEV;
}