From ae38fd1e4c98588314a42097c5a5e77dcef23561 Mon Sep 17 00:00:00 2001 From: Ralf Baechle Date: Sun, 12 Mar 2000 23:15:27 +0000 Subject: Merge with Linux 2.3.50. --- drivers/video/Config.in | 9 + drivers/video/Makefile | 11 +- drivers/video/fbcmap.c | 45 +-- drivers/video/fbcon-hga.c | 245 +++++++++++++++ drivers/video/fbcon.c | 8 +- drivers/video/fbmem.c | 5 + drivers/video/hgafb.c | 762 +++++++++++++++++++++++++++++++++++++++++++++ drivers/video/riva/fbdev.c | 4 +- drivers/video/vesafb.c | 8 +- drivers/video/vgacon.c | 80 +++++ 10 files changed, 1146 insertions(+), 31 deletions(-) create mode 100644 drivers/video/fbcon-hga.c create mode 100644 drivers/video/hgafb.c (limited to 'drivers/video') diff --git a/drivers/video/Config.in b/drivers/video/Config.in index 850755767..4de32c098 100644 --- a/drivers/video/Config.in +++ b/drivers/video/Config.in @@ -85,6 +85,7 @@ if [ "$CONFIG_FB" = "y" ]; then if [ "$ARCH" = "i386" ]; then bool ' VESA VGA graphics console' CONFIG_FB_VESA tristate ' VGA 16-color graphics console' CONFIG_FB_VGA16 + tristate ' Hercules mono graphics console (EXPERIMENTAL)' CONFIG_FB_HGA define_bool CONFIG_VIDEO_SELECT y fi if [ "$CONFIG_VISWS" = "y" ]; then @@ -173,6 +174,7 @@ if [ "$CONFIG_FB" = "y" ]; then tristate ' Mac variable bpp packed pixels support' CONFIG_FBCON_MAC 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 else # Guess what we need if [ "$CONFIG_FB_ACORN" = "y" -o "$CONFIG_FB_AMIGA" = "y" -o \ @@ -331,6 +333,13 @@ if [ "$CONFIG_FB" = "y" ]; then define_tristate CONFIG_FBCON_VGA_PLANES m fi fi + if [ "$CONFIG_FB_HGA" = "y" ]; then + define_tristate CONFIG_FBCON_HGA y + else + if [ "$CONFIG_FB_HGA" = "m" ]; then + define_tristate CONFIG_FBCON_HGA m + fi + fi fi bool ' Support only 8 pixels wide fonts' CONFIG_FBCON_FONTWIDTH8_ONLY if [ "$ARCH" = "sparc" -o "$ARCH" = "sparc64" ]; then diff --git a/drivers/video/Makefile b/drivers/video/Makefile index 0f8b53c3f..c3d442e22 100644 --- a/drivers/video/Makefile +++ b/drivers/video/Makefile @@ -21,7 +21,7 @@ export-objs := fbmem.o fbcmap.o fbcon.o fbcon-afb.o fbcon-ilbm.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-mac.o fbcon-mfb.o fbcon-vga8-planes.o \ - matrox/matroxfb.o cyber2000fb.o + matrox/matroxfb.o cyber2000fb.o fbcon-hga.o # Object file lists. obj-y := @@ -85,9 +85,6 @@ 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_SUN3) += sun3fb.o -obj-$(CONFIG_FB_BWTWO) += bwtwofb.o -obj-$(CONFIG_FB_VIRTUAL) += vfb.o ifeq ($(CONFIG_FB_MATROX),y) SUB_DIRS += matrox @@ -109,6 +106,11 @@ else endif endif +obj-$(CONFIG_FB_SUN3) += sun3fb.o +obj-$(CONFIG_FB_BWTWO) += bwtwofb.o +obj-$(CONFIG_FB_HGA) += hgafb.o +obj-$(CONFIG_FB_VIRTUAL) += vfb.o + # Generic Low Level Drivers obj-$(CONFIG_FBCON_AFB) += fbcon-afb.o @@ -126,6 +128,7 @@ obj-$(CONFIG_FBCON_IPLAN2P16) += fbcon-iplan2p16.o obj-$(CONFIG_FBCON_MAC) += fbcon-mac.o obj-$(CONFIG_FBCON_MFB) += fbcon-mfb.o obj-$(CONFIG_FBCON_VGA) += fbcon-vga.o +obj-$(CONFIG_FBCON_HGA) += fbcon-hga.o # Extract lists of the multi-part drivers. # The 'int-*' lists are the intermediate files used to build the multi's. diff --git a/drivers/video/fbcmap.c b/drivers/video/fbcmap.c index 9207df06e..264cf14a7 100644 --- a/drivers/video/fbcmap.c +++ b/drivers/video/fbcmap.c @@ -16,22 +16,6 @@ #include - -static void memcpy_fs(int fsfromto, void *to, void *from, int len) -{ - switch (fsfromto) { - case 0: - memcpy(to, from, len); - return; - case 1: - copy_from_user(to, from, len); - return; - case 2: - copy_to_user(to, from, len); - return; - } -} - static u16 red2[] = { 0x0000, 0xaaaa }; @@ -148,11 +132,30 @@ void fb_copy_cmap(struct fb_cmap *from, struct fb_cmap *to, int fsfromto) if (size < 0) return; size *= sizeof(u16); - memcpy_fs(fsfromto, to->red+tooff, from->red+fromoff, size); - memcpy_fs(fsfromto, to->green+tooff, from->green+fromoff, size); - memcpy_fs(fsfromto, to->blue+tooff, from->blue+fromoff, size); - if (from->transp && to->transp) - memcpy_fs(fsfromto, to->transp+tooff, from->transp+fromoff, size); + + switch (fsfromto) { + case 0: + memcpy(to->red+tooff, from->red+fromoff, size); + memcpy(to->green+tooff, from->green+fromoff, size); + memcpy(to->blue+tooff, from->blue+fromoff, size); + if (from->transp && to->transp) + memcpy(to->transp+tooff, from->transp+fromoff, size); + break; + case 1: + copy_from_user(to->red+tooff, from->red+fromoff, size); + copy_from_user(to->green+tooff, from->green+fromoff, size); + copy_from_user(to->blue+tooff, from->blue+fromoff, size); + if (from->transp && to->transp) + copy_from_user(to->transp+tooff, from->transp+fromoff, size); + break; + case 2: + copy_to_user(to->red+tooff, from->red+fromoff, size); + copy_to_user(to->green+tooff, from->green+fromoff, size); + copy_to_user(to->blue+tooff, from->blue+fromoff, size); + if (from->transp && to->transp) + copy_to_user(to->transp+tooff, from->transp+fromoff, size); + break; + } } diff --git a/drivers/video/fbcon-hga.c b/drivers/video/fbcon-hga.c new file mode 100644 index 000000000..384e0a917 --- /dev/null +++ b/drivers/video/fbcon-hga.c @@ -0,0 +1,245 @@ +/* + * linux/drivers/video/fbcon-hga.c -- Low level frame buffer operations for + * the Hercules graphics adaptor + * + * Created 25 Nov 1999 by Ferenc Bakonyi (fero@drama.obuda.kando.hu) + * Based on fbcon-mfb.c by Geert Uytterhoeven + * + * History: + * + * - Revision 0.1.0 (6 Dec 1999): comment changes + * - First release (25 Nov 1999) + * + * 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 +#include +#include +#include +#include + +#include