summaryrefslogtreecommitdiffstats
path: root/drivers/video
diff options
context:
space:
mode:
authorRalf Baechle <ralf@linux-mips.org>2000-03-27 23:54:12 +0000
committerRalf Baechle <ralf@linux-mips.org>2000-03-27 23:54:12 +0000
commitd3e71cb08747743fce908122bab08b479eb403a5 (patch)
treecbec6948fdbdee9af81cf3ecfb504070d2745d7b /drivers/video
parentfe7ff1706e323d0e5ed83972960a1ecc1ee538b3 (diff)
Merge with Linux 2.3.99-pre3.
Diffstat (limited to 'drivers/video')
-rw-r--r--drivers/video/Makefile8
-rw-r--r--drivers/video/amifb.c26
-rw-r--r--drivers/video/cgthreefb.c10
-rw-r--r--drivers/video/macmodes.c121
-rw-r--r--drivers/video/modedb.c15
-rw-r--r--drivers/video/offb.c109
-rw-r--r--drivers/video/riva/fbdev.c2
7 files changed, 140 insertions, 151 deletions
diff --git a/drivers/video/Makefile b/drivers/video/Makefile
index 12918c1b5..49125330f 100644
--- a/drivers/video/Makefile
+++ b/drivers/video/Makefile
@@ -16,7 +16,8 @@ M_OBJS :=
# All of the (potential) objects that export symbols.
# This list comes from 'grep -l EXPORT_SYMBOL *.[hc]'.
-export-objs := fbmem.o fbcmap.o fbcon.o fbmon.o fbcon-afb.o fbcon-ilbm.o \
+export-objs := fbmem.o fbcmap.o fbcon.o fbmon.o modedb.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 \
@@ -46,6 +47,7 @@ obj-$(CONFIG_FONT_PEARL_8x8) += font_pearl_8x8.o
obj-$(CONFIG_FONT_ACORN_8x8) += font_acorn_8x8.o
obj-$(CONFIG_FB) += fbmem.o fbcmap.o modedb.o fbcon.o fonts.o fbmon.o
+obj-$(CONFIG_FB_COMPAT_XPMAC) += macmodes.o
obj-$(CONFIG_FB_ACORN) += acornfb.o
obj-$(CONFIG_FB_AMIGA) += amifb.o
@@ -64,9 +66,9 @@ obj-$(CONFIG_FB_CYBER) += cyberfb.o
obj-$(CONFIG_FB_CYBER2000) += cyber2000fb.o
obj-$(CONFIG_FB_SGIVW) += sgivwfb.o
obj-$(CONFIG_FB_3DFX) += tdfxfb.o
-obj-$(CONFIG_FB_MAC) += macfb.o macmodes.o
+obj-$(CONFIG_FB_MAC) += macfb.o
obj-$(CONFIG_FB_HP300) += hpfb.o
-obj-$(CONFIG_FB_OF) += offb.o macmodes.o
+obj-$(CONFIG_FB_OF) += offb.o
obj-$(CONFIG_FB_IMSTT) += imsttfb.o
obj-$(CONFIG_FB_RETINAZ3) += retz3fb.o
obj-$(CONFIG_FB_CLGEN) += clgenfb.o fbgen.o
diff --git a/drivers/video/amifb.c b/drivers/video/amifb.c
index 97df72fd2..a0518c009 100644
--- a/drivers/video/amifb.c
+++ b/drivers/video/amifb.c
@@ -1765,37 +1765,11 @@ default_chipset:
fb_info.flags = FBINFO_FLAG_DEFAULT;
memset(&var, 0, sizeof(var));
-#ifdef MODULE
- var.xres = ami_modedb[defmode].xres;
- var.yres = ami_modedb[defmode].yres;
- var.xres_virtual = ami_modedb[defmode].xres;
- var.yres_virtual = ami_modedb[defmode].yres;
- var.xoffset = 0;
- var.yoffset = 0;
- var.bits_per_pixel = 4;
- var.activate |= FB_ACTIVATE_TEST;
- var.pixclock = ami_modedb[defmode].pixclock;
- var.left_margin = ami_modedb[defmode].left_margin;
- var.right_margin = ami_modedb[defmode].right_margin;
- var.upper_margin = ami_modedb[defmode].upper_margin;
- var.lower_margin = ami_modedb[defmode].lower_margin;
- var.hsync_len = ami_modedb[defmode].hsync_len;
- var.vsync_len = ami_modedb[defmode].vsync_len;
- var.sync = ami_modedb[defmode].sync;
- var.vmode = ami_modedb[defmode].vmode;
- err = fb_info.fbops->fb_set_var(&var, -1, &fb_info);
- var.activate &= ~FB_ACTIVATE_TEST;
- if (err) {
- err = -EINVAL;
- goto amifb_error;
- }
-#else
if (!fb_find_mode(&var, &fb_info, mode_option, ami_modedb,
NUM_TOTAL_MODES, &ami_modedb[defmode], 4)) {
err = -EINVAL;
goto amifb_error;
}
-#endif
round_down_bpp = 0;
chipptr = chipalloc(videomemorysize+
diff --git a/drivers/video/cgthreefb.c b/drivers/video/cgthreefb.c
index 5e4d45a9e..9cec20abf 100644
--- a/drivers/video/cgthreefb.c
+++ b/drivers/video/cgthreefb.c
@@ -1,4 +1,4 @@
-/* $Id: cgthreefb.c,v 1.8 1999/11/19 09:57:08 davem Exp $
+/* $Id: cgthreefb.c,v 1.9 2000/03/19 04:20:44 anton Exp $
* cgthreefb.c: CGthree frame buffer driver
*
* Copyright (C) 1996,1998 Jakub Jelinek (jj@ultra.linux.cz)
@@ -114,9 +114,9 @@ static void cg3_blank (struct fb_info_sbusfb *fb)
u8 tmp;
spin_lock_irqsave(&fb->lock, flags);
- tmp = sbus_readl(&fb->s.cg3.regs->control);
+ tmp = sbus_readb(&fb->s.cg3.regs->control);
tmp &= ~CG3_CR_ENABLE_VIDEO;
- sbus_writel(tmp, &fb->s.cg3.regs->control);
+ sbus_writeb(tmp, &fb->s.cg3.regs->control);
spin_unlock_irqrestore(&fb->lock, flags);
}
@@ -126,9 +126,9 @@ static void cg3_unblank (struct fb_info_sbusfb *fb)
u8 tmp;
spin_lock_irqsave(&fb->lock, flags);
- tmp = sbus_readl(&fb->s.cg3.regs->control);
+ tmp = sbus_readb(&fb->s.cg3.regs->control);
tmp |= CG3_CR_ENABLE_VIDEO;
- sbus_writel(tmp, &fb->s.cg3.regs->control);
+ sbus_writeb(tmp, &fb->s.cg3.regs->control);
spin_unlock_irqrestore(&fb->lock, flags);
}
diff --git a/drivers/video/macmodes.c b/drivers/video/macmodes.c
index e71f36e50..98bcf32d8 100644
--- a/drivers/video/macmodes.c
+++ b/drivers/video/macmodes.c
@@ -3,15 +3,22 @@
*
* Copyright (C) 1998 Geert Uytterhoeven
*
+ * 2000 - Removal of OpenFirmware dependencies by:
+ * - Ani Joshi
+ * - Brad Douglas <brad@neruo.com>
+ *
* This file is subject to the terms and conditions of the GNU General Public
* License. See the file COPYING in the main directory of this archive for
* more details.
*/
-#include <linux/tty.h>
+#include <linux/errno.h>
#include <linux/fb.h>
#include <linux/string.h>
+#include <asm/vc_ioctl.h>
+
+#include <video/fbcon.h>
#include <video/macmodes.h>
@@ -181,6 +188,107 @@ static const struct monitor_map {
{ -1, VMODE_640_480_60 }, /* catch-all, must be last */
};
+struct fb_info *console_fb_info = NULL;
+struct vc_mode display_info;
+static u16 palette_red[16];
+static u16 palette_green[16];
+static u16 palette_blue[16];
+static struct fb_cmap palette_cmap = {
+ 0, 16, palette_red, palette_green, palette_blue, NULL
+};
+
+
+int console_getmode(struct vc_mode *);
+int console_setmode(struct vc_mode *, int);
+int console_setcmap(int, unsigned char *, unsigned char *, unsigned char *);
+int console_powermode(int);
+int mac_var_to_vmode(const struct fb_var_screeninfo *, int *, int *);
+
+
+int console_getmode(struct vc_mode *mode)
+{
+ *mode = display_info;
+ return 0;
+}
+
+
+int console_setmode(struct vc_mode *mode, int doit)
+{
+ struct fb_var_screeninfo var;
+ int cmode, err;
+
+ if (!console_fb_info)
+ return -EOPNOTSUPP;
+
+ switch(mode->depth) {
+ case 0:
+ case 8:
+ cmode = CMODE_8;
+ break;
+ case 16:
+ cmode = CMODE_16;
+ break;
+ case 24:
+ case 32:
+ cmode = CMODE_32;
+ break;
+ default:
+ return -EINVAL;
+ }
+
+ if ((err = mac_vmode_to_var(mode->mode, cmode, &var)))
+ return err;
+
+ var.activate = FB_ACTIVATE_TEST;
+ err = console_fb_info->fbops->fb_set_var(&var, fg_console,
+ console_fb_info);
+ if (err || !doit)
+ return err;
+ else {
+ int unit;
+
+ var.activate = FB_ACTIVATE_NOW;
+ for (unit = 0; unit < MAX_NR_CONSOLES; unit++)
+ if (fb_display[unit].conp &&
+ (GET_FB_IDX(console_fb_info->node) == con2fb_map[unit]))
+ console_fb_info->fbops->fb_set_var(&var, unit,
+ console_fb_info);
+ }
+
+ return 0;
+}
+
+
+int console_setcmap(int n_entries, unsigned char *red, unsigned char *green,
+ unsigned char *blue)
+{
+ int i, j, n = 0, err;
+
+ if (!console_fb_info)
+ return -EOPNOTSUPP;
+
+ for (i = 0; i < n_entries; i += n) {
+ n = n_entries - i;
+ if (n > 16)
+ n = 16;
+ palette_cmap.start = 1;
+ palette_cmap.len = n;
+
+ for (j = 0; j < n; j++) {
+ palette_cmap.red[j] = (red[i+j] << 8) | red[i+j];
+ palette_cmap.green[j] = (green[i+j] << 8) | green[i+j];
+ palette_cmap.blue[j] = (blue[i+j] << 8) | blue[i+j];
+ }
+ err = console_fb_info->fbops->fb_set_cmap(&palette_cmap, 1,
+ fg_console,
+ console_fb_info);
+ if (err)
+ return err;
+ }
+
+ return 0;
+}
+
/*
* Convert a MacOS vmode/cmode pair to a frame buffer video mode structure
@@ -255,6 +363,17 @@ int mac_vmode_to_var(int vmode, int cmode, struct fb_var_screeninfo *var)
}
+int console_powermode(int mode)
+{
+ if (mode == VC_POWERMODE_INQUIRY)
+ return 0;
+ if (mode < VESA_NO_BLANKING || mode > VESA_POWERDOWN)
+ return -EINVAL;
+ /* Not Supported */
+ return -ENXIO;
+}
+
+
/*
* Convert a frame buffer video mode structure to a MacOS vmode/cmode pair
*/
diff --git a/drivers/video/modedb.c b/drivers/video/modedb.c
index 404c646f5..e33b8fdd7 100644
--- a/drivers/video/modedb.c
+++ b/drivers/video/modedb.c
@@ -8,6 +8,7 @@
* more details.
*/
+#include <linux/module.h>
#include <linux/tty.h>
#include <linux/fb.h>
#include <linux/console_struct.h>
@@ -253,7 +254,7 @@ static int __init my_atoi(const char *name)
}
}
-static int __init PROC_CONSOLE(const struct fb_info *info)
+static int PROC_CONSOLE(const struct fb_info *info)
{
int fgc;
@@ -275,8 +276,8 @@ static int __init PROC_CONSOLE(const struct fb_info *info)
return MINOR(current->tty->device) - 1;
}
-static int __init try_mode(struct fb_var_screeninfo *var, struct fb_info *info,
- const struct fb_videomode *mode, unsigned int bpp)
+int __fb_try_mode(struct fb_var_screeninfo *var, struct fb_info *info,
+ const struct fb_videomode *mode, unsigned int bpp)
{
int err;
@@ -391,20 +392,22 @@ done:
if ((name_matches(db[j], name, namelen) ||
(res_specified && res_matches(db[j], xres, yres))) &&
(!i || db[j].refresh == refresh) &&
- try_mode(var, info, &db[j], bpp))
+ __fb_try_mode(var, info, &db[j], bpp))
return 2-i;
}
}
DPRINTK("Trying default video mode\n");
- if (try_mode(var, info, default_mode, default_bpp))
+ if (__fb_try_mode(var, info, default_mode, default_bpp))
return 3;
DPRINTK("Trying all modes\n");
for (i = 0; i < dbsize; i++)
- if (try_mode(var, info, &db[i], default_bpp))
+ if (__fb_try_mode(var, info, &db[i], default_bpp))
return 4;
DPRINTK("No valid mode found\n");
return 0;
}
+
+EXPORT_SYMBOL(__fb_try_mode);
diff --git a/drivers/video/offb.c b/drivers/video/offb.c
index f734c4f9f..d3a609d35 100644
--- a/drivers/video/offb.c
+++ b/drivers/video/offb.c
@@ -94,15 +94,6 @@ static int offb_set_cmap(struct fb_cmap *cmap, int kspc, int con,
static int offb_ioctl(struct inode *inode, struct file *file, u_int cmd,
u_long arg, int con, struct fb_info *info);
-#ifdef CONFIG_FB_COMPAT_XPMAC
-int console_getmode(struct vc_mode *);
-int console_setmode(struct vc_mode *, int);
-int console_setcmap(int, unsigned char *, unsigned char *, unsigned char *);
-int console_powermode(int);
-struct fb_info *console_fb_info = NULL;
-struct vc_mode display_info;
-#endif /* CONFIG_FB_COMPAT_XPMAC */
-
extern boot_infos_t *boot_infos;
static int offb_init_driver(struct device_node *);
@@ -898,103 +889,3 @@ static void do_install_cmap(int con, struct fb_info *info)
fb_set_cmap(fb_default_cmap(size), 1, offb_setcolreg, info);
}
}
-
-
-#ifdef CONFIG_FB_COMPAT_XPMAC
-
- /*
- * Backward compatibility mode for Xpmac
- */
-
-int console_getmode(struct vc_mode *mode)
-{
- *mode = display_info;
- return 0;
-}
-
-int console_setmode(struct vc_mode *mode, int doit)
-{
- struct fb_var_screeninfo var;
- int cmode, err;
-
- if (!console_fb_info)
- return -EOPNOTSUPP;
- switch (mode->depth) {
- case 8:
- case 0: /* default */
- cmode = CMODE_8;
- break;
- case 16:
- cmode = CMODE_16;
- break;
- case 24:
- case 32:
- cmode = CMODE_32;
- break;
- default:
- return -EINVAL;
- }
- if ((err = mac_vmode_to_var(mode->mode, cmode, &var)))
- return err;
- var.activate = FB_ACTIVATE_TEST;
- err = console_fb_info->fbops->fb_set_var(&var, fg_console,
- console_fb_info);
- if (err || !doit)
- return err;
- else {
- int unit;
- var.activate = FB_ACTIVATE_NOW;
- for (unit = 0; unit < MAX_NR_CONSOLES; unit++)
- if (fb_display[unit].conp &&
- (GET_FB_IDX(console_fb_info->node) == con2fb_map[unit]))
- console_fb_info->fbops->fb_set_var(&var, unit,
- console_fb_info);
- }
- return 0;
-}
-
-static u16 palette_red[16];
-static u16 palette_green[16];
-static u16 palette_blue[16];
-
-static struct fb_cmap palette_cmap = {
- 0, 16, palette_red, palette_green, palette_blue, NULL
-};
-
-int console_setcmap(int n_entries, unsigned char *red, unsigned char *green,
- unsigned char *blue)
-{
- int i, j, n, err;
-
- if (!console_fb_info)
- return -EOPNOTSUPP;
- for (i = 0; i < n_entries; i += n) {
- n = n_entries-i;
- if (n > 16)
- n = 16;
- palette_cmap.start = i;
- palette_cmap.len = n;
- for (j = 0; j < n; j++) {
- palette_cmap.red[j] = (red[i+j] << 8) | red[i+j];
- palette_cmap.green[j] = (green[i+j] << 8) | green[i+j];
- palette_cmap.blue[j] = (blue[i+j] << 8) | blue[i+j];
- }
- err = console_fb_info->fbops->fb_set_cmap(&palette_cmap, 1, fg_console,
- console_fb_info);
- if (err)
- return err;
- }
- return 0;
-}
-
-int console_powermode(int mode)
-{
- if (mode == VC_POWERMODE_INQUIRY)
- return 0;
- if (mode < VESA_NO_BLANKING || mode > VESA_POWERDOWN)
- return -EINVAL;
- /* Not supported */
- return -ENXIO;
-}
-
-#endif /* CONFIG_FB_COMPAT_XPMAC */
diff --git a/drivers/video/riva/fbdev.c b/drivers/video/riva/fbdev.c
index 82c916d8a..eef60b04e 100644
--- a/drivers/video/riva/fbdev.c
+++ b/drivers/video/riva/fbdev.c
@@ -521,7 +521,7 @@ static int __devinit rivafb_init_one (struct pci_dev *pd,
rinfo->base1_region_size = pci_resource_len (pd, 1);
assert (rinfo->base0_region_size >= 0x00800000); /* from GGI */
- assert (rinfo->base0_region_size >= 0x01000000); /* from GGI */
+ assert (rinfo->base1_region_size >= 0x01000000); /* from GGI */
rinfo->ctrl_base_phys = rinfo->pd->resource[0].start;
rinfo->fb_base_phys = rinfo->pd->resource[1].start;