Commit 67f42795 authored by James Simmons's avatar James Simmons

Accel wrapper is now intergarted into fbcon.c. VESA fb fixes

parent 4f81b375
...@@ -3,6 +3,7 @@ This is a first start for some documentation about frame buffer device ...@@ -3,6 +3,7 @@ This is a first start for some documentation about frame buffer device
internals. internals.
Geert Uytterhoeven <geert@linux-m68k.org>, 21 July 1998 Geert Uytterhoeven <geert@linux-m68k.org>, 21 July 1998
James Simmons <jsimmons@user.sf.net>, Nov 26 2002
-------------------------------------------------------------------------------- --------------------------------------------------------------------------------
...@@ -44,10 +45,6 @@ are defined in <linux/fb.h>. ...@@ -44,10 +45,6 @@ are defined in <linux/fb.h>.
Device dependent information that uniquely defines the video mode for this Device dependent information that uniquely defines the video mode for this
particular piece of hardware. particular piece of hardware.
- struct display
Interface between the frame buffer device and the console driver.
-------------------------------------------------------------------------------- --------------------------------------------------------------------------------
......
...@@ -336,13 +336,18 @@ config FB_TGA ...@@ -336,13 +336,18 @@ config FB_TGA
config FB_VESA config FB_VESA
bool "VESA VGA graphics console" bool "VESA VGA graphics console"
depends on FB && X86 depends on FB && (X86 || X86_64)
help help
This is the frame buffer device driver for generic VESA 2.0 This is the frame buffer device driver for generic VESA 2.0
compliant graphic cards. The older VESA 1.2 cards are not supported. compliant graphic cards. The older VESA 1.2 cards are not supported.
You will get a boot time penguin logo at no additional cost. Please You will get a boot time penguin logo at no additional cost. Please
read <file:Documentation/fb/vesafb.txt>. If unsure, say Y. read <file:Documentation/fb/vesafb.txt>. If unsure, say Y.
config VIDEO_SELECT
bool
depends on FB_VESA
default y
config FB_HGA config FB_HGA
tristate "Hercules mono graphics console" tristate "Hercules mono graphics console"
depends on FB && X86 depends on FB && X86
......
...@@ -75,7 +75,7 @@ obj-$(CONFIG_FB_ATY) += aty/ cfbimgblt.o ...@@ -75,7 +75,7 @@ obj-$(CONFIG_FB_ATY) += aty/ cfbimgblt.o
obj-$(CONFIG_FB_SUN3) += sun3fb.o obj-$(CONFIG_FB_SUN3) += sun3fb.o
obj-$(CONFIG_FB_BWTWO) += bwtwofb.o obj-$(CONFIG_FB_BWTWO) += bwtwofb.o
obj-$(CONFIG_FB_HGA) += hgafb.o obj-$(CONFIG_FB_HGA) += hgafb.o cfbfillrect.o cfbcopyarea.o cfbimgblt.o
obj-$(CONFIG_FB_SA1100) += sa1100fb.o obj-$(CONFIG_FB_SA1100) += sa1100fb.o
obj-$(CONFIG_FB_VIRTUAL) += vfb.o cfbfillrect.o cfbcopyarea.o cfbimgblt.o obj-$(CONFIG_FB_VIRTUAL) += vfb.o cfbfillrect.o cfbcopyarea.o cfbimgblt.o
obj-$(CONFIG_FB_HIT) += hitfb.o cfbfillrect.o cfbcopyarea.o cfbimgblt.o obj-$(CONFIG_FB_HIT) += hitfb.o cfbfillrect.o cfbcopyarea.o cfbimgblt.o
......
...@@ -27,6 +27,7 @@ config VGA_CONSOLE ...@@ -27,6 +27,7 @@ config VGA_CONSOLE
config VIDEO_SELECT config VIDEO_SELECT
bool "Video mode selection support" bool "Video mode selection support"
depends on (X86 || X86_64) && VGA_CONSOLE
---help--- ---help---
This enables support for text mode selection on kernel startup. If This enables support for text mode selection on kernel startup. If
you want to take advantage of some high-resolution text mode your you want to take advantage of some high-resolution text mode your
......
...@@ -100,9 +100,6 @@ ...@@ -100,9 +100,6 @@
#include <asm/linux_logo.h> #include <asm/linux_logo.h>
#include "fbcon.h" #include "fbcon.h"
#ifdef CONFIG_FBCON_ACCEL
#include "fbcon-accel.h"
#endif
#include "font.h" #include "font.h"
#ifdef FBCONDEBUG #ifdef FBCONDEBUG
...@@ -2487,16 +2484,12 @@ static int __init fbcon_show_logo(void) ...@@ -2487,16 +2484,12 @@ static int __init fbcon_show_logo(void)
struct display *p = &fb_display[fg_console]; /* draw to vt in foreground */ struct display *p = &fb_display[fg_console]; /* draw to vt in foreground */
struct fb_info *info = p->fb_info; struct fb_info *info = p->fb_info;
struct vc_data *vc = info->display_fg; struct vc_data *vc = info->display_fg;
#ifdef CONFIG_FBCON_ACCEL
struct fb_image image; struct fb_image image;
u32 *palette = NULL, *saved_palette = NULL; u32 *palette = NULL, *saved_palette = NULL;
#endif
int depth = info->var.bits_per_pixel; int depth = info->var.bits_per_pixel;
int line = info->fix.line_length;
unsigned char *fb = info->screen_base; unsigned char *fb = info->screen_base;
unsigned char *logo; unsigned char *logo;
unsigned char *dst, *src; int i, j, n, x;
int i, j, n, x1, y1, x;
int logo_depth, done = 0; int logo_depth, done = 0;
/* Return if the frame buffer is not mapped */ /* Return if the frame buffer is not mapped */
...@@ -2543,7 +2536,6 @@ static int __init fbcon_show_logo(void) ...@@ -2543,7 +2536,6 @@ static int __init fbcon_show_logo(void)
logo_depth = 1; logo_depth = 1;
} }
#if defined(CONFIG_FBCON_ACCEL)
if (info->fix.visual == FB_VISUAL_TRUECOLOR) { if (info->fix.visual == FB_VISUAL_TRUECOLOR) {
unsigned char mask[9] = unsigned char mask[9] =
{ 0, 0x80, 0xc0, 0xe0, 0xf0, 0xf8, 0xfc, 0xfe, 0xff }; { 0, 0x80, 0xc0, 0xe0, 0xf0, 0xf8, 0xfc, 0xfe, 0xff };
...@@ -2593,157 +2585,22 @@ static int __init fbcon_show_logo(void) ...@@ -2593,157 +2585,22 @@ static int __init fbcon_show_logo(void)
image.depth = depth; image.depth = depth;
image.data = logo; image.data = logo;
image.dy = 0; image.dy = 0;
#endif
for (x = 0; x < num_online_cpus() * (LOGO_W + 8) && for (x = 0; x < num_online_cpus() * (LOGO_W + 8) &&
x < info->var.xres - (LOGO_W + 8); x += (LOGO_W + 8)) { x < info->var.xres - (LOGO_W + 8); x += (LOGO_W + 8)) {
#if defined (CONFIG_FBCON_ACCEL)
image.dx = x; image.dx = x;
info->fbops->fb_imageblit(info, &image); info->fbops->fb_imageblit(info, &image);
done = 1; done = 1;
#endif
#if defined(CONFIG_FBCON_AFB) || defined(CONFIG_FBCON_ILBM) || \
defined(CONFIG_FBCON_IPLAN2P2) || defined(CONFIG_FBCON_IPLAN2P4) || \
defined(CONFIG_FBCON_IPLAN2P8)
if (depth >= 2 && (info->fix.type == FB_TYPE_PLANES ||
info->fix.type ==
FB_TYPE_INTERLEAVED_PLANES)) {
/* planes (normal or interleaved), with color registers */
int bit;
unsigned char val, mask;
#if defined(CONFIG_FBCON_IPLAN2P2) || defined(CONFIG_FBCON_IPLAN2P4) || \
defined(CONFIG_FBCON_IPLAN2P8)
int line_length = info->fix.line_length;
/* for support of Atari interleaved planes */
#define MAP_X(x) (line_length ? (x) : ((x) & ~1)*depth + ((x) & 1))
#else
#define MAP_X(x) (x)
#endif
/* extract a bit from the source image */
#define BIT(p,pix,bit) (p[pix*logo_depth/8] & \
(1 << ((8-((pix*logo_depth)&7)-logo_depth) + bit)))
src = logo;
for (y1 = 0; y1 < LOGO_H; y1++) {
for (x1 = 0; x1 < LOGO_LINE;
x1++, src += logo_depth) {
dst =
fb + y1 * line + MAP_X(x / 8 +
x1);
for (bit = 0; bit < logo_depth;
bit++) {
val = 0;
for (mask = 0x80, i = 0;
i < 8;
mask >>= 1, i++) {
if (BIT
(src, i, bit))
val |=
mask;
}
*dst = val;
dst += plane;
}
}
}
/* fill remaining planes */
if (depth > logo_depth) {
for (y1 = 0; y1 < LOGO_H; y1++) {
for (x1 = 0; x1 < LOGO_LINE; x1++) {
dst =
fb + y1 * line +
MAP_X(x / 8 + x1) +
logo_depth * plane;
for (i = logo_depth;
i < depth;
i++, dst += plane)
*dst = 0x00;
}
}
}
done = 1;
break;
}
#endif
#if defined(CONFIG_FBCON_ILBM) || defined(CONFIG_FBCON_AFB)
if (depth == 1
&& (info->fix.type == FB_TYPE_PACKED_PIXELS
|| info->fix.type == FB_TYPE_PLANES
|| info->fix.type == FB_TYPE_INTERLEAVED_PLANES)) {
/* monochrome */
unsigned char inverse = p->inverse
|| info->fix.visual ==
FB_VISUAL_MONO01 ? 0x00 : 0xff;
int is_hga = !strncmp(info->fix.id, "HGA", 3);
/* can't use simply memcpy because need to apply inverse */
for (y1 = 0; y1 < LOGO_H; y1++) {
src = logo + y1 * LOGO_LINE;
if (is_hga)
dst =
fb + (y1 % 4) * 8192 +
(y1 >> 2) * line + x / 8;
else
dst = fb + y1 * line + x / 8;
for (x1 = 0; x1 < LOGO_LINE; ++x1)
fb_writeb(*src++ ^ inverse, dst++);
}
done = 1;
}
#endif
#if defined(CONFIG_FBCON_VGA_PLANES)
if (depth == 4 && info->fix.type == FB_TYPE_VGA_PLANES) {
outb_p(1, 0x3ce);
outb_p(0xf, 0x3cf);
outb_p(3, 0x3ce);
outb_p(0, 0x3cf);
outb_p(5, 0x3ce);
outb_p(0, 0x3cf);
src = logo;
for (y1 = 0; y1 < LOGO_H; y1++) {
for (x1 = 0; x1 < LOGO_W / 2; x1++) {
dst =
fb + y1 * line + x1 / 4 +
x / 8;
outb_p(0, 0x3ce);
outb_p(*src >> 4, 0x3cf);
outb_p(8, 0x3ce);
outb_p(1 << (7 - x1 % 4 * 2),
0x3cf);
fb_readb(dst);
fb_writeb(0, dst);
outb_p(0, 0x3ce);
outb_p(*src & 0xf, 0x3cf);
outb_p(8, 0x3ce);
outb_p(1 << (7 - (1 + x1 % 4 * 2)),
0x3cf);
fb_readb(dst);
fb_writeb(0, dst);
src++;
}
}
done = 1;
}
#endif
} }
#if defined (CONFIG_FBCON_ACCEL)
if (palette != NULL) if (palette != NULL)
kfree(palette); kfree(palette);
if (saved_palette != NULL) if (saved_palette != NULL)
info->pseudo_palette = saved_palette; info->pseudo_palette = saved_palette;
#endif /*
/* Modes not yet supported: packed pixels with depth != 8 (does such a * Modes not yet supported: packed pixels with depth != 8 (does such a
* thing exist in reality?) */ * thing exist in reality?)
*/
return done ? (LOGO_H + vc->vc_font.height - 1) / vc->vc_font.height : 0; return done ? (LOGO_H + vc->vc_font.height - 1) / vc->vc_font.height : 0;
} }
......
...@@ -33,9 +33,7 @@ static struct fbcon_font_desc *fbcon_fonts[] = { ...@@ -33,9 +33,7 @@ static struct fbcon_font_desc *fbcon_fonts[] = {
&font_vga_8x16, &font_vga_8x16,
#endif #endif
#ifdef CONFIG_FONT_6x11 #ifdef CONFIG_FONT_6x11
#if defined(CONFIG_FBCON_ACCEL) || defined(CONFIG_FB_SBUS)
#undef NO_FONTS #undef NO_FONTS
#endif
&font_vga_6x11, &font_vga_6x11,
#endif #endif
#ifdef CONFIG_FONT_SUN8x16 #ifdef CONFIG_FONT_SUN8x16
...@@ -43,9 +41,7 @@ static struct fbcon_font_desc *fbcon_fonts[] = { ...@@ -43,9 +41,7 @@ static struct fbcon_font_desc *fbcon_fonts[] = {
&font_sun_8x16, &font_sun_8x16,
#endif #endif
#ifdef CONFIG_FONT_SUN12x22 #ifdef CONFIG_FONT_SUN12x22
#if defined(CONFIG_FB_SBUS) || defined(CONFIG_FBCON_CFB8) || defined(CONFIG_FBCON_CFB16) || defined(CONFIG_FBCON_CFB24) || defined(CONFIG_FBCON_CFB32) || defined(CONFIG_FBCON_ACCEL)
#undef NO_FONTS #undef NO_FONTS
#endif
&font_sun_12x22, &font_sun_12x22,
#endif #endif
#ifdef CONFIG_FONT_ACORN_8x8 #ifdef CONFIG_FONT_ACORN_8x8
......
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