Commit 8ccb8c60 authored by James Simmons's avatar James Simmons

Removed fbcon-vga.c and the old fbgen code. Ported over the SgiVW,...

Removed fbcon-vga.c and the old fbgen code. Ported over the SgiVW, OpenFirmware fbdev driver and started the Mach64 fbdev driver to the new api. A few simple typos as well.
parent 8f1c76f6
...@@ -720,8 +720,3 @@ CONFIG_FBCON_HGA ...@@ -720,8 +720,3 @@ CONFIG_FBCON_HGA
This is the low level frame buffer console driver for Hercules mono This is the low level frame buffer console driver for Hercules mono
graphics cards. graphics cards.
CONFIG_FBCON_VGA
This is the low level frame buffer console driver for VGA text mode;
it is used by frame buffer device drivers that support VGA text
mode.
...@@ -228,7 +228,6 @@ if [ "$CONFIG_FB" = "y" ]; then ...@@ -228,7 +228,6 @@ if [ "$CONFIG_FB" = "y" ]; then
tristate ' Atari interleaved bitplanes (8 planes) support' CONFIG_FBCON_IPLAN2P8 tristate ' Atari interleaved bitplanes (8 planes) support' CONFIG_FBCON_IPLAN2P8
# tristate ' Atari interleaved bitplanes (16 planes) support' CONFIG_FBCON_IPLAN2P16 # tristate ' Atari interleaved bitplanes (16 planes) support' CONFIG_FBCON_IPLAN2P16
tristate ' VGA 16-color planar support' CONFIG_FBCON_VGA_PLANES tristate ' VGA 16-color planar support' CONFIG_FBCON_VGA_PLANES
tristate ' VGA characters/attributes support' CONFIG_FBCON_VGA
tristate ' HGA monochrome support (EXPERIMENTAL)' CONFIG_FBCON_HGA tristate ' HGA monochrome support (EXPERIMENTAL)' CONFIG_FBCON_HGA
else else
# Guess what we need # Guess what we need
...@@ -256,7 +255,7 @@ if [ "$CONFIG_FB" = "y" ]; then ...@@ -256,7 +255,7 @@ if [ "$CONFIG_FB" = "y" ]; then
fi fi
if [ "$CONFIG_FB_ACORN" = "y" -o "$CONFIG_FB_ATARI" = "y" -o \ if [ "$CONFIG_FB_ACORN" = "y" -o "$CONFIG_FB_ATARI" = "y" -o \
"$CONFIG_FB_ATY" = "y" -o "$CONFIG_FB_CYBER2000" = "y" -o \ "$CONFIG_FB_ATY" = "y" -o "$CONFIG_FB_CYBER2000" = "y" -o \
"$CONFIG_FB_OF" = "y" -o "$CONFIG_FB_TGA" = "y" -o \ "$CONFIG_FB_RADEON" = "y" -o "$CONFIG_FB_TGA" = "y" -o \
"$CONFIG_FB_SIS" = "y" -o "$CONFIG_FB_PM3" = "y" -o \ "$CONFIG_FB_SIS" = "y" -o "$CONFIG_FB_PM3" = "y" -o \
"$CONFIG_FB_TCX" = "y" -o "$CONFIG_FB_CGTHREE" = "y" -o \ "$CONFIG_FB_TCX" = "y" -o "$CONFIG_FB_CGTHREE" = "y" -o \
"$CONFIG_FB_CONTROL" = "y" -o "$CONFIG_FB_CLGEN" = "y" -o \ "$CONFIG_FB_CONTROL" = "y" -o "$CONFIG_FB_CLGEN" = "y" -o \
...@@ -265,13 +264,12 @@ if [ "$CONFIG_FB" = "y" ]; then ...@@ -265,13 +264,12 @@ if [ "$CONFIG_FB" = "y" ]; then
"$CONFIG_FB_VALKYRIE" = "y" -o "$CONFIG_FB_PLATINUM" = "y" -o \ "$CONFIG_FB_VALKYRIE" = "y" -o "$CONFIG_FB_PLATINUM" = "y" -o \
"$CONFIG_FB_IGA" = "y" -o "$CONFIG_FB_MATROX" = "y" -o \ "$CONFIG_FB_IGA" = "y" -o "$CONFIG_FB_MATROX" = "y" -o \
"$CONFIG_FB_CT65550" = "y" -o "$CONFIG_FB_PM2" = "y" -o \ "$CONFIG_FB_CT65550" = "y" -o "$CONFIG_FB_PM2" = "y" -o \
"$CONFIG_FB_P9100" = "y" -o "$CONFIG_FB_RADEON" = "y" -o \ "$CONFIG_FB_P9100" = "y" ]; then
"$CONFIG_FB_SGIVW" = "y" ]; then
define_tristate CONFIG_FBCON_CFB8 y define_tristate CONFIG_FBCON_CFB8 y
else else
if [ "$CONFIG_FB_ACORN" = "m" -o "$CONFIG_FB_ATARI" = "m" -o \ if [ "$CONFIG_FB_ACORN" = "m" -o "$CONFIG_FB_ATARI" = "m" -o \
"$CONFIG_FB_ATY" = "m" -o "$CONFIG_FB_CYBER2000" = "m" -o \ "$CONFIG_FB_ATY" = "m" -o "$CONFIG_FB_CYBER2000" = "m" -o \
"$CONFIG_FB_OF" = "m" -o "$CONFIG_FB_TGA" = "m" -o \ "$CONFIG_FB_RADEON" = "m" -o "$CONFIG_FB_TGA" = "m" -o \
"$CONFIG_FB_SIS" = "m" -o "$CONFIG_FB_PM3" = "m" -o \ "$CONFIG_FB_SIS" = "m" -o "$CONFIG_FB_PM3" = "m" -o \
"$CONFIG_FB_TCX" = "m" -o "$CONFIG_FB_CGTHREE" = "m" -o \ "$CONFIG_FB_TCX" = "m" -o "$CONFIG_FB_CGTHREE" = "m" -o \
"$CONFIG_FB_CONTROL" = "m" -o "$CONFIG_FB_CLGEN" = "m" -o \ "$CONFIG_FB_CONTROL" = "m" -o "$CONFIG_FB_CLGEN" = "m" -o \
...@@ -280,8 +278,7 @@ if [ "$CONFIG_FB" = "y" ]; then ...@@ -280,8 +278,7 @@ if [ "$CONFIG_FB" = "y" ]; then
"$CONFIG_FB_VALKYRIE" = "m" -o "$CONFIG_FB_PLATINUM" = "m" -o \ "$CONFIG_FB_VALKYRIE" = "m" -o "$CONFIG_FB_PLATINUM" = "m" -o \
"$CONFIG_FB_IGA" = "m" -o "$CONFIG_FB_MATROX" = "m" -o \ "$CONFIG_FB_IGA" = "m" -o "$CONFIG_FB_MATROX" = "m" -o \
"$CONFIG_FB_CT65550" = "m" -o "$CONFIG_FB_PM2" = "m" -o \ "$CONFIG_FB_CT65550" = "m" -o "$CONFIG_FB_PM2" = "m" -o \
"$CONFIG_FB_P9100" = "m" -o "$CONFIG_FB_RADEON" = "m" -o \ "$CONFIG_FB_P9100" = "m" ]; then
"$CONFIG_FB_SGIVW" = "m" ]; then
define_tristate CONFIG_FBCON_CFB8 m define_tristate CONFIG_FBCON_CFB8 m
fi fi
fi fi
...@@ -293,8 +290,8 @@ if [ "$CONFIG_FB" = "y" ]; then ...@@ -293,8 +290,8 @@ if [ "$CONFIG_FB" = "y" ]; then
"$CONFIG_FB_VIRGE" = "y" -o "$CONFIG_FB_CYBER" = "y" -o \ "$CONFIG_FB_VIRGE" = "y" -o "$CONFIG_FB_CYBER" = "y" -o \
"$CONFIG_FB_VALKYRIE" = "y" -o "$CONFIG_FB_PLATINUM" = "y" -o \ "$CONFIG_FB_VALKYRIE" = "y" -o "$CONFIG_FB_PLATINUM" = "y" -o \
"$CONFIG_FB_CT65550" = "y" -o "$CONFIG_FB_MATROX" = "y" -o \ "$CONFIG_FB_CT65550" = "y" -o "$CONFIG_FB_MATROX" = "y" -o \
"$CONFIG_FB_PM2" = "y" -o "$CONFIG_FB_SGIVW" = "y" -o \ "$CONFIG_FB_PM2" = "y" -o "$CONFIG_FB_CYBER2000" = "y" -o \
"$CONFIG_FB_PM3" = "y" -o "$CONFIG_FB_CYBER2000" = "y" ]; then "$CONFIG_FB_PM3" = "y" ]; then
define_tristate CONFIG_FBCON_CFB16 y define_tristate CONFIG_FBCON_CFB16 y
else else
if [ "$CONFIG_FB_ATARI" = "m" -o "$CONFIG_FB_ATY" = "m" -o \ if [ "$CONFIG_FB_ATARI" = "m" -o "$CONFIG_FB_ATY" = "m" -o \
...@@ -305,8 +302,8 @@ if [ "$CONFIG_FB" = "y" ]; then ...@@ -305,8 +302,8 @@ if [ "$CONFIG_FB" = "y" ]; then
"$CONFIG_FB_VIRGE" = "m" -o "$CONFIG_FB_CYBER" = "m" -o \ "$CONFIG_FB_VIRGE" = "m" -o "$CONFIG_FB_CYBER" = "m" -o \
"$CONFIG_FB_VALKYRIE" = "m" -o "$CONFIG_FB_PLATINUM" = "m" -o \ "$CONFIG_FB_VALKYRIE" = "m" -o "$CONFIG_FB_PLATINUM" = "m" -o \
"$CONFIG_FB_CT65550" = "m" -o "$CONFIG_FB_MATROX" = "m" -o \ "$CONFIG_FB_CT65550" = "m" -o "$CONFIG_FB_MATROX" = "m" -o \
"$CONFIG_FB_PM2" = "m" -o "$CONFIG_FB_SGIVW" = "m" -o \ "$CONFIG_FB_PM2" = "m" -o "$CONFIG_FB_CYBER2000" = "m" -o \
"$CONFIG_FB_SIS" = "m" -o "$CONFIG_FB_CYBER2000" = "y" ]; then "$CONFIG_FB_SIS" = "m" ]; then
define_tristate CONFIG_FBCON_CFB16 m define_tristate CONFIG_FBCON_CFB16 m
fi fi
fi fi
...@@ -333,8 +330,7 @@ if [ "$CONFIG_FB" = "y" ]; then ...@@ -333,8 +330,7 @@ if [ "$CONFIG_FB" = "y" ]; then
"$CONFIG_FB_TGA" = "y" -o "$CONFIG_FB_PLATINUM" = "y" -o \ "$CONFIG_FB_TGA" = "y" -o "$CONFIG_FB_PLATINUM" = "y" -o \
"$CONFIG_FB_MATROX" = "y" -o "$CONFIG_FB_PM2" = "y" -o \ "$CONFIG_FB_MATROX" = "y" -o "$CONFIG_FB_PM2" = "y" -o \
"$CONFIG_FB_PVR2" = "y" -o "$CONFIG_FB_PM3" = "y" -o \ "$CONFIG_FB_PVR2" = "y" -o "$CONFIG_FB_PM3" = "y" -o \
"$CONFIG_FB_SIS" = "y" -o "$CONFIG_FB_SGIVW" = "y" -o \ "$CONFIG_FB_SIS" = "y" -o "$CONFIG_FB_RADEON" = "y" ]; then
"$CONFIG_FB_RADEON" = "y" ]; then
define_tristate CONFIG_FBCON_CFB32 y define_tristate CONFIG_FBCON_CFB32 y
else else
if [ "$CONFIG_FB_ATARI" = "m" -o "$CONFIG_FB_ATY" = "m" -o \ if [ "$CONFIG_FB_ATARI" = "m" -o "$CONFIG_FB_ATY" = "m" -o \
...@@ -343,8 +339,7 @@ if [ "$CONFIG_FB" = "y" ]; then ...@@ -343,8 +339,7 @@ if [ "$CONFIG_FB" = "y" ]; then
"$CONFIG_FB_TGA" = "m" -o "$CONFIG_FB_PLATINUM" = "m" -o \ "$CONFIG_FB_TGA" = "m" -o "$CONFIG_FB_PLATINUM" = "m" -o \
"$CONFIG_FB_MATROX" = "m" -o "$CONFIG_FB_PM2" = "m" -o \ "$CONFIG_FB_MATROX" = "m" -o "$CONFIG_FB_PM2" = "m" -o \
"$CONFIG_FB_SIS" = "m" -o "$CONFIG_FB_PVR2" = "m" -o \ "$CONFIG_FB_SIS" = "m" -o "$CONFIG_FB_PVR2" = "m" -o \
"$CONFIG_FB_PM3" = "m" -o "$CONFIG_FB_RADEON" = "m" -o \ "$CONFIG_FB_PM3" = "m" -o "$CONFIG_FB_RADEON" = "m" ]; then
"$CONFIG_FB_SGIVW" = "m" ]; then
define_tristate CONFIG_FBCON_CFB32 m define_tristate CONFIG_FBCON_CFB32 m
fi fi
fi fi
...@@ -357,13 +352,15 @@ if [ "$CONFIG_FB" = "y" ]; then ...@@ -357,13 +352,15 @@ if [ "$CONFIG_FB" = "y" ]; then
"$CONFIG_FB_3DFX" = "y" -o "$CONFIG_FB_TX3912" = "y" -o \ "$CONFIG_FB_3DFX" = "y" -o "$CONFIG_FB_TX3912" = "y" -o \
"$CONFIG_FB_MAXINE" = "y" -o "$CONFIG_FB_APOLLO" = "y" -o \ "$CONFIG_FB_MAXINE" = "y" -o "$CONFIG_FB_APOLLO" = "y" -o \
"$CONFIG_FB_ATY128" = "y" -o "$CONFIG_FB_MAC" = "y" -o \ "$CONFIG_FB_ATY128" = "y" -o "$CONFIG_FB_MAC" = "y" -o \
"$CONFIG_FB_RIVA" = "y" -o "$CONFIG_FB_SA1100" = "y" ]; then "$CONFIG_FB_RIVA" = "y" -o "$CONFIG_FB_SA1100" = "y" -o \
"$CONFIG_FB_OF" = "y" -o "$CONFIG_FB_SGIVW" = "y" ]; then
define_tristate CONFIG_FBCON_ACCEL y define_tristate CONFIG_FBCON_ACCEL y
else else
if [ "$CONFIG_FB_NEOMAGIC" = "m" -o "$CONFIG_FB_HIT" = "m" -o \ if [ "$CONFIG_FB_NEOMAGIC" = "m" -o "$CONFIG_FB_HIT" = "m" -o \
"$CONFIG_FB_G364" = "m" -o "$CONFIG_FB_VIRTUAL" = "m" -o \ "$CONFIG_FB_G364" = "m" -o "$CONFIG_FB_VIRTUAL" = "m" -o \
"$CONFIG_FB_CLPS711X" = "m" -o "$CONFIG_FB_3DFX" = "m" -o \ "$CONFIG_FB_CLPS711X" = "m" -o "$CONFIG_FB_3DFX" = "m" -o \
"$CONFIG_FB_RIVA" = "m" -o "$CONFIG_FB_ATY128" = "m" ]; then "$CONFIG_FB_RIVA" = "m" -o "$CONFIG_FB_ATY128" = "m" -o \
"$CONFIG_FB_SGIVW" = "m" ]; then
define_tristate CONFIG_FBCON_ACCEL m define_tristate CONFIG_FBCON_ACCEL m
fi fi
fi fi
......
...@@ -56,7 +56,7 @@ obj-$(CONFIG_FB_ANAKIN) += anakinfb.o cfbfillrect.o cfbcopyarea.o cfbi ...@@ -56,7 +56,7 @@ obj-$(CONFIG_FB_ANAKIN) += anakinfb.o cfbfillrect.o cfbcopyarea.o cfbi
obj-$(CONFIG_FB_CLPS711X) += clps711xfb.o cfbfillrect.o cfbcopyarea.o cfbimgblt.o obj-$(CONFIG_FB_CLPS711X) += clps711xfb.o cfbfillrect.o cfbcopyarea.o cfbimgblt.o
obj-$(CONFIG_FB_CYBER) += cyberfb.o obj-$(CONFIG_FB_CYBER) += cyberfb.o
obj-$(CONFIG_FB_CYBER2000) += cyber2000fb.o obj-$(CONFIG_FB_CYBER2000) += cyber2000fb.o
obj-$(CONFIG_FB_SGIVW) += sgivwfb.o obj-$(CONFIG_FB_SGIVW) += sgivwfb.o cfbfillrect.o cfbcopyarea.o cfbimgblt.o
obj-$(CONFIG_FB_3DFX) += tdfxfb.o obj-$(CONFIG_FB_3DFX) += tdfxfb.o
obj-$(CONFIG_FB_MAC) += macfb.o macmodes.o cfbfillrect.o cfbcopyarea.o cfbimgblt.o obj-$(CONFIG_FB_MAC) += macfb.o macmodes.o cfbfillrect.o cfbcopyarea.o cfbimgblt.o
obj-$(CONFIG_FB_HP300) += hpfb.o cfbfillrect.o cfbimgblt.o obj-$(CONFIG_FB_HP300) += hpfb.o cfbfillrect.o cfbimgblt.o
...@@ -115,7 +115,6 @@ obj-$(CONFIG_FBCON_IPLAN2P2) += fbcon-iplan2p2.o ...@@ -115,7 +115,6 @@ obj-$(CONFIG_FBCON_IPLAN2P2) += fbcon-iplan2p2.o
obj-$(CONFIG_FBCON_IPLAN2P4) += fbcon-iplan2p4.o obj-$(CONFIG_FBCON_IPLAN2P4) += fbcon-iplan2p4.o
obj-$(CONFIG_FBCON_IPLAN2P8) += fbcon-iplan2p8.o obj-$(CONFIG_FBCON_IPLAN2P8) += fbcon-iplan2p8.o
obj-$(CONFIG_FBCON_MFB) += fbcon-mfb.o obj-$(CONFIG_FBCON_MFB) += fbcon-mfb.o
obj-$(CONFIG_FBCON_VGA) += fbcon-vga.o
obj-$(CONFIG_FBCON_HGA) += fbcon-hga.o obj-$(CONFIG_FBCON_HGA) += fbcon-hga.o
obj-$(CONFIG_FBCON_STI) += fbcon-sti.o obj-$(CONFIG_FBCON_STI) += fbcon-sti.o
obj-$(CONFIG_FBCON_ACCEL) += fbcon-accel.o obj-$(CONFIG_FBCON_ACCEL) += fbcon-accel.o
......
/* /*
* ATI Frame Buffer Device Driver Core Definitions * ATI Frame Buffer Device Driver Core Definitions
*/ */
...@@ -89,19 +88,14 @@ struct aty_cursor { ...@@ -89,19 +88,14 @@ struct aty_cursor {
struct fb_info_aty { struct fb_info_aty {
struct fb_info fb_info; struct fb_info fb_info;
struct fb_info_aty *next; struct fb_info_aty *next;
unsigned long ati_regbase_phys;
unsigned long ati_regbase; unsigned long ati_regbase;
unsigned long frame_buffer_phys;
unsigned long frame_buffer;
unsigned long clk_wr_offset; unsigned long clk_wr_offset;
struct pci_mmap_map *mmap_map; struct pci_mmap_map *mmap_map;
struct aty_cursor *cursor; struct aty_cursor *cursor;
struct aty_cmap_regs *aty_cmap_regs; struct aty_cmap_regs *aty_cmap_regs;
struct { u8 red, green, blue, pad; } palette[256];
struct atyfb_par default_par; struct atyfb_par default_par;
struct atyfb_par current_par; struct atyfb_par current_par;
u32 features; u32 features;
u32 total_vram;
u32 ref_clk_per; u32 ref_clk_per;
u32 pll_per; u32 pll_per;
u32 mclk_per; u32 mclk_per;
...@@ -110,19 +104,7 @@ struct fb_info_aty { ...@@ -110,19 +104,7 @@ struct fb_info_aty {
u8 mem_refresh_rate; u8 mem_refresh_rate;
const struct aty_dac_ops *dac_ops; const struct aty_dac_ops *dac_ops;
const struct aty_pll_ops *pll_ops; const struct aty_pll_ops *pll_ops;
struct display disp;
struct display_switch dispsw; struct display_switch dispsw;
union {
#ifdef FBCON_HAS_CFB16
u16 cfb16[16];
#endif
#ifdef FBCON_HAS_CFB24
u32 cfb24[16];
#endif
#ifdef FBCON_HAS_CFB32
u32 cfb32[16];
#endif
} fbcon_cmap;
u8 blitter_may_be_busy; u8 blitter_may_be_busy;
#ifdef __sparc__ #ifdef __sparc__
u8 mmaped; u8 mmaped;
......
This diff is collapsed.
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
#include <video/fbcon-cfb24.h> #include <video/fbcon-cfb24.h>
#include <video/fbcon-cfb32.h> #include <video/fbcon-cfb32.h>
#include "mach64.h" #include <video/mach64.h>
#include "atyfb.h" #include "atyfb.h"
/* /*
......
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
#include <video/fbcon.h> #include <video/fbcon.h>
#include "mach64.h" #include <video/mach64.h>
#include "atyfb.h" #include "atyfb.h"
...@@ -73,7 +73,7 @@ static int aty_dsp_gt(const struct fb_info_aty *info, u8 bpp, ...@@ -73,7 +73,7 @@ static int aty_dsp_gt(const struct fb_info_aty *info, u8 bpp,
/* fifo_off<<6 */ /* fifo_off<<6 */
fifo_off = ((xclks_per_row*(fifo_size-1))>>5)+(3<<6); fifo_off = ((xclks_per_row*(fifo_size-1))>>5)+(3<<6);
if (info->total_vram > 1*1024*1024) { if (info->fb_info.fix.smem_len > 1*1024*1024) {
if (info->ram_type >= SDRAM) { if (info->ram_type >= SDRAM) {
/* >1 MB SDRAM */ /* >1 MB SDRAM */
dsp_loop_latency += 8; dsp_loop_latency += 8;
......
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
#include <asm/fbio.h> #include <asm/fbio.h>
#endif #endif
#include "mach64.h" #include <video/mach64.h>
#include "atyfb.h" #include "atyfb.h"
...@@ -242,18 +242,18 @@ struct aty_cursor * __init aty_init_cursor(struct fb_info_aty *fb) ...@@ -242,18 +242,18 @@ struct aty_cursor * __init aty_init_cursor(struct fb_info_aty *fb)
memset(cursor->timer, 0, sizeof(*cursor->timer)); memset(cursor->timer, 0, sizeof(*cursor->timer));
cursor->blink_rate = DEFAULT_CURSOR_BLINK_RATE; cursor->blink_rate = DEFAULT_CURSOR_BLINK_RATE;
fb->total_vram -= PAGE_SIZE; fb->fb_info.fix.smem_len -= PAGE_SIZE;
cursor->offset = fb->total_vram; cursor->offset = fb->fb_info.fix.smem_len;
#ifdef __sparc__ #ifdef __sparc__
addr = fb->frame_buffer - 0x800000 + cursor->offset; addr = fb->fb_info.screen_base - 0x800000 + cursor->offset;
cursor->ram = (u8 *)addr; cursor->ram = (u8 *)addr;
#else #else
#ifdef __BIG_ENDIAN #ifdef __BIG_ENDIAN
addr = fb->frame_buffer_phys - 0x800000 + cursor->offset; addr = fb->fb_info.fix.smem_start - 0x800000 + cursor->offset;
cursor->ram = (u8 *)ioremap(addr, 1024); cursor->ram = (u8 *)ioremap(addr, 1024);
#else #else
addr = fb->frame_buffer + cursor->offset; addr = (unsigned long) fb->fb_info.screen_base + cursor->offset;
cursor->ram = (u8 *)addr; cursor->ram = (u8 *)addr;
#endif #endif
#endif #endif
......
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
#include <video/fbcon.h> #include <video/fbcon.h>
#include "mach64.h" #include <video/mach64.h>
#include "atyfb.h" #include "atyfb.h"
/* Definitions for the ICS 2595 == ATI 18818_1 Clockchip */ /* Definitions for the ICS 2595 == ATI 18818_1 Clockchip */
......
/*
* linux/drivers/video/fbcon-vga.c -- Low level frame buffer operations for
* VGA characters/attributes
*
* Created 28 Mar 1998 by Geert Uytterhoeven
* Monochrome attributes added May 1998 by Andrew Apted
*
* 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/module.h>
#include <linux/tty.h>
#include <linux/console.h>
#include <linux/string.h>
#include <linux/fb.h>
#include <asm/io.h>
#include <video/fbcon.h>
#include <video/fbcon-vga.h>
/*
* VGA screen access
*/
static inline void vga_writew(u16 val, u16 *addr)
{
#ifdef __powerpc__
st_le16(addr, val);
#else
writew(val, (unsigned long)addr);
#endif /* !__powerpc__ */
}
static inline u16 vga_readw(u16 *addr)
{
#ifdef __powerpc__
return ld_le16(addr);
#else
return readw((unsigned long)addr);
#endif /* !__powerpc__ */
}
static inline void vga_memsetw(void *s, u16 c, unsigned int count)
{
u16 *addr = (u16 *)s;
while (count) {
count--;
vga_writew(c, addr++);
}
}
static inline void vga_memmovew(u16 *to, u16 *from, unsigned int count)
{
if (to < from) {
while (count) {
count--;
vga_writew(vga_readw(from++), to++);
}
} else {
from += count;
to += count;
while (count) {
count--;
vga_writew(vga_readw(--from), --to);
}
}
}
/*
* VGA characters/attributes
*/
static inline u16 fbcon_vga_attr(struct display *p,
unsigned short s)
{
/* Underline and reverse-video are mutually exclusive on MDA.
* Since reverse-video is used for cursors and selected areas,
* it takes precedence.
*/
return (attr_reverse(p, s) ? 0x7000 :
(attr_underline(p, s) ? 0x0100 : 0x0700)) |
(attr_bold(p, s) ? 0x0800 : 0) |
(attr_blink(p, s) ? 0x8000 : 0);
}
void fbcon_vga_setup(struct display *p)
{
p->next_line = p->line_length;
p->next_plane = 0;
}
void fbcon_vga_bmove(struct display *p, int sy, int sx, int dy, int dx,
int height, int width)
{
u16 *src, *dst;
int rows;
if (sx == 0 && dx == 0 && width == p->next_line/2) {
src = (u16 *)(p->fb_info->screen_base+sy*p->next_line);
dst = (u16 *)(p->fb_info->screen_base+dy*p->next_line);
vga_memmovew(dst, src, height*width);
} else if (dy < sy || (dy == sy && dx < sx)) {
src = (u16 *)(p->fb_info->screen_base+sy*p->next_line+sx*2);
dst = (u16 *)(p->fb_info->screen_base+dy*p->next_line+dx*2);
for (rows = height; rows-- ;) {
vga_memmovew(dst, src, width);
src += p->next_line/2;
dst += p->next_line/2;
}
} else {
src = (u16 *)(p->fb_info->screen_base+(sy+height-1)*p->next_line+sx*2);
dst = (u16 *)(p->fb_info->screen_base+(dy+height-1)*p->next_line+dx*2);
for (rows = height; rows-- ;) {
vga_memmovew(dst, src, width);
src -= p->next_line/2;
dst -= p->next_line/2;
}
}
}
void fbcon_vga_clear(struct vc_data *conp, struct display *p, int sy, int sx,
int height, int width)
{
u16 *dest = (u16 *)(p->fb_info->screen_base+sy*p->next_line+sx*2);
int rows;
if (sx == 0 && width*2 == p->next_line)
vga_memsetw(dest, conp->vc_video_erase_char, height*width);
else
for (rows = height; rows-- ; dest += p->next_line/2)
vga_memsetw(dest, conp->vc_video_erase_char, width);
}
void fbcon_vga_putc(struct vc_data *conp, struct display *p, int c, int y,
int x)
{
u16 *dst = (u16 *)(p->fb_info->screen_base+y*p->next_line+x*2);
if (conp->vc_can_do_color)
vga_writew(c, dst);
else
vga_writew(fbcon_vga_attr(p, c) | (c & 0xff), dst);
}
void fbcon_vga_putcs(struct vc_data *conp, struct display *p,
const unsigned short *s, int count, int y, int x)
{
u16 *dst = (u16 *)(p->fb_info->screen_base+y*p->next_line+x*2);
u16 sattr;
if (conp->vc_can_do_color)
while (count--)
vga_writew(scr_readw(s++), dst++);
else {
sattr = fbcon_vga_attr(p, scr_readw(s));
while (count--)
vga_writew(sattr | ((int) (scr_readw(s++)) & 0xff), dst++);
}
}
void fbcon_vga_revc(struct display *p, int x, int y)
{
u16 *dst = (u16 *)(p->fb_info->screen_base+y*p->next_line+x*2);
u16 val = vga_readw(dst);
val = (val & 0x88ff) | ((val<<4) & 0x7000) | ((val>>4) & 0x0700);
vga_writew(val, dst);
}
/*
* `switch' for the low level operations
*/
struct display_switch fbcon_vga = {
setup: fbcon_vga_setup,
bmove: fbcon_vga_bmove,
clear: fbcon_vga_clear,
putc: fbcon_vga_putc,
putcs: fbcon_vga_putcs,
revc: fbcon_vga_revc,
fontwidthmask: FONTWIDTH(8)
};
#ifdef MODULE
MODULE_LICENSE("GPL");
int init_module(void)
{
return 0;
}
void cleanup_module(void)
{}
#endif /* MODULE */
/*
* Visible symbols for modules
*/
EXPORT_SYMBOL(fbcon_vga);
EXPORT_SYMBOL(fbcon_vga_setup);
EXPORT_SYMBOL(fbcon_vga_bmove);
EXPORT_SYMBOL(fbcon_vga_clear);
EXPORT_SYMBOL(fbcon_vga_putc);
EXPORT_SYMBOL(fbcon_vga_putcs);
EXPORT_SYMBOL(fbcon_vga_revc);
This diff is collapsed.
...@@ -132,7 +132,7 @@ extern int pmagbafb_init(void); ...@@ -132,7 +132,7 @@ extern int pmagbafb_init(void);
extern int pmagbbfb_init(void); extern int pmagbbfb_init(void);
extern void maxinefb_init(void); extern void maxinefb_init(void);
extern int tx3912fb_init(void); extern int tx3912fb_init(void);
extern int tx3912fb_setup(char*); extern void tx3912fb_setup(char*);
extern int radeonfb_init(void); extern int radeonfb_init(void);
extern int radeonfb_setup(char*); extern int radeonfb_setup(char*);
extern int e1355fb_init(void); extern int e1355fb_init(void);
......
This diff is collapsed.
This diff is collapsed.
...@@ -325,7 +325,7 @@ int __init tx3912fb_init(void) ...@@ -325,7 +325,7 @@ int __init tx3912fb_init(void)
return 0; return 0;
} }
int __init tx3912fb_setup(char *options) void __init tx3912fb_setup(char *options)
{ {
char *this_opt; char *this_opt;
......
...@@ -32,7 +32,7 @@ ...@@ -32,7 +32,7 @@
/* --------------------------------------------------------------------- */ /* --------------------------------------------------------------------- */
static struct fb_var_screeninfo vesafb_defined = { static struct fb_var_screeninfo vesafb_defined __initdata = {
activate: FB_ACTIVATE_NOW, activate: FB_ACTIVATE_NOW,
height: -1, height: -1,
width: -1, width: -1,
...@@ -43,7 +43,7 @@ static struct fb_var_screeninfo vesafb_defined = { ...@@ -43,7 +43,7 @@ static struct fb_var_screeninfo vesafb_defined = {
vmode: FB_VMODE_NONINTERLACED, vmode: FB_VMODE_NONINTERLACED,
}; };
static struct fb_fix_screeninfo vesafb_fix = { static struct fb_fix_screeninfo vesafb_fix __initdata = {
id: "VESA VGA", id: "VESA VGA",
type: FB_TYPE_PACKED_PIXELS, type: FB_TYPE_PACKED_PIXELS,
accel: FB_ACCEL_NONE, accel: FB_ACCEL_NONE,
......
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