Commit 112483d2 authored by James Simmons's avatar James Simmons

Merge maxwell.earthlink.net:/usr/src/linus-2.5

into maxwell.earthlink.net:/usr/src/fbdev-2.5
parents a1a71d01 401c933c
......@@ -2790,6 +2790,16 @@ S: Klosterweg 28 / i309
S: 76131 Karlsruhe
S: Germany
N: James Simmons
E: jsimmons@users.sf.net
D: Frame buffer device maintainer
D: input layer developement
D: tty/console layer
D: various mipsel devices
S: 115 Carmel Avenue
S: El Cerrito CA 94530
S: USA
N: Jaspreet Singh
E: jaspreet@sangoma.com
W: www.sangoma.com
......
......@@ -365,7 +365,7 @@ KAO -->
!Edrivers/video/fbmem.c
</sect1>
<sect1><title>Frame Buffer Console</title>
!Edrivers/video/fbcon.c
!Edrivers/video/console/fbcon.c
</sect1>
<sect1><title>Frame Buffer Colormap</title>
!Edrivers/video/fbcmap.c
......@@ -385,7 +385,7 @@ KAO -->
!Idrivers/video/macmodes.c
</sect1>
<sect1><title>Frame Buffer Fonts</title>
!Idrivers/video/fonts.c
!Idrivers/video/console/fonts.c
</sect1>
</chapter>
<!-- Needs ksyms to list additional exported symbols, but no specific doc.
......
......@@ -599,6 +599,13 @@ M: kevin.curtis@farsite.co.uk
W: http://www.farsite.co.uk/
S: Supported
FRAMEBUFFER LAYER
P: James Simmons, Geert Uytterhoeven
M: jsimmons@users.sf.net, geert@linux-m68k.org
L: linux-fbdev-devel@lists.sourceforge.net
W: http://www.linux-fbdev.org
S: Supported
FILE LOCKING (flock() and fcntl()/lockf())
P: Matthew Wilcox
M: matthew@wil.cx
......
......@@ -887,39 +887,8 @@ source "drivers/media/Kconfig"
source "fs/Kconfig"
menu "Console drivers"
depends on VT
config VGA_CONSOLE
bool "VGA text console"
help
Saying Y here will allow you to use Linux in text mode through a
display that complies with the generic VGA standard. Virtually
everyone wants that.
The program SVGATextMode can be used to utilize SVGA video cards to
their full potential in text mode. Download it from
<ftp://ibiblio.org/pub/Linux/utils/console/>.
Say Y.
# if [ "$CONFIG_PCI" = "y" -a "$CONFIG_VGA_CONSOLE" = "y" ]; then
# bool ' Allow VGA on any bus?' CONFIG_VGA_HOSE
# if [ "$CONFIG_VGA_HOSE" = "y" ]; then
# define_bool CONFIG_DUMMY_CONSOLE y
# fi
# fi
source "drivers/video/Kconfig"
config PCI_CONSOLE
bool
depends on FB
default y
endmenu
menu "Sound"
config SOUND
......
......@@ -1044,29 +1044,8 @@ source "drivers/media/Kconfig"
source "fs/Kconfig"
menu "Console drivers"
depends on VT
config VGA_CONSOLE
bool "VGA text console"
depends on !ARCH_ACORN && !ARCH_EBSA110
help
Saying Y here will allow you to use Linux in text mode through a
display that complies with the generic VGA standard. Virtually
everyone wants that.
The program SVGATextMode can be used to utilize SVGA video cards to
their full potential in text mode. Download it from
<ftp://ibiblio.org/pub/Linux/utils/console/>.
Say Y.
source "drivers/video/Kconfig"
endmenu
menu "Sound"
depends on ARCH_ACORN || ARCH_CLPS7500 || ARCH_TBOX || ARCH_SHARK || ARCH_SA1100 || PCI
......
......@@ -1414,63 +1414,8 @@ source "drivers/media/Kconfig"
source "fs/Kconfig"
menu "Console drivers"
depends on VT
config VGA_CONSOLE
bool "VGA text console"
help
Saying Y here will allow you to use Linux in text mode through a
display that complies with the generic VGA standard. Virtually
everyone wants that.
The program SVGATextMode can be used to utilize SVGA video cards to
their full potential in text mode. Download it from
<ftp://ibiblio.org/pub/Linux/utils/console/>.
Say Y.
config VIDEO_SELECT
bool "Video mode selection support"
---help---
This enables support for text mode selection on kernel startup. If
you want to take advantage of some high-resolution text mode your
card's BIOS offers, but the traditional Linux utilities like
SVGATextMode don't, you can say Y here and set the mode using the
"vga=" option from your boot loader (lilo or loadlin) or set
"vga=ask" which brings up a video mode menu on kernel startup. (Try
"man bootparam" or see the documentation of your boot loader about
how to pass options to the kernel.)
Read the file <file:Documentation/svga.txt> for more information
about the Video mode selection support. If unsure, say N.
if EXPERIMENTAL
config MDA_CONSOLE
tristate "MDA text console (dual-headed) (EXPERIMENTAL)"
---help---
Say Y here if you have an old MDA or monochrome Hercules graphics
adapter in your system acting as a second head ( = video card). You
will then be able to use two monitors with your Linux system. Do not
say Y here if your MDA card is the primary card in your system; the
normal VGA driver will handle it.
This driver is also available as a module ( = code which can be
inserted and removed from the running kernel whenever you want).
The module will be called mdacon.o. If you want to compile it as
a module, say M here and read <file:Documentation/modules.txt>.
If unsure, say N.
source "drivers/video/Kconfig"
endif
endmenu
menu "Sound"
config SOUND
......
......@@ -721,33 +721,8 @@ source "fs/Kconfig"
if !IA64_HP_SIM
menu "Console drivers"
depends on VT
config VGA_CONSOLE
bool "VGA text console"
help
Saying Y here will allow you to use Linux in text mode through a
display that complies with the generic VGA standard. Virtually
everyone wants that.
The program SVGATextMode can be used to utilize SVGA video cards to
their full potential in text mode. Download it from
<ftp://ibiblio.org/pub/Linux/utils/console/>.
Say Y.
source "drivers/video/Kconfig"
config PCI_CONSOLE
bool
depends on FB
default y
endmenu
menu "Sound"
config SOUND
......
......@@ -2340,15 +2340,8 @@ endmenu
source "fs/Kconfig"
menu "Console drivers"
depends on VT
source "drivers/video/Kconfig"
endmenu
menu "Kernel hacking"
config DEBUG_KERNEL
......
......@@ -1107,28 +1107,6 @@ config VT_CONSOLE
bool "Support for console on virtual terminal"
depends on VT
config SGI_NEWPORT_CONSOLE
tristate "SGI Newport Console support"
depends on VT
help
Say Y here if you want the console on the Newport aka XL graphics
card of your Indy. Most people say Y here.
config DUMMY_CONSOLE
bool
depends on VT && SGI_NEWPORT_CONSOLE!=y
default y
config FONT_8x16
bool
depends on VT && SGI_NEWPORT_CONSOLE=y
default y
help
This is the "high resolution" font for the VGA frame buffer (the one
provided by the VGA text console 80x25 mode.
If unsure, say Y.
config PSMOUSE
bool "PS/2 mouse support (aka \"auxiliary device\")"
---help---
......@@ -1184,48 +1162,8 @@ endmenu
source "fs/Kconfig"
menu "Console drivers"
depends on VT
config VGA_CONSOLE
bool "VGA text console"
help
Saying Y here will allow you to use Linux in text mode through a
display that complies with the generic VGA standard. Virtually
everyone wants that.
The program SVGATextMode can be used to utilize SVGA video cards to
their full potential in text mode. Download it from
<ftp://ibiblio.org/pub/Linux/utils/console/>.
Say Y.
if EXPERIMENTAL
config MDA_CONSOLE
tristate "MDA text console (dual-headed) (EXPERIMENTAL)"
---help---
Say Y here if you have an old MDA or monochrome Hercules graphics
adapter in your system acting as a second head ( = video card). You
will then be able to use two monitors with your Linux system. Do not
say Y here if your MDA card is the primary card in your system; the
normal VGA driver will handle it.
This driver is also available as a module ( = code which can be
inserted and removed from the running kernel whenever you want).
The module will be called mdacon.o. If you want to compile it as
a module, say M here and read <file:Documentation/modules.txt>.
If unsure, say N.
source "drivers/video/Kconfig"
endif
endmenu
menu "Sound"
depends on !DECSTATION
......
......@@ -585,31 +585,8 @@ source "drivers/media/Kconfig"
source "fs/Kconfig"
menu "Console drivers"
depends on VT
source "drivers/video/Kconfig"
config SGI_NEWPORT_CONSOLE
tristate "SGI Newport Console support"
depends on SGI_IP22
help
Say Y here if you want the console on the Newport aka XL graphics
card of your Indy. Most people say Y here.
config DUMMY_CONSOLE
bool
depends on SGI_IP22 && SGI_NEWPORT_CONSOLE!=y
default y
config FONT_8x16
bool
depends on SGI_IP22 && SGI_NEWPORT_CONSOLE=y
default y
endmenu
config KCORE_ELF
bool
depends on PROC_FS
......
......@@ -714,27 +714,8 @@ source "sound/Kconfig"
endmenu
menu "Console drivers"
depends on VT
source "drivers/video/Kconfig"
# bool 'IODC console' CONFIG_IODC_CONSOLE
config STI_CONSOLE
bool "STI console"
help
The STI console is the builtin display/keyboard on HP-PARISC
machines. Say Y here to build support for it into your kernel.
The alternative is to use your primary serial port as a console.
config DUMMY_CONSOLE
bool
depends on STI_CONSOLE || !IODC_CONSOLE && GSC_PS2
default y
endmenu
# endmenu
menu "Kernel hacking"
......
......@@ -1045,11 +1045,6 @@ config CMDLINE
some command-line options at build time by entering them here. In
most cases you will need to specify the root device here.
config FB_CONSOLE
bool
depends on APUS
default y
config AMIGA
bool
depends on APUS
......@@ -1424,25 +1419,8 @@ source "net/irda/Kconfig"
source "drivers/isdn/Kconfig"
menu "Console drivers"
config VGA_CONSOLE
bool "VGA text console"
depends on !4xx && !8xx
help
Saying Y here will allow you to use Linux in text mode through a
display that complies with the generic VGA standard. This can be
useful on PReP systems and IBM RS/6000 or pSeries machines but is of
limited usefulness on Apple machines.
Say N here if you have an Apple machine.
source "drivers/video/Kconfig"
endmenu
menu "iSeries device drivers"
depends on PPC_ISERIES
......
......@@ -401,15 +401,8 @@ source "drivers/media/Kconfig"
source "fs/Kconfig"
menu "Console drivers"
depends on VT
source "drivers/video/Kconfig"
endmenu
menu "Sound"
config SOUND
......
......@@ -1182,63 +1182,8 @@ source "fs/Kconfig"
source "drivers/media/Kconfig"
menu "Console drivers"
depends on VT
config VGA_CONSOLE
bool "VGA text console"
help
Saying Y here will allow you to use Linux in text mode through a
display that complies with the generic VGA standard. Virtually
everyone wants that.
The program SVGATextMode can be used to utilize SVGA video cards to
their full potential in text mode. Download it from
<ftp://ibiblio.org/pub/Linux/utils/console/>.
Say Y.
config VIDEO_SELECT
bool "Video mode selection support"
---help---
This enables support for text mode selection on kernel startup. If
you want to take advantage of some high-resolution text mode your
card's BIOS offers, but the traditional Linux utilities like
SVGATextMode don't, you can say Y here and set the mode using the
"vga=" option from your boot loader (lilo or loadlin) or set
"vga=ask" which brings up a video mode menu on kernel startup. (Try
"man bootparam" or see the documentation of your boot loader about
how to pass options to the kernel.)
Read the file <file:Documentation/svga.txt> for more information
about the Video mode selection support. If unsure, say N.
if EXPERIMENTAL
config MDA_CONSOLE
tristate "MDA text console (dual-headed) (EXPERIMENTAL)"
---help---
Say Y here if you have an old MDA or monochrome Hercules graphics
adapter in your system acting as a second head ( = video card). You
will then be able to use two monitors with your Linux system. Do not
say Y here if your MDA card is the primary card in your system; the
normal VGA driver will handle it.
This driver is also available as a module ( = code which can be
inserted and removed from the running kernel whenever you want).
The module will be called mdacon.o. If you want to compile it as
a module, say M here and read <file:Documentation/modules.txt>.
If unsure, say N.
source "drivers/video/Kconfig"
endif
endmenu
menu "Sound"
config SOUND
......
......@@ -409,24 +409,8 @@ config PRINTER
endmenu
menu "Console drivers"
config PROM_CONSOLE
bool "PROM console"
help
Say Y to build a console driver for Sun machines that uses the
terminal emulation built into their console PROMS.
config DUMMY_CONSOLE
bool
depends on !PROM_CONSOLE
default y
source "drivers/video/Kconfig"
endmenu
source "drivers/mtd/Kconfig"
source "drivers/serial/Kconfig"
......
......@@ -517,19 +517,8 @@ config WATCHDOG_RIO
endmenu
menu "Console drivers"
config PROM_CONSOLE
bool "PROM console"
help
Say Y to build a console driver for Sun machines that uses the
terminal emulation built into their console PROMS.
source "drivers/video/Kconfig"
endmenu
source "drivers/serial/Kconfig"
source "drivers/sbus/char/Kconfig"
......
......@@ -580,63 +580,8 @@ source "drivers/media/Kconfig"
source "fs/Kconfig"
menu "Console drivers"
depends on VT
config VGA_CONSOLE
bool "VGA text console"
help
Saying Y here will allow you to use Linux in text mode through a
display that complies with the generic VGA standard. Virtually
everyone wants that.
The program SVGATextMode can be used to utilize SVGA video cards to
their full potential in text mode. Download it from
<ftp://ibiblio.org/pub/Linux/utils/console/>.
Say Y.
config VIDEO_SELECT
bool "Video mode selection support"
---help---
This enables support for text mode selection on kernel startup. If
you want to take advantage of some high-resolution text mode your
card's BIOS offers, but the traditional Linux utilities like
SVGATextMode don't, you can say Y here and set the mode using the
"vga=" option from your boot loader (lilo or loadlin) or set
"vga=ask" which brings up a video mode menu on kernel startup. (Try
"man bootparam" or see the documentation of your boot loader about
how to pass options to the kernel.)
Read the file <file:Documentation/svga.txt> for more information
about the Video mode selection support. If unsure, say N.
if EXPERIMENTAL
config MDA_CONSOLE
tristate "MDA text console (dual-headed) (EXPERIMENTAL)"
---help---
Say Y here if you have an old MDA or monochrome Hercules graphics
adapter in your system acting as a second head ( = video card). You
will then be able to use two monitors with your Linux system. Do not
say Y here if your MDA card is the primary card in your system; the
normal VGA driver will handle it.
This driver is also available as a module ( = code which can be
inserted and removed from the running kernel whenever you want).
The module will be called mdacon.o. If you want to compile it as
a module, say M here and read <file:Documentation/modules.txt>.
If unsure, say N.
source "drivers/video/Kconfig"
endif
endmenu
menu "Sound"
config SOUND
......
......@@ -17,7 +17,7 @@ obj-$(CONFIG_FC4) += fc4/
obj-$(CONFIG_SCSI) += scsi/
obj-$(CONFIG_FUSION) += message/
obj-$(CONFIG_IEEE1394) += ieee1394/
obj-y += cdrom/
obj-y += cdrom/ video/
obj-$(CONFIG_MTD) += mtd/
obj-$(CONFIG_PCMCIA) += pcmcia/
obj-$(CONFIG_DIO) += dio/
......@@ -27,7 +27,6 @@ obj-$(CONFIG_ALL_PPC) += macintosh/
obj-$(CONFIG_MAC) += macintosh/
obj-$(CONFIG_PNP) += pnp/
obj-$(CONFIG_SGI) += sgi/
obj-$(CONFIG_VT) += video/
obj-$(CONFIG_PARIDE) += block/paride/
obj-$(CONFIG_TC) += tc/
obj-$(CONFIG_USB) += usb/
......
......@@ -19,7 +19,6 @@
#include <linux/tty.h>
#include <asm/uaccess.h>
#include <linux/consolemap.h>
#include <linux/console_struct.h>
#include <linux/vt_kern.h>
static unsigned short translations[][256] = {
......
......@@ -35,7 +35,6 @@
#include <linux/init.h>
#include <linux/slab.h>
#include <linux/console_struct.h>
#include <linux/kbd_kern.h>
#include <linux/kbd_diacr.h>
#include <linux/vt_kern.h>
......
......@@ -22,7 +22,6 @@
#include <linux/vt_kern.h>
#include <linux/consolemap.h>
#include <linux/console_struct.h>
#include <linux/selection.h>
#ifndef MIN
......
......@@ -1504,6 +1504,13 @@ static int tiocswinsz(struct tty_struct *tty, struct tty_struct *real_tty,
return -EFAULT;
if (!memcmp(&tmp_ws, &tty->winsize, sizeof(*arg)))
return 0;
#ifdef CONFIG_VT
if (tty->driver.type == TTY_DRIVER_TYPE_CONSOLE) {
unsigned int currcons = minor(tty->device) - tty->driver.minor_start;
if (vc_resize(currcons, tmp_ws.ws_col, tmp_ws.ws_row))
return -ENXIO;
}
#endif
if (tty->pgrp > 0)
kill_pg(tty->pgrp, SIGWINCH, 1);
if ((real_tty->pgrp != tty->pgrp) && (real_tty->pgrp > 0))
......
......@@ -32,7 +32,6 @@
#include <linux/mm.h>
#include <linux/init.h>
#include <linux/vt_kern.h>
#include <linux/console_struct.h>
#include <linux/selection.h>
#include <linux/kbd_kern.h>
#include <linux/console.h>
......
......@@ -90,7 +90,6 @@
#include <linux/devfs_fs_kernel.h>
#include <linux/vt_kern.h>
#include <linux/selection.h>
#include <linux/console_struct.h>
#include <linux/kbd_kern.h>
#include <linux/consolemap.h>
#include <linux/timer.h>
......@@ -691,106 +690,106 @@ int vc_allocate(unsigned int currcons) /* return 0 on success */
return 0;
}
inline int resize_screen(int currcons, int width, int height)
{
/* Resizes the resolution of the display adapater */
int err = 0;
if (vcmode != KD_GRAPHICS && sw->con_resize)
err = sw->con_resize(vc_cons[currcons].d, width, height);
return err;
}
/*
* Change # of rows and columns (0 means unchanged/the size of fg_console)
* [this is to be used together with some user program
* like resize that changes the hardware videomode]
*/
int vc_resize(unsigned int lines, unsigned int cols,
unsigned int first, unsigned int last)
{
unsigned int cc, ll, ss, sr, todo = 0;
unsigned int currcons = fg_console, i;
unsigned short *newscreens[MAX_NR_CONSOLES];
cc = (cols ? cols : video_num_columns);
ll = (lines ? lines : video_num_lines);
sr = cc << 1;
ss = sr * ll;
for (currcons = first; currcons <= last; currcons++) {
if (!vc_cons_allocated(currcons) ||
(cc == video_num_columns && ll == video_num_lines))
newscreens[currcons] = NULL;
else {
unsigned short *p = (unsigned short *) kmalloc(ss, GFP_USER);
if (!p) {
for (i = first; i < currcons; i++)
if (newscreens[i])
kfree(newscreens[i]);
return -ENOMEM;
}
newscreens[currcons] = p;
todo++;
}
}
if (!todo)
int vc_resize(int currcons, unsigned int cols, unsigned int lines)
{
unsigned long old_origin, new_origin, new_scr_end, rlth, rrem, err = 0;
unsigned int old_cols, old_rows, old_row_size, old_screen_size;
unsigned int new_cols, new_rows, new_row_size, new_screen_size;
unsigned short *newscreen;
if (!vc_cons_allocated(currcons))
return -ENXIO;
new_cols = (cols ? cols : video_num_columns);
new_rows = (lines ? lines : video_num_lines);
new_row_size = new_cols << 1;
new_screen_size = new_row_size * new_rows;
if (new_cols == video_num_columns && new_rows == video_num_lines)
return 0;
for (currcons = first; currcons <= last; currcons++) {
unsigned int occ, oll, oss, osr;
unsigned long ol, nl, nlend, rlth, rrem;
if (!newscreens[currcons] || !vc_cons_allocated(currcons))
continue;
newscreen = (unsigned short *) kmalloc(new_screen_size, GFP_USER);
if (!newscreen)
return -ENOMEM;
oll = video_num_lines;
occ = video_num_columns;
osr = video_size_row;
oss = screenbuf_size;
video_num_lines = ll;
video_num_columns = cc;
video_size_row = sr;
screenbuf_size = ss;
rlth = min(osr, sr);
rrem = sr - rlth;
ol = origin;
nl = (long) newscreens[currcons];
nlend = nl + ss;
if (ll < oll)
ol += (oll - ll) * osr;
update_attr(currcons);
while (ol < scr_end) {
scr_memcpyw((unsigned short *) nl, (unsigned short *) ol, rlth);
if (rrem)
scr_memsetw((void *)(nl + rlth), video_erase_char, rrem);
ol += osr;
nl += sr;
}
if (nlend > nl)
scr_memsetw((void *) nl, video_erase_char, nlend - nl);
if (kmalloced)
kfree(screenbuf);
screenbuf = newscreens[currcons];
kmalloced = 1;
screenbuf_size = ss;
set_origin(currcons);
old_rows = video_num_lines;
old_cols = video_num_columns;
old_row_size = video_size_row;
old_screen_size = screenbuf_size;
/* do part of a reset_terminal() */
top = 0;
bottom = video_num_lines;
gotoxy(currcons, x, y);
save_cur(currcons);
if (console_table[currcons]) {
struct winsize ws, *cws = &console_table[currcons]->winsize;
memset(&ws, 0, sizeof(ws));
ws.ws_row = video_num_lines;
ws.ws_col = video_num_columns;
if ((ws.ws_row != cws->ws_row || ws.ws_col != cws->ws_col) &&
console_table[currcons]->pgrp > 0)
kill_pg(console_table[currcons]->pgrp, SIGWINCH, 1);
*cws = ws;
}
video_num_lines = new_rows;
video_num_columns = new_cols;
video_size_row = new_row_size;
screenbuf_size = new_screen_size;
if (IS_VISIBLE)
update_screen(currcons);
err = resize_screen(currcons, new_cols, new_rows);
if (err)
return err;
rlth = min(old_row_size, new_row_size);
rrem = new_row_size - rlth;
old_origin = origin;
new_origin = (long) newscreen;
new_scr_end = new_origin + new_screen_size;
if (new_rows < old_rows)
old_origin += (old_rows - new_rows) * old_row_size;
update_attr(currcons);
while (old_origin < scr_end) {
scr_memcpyw((unsigned short *) new_origin, (unsigned short *) old_origin, rlth);
if (rrem)
scr_memsetw((void *)(new_origin + rlth), video_erase_char, rrem);
old_origin += old_row_size;
new_origin += new_row_size;
}
if (new_scr_end > new_origin)
scr_memsetw((void *) new_origin, video_erase_char, new_scr_end - new_origin);
if (kmalloced)
kfree(screenbuf);
screenbuf = newscreen;
kmalloced = 1;
screenbuf_size = new_screen_size;
if (IS_VISIBLE)
err = resize_screen(currcons, new_cols, new_rows);
set_origin(currcons);
return 0;
/* do part of a reset_terminal() */
top = 0;
bottom = video_num_lines;
gotoxy(currcons, x, y);
save_cur(currcons);
if (vc_cons[currcons].d->vc_tty) {
struct winsize ws, *cws = &vc_cons[currcons].d->vc_tty->winsize;
memset(&ws, 0, sizeof(ws));
ws.ws_row = video_num_lines;
ws.ws_col = video_num_columns;
if ((ws.ws_row != cws->ws_row || ws.ws_col != cws->ws_col) &&
vc_cons[currcons].d->vc_tty->pgrp > 0)
kill_pg(vc_cons[currcons].d->vc_tty->pgrp, SIGWINCH, 1);
*cws = ws;
}
if (IS_VISIBLE)
update_screen(currcons);
return err;
}
......@@ -1200,7 +1199,7 @@ static void set_mode(int currcons, int on_off)
case 3: /* 80/132 mode switch unimplemented */
deccolm = on_off;
#if 0
(void) vc_resize(video_num_lines, deccolm ? 132 : 80);
(void) vc_resize(deccolm ? 132 : 80, video_num_lines);
/* this alone does not suffice; some user mode
utility has to change the hardware regs */
#endif
......
......@@ -810,7 +810,9 @@ int vt_ioctl(struct tty_struct *tty, struct file * file,
if (get_user(ll, &vtsizes->v_rows) ||
get_user(cc, &vtsizes->v_cols))
return -EFAULT;
return vc_resize_all(ll, cc);
for (i = 0; i < MAX_NR_CONSOLES; i++)
vc_resize(i, cc, ll);
return 0;
}
case VT_RESIZEX:
......@@ -829,37 +831,33 @@ int vt_ioctl(struct tty_struct *tty, struct file * file,
__get_user(vcol, &vtconsize->v_vcol);
__get_user(ccol, &vtconsize->v_ccol);
vlin = vlin ? vlin : video_scan_lines;
if ( clin )
{
if ( ll )
{
if ( ll != vlin/clin )
return -EINVAL; /* Parameters don't add up */
}
else
ll = vlin/clin;
}
if ( vcol && ccol )
{
if ( cc )
{
if ( cc != vcol/ccol )
return -EINVAL;
}
else
cc = vcol/ccol;
}
if ( clin > 32 )
return -EINVAL;
if (clin) {
if (ll) {
if (ll != vlin/clin)
return -EINVAL; /* Parameters don't add up */
} else
ll = vlin/clin;
}
if (vcol && ccol) {
if (cc) {
if (cc != vcol/ccol)
return -EINVAL;
} else
cc = vcol/ccol;
}
if (clin > 32)
return -EINVAL;
if ( vlin )
video_scan_lines = vlin;
if ( clin )
video_font_height = clin;
return vc_resize_all(ll, cc);
}
if (vlin)
video_scan_lines = vlin;
if (clin)
video_font_height = clin;
for (i = 0; i < MAX_NR_CONSOLES; i++)
vc_resize(i, cc, ll);
return 0;
}
case PIO_FONT: {
struct console_font_op op;
......
This diff is collapsed.
......@@ -5,33 +5,14 @@
# 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 modedb.o \
fbcon-afb.o fbcon-ilbm.o fbcon-accel.o cyber2000fb.o \
fbcon-iplan2p2.o fbcon-iplan2p4.o fbgen.o \
fbcon-iplan2p8.o fbcon-vga-planes.o fbcon-cfb16.o \
fbcon-cfb2.o fbcon-cfb24.o fbcon-cfb32.o fbcon-cfb4.o \
fbcon-cfb8.o fbcon-mfb.o fbcon-hga.o
export-objs := fbmem.o fbcmap.o fbgen.o fbmon.o modedb.o cyber2000fb.o
# Each configuration option enables a list of files.
obj-$(CONFIG_DUMMY_CONSOLE) += dummycon.o
obj-$(CONFIG_SGI_NEWPORT_CONSOLE) += newport_con.o
obj-$(CONFIG_PROM_CONSOLE) += promcon.o promcon_tbl.o
obj-$(CONFIG_STI_CONSOLE) += sticon.o sticon-bmode.o sticore.o
obj-$(CONFIG_VGA_CONSOLE) += vgacon.o
obj-$(CONFIG_MDA_CONSOLE) += mdacon.o
obj-$(CONFIG_FONT_SUN8x16) += font_sun8x16.o
obj-$(CONFIG_FONT_SUN12x22) += font_sun12x22.o
obj-$(CONFIG_FONT_8x8) += font_8x8.o
obj-$(CONFIG_FONT_8x16) += font_8x16.o
obj-$(CONFIG_FONT_6x11) += font_6x11.o
obj-$(CONFIG_FONT_PEARL_8x8) += font_pearl_8x8.o
obj-$(CONFIG_FONT_ACORN_8x8) += font_acorn_8x8.o
obj-$(CONFIG_FONT_MINI_4x6) += font_mini_4x6.o
obj-$(CONFIG_VT) += console/
# Add fbmon.o back into obj-$(CONFIG_FB) in 2.5.x
obj-$(CONFIG_FB) += fbmem.o fbcmap.o modedb.o fbcon.o fonts.o fbgen.o
obj-$(CONFIG_FB) += fbmem.o fbcmap.o modedb.o fbgen.o
# Only include macmodes.o if we have FB support and are PPC
ifeq ($(CONFIG_FB),y)
obj-$(CONFIG_PPC) += macmodes.o
......@@ -80,7 +61,7 @@ obj-$(CONFIG_FB_TCX) += tcxfb.o sbusfb.o
obj-$(CONFIG_FB_CGFOURTEEN) += cgfourteenfb.o sbusfb.o
obj-$(CONFIG_FB_P9100) += p9100fb.o sbusfb.o
obj-$(CONFIG_FB_LEO) += leofb.o sbusfb.o
obj-$(CONFIG_FB_STI) += stifb.o sticore.o
obj-$(CONFIG_FB_STI) += stifb.o console/sticore.o
obj-$(CONFIG_FB_PMAG_BA) += pmag-ba-fb.o cfbfillrect.o cfbcopyarea.o cfbimgblt.o
obj-$(CONFIG_FB_PMAGB_B) += pmagb-b-fb.o cfbfillrect.o cfbcopyarea.o cfbimgblt.o
obj-$(CONFIG_FB_MAXINE) += maxinefb.o cfbfillrect.o cfbcopyarea.o cfbimgblt.o
......@@ -101,24 +82,6 @@ obj-$(CONFIG_FB_E1355) += epson1355fb.o
obj-$(CONFIG_FB_PVR2) += pvr2fb.o
obj-$(CONFIG_FB_VOODOO1) += sstfb.o
# Generic Low Level Drivers
obj-$(CONFIG_FBCON_AFB) += fbcon-afb.o
obj-$(CONFIG_FBCON_CFB2) += fbcon-cfb2.o
obj-$(CONFIG_FBCON_CFB4) += fbcon-cfb4.o
obj-$(CONFIG_FBCON_CFB8) += fbcon-cfb8.o
obj-$(CONFIG_FBCON_CFB16) += fbcon-cfb16.o
obj-$(CONFIG_FBCON_CFB24) += fbcon-cfb24.o
obj-$(CONFIG_FBCON_CFB32) += fbcon-cfb32.o
obj-$(CONFIG_FBCON_ILBM) += fbcon-ilbm.o
obj-$(CONFIG_FBCON_IPLAN2P2) += fbcon-iplan2p2.o
obj-$(CONFIG_FBCON_IPLAN2P4) += fbcon-iplan2p4.o
obj-$(CONFIG_FBCON_IPLAN2P8) += fbcon-iplan2p8.o
obj-$(CONFIG_FBCON_MFB) += fbcon-mfb.o
obj-$(CONFIG_FBCON_HGA) += fbcon-hga.o
obj-$(CONFIG_FBCON_STI) += fbcon-sti.o
obj-$(CONFIG_FBCON_ACCEL) += fbcon-accel.o
# Files generated that shall be removed upon make clean
clean-files := promcon_tbl.c
......
......@@ -542,7 +542,7 @@ static void __init s3triofb_of_init(struct device_node *dp)
return;
printk("fb%d: S3 Trio frame buffer device on %s\n",
GET_FB_IDX(fb_info.node), dp->full_name);
minor(fb_info.node), dp->full_name);
}
......
......@@ -1771,7 +1771,7 @@ int __init amifb_init(void)
}
printk("fb%d: %s frame buffer device, using %ldK of video memory\n",
GET_FB_IDX(fb_info.node), fb_info.modename,
minor(fb_info.node), fb_info.modename,
videomemorysize>>10);
return 0;
......
......@@ -20,11 +20,8 @@
#include <asm/io.h>
#include <video/fbcon.h>
static u32 colreg[16];
static struct fb_info fb_info;
static struct display display;
static struct fb_var_screeninfo anakinfb_var = {
.xres = 400,
......@@ -65,33 +62,23 @@ anakinfb_setcolreg(u_int regno, u_int red, u_int green, u_int blue,
static struct fb_ops anakinfb_ops = {
.owner = THIS_MODULE,
.fb_set_var = gen_set_var,
.fb_get_cmap = gen_get_cmap,
.fb_set_cmap = gen_set_cmap,
.fb_setcolreg = anakinfb_setcolreg,
.fb_fillrect = cfb_fillrect,
.fb_copyarea = cfb_copyarea,
.fb_imageblit = cfb_imageblit,
.fb_cursor = cfb_cursor,
};
int __init
anakinfb_init(void)
{
memset(&fb_info, 0, sizeof(struct fb_info));
memset(&display, 0, sizeof(struct display));
strcpy(fb_info.modename, anakinfb_fix.id);
fb_info.node = NODEV;
fb_info.currcon = -1;
fb_info.flags = FBINFO_FLAG_DEFAULT;
fb_info.fbops = &anakinfb_ops;
fb_info.var = anakinfb_var;
fb_info.fix = anakinfb_fix;
fb_info.disp = &display;
strcpy(fb_info.fontname, "VGA8x16");
fb_info.changevar = NULL;
fb_info.switch_con = gen_switch_con;
fb_info.updatevar = gen_update_var;
if (!(request_mem_region(VGA_START, VGA_SIZE, "vga")))
return -ENOMEM;
if (fb_info.screen_base = ioremap(VGA_START, VGA_SIZE)) {
......@@ -100,10 +87,9 @@ anakinfb_init(void)
}
fb_alloc_cmap(&fb_info.cmap, 16, 0);
gen_set_disp(-1, &fb_info);
if (register_framebuffer(&fb_info) < 0) {
iounmap(display.screen_base);
iounmap(fb_info.screen_base);
release_mem_region(VGA_START, VGA_SIZE);
return -EINVAL;
}
......
......@@ -2816,7 +2816,7 @@ int __init atafb_init(void)
printk(" virtual %dx%d\n",
disp.var.xres_virtual, disp.var.yres_virtual);
printk("fb%d: %s frame buffer device, using %dK of video memory\n",
GET_FB_IDX(fb_info.node), fb_info.modename, screen_len>>10);
minor(fb_info.node), fb_info.modename, screen_len>>10);
/* TODO: This driver cannot be unloaded yet */
MOD_INC_USE_COUNT;
......
This diff is collapsed.
......@@ -7,8 +7,6 @@
#include <asm/io.h>
#include <video/fbcon.h>
#include <video/mach64.h>
#include "atyfb.h"
......
......@@ -11,8 +11,6 @@
#include <asm/io.h>
#include <asm/uaccess.h>
#include <video/fbcon.h>
#ifdef __sparc__
#include <asm/pbm.h>
#include <asm/fbio.h>
......
......@@ -9,8 +9,6 @@
#include <asm/io.h>
#include <video/fbcon.h>
#include <video/mach64.h>
#include "atyfb.h"
......
This diff is collapsed.
This diff is collapsed.
......@@ -20,7 +20,6 @@
#include <linux/string.h>
#include <linux/fb.h>
#include <asm/types.h>
#include <video/fbcon.h>
#if BITS_PER_LONG == 32
#define FB_READ fb_readl
......@@ -36,7 +35,7 @@ void cfb_fillrect(struct fb_info *p, struct fb_fillrect *rect)
unsigned long height, ppw, fg, fgcolor;
int i, n, x2, y2, linesize = p->fix.line_length;
int bpl = sizeof(unsigned long);
unsigned long *dst;
unsigned long *dst = NULL;
char *dst1;
if (!rect->width || !rect->height)
......@@ -56,7 +55,7 @@ void cfb_fillrect(struct fb_info *p, struct fb_fillrect *rect)
ppw = BITS_PER_LONG / p->var.bits_per_pixel;
dst1 = p->screen_base + (rect->dy * linesize) +
(rect->dx * (p->var.bits_per_pixel >> 3));
(rect->dx * (p->var.bits_per_pixel >> 3));
start_index = ((unsigned long) dst1 & (bpl - 1));
end_index = ((unsigned long) (dst1 + n) & (bpl - 1));
......@@ -98,11 +97,12 @@ void cfb_fillrect(struct fb_info *p, struct fb_fillrect *rect)
case ROP_COPY:
do {
/* Word align to increases performace :-) */
dst = (unsigned long *) (dst1 - start_index);
dst =
(unsigned long *) (dst1 - start_index);
if (start_mask) {
FB_WRITE(FB_READ(dst) |
start_mask, dst);
start_mask, dst);
dst++;
}
......@@ -113,17 +113,18 @@ void cfb_fillrect(struct fb_info *p, struct fb_fillrect *rect)
if (end_mask)
FB_WRITE(FB_READ(dst) | end_mask,
dst);
dst);
dst1 += linesize;
} while (--height);
break;
case ROP_XOR:
do {
dst = (unsigned long *) (dst1 - start_index);
dst =
(unsigned long *) (dst1 - start_index);
if (start_mask) {
FB_WRITE(FB_READ(dst) ^
start_mask, dst);
start_mask, dst);
dst++;
}
......@@ -134,56 +135,92 @@ void cfb_fillrect(struct fb_info *p, struct fb_fillrect *rect)
if (end_mask) {
FB_WRITE(FB_READ(dst) ^ end_mask,
dst);
dst);
}
dst1 += linesize;
} while (--height);
break;
}
} else {
/* Odd modes like 24 or 80 bits per pixel */
start_mask = fg >> (start_index * p->var.bits_per_pixel);
end_mask = fg << (end_index * p->var.bits_per_pixel);
/* start_mask =& PFILL24(x1,fg);
end_mask_or = end_mask & PFILL24(x1+width-1,fg); */
n = (rect->width - start_index - end_index) / ppw;
/*
* Slow Method: The aim is to find the number of pixels to
* pack in order to write doubleword multiple data.
* For 24 bpp, 4 pixels are packed which are written as
* 3 dwords.
*/
char *dst2, *dst3;
int bytes = (p->var.bits_per_pixel + 7) >> 3;
int read, write, total, pack_size;
u32 pixarray[BITS_PER_LONG >> 3], m;
fg = fgcolor;
read = (bytes + (bpl - 1)) & ~(bpl - 1);
write = bytes;
total = (rect->width * bytes);
pack_size = bpl * write;
dst3 = (char *) pixarray;
for (n = read; n--;) {
*(u32 *) dst3 = fg;
dst3 += bytes;
}
switch (rect->rop) {
case ROP_COPY:
do {
dst = (unsigned long *) dst1;
if (start_mask)
*dst |= start_mask;
if ((start_index + rect->width) > ppw)
dst++;
/* XXX: slow */
for (i = 0; i < n; i++) {
*dst++ = fg;
dst2 = dst1;
n = total;
while (n >= pack_size) {
for (m = 0; m < write; m++) {
fb_writel(pixarray[m],
(u32 *) dst2);
dst2 += 4;
}
n -= pack_size;
}
if (n) {
m = 0;
while (n--)
fb_writeb(((u8 *)
pixarray)[m++],
dst2++);
}
if (end_mask)
*dst |= end_mask;
dst1 += linesize;
} while (--height);
break;
case ROP_XOR:
do {
dst = (unsigned long *) dst1;
if (start_mask)
*dst ^= start_mask;
if ((start_mask + rect->width) > ppw)
dst++;
for (i = 0; i < n; i++) {
*dst++ ^= fg; /* PFILL24(fg,x1+i); */
dst2 = dst1;
n = total;
while (n >= pack_size) {
for (m = 0; m < write; m++) {
fb_writel(fb_readl
((u32 *) dst2) ^
pixarray[m],
(u32 *) dst2);
dst2 += 4;
}
n -= pack_size;
}
if (n) {
m = 0;
while (n--) {
fb_writeb(fb_readb(dst2) ^
((u8 *)
pixarray)[m++],
dst2);
dst2++;
}
}
if (end_mask)
*dst ^= end_mask;
dst1 += linesize;
} while (--height);
break;
}
}
return;
}
......@@ -22,6 +22,13 @@
* FIXME
* The code for 24 bit is horrible. It copies byte by byte size instead of
* longs like the other sizes. Needs to be optimized.
*
* Tony:
* Incorporate mask tables similar to fbcon-cfb*.c in 2.4 API. This speeds
* up the code significantly.
*
* Code for depths not multiples of BITS_PER_LONG is still kludgy, which is
* still processed a bit at a time.
*
* Also need to add code to deal with cards endians that are different than
* the native cpu endians. I also need to deal with MSB position in the word.
......@@ -31,8 +38,6 @@
#include <linux/fb.h>
#include <asm/types.h>
#include <video/fbcon.h>
#define DEBUG
#ifdef DEBUG
......@@ -41,16 +46,251 @@
#define DPRINTK(fmt, args...)
#endif
void cfb_imageblit(struct fb_info *p, struct fb_image *image)
static u32 cfb_tab8[] = {
#if defined(__BIG_ENDIAN)
0x00000000, 0x000000ff, 0x0000ff00, 0x0000ffff,
0x00ff0000, 0x00ff00ff, 0x00ffff00, 0x00ffffff,
0xff000000, 0xff0000ff, 0xff00ff00, 0xff00ffff,
0xffff0000, 0xffff00ff, 0xffffff00, 0xffffffff
#elif defined(__LITTLE_ENDIAN)
0x00000000, 0xff000000, 0x00ff0000, 0xffff0000,
0x0000ff00, 0xff00ff00, 0x00ffff00, 0xffffff00,
0x000000ff, 0xff0000ff, 0x00ff00ff, 0xffff00ff,
0x0000ffff, 0xff00ffff, 0x00ffffff, 0xffffffff
#else
#error FIXME: No endianness??
#endif
};
static u32 cfb_tab16[] = {
#if defined(__BIG_ENDIAN)
0x00000000, 0x0000ffff, 0xffff0000, 0xffffffff
#elif defined(__LITTLE_ENDIAN)
0x00000000, 0xffff0000, 0x0000ffff, 0xffffffff
#else
#error FIXME: No endianness??
#endif
};
static u32 cfb_tab32[] = {
0x00000000, 0xffffffff
};
static u32 cfb_pixarray[4];
static u32 cfb_tabdef[2];
static inline void fast_imageblit(struct fb_image *image,
struct fb_info *p, char *dst1,
int fgcolor, int bgcolor)
{
int pad, ppw;
int x2, y2, n, i, j, k, l = 7;
int i, j, k, l = 8, n;
int bit_mask, end_mask, eorx;
unsigned long fgx = fgcolor, bgx = bgcolor, pad;
unsigned long tmp = ~0 << (BITS_PER_LONG - p->var.bits_per_pixel);
unsigned long fgx, bgx, fgcolor, bgcolor, eorx;
unsigned long ppw = BITS_PER_LONG / p->var.bits_per_pixel;
unsigned long *dst;
u32 *tab = NULL;
char *src = image->data;
switch (ppw) {
case 4:
tab = cfb_tab8;
break;
case 2:
tab = cfb_tab16;
break;
case 1:
tab = cfb_tab32;
break;
}
for (i = ppw - 1; i--;) {
fgx <<= p->var.bits_per_pixel;
bgx <<= p->var.bits_per_pixel;
fgx |= fgcolor;
bgx |= bgcolor;
}
n = ((image->width + 7) >> 3);
pad = (n << 3) - image->width;
n = image->width % ppw;
bit_mask = (1 << ppw) - 1;
eorx = fgx ^ bgx;
k = image->width / ppw;
for (i = image->height; i--;) {
dst = (unsigned long *) dst1;
for (j = k; j--;) {
l -= ppw;
end_mask = tab[(*src >> l) & bit_mask];
fb_writel((end_mask & eorx) ^ bgx, dst++);
if (!l) {
l = 8;
src++;
}
}
if (n) {
end_mask = 0;
for (j = n; j > 0; j--) {
l--;
if (test_bit(l, (unsigned long *) src))
end_mask |=
(tmp >>
(p->var.bits_per_pixel *
(j - 1)));
if (!l) {
l = 8;
src++;
}
}
fb_writel((end_mask & eorx) ^ bgx, dst++);
}
l -= pad;
dst1 += p->fix.line_length;
}
}
/*
* Slow method: The idea is to find the number of pixels necessary to form
* dword-sized multiples that will be written to the framebuffer. For BPP24,
* 4 pixels has to be read which are then packed into 3 double words that
* are then written to the framebuffer.
*
* With this method, processing is done 1 pixel at a time.
*/
static inline void slow_imageblit(struct fb_image *image,
struct fb_info *p, char *dst1,
int fgcolor, int bgcolor)
{
int bytes = (p->var.bits_per_pixel + 7) >> 3;
int tmp = ~0UL >> (BITS_PER_LONG - p->var.bits_per_pixel);
int i, j, k, l = 8, m, end_mask, eorx;
int read, write, total, pack_size, bpl = sizeof(unsigned long);
unsigned long *dst;
char *dst2 = (char *) cfb_pixarray, *src = image->data;
cfb_tabdef[0] = 0;
cfb_tabdef[1] = tmp;
eorx = fgcolor ^ bgcolor;
read = (bytes + (bpl - 1)) & ~(bpl - 1);
write = bytes;
total = image->width * bytes;
pack_size = bpl * write;
for (i = image->height; i--;) {
dst = (unsigned long *) dst1;
j = total;
m = read;
while (j >= pack_size) {
l--;
m--;
end_mask = cfb_tabdef[(*src >> l) & 1];
*(unsigned long *) dst2 =
(end_mask & eorx) ^ bgcolor;
dst2 += bytes;
if (!m) {
for (k = 0; k < write; k++)
fb_writel(cfb_pixarray[k], dst++);
dst2 = (char *) cfb_pixarray;
j -= pack_size;
m = read;
}
if (!l) {
l = 8;
src++;
}
}
/* write residual pixels */
if (j) {
k = 0;
while (j--)
fb_writeb(((u8 *) cfb_pixarray)[k++],
dst++);
}
dst1 += p->fix.line_length;
}
}
static inline void bitwise_blit(struct fb_image *image, struct fb_info *p,
char *dst1, int fgcolor, int bgcolor)
{
int i, j, k, l = 8, n, pad, ppw;
unsigned long tmp = ~0 << (BITS_PER_LONG - p->var.bits_per_pixel);
unsigned long fgx = fgcolor, bgx = bgcolor, eorx;
unsigned long end_mask;
unsigned long *dst = NULL;
char *src = image->data;
ppw = BITS_PER_LONG / p->var.bits_per_pixel;
for (i = 0; i < ppw - 1; i++) {
fgx <<= p->var.bits_per_pixel;
bgx <<= p->var.bits_per_pixel;
fgx |= fgcolor;
bgx |= bgcolor;
}
eorx = fgx ^ bgx;
n = ((image->width + 7) >> 3);
pad = (n << 3) - image->width;
n = image->width % ppw;
for (i = 0; i < image->height; i++) {
dst = (unsigned long *) dst1;
for (j = image->width / ppw; j > 0; j--) {
end_mask = 0;
for (k = ppw; k > 0; k--) {
l--;
if (test_bit(l, (unsigned long *) src))
end_mask |=
(tmp >>
(p->var.bits_per_pixel *
(k - 1)));
if (!l) {
l = 8;
src++;
}
}
fb_writel((end_mask & eorx) ^ bgx, dst);
dst++;
}
if (n) {
end_mask = 0;
for (j = n; j > 0; j--) {
l--;
if (test_bit(l, (unsigned long *) src))
end_mask |=
(tmp >>
(p->var.bits_per_pixel *
(j - 1)));
if (!l) {
l = 8;
src++;
}
}
fb_writel((end_mask & eorx) ^ bgx, dst);
dst++;
}
l -= pad;
dst1 += p->fix.line_length;
}
}
void cfb_imageblit(struct fb_info *p, struct fb_image *image)
{
int x2, y2, n;
unsigned long fgcolor, bgcolor;
unsigned long end_mask;
u8 *dst1;
u8 *src;
/*
* We could use hardware clipping but on many cards you get around hardware
......@@ -62,68 +302,37 @@ void cfb_imageblit(struct fb_info *p, struct fb_image *image)
image->dy = image->dy > 0 ? image->dy : 0;
x2 = x2 < p->var.xres_virtual ? x2 : p->var.xres_virtual;
y2 = y2 < p->var.yres_virtual ? y2 : p->var.yres_virtual;
image->width = x2 - image->dx;
image->width = x2 - image->dx;
image->height = y2 - image->dy;
dst1 = p->screen_base + image->dy * p->fix.line_length +
((image->dx * p->var.bits_per_pixel) >> 3);
ppw = BITS_PER_LONG/p->var.bits_per_pixel;
src = image->data;
dst1 = p->screen_base + image->dy * p->fix.line_length +
((image->dx * p->var.bits_per_pixel) >> 3);
if (image->depth == 1) {
if (p->fix.visual == FB_VISUAL_TRUECOLOR) {
fgx = fgcolor = ((u32 *)(p->pseudo_palette))[image->fg_color];
bgx = bgcolor = ((u32 *)(p->pseudo_palette))[image->bg_color];
fgcolor =
((u32 *) (p->pseudo_palette))[image->fg_color];
bgcolor =
((u32 *) (p->pseudo_palette))[image->bg_color];
} else {
fgx = fgcolor = image->fg_color;
bgx = bgcolor = image->bg_color;
}
for (i = 0; i < ppw-1; i++) {
fgx <<= p->var.bits_per_pixel;
bgx <<= p->var.bits_per_pixel;
fgx |= fgcolor;
bgx |= bgcolor;
fgcolor = image->fg_color;
bgcolor = image->bg_color;
}
eorx = fgx ^ bgx;
n = ((image->width + 7) >> 3);
pad = (n << 3) - image->width;
n = image->width % ppw;
for (i = 0; i < image->height; i++) {
dst = (unsigned long *) dst1;
for (j = image->width/ppw; j > 0; j--) {
end_mask = 0;
for (k = ppw; k > 0; k--) {
if (test_bit(l, (unsigned long *) src))
end_mask |= (tmp >> (p->var.bits_per_pixel*(k-1)));
l--;
if (l < 0) { l = 7; src++; }
}
fb_writel((end_mask & eorx)^bgx, dst);
dst++;
}
if (n) {
end_mask = 0;
for (j = n; j > 0; j--) {
if (test_bit(l, (unsigned long *) src))
end_mask |= (tmp >> (p->var.bits_per_pixel*(j-1)));
l--;
if (l < 0) { l = 7; src++; }
}
fb_writel((end_mask & eorx)^bgx, dst);
dst++;
}
l -= pad;
dst1 += p->fix.line_length;
}
} else {
if (p->var.bits_per_pixel >= 8) {
if (BITS_PER_LONG % p->var.bits_per_pixel == 0)
fast_imageblit(image, p, dst1, fgcolor,
bgcolor);
else
slow_imageblit(image, p, dst1, fgcolor,
bgcolor);
} else
/* Is there such a thing as 3 or 5 bits per pixel? */
slow_imageblit(image, p, dst1, fgcolor, bgcolor);
}
else {
/* Draw the penguin */
n = ((image->width * p->var.bits_per_pixel) >> 3);
end_mask = 0;
......
......@@ -562,7 +562,7 @@ static void __init init_chips(struct fb_info_chips *p)
}
printk("fb%d: Chips 65550 frame buffer (%dK RAM detected)\n",
GET_FB_IDX(p->info.node), p->fix.smem_len / 1024);
minor(p->info.node), p->fix.smem_len / 1024);
chips_hw_init(p);
......
......@@ -27,8 +27,6 @@
#include <linux/proc_fs.h>
#include <linux/delay.h>
#include <video/fbcon.h>
#include <asm/hardware.h>
#include <asm/mach-types.h>
#include <asm/uaccess.h>
......@@ -216,14 +214,12 @@ static struct fb_ops clps7111fb_ops = {
.owner = THIS_MODULE,
.fb_check_var = clps7111fb_check_var,
.fb_set_par = clps7111fb_set_par,
.fb_set_var = gen_set_var,
.fb_set_cmap = gen_set_cmap,
.fb_get_cmap = gen_get_cmap,
.fb_setcolreg = clps7111fb_setcolreg,
.fb_blank = clps7111fb_blank,
.fb_fillrect = cfb_fillrect,
.fb_copyarea = cfb_copyarea,
.fb_imageblit = cfb_imageblit,
.fb_cursor = cfb_cursor,
};
static int
......@@ -368,20 +364,15 @@ int __init clps711xfb_init(void)
{
int err = -ENOMEM;
cfb = kmalloc(sizeof(*cfb) + sizeof(struct display), GFP_KERNEL);
cfb = kmalloc(sizeof(*cfb), GFP_KERNEL);
if (!cfb)
goto out;
memset(cfb, 0, sizeof(*cfb) + sizeof(struct display));
memset(cfb, 0, sizeof(*cfb));
strcpy(cfb->fix.id, "clps711x");
cfb->currcon = -1;
cfb->fbops = &clps7111fb_ops;
cfb->changevar = NULL;
cfb->switch_con = gen_switch;
cfb->updatevar = gen_update_var;
cfb->flags = FBINFO_FLAG_DEFAULT;
cfb->disp = (struct display *)(cfb + 1);
clps711x_guess_lcd_params(cfb);
......@@ -422,7 +413,6 @@ int __init clps711xfb_init(void)
clps_writeb(clps_readb(PDDR) | EDB_PD3_LCDBL, PDDR);
}
gen_set_var(&cfb->var, -1, cfb);
err = register_framebuffer(cfb);
out: return err;
......
#
# Video configuration
#
menu "Console display driver support"
config VGA_CONSOLE
bool "VGA text console"
depends on !ARCH_ACORN && !ARCH_EBSA110 || !4xx && !8xx
help
Saying Y here will allow you to use Linux in text mode through a
display that complies with the generic VGA standard. Virtually
everyone wants that.
The program SVGATextMode can be used to utilize SVGA video cards to
their full potential in text mode. Download it from
<ftp://ibiblio.org/pub/Linux/utils/console/>.
Say Y.
# if [ "$CONFIG_PCI" = "y" -a "$CONFIG_VGA_CONSOLE" = "y" ]; then
# bool ' Allow VGA on any bus?' CONFIG_VGA_HOSE
# if [ "$CONFIG_VGA_HOSE" = "y" ]; then
# define_bool CONFIG_DUMMY_CONSOLE y
# fi
# fi
config VIDEO_SELECT
bool "Video mode selection support"
---help---
This enables support for text mode selection on kernel startup. If
you want to take advantage of some high-resolution text mode your
card's BIOS offers, but the traditional Linux utilities like
SVGATextMode don't, you can say Y here and set the mode using the
"vga=" option from your boot loader (lilo or loadlin) or set
"vga=ask" which brings up a video mode menu on kernel startup. (Try
"man bootparam" or see the documentation of your boot loader about
how to pass options to the kernel.)
Read the file <file:Documentation/svga.txt> for more information
about the Video mode selection support. If unsure, say N.
config MDA_CONSOLE
tristate "MDA text console (dual-headed) (EXPERIMENTAL)"
---help---
Say Y here if you have an old MDA or monochrome Hercules graphics
adapter in your system acting as a second head ( = video card). You
will then be able to use two monitors with your Linux system. Do not
say Y here if your MDA card is the primary card in your system; the
normal VGA driver will handle it.
This driver is also available as a module ( = code which can be
inserted and removed from the running kernel whenever you want).
The module will be called mdacon.o. If you want to compile it as
a module, say M here and read <file:Documentation/modules.txt>.
If unsure, say N.
config SGI_NEWPORT_CONSOLE
tristate "SGI Newport Console support"
depends on SGI_IP22
help
Say Y here if you want the console on the Newport aka XL graphics
card of your Indy. Most people say Y here.
# bool 'IODC console' CONFIG_IODC_CONSOLE
config STI_CONSOLE
bool "STI console"
depends on PARISC
help
The STI console is the builtin display/keyboard on HP-PARISC
machines. Say Y here to build support for it into your kernel.
The alternative is to use your primary serial port as a console.
config PROM_CONSOLE
bool "PROM console"
depends on SPARC32 || SPARC64
help
Say Y to build a console driver for Sun machines that uses the
terminal emulation built into their console PROMS.
config DUMMY_CONSOLE
bool
depends on !PROM_CONSOLE=y || VGA_CONSOLE!=y || SGI_NEWPORT_CONSOLE!=y || !IODC_CONSOLE && GSC_PS2
default y
config FRAMEBUFFER_CONSOLE
bool "Framebuffer Console support"
depends on FB
config PCI_CONSOLE
bool
depends on FRAMEBUFFER_CONSOLE
default y
config FBCON_ADVANCED
bool "Advanced low level driver options"
depends on FRAMEBUFFER_CONSOLE
---help---
The frame buffer console uses character drawing routines that are
tailored to the specific organization of pixels in the memory of
your graphics hardware. These are called the low level frame buffer
console drivers. Note that they are used for text console output
only; they are NOT needed for graphical applications.
If you say N here, the needed low level drivers are automatically
enabled, depending on what frame buffer devices you selected above.
This is recommended for most users.
If you say Y here, you have more fine-grained control over which low
level drivers are enabled. You can e.g. leave out low level drivers
for color depths you do not intend to use for text consoles.
Low level frame buffer console drivers can be modules ( = code which
can be inserted and removed from the running kernel whenever you
want). The modules will be called fbcon-*.o. If you want to compile
(some of) them as modules, read <file:Documentation/modules.txt>.
If unsure, say N.
config FBCON_ACCEL
tristate "Hardware acceleration support" if FBCON_ADVANCED
depends on FB
default m if !FBCON_ADVANCED && FB_NEOMAGIC!=y && !FB_VESA && !FB_FM2 && FB_HIT!=y && !FB_HP300 && !FB_Q40 && !FB_ANAKIN && !FB_G364 && FB_VIRTUAL!=y && !FB_CLPS711X && !FB_PMAG_BA && !FB_PMAGB_B && FB_3DFX!=y && !FB_TX3912 && !FB_MAXINE && !FB_APOLLO && FB_ATY!=y && !FB_MAC && FB_RIVA!=y && !FB_OF && FB_SGIVW!=y && (FB_NEOMAGIC=m || FB_HIT=m || FB_VIRTUAL=m || FB_3DFX=m || FB_RIVA=m || FB_SGIVW=m)
default y if !FBCON_ADVANCED && (FB_NEOMAGIC=y || FB_VESA || FB_FM2 || FB_HIT=y || FB_HP300 || FB_Q40 || FB_ANAKIN || FB_G364 || FB_VIRTUAL=y || FB_CLPS711X || FB_PMAG_BA || FB_PMAGB_B || FB_3DFX=y || FB_TX3912 || FB_MAXINE || FB_APOLLO || FB_ATY=y || FB_MAC || FB_RIVA=y || FB_OF || FB_SGIVW=y)
config FBCON_AFB
tristate "Amiga bitplanes support" if FBCON_ADVANCED
depends on FB
default m if !FBCON_ADVANCED && FB_AMIGA=m
default y if !FBCON_ADVANCED && FB_AMIGA=y
help
This is the low level frame buffer console driver for 1 to 8
bitplanes (2 to 256 colors) on Amiga.
config FBCON_ILBM
tristate "Amiga interleaved bitplanes support" if FBCON_ADVANCED
depends on FB
default m if !FBCON_ADVANCED && FB_AMIGA=m
default y if !FBCON_ADVANCED && FB_AMIGA=y
help
This is the low level frame buffer console driver for 1 to 8
interleaved bitplanes (2 to 256 colors) on Amiga.
config FBCON_IPLAN2P2
tristate "Atari interleaved bitplanes (2 planes) support" if FBCON_ADVANCED
depends on FB
default y if !FBCON_ADVANCED && FB_ATARI
help
This is the low level frame buffer console driver for 2 interleaved
bitplanes (4 colors) on Atari.
config FBCON_IPLAN2P4
tristate "Atari interleaved bitplanes (4 planes) support" if FBCON_ADVANCED
depends on FB
default y if !FBCON_ADVANCED && FB_ATARI
help
This is the low level frame buffer console driver for 4 interleaved
bitplanes (16 colors) on Atari.
config FBCON_IPLAN2P8
tristate "Atari interleaved bitplanes (8 planes) support" if FBCON_ADVANCED
depends on FB
default y if !FBCON_ADVANCED && FB_ATARI
help
This is the low level frame buffer console driver for 8 interleaved
bitplanes (256 colors) on Atari.
config FBCON_HGA
tristate "HGA monochrome support (EXPERIMENTAL)" if FBCON_ADVANCED
depends on FB
default m if !FBCON_ADVANCED && FB_HGA=m
default y if !FBCON_ADVANCED && FB_HGA=y
help
This is the low level frame buffer console driver for Hercules mono
graphics cards.
# Guess what we need
config FBCON_STI
tristate
depends on !FBCON_ADVANCED && FB_STI
default y
config FBCON_FONTWIDTH8_ONLY
bool "Support only 8 pixels wide fonts"
depends on FB
help
Answer Y here will make the kernel provide only the 8x8 fonts (these
are the less readable).
If unsure, say N.
config FONT_SUN8x16
bool "Sparc console 8x16 font"
depends on FB && (!SPARC32 && !SPARC64 && FBCON_FONTS || SPARC32 || SPARC64)
help
This is the high resolution console font for Sun machines. Say Y.
config FONT_SUN12x22
bool "Sparc console 12x22 font (not supported by all drivers)"
depends on FB && !FBCON_FONTWIDTH8_ONLY && (!SPARC32 && !SPARC64 && FBCON_FONTS || SPARC32 || SPARC64)
help
This is the high resolution console font for Sun machines with very
big letters (like the letters used in the SPARC PROM). If the
standard font is unreadable for you, say Y, otherwise say N.
config FBCON_FONTS
bool "Select other fonts" if SPARC32 || SPARC64
depends on FB
help
Say Y here if you would like to use fonts other than the default
your frame buffer console usually use.
Note that the answer to this question won't directly affect the
kernel: saying N will just cause the configurator to skip all
the questions about foreign fonts.
If unsure, say N (the default choices are safe).
config FBCON_FONTS
prompt "Select compiled-in fonts"
depends on FB && !SPARC32 && !SPARC64
config FONT_8x8
bool "VGA 8x8 font" if FBCON_FONTS
depends on FB
default y if !SPARC32 && !SPARC64 && !FBCON_FONTS
help
This is the "high resolution" font for the VGA frame buffer (the one
provided by the text console 80x50 (and higher) modes).
Note that this is a poor quality font. The VGA 8x16 font is quite a
lot more readable.
Given the resolution provided by the frame buffer device, answer N
here is safe.
config FONT_8x16
bool "VGA 8x16 font" if FBCON_FONTS
depends on FB && SGI_NEWPORT_CONSOLE=y
default y if !SPARC32 && !SPARC64 && !FBCON_FONTS
help
This is the "high resolution" font for the VGA frame buffer (the one
provided by the VGA text console 80x25 mode.
If unsure, say Y.
config FONT_6x11
bool "Mac console 6x11 font (not supported by all drivers)" if FBCON_FONTS
depends on FB && !FBCON_FONTWIDTH8_ONLY
default y if !SPARC32 && !SPARC64 && !FBCON_FONTS && MAC
help
Small console font with Macintosh-style high-half glyphs. Some Mac
framebuffer drivers don't support this one at all.
config FONT_PEARL_8x8
bool "Pearl (old m68k) console 8x8 font" if FBCON_FONTS
depends on FB
default y if !SPARC32 && !SPARC64 && !FBCON_FONTS && AMIGA
help
Small console font with PC-style control-character and high-half
glyphs.
config FONT_ACORN_8x8
bool "Acorn console 8x8 font" if FBCON_FONTS
depends on FB
default y if !SPARC32 && !SPARC64 && !FBCON_FONTS && ARM && ARCH_ACORN
help
Small console font with PC-style control characters and high-half
glyphs.
config FONT_MINI_4x6
bool "Mini 4x6 font"
depends on !SPARC32 && !SPARC64 && FBCON_FONTS
endmenu
# Makefile for the Linux graphics to console drivers.
# 5 Aug 1999, James Simmons, <mailto:jsimmons@users.sf.net>
# Rewritten to use lists instead of if-statements.
# All of the (potential) objects that export symbols.
# This list comes from 'grep -l EXPORT_SYMBOL *.[hc]'.
export-objs := fbcon.o fbcon-accel.o fbcon-afb.o fbcon-ilbm.o \
fbcon-iplan2p2.o fbcon-iplan2p4.o fbcon-iplan2p8.o \
fbcon-hga.o
# Each configuration option enables a list of files.
obj-$(CONFIG_DUMMY_CONSOLE) += dummycon.o
obj-$(CONFIG_SGI_NEWPORT_CONSOLE) += newport_con.o
obj-$(CONFIG_PROM_CONSOLE) += promcon.o promcon_tbl.o
obj-$(CONFIG_STI_CONSOLE) += sticon.o sticore.o
obj-$(CONFIG_VGA_CONSOLE) += vgacon.o
obj-$(CONFIG_MDA_CONSOLE) += mdacon.o
obj-$(CONFIG_FONT_SUN8x16) += font_sun8x16.o
obj-$(CONFIG_FONT_SUN12x22) += font_sun12x22.o
obj-$(CONFIG_FONT_8x8) += font_8x8.o
obj-$(CONFIG_FONT_8x16) += font_8x16.o
obj-$(CONFIG_FONT_6x11) += font_6x11.o
obj-$(CONFIG_FONT_PEARL_8x8) += font_pearl_8x8.o
obj-$(CONFIG_FONT_ACORN_8x8) += font_acorn_8x8.o
obj-$(CONFIG_FONT_MINI_4x6) += font_mini_4x6.o
obj-$(CONFIG_FRAMEBUFFER_CONSOLE) += fbcon.o fonts.o
# Generic Low Level Drivers
obj-$(CONFIG_FBCON_AFB) += fbcon-afb.o
obj-$(CONFIG_FBCON_ILBM) += fbcon-ilbm.o
obj-$(CONFIG_FBCON_IPLAN2P2) += fbcon-iplan2p2.o
obj-$(CONFIG_FBCON_IPLAN2P4) += fbcon-iplan2p4.o
obj-$(CONFIG_FBCON_IPLAN2P8) += fbcon-iplan2p8.o
obj-$(CONFIG_FBCON_HGA) += fbcon-hga.o
obj-$(CONFIG_FBCON_STI) += fbcon-sti.o
obj-$(CONFIG_FBCON_ACCEL) += fbcon-accel.o
# Files generated that shall be removed upon make clean
clean-files := promcon_tbl.c
include $(TOPDIR)/Rules.make
$(obj)/promcon_tbl.c: $(src)/prom.uni
$(objtree)/scripts/conmakehash $< | \
sed -e '/#include <[^>]*>/p' -e 's/types/init/' \
-e 's/dfont\(_uni.*\]\)/promfont\1 __initdata/' > $@
......@@ -9,7 +9,6 @@
#include <linux/kdev_t.h>
#include <linux/tty.h>
#include <linux/console.h>
#include <linux/console_struct.h>
#include <linux/vt_kern.h>
#include <linux/init.h>
......@@ -33,14 +32,14 @@ static const char *dummycon_startup(void)
return "dummy device";
}
static void dummycon_init(struct vc_data *conp, int init)
static void dummycon_init(struct vc_data *vc, int init)
{
conp->vc_can_do_color = 1;
vc->vc_can_do_color = 1;
if (init) {
conp->vc_cols = DUMMY_COLUMNS;
conp->vc_rows = DUMMY_ROWS;
vc->vc_cols = DUMMY_COLUMNS;
vc->vc_rows = DUMMY_ROWS;
} else
vc_resize_con(DUMMY_ROWS, DUMMY_COLUMNS, conp->vc_num);
vc_resize(vc->vc_num, DUMMY_COLUMNS, DUMMY_ROWS);
}
static int dummycon_dummy(void)
......
......@@ -14,7 +14,7 @@
#include <linux/string.h>
#include <linux/fb.h>
#include <video/fbcon.h>
#include "fbcon.h"
#include "fbcon-accel.h"
void fbcon_accel_setup(struct display *p)
......@@ -34,18 +34,18 @@ void fbcon_accel_bmove(struct display *p, int sy, int sx, int dy, int dx,
area.dx = dx * fontwidth(p);
area.dy = dy * fontheight(p);
area.height = height * fontheight(p);
area.width = width * fontwidth(p);
area.width = width * fontwidth(p);
info->fbops->fb_copyarea(info, &area);
}
void fbcon_accel_clear(struct vc_data *vc, struct display *p, int sy, int sx,
int height, int width)
void fbcon_accel_clear(struct vc_data *vc, struct display *p, int sy,
int sx, int height, int width)
{
struct fb_info *info = p->fb_info;
struct fb_fillrect region;
region.color = attr_bgcol_ec(p,vc);
region.color = attr_bgcol_ec(p, vc);
region.dx = sx * fontwidth(p);
region.dy = sy * fontheight(p);
region.width = width * fontwidth(p);
......@@ -60,7 +60,7 @@ void fbcon_accel_putc(struct vc_data *vc, struct display *p, int c, int yy,
{
struct fb_info *info = p->fb_info;
unsigned short charmask = p->charmask;
unsigned int width = ((fontwidth(p)+7)>>3);
unsigned int width = ((fontwidth(p) + 7) >> 3);
struct fb_image image;
image.fg_color = attr_fgcol(p, c);
......@@ -70,7 +70,7 @@ void fbcon_accel_putc(struct vc_data *vc, struct display *p, int c, int yy,
image.width = fontwidth(p);
image.height = fontheight(p);
image.depth = 1;
image.data = p->fontdata + (c & charmask)*fontheight(p)*width;
image.data = p->fontdata + (c & charmask) * fontheight(p) * width;
info->fbops->fb_imageblit(info, &image);
}
......@@ -80,11 +80,12 @@ void fbcon_accel_putcs(struct vc_data *vc, struct display *p,
{
struct fb_info *info = p->fb_info;
unsigned short charmask = p->charmask;
unsigned int width = ((fontwidth(p)+7)>>3);
unsigned int width = ((fontwidth(p) + 7) >> 3);
struct fb_image image;
u16 c = scr_readw(s);
image.fg_color = attr_fgcol(p, *s);
image.bg_color = attr_bgcol(p, *s);
image.fg_color = attr_fgcol(p, c);
image.bg_color = attr_bgcol(p, c);
image.dx = xx * fontwidth(p);
image.dy = yy * fontheight(p);
image.width = fontwidth(p);
......@@ -93,7 +94,7 @@ void fbcon_accel_putcs(struct vc_data *vc, struct display *p,
while (count--) {
image.data = p->fontdata +
(scr_readw(s++) & charmask) * fontheight(p) * width;
(scr_readw(s++) & charmask) * fontheight(p) * width;
info->fbops->fb_imageblit(info, &image);
image.dx += fontwidth(p);
}
......@@ -107,10 +108,10 @@ void fbcon_accel_revc(struct display *p, int xx, int yy)
region.color = attr_fgcol_ec(p, p->conp);
region.dx = xx * fontwidth(p);
region.dy = yy * fontheight(p);
region.width = fontwidth(p);
region.height = fontheight(p);
region.width = fontwidth(p);
region.height = fontheight(p);
region.rop = ROP_XOR;
info->fbops->fb_fillrect(info, &region);
}
......@@ -126,39 +127,180 @@ void fbcon_accel_clear_margins(struct vc_data *vc, struct display *p,
unsigned int bs = info->var.yres - bh;
struct fb_fillrect region;
region.color = attr_bgcol_ec(p,vc);
region.color = attr_bgcol_ec(p, vc);
region.rop = ROP_COPY;
if (rw && !bottom_only) {
region.dx = info->var.xoffset + rs;
region.dy = 0;
region.width = rw;
region.width = rw;
region.height = info->var.yres_virtual;
info->fbops->fb_fillrect(info, &region);
info->fbops->fb_fillrect(info, &region);
}
if (bh) {
region.dx = info->var.xoffset;
region.dy = info->var.yoffset + bs;
region.width = rs;
region.height = bh;
region.dy = info->var.yoffset + bs;
region.width = rs;
region.height = bh;
info->fbops->fb_fillrect(info, &region);
}
}
/*
* `switch' for the low level operations
*/
void fbcon_accel_cursor(struct display *p, int flags, int xx, int yy)
{
static u32 palette_index[2];
static struct fb_index index = { 2, palette_index };
static char mask[64], image[64], *dest;
static int fgcolor, bgcolor, shape, width, height;
struct fb_info *info = p->fb_info;
struct fbcursor cursor;
int c;
char *font;
cursor.set = FB_CUR_SETPOS;
if (width != fontwidth(p) || height != fontheight(p)) {
width = fontwidth(p);
height = fontheight(p);
cursor.set |= FB_CUR_SETSIZE;
}
if ((p->conp->vc_cursor_type & 0x0f) != shape) {
shape = p->conp->vc_cursor_type & 0x0f;
cursor.set |= FB_CUR_SETSHAPE;
}
c = scr_readw((u16 *) p->cursor_pos);
if (fgcolor != (int) attr_fgcol(p, c) ||
bgcolor != (int) attr_bgcol(p, c)) {
fgcolor = (int) attr_fgcol(p, c);
bgcolor = (int) attr_bgcol(p, c);
cursor.set |= FB_CUR_SETCMAP;
}
c &= p->charmask;
font = p->fontdata + (c * ((width + 7) / 8) * height);
if (font != dest) {
dest = font;
cursor.set |= FB_CUR_SETDEST;
}
if (flags & FB_CUR_SETCUR)
cursor.enable = 1;
else
cursor.enable = 0;
if (cursor.set & FB_CUR_SETCMAP) {
palette_index[0] = bgcolor;
palette_index[1] = fgcolor;
}
if (cursor.set & FB_CUR_SETSIZE) {
memset(image, 0xff, 64);
cursor.set |= FB_CUR_SETSHAPE;
}
if (cursor.set & FB_CUR_SETSHAPE) {
int w, cur_height, size, i = 0;
w = (width + 7) / 8;
switch (shape) {
case CUR_NONE:
cur_height = 0;
break;
case CUR_UNDERLINE:
cur_height = (height < 10) ? 1 : 2;
break;
case CUR_LOWER_THIRD:
cur_height = height / 3;
break;
case CUR_LOWER_HALF:
cur_height = height / 2;
break;
case CUR_TWO_THIRDS:
cur_height = (height * 2) / 3;
break;
case CUR_BLOCK:
default:
cur_height = height;
break;
}
size = (height - cur_height) * w;
while (size--)
mask[i++] = 0;
size = cur_height * w;
while (size--)
mask[i++] = 0xff;
}
cursor.size.x = width;
cursor.size.y = height;
cursor.pos.x = xx * width;
cursor.pos.y = yy * height;
cursor.image = image;
cursor.mask = mask;
cursor.dest = dest;
cursor.rop = ROP_XOR;
cursor.index = &index;
cursor.depth = 1;
if (info->fbops->fb_cursor)
info->fbops->fb_cursor(info, &cursor);
else {
int i, size = ((cursor.size.x + 7) / 8) * cursor.size.y;
struct fb_image image;
static char data[64];
image.bg_color = cursor.index->entry[0];
image.fg_color = cursor.index->entry[1];
if (cursor.enable) {
switch (cursor.rop) {
case ROP_XOR:
for (i = 0; i < size; i++)
data[i] = (cursor.image[i] &
cursor.mask[i]) ^
cursor.dest[i];
break;
case ROP_COPY:
default:
for (i = 0; i < size; i++)
data[i] = cursor.image[i] &
cursor.mask[i];
break;
}
} else
memcpy(data, &cursor.dest, size);
image.dx = cursor.pos.x;
image.dy = cursor.pos.y;
image.width = cursor.size.x;
image.height = cursor.size.y;
image.depth = cursor.depth;
image.data = data;
if (info->fbops->fb_imageblit)
info->fbops->fb_imageblit(info, &image);
}
}
/*
* `switch' for the low level operations
*/
struct display_switch fbcon_accel = {
.setup = fbcon_accel_setup,
.bmove = fbcon_accel_bmove,
.clear = fbcon_accel_clear,
.putc = fbcon_accel_putc,
.putcs = fbcon_accel_putcs,
.revc = fbcon_accel_revc,
.clear_margins =fbcon_accel_clear_margins,
.fontwidthmask =FONTWIDTHRANGE(1, 16)
.setup = fbcon_accel_setup,
.bmove = fbcon_accel_bmove,
.clear = fbcon_accel_clear,
.putc = fbcon_accel_putc,
.putcs = fbcon_accel_putcs,
.revc = fbcon_accel_revc,
.clear_margins = fbcon_accel_clear_margins,
.cursor = fbcon_accel_cursor,
.fontwidthmask = FONTWIDTHRANGE(1, 16)
};
#ifdef MODULE
......@@ -166,17 +308,17 @@ MODULE_LICENSE("GPL");
int init_module(void)
{
return 0;
return 0;
}
void cleanup_module(void)
{}
#endif /* MODULE */
{
}
#endif /* MODULE */
/*
* Visible symbols for modules
*/
/*
* Visible symbols for modules
*/
EXPORT_SYMBOL(fbcon_accel);
EXPORT_SYMBOL(fbcon_accel_setup);
......
......@@ -15,8 +15,8 @@
#include <linux/string.h>
#include <linux/fb.h>
#include <video/fbcon.h>
#include <video/fbcon-afb.h>
#include "fbcon.h"
#include "fbcon-afb.h"
/*
......
......@@ -15,8 +15,8 @@
#include <linux/string.h>
#include <linux/fb.h>
#include <video/fbcon.h>
#include <video/fbcon-ilbm.h>
#include "fbcon.h"
#include "fbcon-ilbm.h"
/*
......
......@@ -22,8 +22,8 @@
#include <asm/setup.h>
#endif
#include <video/fbcon.h>
#include <video/fbcon-iplan2p2.h>
#include "fbcon.h"
#include "fbcon-iplan2p2.h"
/*
......
......@@ -22,8 +22,8 @@
#include <asm/setup.h>
#endif
#include <video/fbcon.h>
#include <video/fbcon-iplan2p4.h>
#include "fbcon.h"
#include "fbcon-iplan2p4.h"
/*
......
......@@ -22,8 +22,8 @@
#include <asm/setup.h>
#endif
#include <video/fbcon.h>
#include <video/fbcon-iplan2p8.h>
#include "fbcon.h"
#include "fbcon-iplan2p8.h"
/*
......
......@@ -17,42 +17,18 @@
#include <linux/string.h>
#include <linux/fb.h>
#include <linux/delay.h>
#include <asm/gsc.h> /* for gsc_read/write */
#include <asm/types.h>
#include <video/fbcon.h>
#include <video/fbcon-mfb.h>
#include "sti.h"
/* Translate an address as it would be found in a 2048x2048x1 bit frame
* buffer into a logical address Artist actually expects. Addresses fed
* into Artist look like this:
* fixed Y X
* FFFF FFFF LLLL LLLL LLLC CCCC CCCC CC00
*
* our "RAM" addresses look like this:
*
* FFFF FFFF 0000 0LLL LLLL LLLL CCCC CCCC [CCC]
*
* */
#include "../sticore.h"
static inline u32
ram2log(void * addr)
{
u32 a = (unsigned long) addr;
u32 r;
#if 0
r = a & 0xff000000; /* fixed part */
r += ((a & 0x000000ff) << 5);
r += ((a & 0x00ffff00) << 3);
#else
r = a & 0xff000000; /* fixed part */
r += ((a & 0x000000ff) << 5);
r += ((a & 0x0007ff00) << 5);
#endif
return r;
return (unsigned long) addr;
}
/* All those functions need better names. */
......@@ -74,30 +50,6 @@ memcpy_fromhp_tohp(void *dest, void *src, int count)
}
}
static void
memcpy_tohp(void *dest, void *src, int count)
{
unsigned long d = (unsigned long) dest;
u32 *s = (u32 *)src;
count += 3;
count &= ~3; /* XXX */
d = ram2log(dest);
while(count) {
count--;
gsc_writel(*s++, d);
d += 32*4;
}
}
static void
memcopy_fromhp(void *dest, void *src, int count)
{
/* FIXME */
printk("uhm ...\n");
}
static void
memset_tohp(void *dest, u32 word, int count)
......@@ -139,10 +91,11 @@ writeb_hp(u8 b, void *dst)
static void
fbcon_sti_setup(struct display *p)
{
if (p->line_length)
p->next_line = p->line_length;
else
/* in kernel 2.5 the value of sadly line_length disapeared */
if (p->var.xres_virtual /*line_length*/)
p->next_line = p->var.xres_virtual>>3;
else
p->next_line = 2048; /* default STI value */
p->next_plane = 0;
}
......@@ -152,7 +105,7 @@ fbcon_sti_bmove(struct display *p, int sy, int sx,
int height, int width)
{
#if 0 /* Unfortunately, still broken */
sti_bmove(&default_sti /* FIXME */, sy, sx, dy, dx, height, width);
sti_bmove(default_sti /* FIXME */, sy, sx, dy, dx, height, width);
#else
u8 *src, *dest;
u_int rows;
......@@ -285,7 +238,6 @@ static void fbcon_sti_revc(struct display *p,
u8 *dest, d;
u_int rows;
dest = p->fb_info->screen_base+yy*fontheight(p)*p->next_line+xx;
for (rows = fontheight(p); rows--; dest += p->next_line) {
d = readb_hp(dest);
......
/*
* linux/drivers/video/console/fbcon.h -- Low level frame buffer based console driver
*
* Copyright (C) 1997 Geert Uytterhoeven
*
* 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.
*/
#ifndef _VIDEO_FBCON_H
#define _VIDEO_FBCON_H
#include <linux/config.h>
#include <linux/types.h>
#include <linux/vt_buffer.h>
#include <linux/vt_kern.h>
#include <asm/io.h>
struct display;
/*
* `switch' for the Low Level Operations
*/
struct display_switch {
void (*setup)(struct display *p);
void (*bmove)(struct display *p, int sy, int sx, int dy, int dx,
int height, int width);
/* for clear, conp may be NULL, which means use a blanking (black) color */
void (*clear)(struct vc_data *conp, struct display *p, int sy, int sx,
int height, int width);
void (*putc)(struct vc_data *conp, struct display *p, int c, int yy,
int xx);
void (*putcs)(struct vc_data *conp, struct display *p, const unsigned short *s,
int count, int yy, int xx);
void (*revc)(struct display *p, int xx, int yy);
void (*cursor)(struct display *p, int flags, int xx, int yy);
int (*set_font)(struct display *p, int width, int height);
void (*clear_margins)(struct vc_data *conp, struct display *p,
int bottom_only);
unsigned int fontwidthmask; /* 1 at (1 << (width - 1)) if width is supported */
};
extern struct display_switch fbcon_dummy;
/*
* This is the interface between the low-level console driver and the
* low-level frame buffer device
*/
struct display {
/* Filled in by the frame buffer device */
u_short can_soft_blank; /* zero if no hardware blanking */
u_short inverse; /* != 0 text black on white as default */
struct display_switch *dispsw; /* low level operations */
void *dispsw_data; /* optional dispsw helper data */
#if 0
struct fb_fix_cursorinfo fcrsr;
struct fb_var_cursorinfo *vcrsr;
struct fb_cursorstate crsrstate;
#endif
/* Filled in by the low-level console driver */
struct vc_data *conp; /* pointer to console data */
struct fb_info *fb_info; /* frame buffer for this console */
int vrows; /* number of virtual rows */
unsigned short cursor_x; /* current cursor position */
unsigned short cursor_y;
unsigned long cursor_pos;
int fgcol; /* text colors */
int bgcol;
u_long next_line; /* offset to one line below */
u_long next_plane; /* offset to next plane */
char fontname[40]; /* Font associated to this display */
u_char *fontdata;
unsigned short _fontheightlog;
unsigned short _fontwidthlog;
unsigned short _fontheight;
unsigned short _fontwidth;
int userfont; /* != 0 if fontdata kmalloc()ed */
u_short scrollmode; /* Scroll Method */
short yscroll; /* Hardware scrolling */
unsigned char fgshift, bgshift;
unsigned short charmask; /* 0xff or 0x1ff */
};
/* drivers/video/console/fbcon.c */
extern struct display fb_display[MAX_NR_CONSOLES];
extern char con2fb_map[MAX_NR_CONSOLES];
extern void set_con2fb_map(int unit, int newidx);
extern int set_all_vcs(int fbidx, struct fb_ops *fb,
struct fb_var_screeninfo *var, struct fb_info *info);
#define fontheight(p) ((p)->_fontheight)
#define fontheightlog(p) ((p)->_fontheightlog)
#ifdef CONFIG_FBCON_FONTWIDTH8_ONLY
/* fontwidth w is supported by dispsw */
#define FONTWIDTH(w) (1 << ((8) - 1))
/* fontwidths w1-w2 inclusive are supported by dispsw */
#define FONTWIDTHRANGE(w1,w2) FONTWIDTH(8)
#define fontwidth(p) (8)
#define fontwidthlog(p) (0)
#else
/* fontwidth w is supported by dispsw */
#define FONTWIDTH(w) (1 << ((w) - 1))
/* fontwidths w1-w2 inclusive are supported by dispsw */
#define FONTWIDTHRANGE(w1,w2) (FONTWIDTH(w2+1) - FONTWIDTH(w1))
#define fontwidth(p) ((p)->_fontwidth)
#define fontwidthlog(p) ((p)->_fontwidthlog)
#endif
/*
* Attribute Decoding
*/
/* Color */
#define attr_fgcol(p,s) \
(((s) >> ((p)->fgshift)) & 0x0f)
#define attr_bgcol(p,s) \
(((s) >> ((p)->bgshift)) & 0x0f)
#define attr_bgcol_ec(p,conp) \
((conp) ? (((conp)->vc_video_erase_char >> ((p)->bgshift)) & 0x0f) : 0)
#define attr_fgcol_ec(p,vc) \
((vc) ? (((vc)->vc_video_erase_char >> ((p)->fgshift)) & 0x0f) : 0)
/* Monochrome */
#define attr_bold(p,s) \
((s) & 0x200)
#define attr_reverse(p,s) \
(((s) & 0x800) ^ ((p)->inverse ? 0x800 : 0))
#define attr_underline(p,s) \
((s) & 0x400)
#define attr_blink(p,s) \
((s) & 0x8000)
/*
* Scroll Method
*/
/* Internal flags */
#define __SCROLL_YPAN 0x001
#define __SCROLL_YWRAP 0x002
#define __SCROLL_YMOVE 0x003
#define __SCROLL_YREDRAW 0x004
#define __SCROLL_YMASK 0x00f
#define __SCROLL_YFIXED 0x010
#define __SCROLL_YNOMOVE 0x020
#define __SCROLL_YPANREDRAW 0x040
#define __SCROLL_YNOPARTIAL 0x080
/* Only these should be used by the drivers */
/* Which one should you use? If you have a fast card and slow bus,
then probably just 0 to indicate fbcon should choose between
YWRAP/YPAN+MOVE/YMOVE. On the other side, if you have a fast bus
and even better if your card can do fonting (1->8/32bit painting),
you should consider either SCROLL_YREDRAW (if your card is
able to do neither YPAN/YWRAP), or SCROLL_YNOMOVE.
The best is to test it with some real life scrolling (usually, not
all lines on the screen are filled completely with non-space characters,
and REDRAW performs much better on such lines, so don't cat a file
with every line covering all screen columns, it would not be the right
benchmark).
*/
#define SCROLL_YREDRAW (__SCROLL_YFIXED|__SCROLL_YREDRAW)
#define SCROLL_YNOMOVE (__SCROLL_YNOMOVE|__SCROLL_YPANREDRAW)
/* SCROLL_YNOPARTIAL, used in combination with the above, is for video
cards which can not handle using panning to scroll a portion of the
screen without excessive flicker. Panning will only be used for
whole screens.
*/
/* Namespace consistency */
#define SCROLL_YNOPARTIAL __SCROLL_YNOPARTIAL
extern void fbcon_redraw_clear(struct vc_data *, struct display *, int, int, int, int);
extern void fbcon_redraw_bmove(struct display *, int, int, int, int, int, int);
#endif /* _VIDEO_FBCON_H */
......@@ -4,7 +4,7 @@
/* */
/**********************************************/
#include <video/font.h>
#include "font.h"
#define FONTDATAMAX (11*256)
......
......@@ -4,7 +4,7 @@
/* */
/**********************************************/
#include <video/font.h>
#include "font.h"
#define FONTDATAMAX 4096
......
......@@ -4,7 +4,7 @@
/* */
/**********************************************/
#include <video/font.h>
#include "font.h"
#define FONTDATAMAX 2048
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
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