Commit d295086c authored by James Simmons's avatar James Simmons

Ug. Synced up.

parents 32882f41 9999aa2c
...@@ -2790,6 +2790,19 @@ S: Klosterweg 28 / i309 ...@@ -2790,6 +2790,19 @@ S: Klosterweg 28 / i309
S: 76131 Karlsruhe S: 76131 Karlsruhe
S: Germany 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: Chris Vance
E: cvance@tislabs.com
N: Jaspreet Singh N: Jaspreet Singh
E: jaspreet@sangoma.com E: jaspreet@sangoma.com
W: www.sangoma.com W: www.sangoma.com
......
...@@ -365,7 +365,7 @@ KAO --> ...@@ -365,7 +365,7 @@ KAO -->
!Edrivers/video/fbmem.c !Edrivers/video/fbmem.c
</sect1> </sect1>
<sect1><title>Frame Buffer Console</title> <sect1><title>Frame Buffer Console</title>
!Edrivers/video/fbcon.c !Edrivers/video/console/fbcon.c
</sect1> </sect1>
<sect1><title>Frame Buffer Colormap</title> <sect1><title>Frame Buffer Colormap</title>
!Edrivers/video/fbcmap.c !Edrivers/video/fbcmap.c
...@@ -385,7 +385,7 @@ KAO --> ...@@ -385,7 +385,7 @@ KAO -->
!Idrivers/video/macmodes.c !Idrivers/video/macmodes.c
</sect1> </sect1>
<sect1><title>Frame Buffer Fonts</title> <sect1><title>Frame Buffer Fonts</title>
!Idrivers/video/fonts.c !Idrivers/video/console/fonts.c
</sect1> </sect1>
</chapter> </chapter>
<!-- Needs ksyms to list additional exported symbols, but no specific doc. <!-- Needs ksyms to list additional exported symbols, but no specific doc.
......
...@@ -591,6 +591,13 @@ M: kevin.curtis@farsite.co.uk ...@@ -591,6 +591,13 @@ M: kevin.curtis@farsite.co.uk
W: http://www.farsite.co.uk/ W: http://www.farsite.co.uk/
S: Supported 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()) FILE LOCKING (flock() and fcntl()/lockf())
P: Matthew Wilcox P: Matthew Wilcox
M: matthew@wil.cx M: matthew@wil.cx
......
...@@ -17,7 +17,7 @@ obj-$(CONFIG_FC4) += fc4/ ...@@ -17,7 +17,7 @@ obj-$(CONFIG_FC4) += fc4/
obj-$(CONFIG_SCSI) += scsi/ obj-$(CONFIG_SCSI) += scsi/
obj-$(CONFIG_FUSION) += message/ obj-$(CONFIG_FUSION) += message/
obj-$(CONFIG_IEEE1394) += ieee1394/ obj-$(CONFIG_IEEE1394) += ieee1394/
obj-y += cdrom/ obj-y += cdrom/ video/
obj-$(CONFIG_MTD) += mtd/ obj-$(CONFIG_MTD) += mtd/
obj-$(CONFIG_PCMCIA) += pcmcia/ obj-$(CONFIG_PCMCIA) += pcmcia/
obj-$(CONFIG_DIO) += dio/ obj-$(CONFIG_DIO) += dio/
...@@ -27,7 +27,6 @@ obj-$(CONFIG_ALL_PPC) += macintosh/ ...@@ -27,7 +27,6 @@ obj-$(CONFIG_ALL_PPC) += macintosh/
obj-$(CONFIG_MAC) += macintosh/ obj-$(CONFIG_MAC) += macintosh/
obj-$(CONFIG_PNP) += pnp/ obj-$(CONFIG_PNP) += pnp/
obj-$(CONFIG_SGI) += sgi/ obj-$(CONFIG_SGI) += sgi/
obj-$(CONFIG_VT) += video/
obj-$(CONFIG_PARIDE) += block/paride/ obj-$(CONFIG_PARIDE) += block/paride/
obj-$(CONFIG_TC) += tc/ obj-$(CONFIG_TC) += tc/
obj-$(CONFIG_USB) += usb/ obj-$(CONFIG_USB) += usb/
......
...@@ -5,33 +5,14 @@ ...@@ -5,33 +5,14 @@
# All of the (potential) objects that export symbols. # All of the (potential) objects that export symbols.
# This list comes from 'grep -l EXPORT_SYMBOL *.[hc]'. # This list comes from 'grep -l EXPORT_SYMBOL *.[hc]'.
export-objs := fbmem.o fbcmap.o fbcon.o fbmon.o modedb.o \ export-objs := fbmem.o fbcmap.o fbgen.o fbmon.o modedb.o cyber2000fb.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
# Each configuration option enables a list of files. # Each configuration option enables a list of files.
obj-$(CONFIG_DUMMY_CONSOLE) += dummycon.o obj-$(CONFIG_VT) += console/
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
# Add fbmon.o back into obj-$(CONFIG_FB) in 2.5.x # 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 # Only include macmodes.o if we have FB support and are PPC
ifeq ($(CONFIG_FB),y) ifeq ($(CONFIG_FB),y)
obj-$(CONFIG_PPC) += macmodes.o obj-$(CONFIG_PPC) += macmodes.o
...@@ -80,7 +61,7 @@ obj-$(CONFIG_FB_TCX) += tcxfb.o sbusfb.o ...@@ -80,7 +61,7 @@ obj-$(CONFIG_FB_TCX) += tcxfb.o sbusfb.o
obj-$(CONFIG_FB_CGFOURTEEN) += cgfourteenfb.o sbusfb.o obj-$(CONFIG_FB_CGFOURTEEN) += cgfourteenfb.o sbusfb.o
obj-$(CONFIG_FB_P9100) += p9100fb.o sbusfb.o obj-$(CONFIG_FB_P9100) += p9100fb.o sbusfb.o
obj-$(CONFIG_FB_LEO) += leofb.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_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_PMAGB_B) += pmagb-b-fb.o cfbfillrect.o cfbcopyarea.o cfbimgblt.o
obj-$(CONFIG_FB_MAXINE) += maxinefb.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 ...@@ -101,24 +82,6 @@ obj-$(CONFIG_FB_E1355) += epson1355fb.o
obj-$(CONFIG_FB_PVR2) += pvr2fb.o obj-$(CONFIG_FB_PVR2) += pvr2fb.o
obj-$(CONFIG_FB_VOODOO1) += sstfb.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 # Files generated that shall be removed upon make clean
clean-files := promcon_tbl.c clean-files := promcon_tbl.c
......
...@@ -20,11 +20,8 @@ ...@@ -20,11 +20,8 @@
#include <asm/io.h> #include <asm/io.h>
#include <video/fbcon.h>
static u32 colreg[16]; static u32 colreg[16];
static struct fb_info fb_info; static struct fb_info fb_info;
static struct display display;
static struct fb_var_screeninfo anakinfb_var = { static struct fb_var_screeninfo anakinfb_var = {
.xres = 400, .xres = 400,
...@@ -65,33 +62,23 @@ anakinfb_setcolreg(u_int regno, u_int red, u_int green, u_int blue, ...@@ -65,33 +62,23 @@ anakinfb_setcolreg(u_int regno, u_int red, u_int green, u_int blue,
static struct fb_ops anakinfb_ops = { static struct fb_ops anakinfb_ops = {
.owner = THIS_MODULE, .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_setcolreg = anakinfb_setcolreg,
.fb_fillrect = cfb_fillrect, .fb_fillrect = cfb_fillrect,
.fb_copyarea = cfb_copyarea, .fb_copyarea = cfb_copyarea,
.fb_imageblit = cfb_imageblit, .fb_imageblit = cfb_imageblit,
.fb_cursor = cfb_cursor,
}; };
int __init int __init
anakinfb_init(void) anakinfb_init(void)
{ {
memset(&fb_info, 0, sizeof(struct fb_info)); 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.node = NODEV;
fb_info.currcon = -1;
fb_info.flags = FBINFO_FLAG_DEFAULT; fb_info.flags = FBINFO_FLAG_DEFAULT;
fb_info.fbops = &anakinfb_ops; fb_info.fbops = &anakinfb_ops;
fb_info.var = anakinfb_var; fb_info.var = anakinfb_var;
fb_info.fix = anakinfb_fix; 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"))) if (!(request_mem_region(VGA_START, VGA_SIZE, "vga")))
return -ENOMEM; return -ENOMEM;
if (fb_info.screen_base = ioremap(VGA_START, VGA_SIZE)) { if (fb_info.screen_base = ioremap(VGA_START, VGA_SIZE)) {
...@@ -100,10 +87,9 @@ anakinfb_init(void) ...@@ -100,10 +87,9 @@ anakinfb_init(void)
} }
fb_alloc_cmap(&fb_info.cmap, 16, 0); fb_alloc_cmap(&fb_info.cmap, 16, 0);
gen_set_disp(-1, &fb_info);
if (register_framebuffer(&fb_info) < 0) { if (register_framebuffer(&fb_info) < 0) {
iounmap(display.screen_base); iounmap(fb_info.screen_base);
release_mem_region(VGA_START, VGA_SIZE); release_mem_region(VGA_START, VGA_SIZE);
return -EINVAL; return -EINVAL;
} }
......
This diff is collapsed.
...@@ -7,8 +7,6 @@ ...@@ -7,8 +7,6 @@
#include <asm/io.h> #include <asm/io.h>
#include <video/fbcon.h>
#include <video/mach64.h> #include <video/mach64.h>
#include "atyfb.h" #include "atyfb.h"
......
...@@ -11,8 +11,6 @@ ...@@ -11,8 +11,6 @@
#include <asm/io.h> #include <asm/io.h>
#include <asm/uaccess.h> #include <asm/uaccess.h>
#include <video/fbcon.h>
#ifdef __sparc__ #ifdef __sparc__
#include <asm/pbm.h> #include <asm/pbm.h>
#include <asm/fbio.h> #include <asm/fbio.h>
......
...@@ -9,8 +9,6 @@ ...@@ -9,8 +9,6 @@
#include <asm/io.h> #include <asm/io.h>
#include <video/fbcon.h>
#include <video/mach64.h> #include <video/mach64.h>
#include "atyfb.h" #include "atyfb.h"
......
This source diff could not be displayed because it is too large. You can view the blob instead.
This diff is collapsed.
...@@ -20,7 +20,6 @@ ...@@ -20,7 +20,6 @@
#include <linux/string.h> #include <linux/string.h>
#include <linux/fb.h> #include <linux/fb.h>
#include <asm/types.h> #include <asm/types.h>
#include <video/fbcon.h>
#if BITS_PER_LONG == 32 #if BITS_PER_LONG == 32
#define FB_READ fb_readl #define FB_READ fb_readl
...@@ -36,7 +35,7 @@ void cfb_fillrect(struct fb_info *p, struct fb_fillrect *rect) ...@@ -36,7 +35,7 @@ void cfb_fillrect(struct fb_info *p, struct fb_fillrect *rect)
unsigned long height, ppw, fg, fgcolor; unsigned long height, ppw, fg, fgcolor;
int i, n, x2, y2, linesize = p->fix.line_length; int i, n, x2, y2, linesize = p->fix.line_length;
int bpl = sizeof(unsigned long); int bpl = sizeof(unsigned long);
unsigned long *dst; unsigned long *dst = NULL;
char *dst1; char *dst1;
if (!rect->width || !rect->height) if (!rect->width || !rect->height)
...@@ -56,7 +55,7 @@ void cfb_fillrect(struct fb_info *p, struct fb_fillrect *rect) ...@@ -56,7 +55,7 @@ void cfb_fillrect(struct fb_info *p, struct fb_fillrect *rect)
ppw = BITS_PER_LONG / p->var.bits_per_pixel; ppw = BITS_PER_LONG / p->var.bits_per_pixel;
dst1 = p->screen_base + (rect->dy * linesize) + 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)); start_index = ((unsigned long) dst1 & (bpl - 1));
end_index = ((unsigned long) (dst1 + n) & (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) ...@@ -98,11 +97,12 @@ void cfb_fillrect(struct fb_info *p, struct fb_fillrect *rect)
case ROP_COPY: case ROP_COPY:
do { do {
/* Word align to increases performace :-) */ /* Word align to increases performace :-) */
dst = (unsigned long *) (dst1 - start_index); dst =
(unsigned long *) (dst1 - start_index);
if (start_mask) { if (start_mask) {
FB_WRITE(FB_READ(dst) | FB_WRITE(FB_READ(dst) |
start_mask, dst); start_mask, dst);
dst++; dst++;
} }
...@@ -113,17 +113,18 @@ void cfb_fillrect(struct fb_info *p, struct fb_fillrect *rect) ...@@ -113,17 +113,18 @@ void cfb_fillrect(struct fb_info *p, struct fb_fillrect *rect)
if (end_mask) if (end_mask)
FB_WRITE(FB_READ(dst) | end_mask, FB_WRITE(FB_READ(dst) | end_mask,
dst); dst);
dst1 += linesize; dst1 += linesize;
} while (--height); } while (--height);
break; break;
case ROP_XOR: case ROP_XOR:
do { do {
dst = (unsigned long *) (dst1 - start_index); dst =
(unsigned long *) (dst1 - start_index);
if (start_mask) { if (start_mask) {
FB_WRITE(FB_READ(dst) ^ FB_WRITE(FB_READ(dst) ^
start_mask, dst); start_mask, dst);
dst++; dst++;
} }
...@@ -134,56 +135,92 @@ void cfb_fillrect(struct fb_info *p, struct fb_fillrect *rect) ...@@ -134,56 +135,92 @@ void cfb_fillrect(struct fb_info *p, struct fb_fillrect *rect)
if (end_mask) { if (end_mask) {
FB_WRITE(FB_READ(dst) ^ end_mask, FB_WRITE(FB_READ(dst) ^ end_mask,
dst); dst);
} }
dst1 += linesize; dst1 += linesize;
} while (--height); } while (--height);
break; break;
} }
} else { } else {
/* Odd modes like 24 or 80 bits per pixel */ /*
start_mask = fg >> (start_index * p->var.bits_per_pixel); * Slow Method: The aim is to find the number of pixels to
end_mask = fg << (end_index * p->var.bits_per_pixel); * pack in order to write doubleword multiple data.
/* start_mask =& PFILL24(x1,fg); * For 24 bpp, 4 pixels are packed which are written as
end_mask_or = end_mask & PFILL24(x1+width-1,fg); */ * 3 dwords.
*/
n = (rect->width - start_index - end_index) / ppw; 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) { switch (rect->rop) {
case ROP_COPY: case ROP_COPY:
do { do {
dst = (unsigned long *) dst1; dst2 = dst1;
if (start_mask) n = total;
*dst |= start_mask;
if ((start_index + rect->width) > ppw) while (n >= pack_size) {
dst++; for (m = 0; m < write; m++) {
fb_writel(pixarray[m],
/* XXX: slow */ (u32 *) dst2);
for (i = 0; i < n; i++) { dst2 += 4;
*dst++ = fg; }
n -= pack_size;
}
if (n) {
m = 0;
while (n--)
fb_writeb(((u8 *)
pixarray)[m++],
dst2++);
} }
if (end_mask)
*dst |= end_mask;
dst1 += linesize; dst1 += linesize;
} while (--height); } while (--height);
break; break;
case ROP_XOR: case ROP_XOR:
do { do {
dst = (unsigned long *) dst1; dst2 = dst1;
if (start_mask) n = total;
*dst ^= start_mask;
if ((start_mask + rect->width) > ppw) while (n >= pack_size) {
dst++; for (m = 0; m < write; m++) {
fb_writel(fb_readl
for (i = 0; i < n; i++) { ((u32 *) dst2) ^
*dst++ ^= fg; /* PFILL24(fg,x1+i); */ 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; dst1 += linesize;
} while (--height); } while (--height);
break; break;
} }
} }
return; return;
} }
...@@ -22,6 +22,13 @@ ...@@ -22,6 +22,13 @@
* FIXME * FIXME
* The code for 24 bit is horrible. It copies byte by byte size instead of * The code for 24 bit is horrible. It copies byte by byte size instead of
* longs like the other sizes. Needs to be optimized. * 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 * 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. * the native cpu endians. I also need to deal with MSB position in the word.
...@@ -31,8 +38,6 @@ ...@@ -31,8 +38,6 @@
#include <linux/fb.h> #include <linux/fb.h>
#include <asm/types.h> #include <asm/types.h>
#include <video/fbcon.h>
#define DEBUG #define DEBUG
#ifdef DEBUG #ifdef DEBUG
...@@ -41,16 +46,251 @@ ...@@ -41,16 +46,251 @@
#define DPRINTK(fmt, args...) #define DPRINTK(fmt, args...)
#endif #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 i, j, k, l = 8, n;
int x2, y2, n, i, j, k, l = 7; 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 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 end_mask;
unsigned long *dst = NULL; 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 *dst1;
u8 *src;
/* /*
* We could use hardware clipping but on many cards you get around hardware * 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) ...@@ -62,68 +302,37 @@ void cfb_imageblit(struct fb_info *p, struct fb_image *image)
image->dy = image->dy > 0 ? image->dy : 0; image->dy = image->dy > 0 ? image->dy : 0;
x2 = x2 < p->var.xres_virtual ? x2 : p->var.xres_virtual; x2 = x2 < p->var.xres_virtual ? x2 : p->var.xres_virtual;
y2 = y2 < p->var.yres_virtual ? y2 : p->var.yres_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; 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 (image->depth == 1) {
if (p->fix.visual == FB_VISUAL_TRUECOLOR) { if (p->fix.visual == FB_VISUAL_TRUECOLOR) {
fgx = fgcolor = ((u32 *)(p->pseudo_palette))[image->fg_color]; fgcolor =
bgx = bgcolor = ((u32 *)(p->pseudo_palette))[image->bg_color]; ((u32 *) (p->pseudo_palette))[image->fg_color];
bgcolor =
((u32 *) (p->pseudo_palette))[image->bg_color];
} else { } else {
fgx = fgcolor = image->fg_color; fgcolor = image->fg_color;
bgx = bgcolor = image->bg_color; 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;
} }
eorx = fgx ^ bgx;
n = ((image->width + 7) >> 3); if (p->var.bits_per_pixel >= 8) {
pad = (n << 3) - image->width; if (BITS_PER_LONG % p->var.bits_per_pixel == 0)
n = image->width % ppw; fast_imageblit(image, p, dst1, fgcolor,
bgcolor);
for (i = 0; i < image->height; i++) { else
dst = (unsigned long *) dst1; slow_imageblit(image, p, dst1, fgcolor,
bgcolor);
for (j = image->width/ppw; j > 0; j--) { } else
end_mask = 0; /* Is there such a thing as 3 or 5 bits per pixel? */
slow_imageblit(image, p, dst1, fgcolor, bgcolor);
for (k = ppw; k > 0; k--) {
if (test_bit(l, (unsigned long *) src)) }
end_mask |= (tmp >> (p->var.bits_per_pixel*(k-1)));
l--; else {
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 {
/* Draw the penguin */ /* Draw the penguin */
n = ((image->width * p->var.bits_per_pixel) >> 3); n = ((image->width * p->var.bits_per_pixel) >> 3);
end_mask = 0; end_mask = 0;
......
...@@ -27,8 +27,6 @@ ...@@ -27,8 +27,6 @@
#include <linux/proc_fs.h> #include <linux/proc_fs.h>
#include <linux/delay.h> #include <linux/delay.h>
#include <video/fbcon.h>
#include <asm/hardware.h> #include <asm/hardware.h>
#include <asm/mach-types.h> #include <asm/mach-types.h>
#include <asm/uaccess.h> #include <asm/uaccess.h>
...@@ -216,14 +214,12 @@ static struct fb_ops clps7111fb_ops = { ...@@ -216,14 +214,12 @@ static struct fb_ops clps7111fb_ops = {
.owner = THIS_MODULE, .owner = THIS_MODULE,
.fb_check_var = clps7111fb_check_var, .fb_check_var = clps7111fb_check_var,
.fb_set_par = clps7111fb_set_par, .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_setcolreg = clps7111fb_setcolreg,
.fb_blank = clps7111fb_blank, .fb_blank = clps7111fb_blank,
.fb_fillrect = cfb_fillrect, .fb_fillrect = cfb_fillrect,
.fb_copyarea = cfb_copyarea, .fb_copyarea = cfb_copyarea,
.fb_imageblit = cfb_imageblit, .fb_imageblit = cfb_imageblit,
.fb_cursor = cfb_cursor,
}; };
static int static int
...@@ -368,20 +364,15 @@ int __init clps711xfb_init(void) ...@@ -368,20 +364,15 @@ int __init clps711xfb_init(void)
{ {
int err = -ENOMEM; int err = -ENOMEM;
cfb = kmalloc(sizeof(*cfb) + sizeof(struct display), GFP_KERNEL); cfb = kmalloc(sizeof(*cfb), GFP_KERNEL);
if (!cfb) if (!cfb)
goto out; goto out;
memset(cfb, 0, sizeof(*cfb) + sizeof(struct display)); memset(cfb, 0, sizeof(*cfb));
strcpy(cfb->fix.id, "clps711x"); strcpy(cfb->fix.id, "clps711x");
cfb->currcon = -1;
cfb->fbops = &clps7111fb_ops; cfb->fbops = &clps7111fb_ops;
cfb->changevar = NULL;
cfb->switch_con = gen_switch;
cfb->updatevar = gen_update_var;
cfb->flags = FBINFO_FLAG_DEFAULT; cfb->flags = FBINFO_FLAG_DEFAULT;
cfb->disp = (struct display *)(cfb + 1);
clps711x_guess_lcd_params(cfb); clps711x_guess_lcd_params(cfb);
...@@ -422,7 +413,6 @@ int __init clps711xfb_init(void) ...@@ -422,7 +413,6 @@ int __init clps711xfb_init(void)
clps_writeb(clps_readb(PDDR) | EDB_PD3_LCDBL, PDDR); clps_writeb(clps_readb(PDDR) | EDB_PD3_LCDBL, PDDR);
} }
gen_set_var(&cfb->var, -1, cfb);
err = register_framebuffer(cfb); err = register_framebuffer(cfb);
out: return err; out: return err;
......
CONFIG_VIDEO_SELECT
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_FBCON_FONTS
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_FONT_8x16
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_FBCON_FONTWIDTH8_ONLY
Answer Y here will make the kernel provide only the 8x8 fonts (these
are the less readable).
If unsure, say N.
CONFIG_FONT_SUN8x16
This is the high resolution console font for Sun machines. Say Y.
CONFIG_FONT_SUN12x22
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_FONT_8x8
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_6x11
Small console font with Macintosh-style high-half glyphs. Some Mac
framebuffer drivers don't support this one at all.
CONFIG_FONT_PEARL_8x8
Small console font with PC-style control-character and high-half
glyphs.
CONFIG_FONT_ACORN_8x8
Small console font with PC-style control characters and high-half
glyphs.
CONFIG_FBCON_ADVANCED
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_AFB
This is the low level frame buffer console driver for 1 to 8
bitplanes (2 to 256 colors) on Amiga.
CONFIG_FBCON_ILBM
This is the low level frame buffer console driver for 1 to 8
interleaved bitplanes (2 to 256 colors) on Amiga.
CONFIG_FBCON_IPLAN2P2
This is the low level frame buffer console driver for 2 interleaved
bitplanes (4 colors) on Atari.
CONFIG_FBCON_IPLAN2P4
This is the low level frame buffer console driver for 4 interleaved
bitplanes (16 colors) on Atari.
CONFIG_FBCON_IPLAN2P8
This is the low level frame buffer console driver for 8 interleaved
bitplanes (256 colors) on Atari.
CONFIG_FBCON_HGA
This is the low level frame buffer console driver for Hercules mono
graphics cards.
#
# Console Display configuration
#
if [ "$CONFIG_VT" != "n" ]; then
mainmenu_option next_comment
comment 'Console Display driver support'
bool 'Video mode selection support' CONFIG_VIDEO_SELECT
if [ "$CONFIG_ARCH_ACORN" != "y" -a "$CONFIG_ARCH_EBSA110" != "y" -a \
"$CONFIG_4xx" != "y" -a "$CONFIG_8xx" != "y" ]; then
bool 'VGA text console' CONFIG_VGA_CONSOLE
# 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
fi
tristate 'MDA text console ' CONFIG_MDA_CONSOLE
if [ "$CONFIG_SGI_IP22" = "y" ]; then
tristate 'SGI Newport Console support' CONFIG_SGI_NEWPORT_CONSOLE
if [ "$CONFIG_SGI_NEWPORT_CONSOLE" != "y" ]; then
define_bool CONFIG_DUMMY_CONSOLE y
else
define_bool CONFIG_FONT_8x16 y
fi
fi
if [ "$CONFIG_PARISC" = "y" ]; then
# bool 'IODC console' CONFIG_IODC_CONSOLE
bool 'STI console' CONFIG_STI_CONSOLE
if [ "$CONFIG_IODC_CONSOLE" = "n" ]; then
if [ "$CONFIG_GSC_PS2" = "y" ]; then
define_bool CONFIG_DUMMY_CONSOLE y
fi
fi
if [ "$CONFIG_STI_CONSOLE" = "y" ]; then
define_bool CONFIG_DUMMY_CONSOLE y
fi
fi
if [ "$CONFIG_SPARC32" = "y" -o "$CONFIG_SPARC64" = "y" ]; then
bool 'PROM console' CONFIG_PROM_CONSOLE
if [ "$CONFIG_PROM_CONSOLE" != "y" ]; then
define_bool CONFIG_DUMMY_CONSOLE y
fi
fi
if [ "$CONFIG_FB" = "y" ]; then
bool 'Framebuffer Console support' CONFIG_FRAMEBUFFER_CONSOLE
if [ "$CONFIG_FRAMEBUFFER_CONSOLE" = "y" ]; then
define_bool CONFIG_DUMMY_CONSOLE y
define_bool CONFIG_PCI_CONSOLE y
bool ' Advanced low level driver options' CONFIG_FBCON_ADVANCED
if [ "$CONFIG_FBCON_ADVANCED" = "y" ]; then
tristate ' Hardware acceleration support' CONFIG_FBCON_ACCEL
tristate ' Amiga bitplanes support' CONFIG_FBCON_AFB
tristate ' Amiga interleaved bitplanes support' CONFIG_FBCON_ILBM
tristate ' Atari interleaved bitplanes (2 planes) support' CONFIG_FBCON_IPLAN2P2
tristate ' Atari interleaved bitplanes (4 planes) support' CONFIG_FBCON_IPLAN2P4
tristate ' Atari interleaved bitplanes (8 planes) support' CONFIG_FBCON_IPLAN2P8
tristate ' HGA monochrome support ' CONFIG_FBCON_HGA
else
if [ "$CONFIG_FB_NEOMAGIC" = "y" -o "$CONFIG_FB_VESA" = "y" -o \
"$CONFIG_FB_FM2" = "y" -o "$CONFIG_FB_HIT" = "y" -o \
"$CONFIG_FB_HP300" = "y" -o "$CONFIG_FB_Q40" = "y" -o \
"$CONFIG_FB_ANAKIN" = "y" -o "$CONFIG_FB_G364" = "y" -o \
"$CONFIG_FB_VIRTUAL" = "y" -o "$CONFIG_FB_CLPS711X" = "y" -o \
"$CONFIG_FB_PMAG_BA" = "y" -o "$CONFIG_FB_PMAGB_B" = "y" -o \
"$CONFIG_FB_3DFX" = "y" -o "$CONFIG_FB_TX3912" = "y" -o \
"$CONFIG_FB_MAXINE" = "y" -o "$CONFIG_FB_APOLLO" = "y" -o \
"$CONFIG_FB_ATY" = "y" -o "$CONFIG_FB_MAC" = "y" -o \
"$CONFIG_FB_RIVA" = "y" -o "$CONFIG_FB_OF" = "y" -o \
"$CONFIG_FB_SGIVW" = "y" -o "$CONFIG_SIS" = "y" ]; then
define_tristate CONFIG_FBCON_ACCEL y
else
if [ "$CONFIG_FB_NEOMAGIC" = "m" -o "$CONFIG_FB_HIT" = "m" -o \
"$CONFIG_FB_G364" = "m" -o "$CONFIG_FB_VIRTUAL" = "m" -o \
"$CONFIG_FB_CLPS711X" = "m" -o "$CONFIG_FB_3DFX" = "m" -o \
"$CONFIG_FB_RIVA" = "m" -o "$CONFIG_FB_SGIVW" = "m" -o \
"$CONFIG_FB_ATY" = "m" -o "$CONFIG_FB_SIS" = "y" ]; then
define_tristate CONFIG_FBCON_ACCEL m
fi
fi
if [ "$CONFIG_FB_AMIGA" = "y" ]; then
define_tristate CONFIG_FBCON_AFB y
define_tristate CONFIG_FBCON_ILBM y
else
if [ "$CONFIG_FB_AMIGA" = "m" ]; then
define_tristate CONFIG_FBCON_AFB m
define_tristate CONFIG_FBCON_ILBM m
fi
fi
if [ "$CONFIG_FB_ATARI" = "y" ]; then
define_tristate CONFIG_FBCON_IPLAN2P2 y
define_tristate CONFIG_FBCON_IPLAN2P4 y
define_tristate CONFIG_FBCON_IPLAN2P8 y
else
if [ "$CONFIG_FB_ATARI" = "m" ]; then
define_tristate CONFIG_FBCON_IPLAN2P2 m
define_tristate CONFIG_FBCON_IPLAN2P4 m
define_tristate CONFIG_FBCON_IPLAN2P8 m
fi
fi
fi
bool ' Support only 8 pixels wide fonts' CONFIG_FBCON_FONTWIDTH8_ONLY
if [ "$CONFIG_SPARC32" = "y" -o "$CONFIG_SPARC64" = "y" ]; then
bool ' Sparc console 8x16 font' CONFIG_FONT_SUN8x16
if [ "$CONFIG_FBCON_FONTWIDTH8_ONLY" = "n" ]; then
bool ' Sparc console 12x22 font (not supported by all drivers)' CONFIG_FONT_SUN12x22
fi
bool ' Select other fonts' CONFIG_FBCON_FONTS
if [ "$CONFIG_FBCON_FONTS" = "y" ]; then
bool ' VGA 8x8 font' CONFIG_FONT_8x8
bool ' VGA 8x16 font' CONFIG_FONT_8x16
if [ "$CONFIG_FBCON_FONTWIDTH8_ONLY" = "n" ]; then
bool ' Mac console 6x11 font (not supported by all drivers)' CONFIG_FONT_6x11
fi
bool ' Pearl (old m68k) console 8x8 font' CONFIG_FONT_PEARL_8x8
bool ' Acorn console 8x8 font' CONFIG_FONT_ACORN_8x8
fi
else
bool ' Select compiled-in fonts' CONFIG_FBCON_FONTS
if [ "$CONFIG_FBCON_FONTS" = "y" ]; then
bool ' VGA 8x8 font' CONFIG_FONT_8x8
bool ' VGA 8x16 font' CONFIG_FONT_8x16
bool ' Sparc console 8x16 font' CONFIG_FONT_SUN8x16
if [ "$CONFIG_FBCON_FONTWIDTH8_ONLY" = "n" ]; then
bool ' Sparc console 12x22 font (not supported by all drivers)' CONFIG_FONT_SUN12x22
bool ' Mac console 6x11 font (not supported by all drivers)' CONFIG_FONT_6x11
fi
bool ' Pearl (old m68k) console 8x8 font' CONFIG_FONT_PEARL_8x8
bool ' Acorn console 8x8 font' CONFIG_FONT_ACORN_8x8
bool ' Mini 4x6 font' CONFIG_FONT_MINI_4x6
else
define_bool CONFIG_FONT_8x8 y
define_bool CONFIG_FONT_8x16 y
if [ "$CONFIG_MAC" = "y" ]; then
if [ "$CONFIG_FBCON_FONTWIDTH8_ONLY" = "n" ]; then
define_bool CONFIG_FONT_6x11 y
fi
fi
if [ "$CONFIG_AMIGA" = "y" ]; then
define_bool CONFIG_FONT_PEARL_8x8 y
fi
if [ "$CONFIG_ARM" = "y" -a "$CONFIG_ARCH_ACORN" = "y" ]; then
define_bool CONFIG_FONT_ACORN_8x8 y
fi
fi
fi
fi
fi
endmenu
fi
# 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/' > $@
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
#include <linux/string.h> #include <linux/string.h>
#include <linux/fb.h> #include <linux/fb.h>
#include <video/fbcon.h> #include "fbcon.h"
#include "fbcon-accel.h" #include "fbcon-accel.h"
void fbcon_accel_setup(struct display *p) 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, ...@@ -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.dx = dx * fontwidth(p);
area.dy = dy * fontheight(p); area.dy = dy * fontheight(p);
area.height = height * fontheight(p); area.height = height * fontheight(p);
area.width = width * fontwidth(p); area.width = width * fontwidth(p);
info->fbops->fb_copyarea(info, &area); info->fbops->fb_copyarea(info, &area);
} }
void fbcon_accel_clear(struct vc_data *vc, struct display *p, int sy, int sx, void fbcon_accel_clear(struct vc_data *vc, struct display *p, int sy,
int height, int width) int sx, int height, int width)
{ {
struct fb_info *info = p->fb_info; struct fb_info *info = p->fb_info;
struct fb_fillrect region; struct fb_fillrect region;
region.color = attr_bgcol_ec(p,vc); region.color = attr_bgcol_ec(p, vc);
region.dx = sx * fontwidth(p); region.dx = sx * fontwidth(p);
region.dy = sy * fontheight(p); region.dy = sy * fontheight(p);
region.width = width * fontwidth(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, ...@@ -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; struct fb_info *info = p->fb_info;
unsigned short charmask = p->charmask; unsigned short charmask = p->charmask;
unsigned int width = ((fontwidth(p)+7)>>3); unsigned int width = ((fontwidth(p) + 7) >> 3);
struct fb_image image; struct fb_image image;
image.fg_color = attr_fgcol(p, c); 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, ...@@ -70,7 +70,7 @@ void fbcon_accel_putc(struct vc_data *vc, struct display *p, int c, int yy,
image.width = fontwidth(p); image.width = fontwidth(p);
image.height = fontheight(p); image.height = fontheight(p);
image.depth = 1; 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); info->fbops->fb_imageblit(info, &image);
} }
...@@ -80,11 +80,12 @@ void fbcon_accel_putcs(struct vc_data *vc, struct display *p, ...@@ -80,11 +80,12 @@ void fbcon_accel_putcs(struct vc_data *vc, struct display *p,
{ {
struct fb_info *info = p->fb_info; struct fb_info *info = p->fb_info;
unsigned short charmask = p->charmask; unsigned short charmask = p->charmask;
unsigned int width = ((fontwidth(p)+7)>>3); unsigned int width = ((fontwidth(p) + 7) >> 3);
struct fb_image image; struct fb_image image;
u16 c = scr_readw(s);
image.fg_color = attr_fgcol(p, *s); image.fg_color = attr_fgcol(p, c);
image.bg_color = attr_bgcol(p, *s); image.bg_color = attr_bgcol(p, c);
image.dx = xx * fontwidth(p); image.dx = xx * fontwidth(p);
image.dy = yy * fontheight(p); image.dy = yy * fontheight(p);
image.width = fontwidth(p); image.width = fontwidth(p);
...@@ -93,7 +94,7 @@ void fbcon_accel_putcs(struct vc_data *vc, struct display *p, ...@@ -93,7 +94,7 @@ void fbcon_accel_putcs(struct vc_data *vc, struct display *p,
while (count--) { while (count--) {
image.data = p->fontdata + image.data = p->fontdata +
(scr_readw(s++) & charmask) * fontheight(p) * width; (scr_readw(s++) & charmask) * fontheight(p) * width;
info->fbops->fb_imageblit(info, &image); info->fbops->fb_imageblit(info, &image);
image.dx += fontwidth(p); image.dx += fontwidth(p);
} }
...@@ -107,10 +108,10 @@ void fbcon_accel_revc(struct display *p, int xx, int yy) ...@@ -107,10 +108,10 @@ void fbcon_accel_revc(struct display *p, int xx, int yy)
region.color = attr_fgcol_ec(p, p->conp); region.color = attr_fgcol_ec(p, p->conp);
region.dx = xx * fontwidth(p); region.dx = xx * fontwidth(p);
region.dy = yy * fontheight(p); region.dy = yy * fontheight(p);
region.width = fontwidth(p); region.width = fontwidth(p);
region.height = fontheight(p); region.height = fontheight(p);
region.rop = ROP_XOR; region.rop = ROP_XOR;
info->fbops->fb_fillrect(info, &region); info->fbops->fb_fillrect(info, &region);
} }
...@@ -126,39 +127,180 @@ void fbcon_accel_clear_margins(struct vc_data *vc, struct display *p, ...@@ -126,39 +127,180 @@ void fbcon_accel_clear_margins(struct vc_data *vc, struct display *p,
unsigned int bs = info->var.yres - bh; unsigned int bs = info->var.yres - bh;
struct fb_fillrect region; struct fb_fillrect region;
region.color = attr_bgcol_ec(p,vc); region.color = attr_bgcol_ec(p, vc);
region.rop = ROP_COPY; region.rop = ROP_COPY;
if (rw && !bottom_only) { if (rw && !bottom_only) {
region.dx = info->var.xoffset + rs; region.dx = info->var.xoffset + rs;
region.dy = 0; region.dy = 0;
region.width = rw; region.width = rw;
region.height = info->var.yres_virtual; region.height = info->var.yres_virtual;
info->fbops->fb_fillrect(info, &region); info->fbops->fb_fillrect(info, &region);
} }
if (bh) { if (bh) {
region.dx = info->var.xoffset; region.dx = info->var.xoffset;
region.dy = info->var.yoffset + bs; region.dy = info->var.yoffset + bs;
region.width = rs; region.width = rs;
region.height = bh; region.height = bh;
info->fbops->fb_fillrect(info, &region); info->fbops->fb_fillrect(info, &region);
} }
} }
/* void fbcon_accel_cursor(struct display *p, int flags, int xx, int yy)
* `switch' for the low level operations {
*/ 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 = { struct display_switch fbcon_accel = {
.setup = fbcon_accel_setup, .setup = fbcon_accel_setup,
.bmove = fbcon_accel_bmove, .bmove = fbcon_accel_bmove,
.clear = fbcon_accel_clear, .clear = fbcon_accel_clear,
.putc = fbcon_accel_putc, .putc = fbcon_accel_putc,
.putcs = fbcon_accel_putcs, .putcs = fbcon_accel_putcs,
.revc = fbcon_accel_revc, .revc = fbcon_accel_revc,
.clear_margins =fbcon_accel_clear_margins, .clear_margins = fbcon_accel_clear_margins,
.fontwidthmask =FONTWIDTHRANGE(1, 16) .cursor = fbcon_accel_cursor,
.fontwidthmask = FONTWIDTHRANGE(1, 16)
}; };
#ifdef MODULE #ifdef MODULE
...@@ -166,17 +308,17 @@ MODULE_LICENSE("GPL"); ...@@ -166,17 +308,17 @@ MODULE_LICENSE("GPL");
int init_module(void) int init_module(void)
{ {
return 0; return 0;
} }
void cleanup_module(void) void cleanup_module(void)
{} {
#endif /* MODULE */ }
#endif /* MODULE */
/* /*
* Visible symbols for modules * Visible symbols for modules
*/ */
EXPORT_SYMBOL(fbcon_accel); EXPORT_SYMBOL(fbcon_accel);
EXPORT_SYMBOL(fbcon_accel_setup); EXPORT_SYMBOL(fbcon_accel_setup);
......
...@@ -15,8 +15,8 @@ ...@@ -15,8 +15,8 @@
#include <linux/string.h> #include <linux/string.h>
#include <linux/fb.h> #include <linux/fb.h>
#include <video/fbcon.h> #include "fbcon.h"
#include <video/fbcon-afb.h> #include "fbcon-afb.h"
/* /*
......
...@@ -15,8 +15,8 @@ ...@@ -15,8 +15,8 @@
#include <linux/string.h> #include <linux/string.h>
#include <linux/fb.h> #include <linux/fb.h>
#include <video/fbcon.h> #include "fbcon.h"
#include <video/fbcon-ilbm.h> #include "fbcon-ilbm.h"
/* /*
......
...@@ -22,8 +22,8 @@ ...@@ -22,8 +22,8 @@
#include <asm/setup.h> #include <asm/setup.h>
#endif #endif
#include <video/fbcon.h> #include "fbcon.h"
#include <video/fbcon-iplan2p2.h> #include "fbcon-iplan2p2.h"
/* /*
......
...@@ -22,8 +22,8 @@ ...@@ -22,8 +22,8 @@
#include <asm/setup.h> #include <asm/setup.h>
#endif #endif
#include <video/fbcon.h> #include "fbcon.h"
#include <video/fbcon-iplan2p4.h> #include "fbcon-iplan2p4.h"
/* /*
......
...@@ -22,8 +22,8 @@ ...@@ -22,8 +22,8 @@
#include <asm/setup.h> #include <asm/setup.h>
#endif #endif
#include <video/fbcon.h> #include "fbcon.h"
#include <video/fbcon-iplan2p8.h> #include "fbcon-iplan2p8.h"
/* /*
......
...@@ -17,42 +17,18 @@ ...@@ -17,42 +17,18 @@
#include <linux/string.h> #include <linux/string.h>
#include <linux/fb.h> #include <linux/fb.h>
#include <linux/delay.h> #include <linux/delay.h>
#include <asm/gsc.h> /* for gsc_read/write */
#include <asm/types.h> #include <asm/types.h>
#include <video/fbcon.h> #include <video/fbcon.h>
#include <video/fbcon-mfb.h> #include <video/fbcon-mfb.h>
#include "sti.h" #include "../sticore.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]
*
* */
static inline u32 static inline u32
ram2log(void * addr) ram2log(void * addr)
{ {
u32 a = (unsigned long) addr; return (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;
} }
/* All those functions need better names. */ /* All those functions need better names. */
...@@ -74,30 +50,6 @@ memcpy_fromhp_tohp(void *dest, void *src, int count) ...@@ -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 static void
memset_tohp(void *dest, u32 word, int count) memset_tohp(void *dest, u32 word, int count)
...@@ -139,10 +91,11 @@ writeb_hp(u8 b, void *dst) ...@@ -139,10 +91,11 @@ writeb_hp(u8 b, void *dst)
static void static void
fbcon_sti_setup(struct display *p) fbcon_sti_setup(struct display *p)
{ {
if (p->line_length) /* in kernel 2.5 the value of sadly line_length disapeared */
p->next_line = p->line_length; if (p->var.xres_virtual /*line_length*/)
else
p->next_line = p->var.xres_virtual>>3; p->next_line = p->var.xres_virtual>>3;
else
p->next_line = 2048; /* default STI value */
p->next_plane = 0; p->next_plane = 0;
} }
...@@ -152,7 +105,7 @@ fbcon_sti_bmove(struct display *p, int sy, int sx, ...@@ -152,7 +105,7 @@ fbcon_sti_bmove(struct display *p, int sy, int sx,
int height, int width) int height, int width)
{ {
#if 0 /* Unfortunately, still broken */ #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 #else
u8 *src, *dest; u8 *src, *dest;
u_int rows; u_int rows;
...@@ -285,7 +238,6 @@ static void fbcon_sti_revc(struct display *p, ...@@ -285,7 +238,6 @@ static void fbcon_sti_revc(struct display *p,
u8 *dest, d; u8 *dest, d;
u_int rows; u_int rows;
dest = p->fb_info->screen_base+yy*fontheight(p)*p->next_line+xx; dest = p->fb_info->screen_base+yy*fontheight(p)*p->next_line+xx;
for (rows = fontheight(p); rows--; dest += p->next_line) { for (rows = fontheight(p); rows--; dest += p->next_line) {
d = readb_hp(dest); 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/console_struct.h>
#include <linux/vt_buffer.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 @@ ...@@ -4,7 +4,7 @@
/* */ /* */
/**********************************************/ /**********************************************/
#include <video/font.h> #include "font.h"
#define FONTDATAMAX (11*256) #define FONTDATAMAX (11*256)
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
/* */ /* */
/**********************************************/ /**********************************************/
#include <video/font.h> #include "font.h"
#define FONTDATAMAX 4096 #define FONTDATAMAX 4096
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
/* */ /* */
/**********************************************/ /**********************************************/
#include <video/font.h> #include "font.h"
#define FONTDATAMAX 2048 #define FONTDATAMAX 2048
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
#include <linux/config.h> #include <linux/config.h>
#include <video/font.h> #include "font.h"
static unsigned char acorndata_8x8[] = { static unsigned char acorndata_8x8[] = {
/* 00 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ^@ */ /* 00 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ^@ */
......
...@@ -39,7 +39,7 @@ __END__; ...@@ -39,7 +39,7 @@ __END__;
MSBit to LSBit = left to right. MSBit to LSBit = left to right.
*/ */
#include <video/font.h> #include "font.h"
#define FONTDATAMAX 1536 #define FONTDATAMAX 1536
......
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
/* */ /* */
/**********************************************/ /**********************************************/
#include <video/font.h> #include "font.h"
#define FONTDATAMAX 2048 #define FONTDATAMAX 2048
......
#include <video/font.h> #include "font.h"
#define FONTDATAMAX 11264 #define FONTDATAMAX 11264
......
#include <video/font.h> #include "font.h"
#define FONTDATAMAX 4096 #define FONTDATAMAX 4096
......
...@@ -19,7 +19,7 @@ ...@@ -19,7 +19,7 @@
#if defined(__mc68000__) || defined(CONFIG_APUS) #if defined(__mc68000__) || defined(CONFIG_APUS)
#include <asm/setup.h> #include <asm/setup.h>
#endif #endif
#include <video/font.h> #include "font.h"
#define NO_FONTS #define NO_FONTS
......
...@@ -30,7 +30,7 @@ ...@@ -30,7 +30,7 @@
#define INCLUDE_LINUX_LOGO_DATA #define INCLUDE_LINUX_LOGO_DATA
#include <asm/linux_logo.h> #include <asm/linux_logo.h>
#include <video/font.h> #include "font.h"
#define LOGO_W 80 #define LOGO_W 80
#define LOGO_H 80 #define LOGO_H 80
......
...@@ -85,9 +85,8 @@ this file *will* be replaced with it. You have been warned. ...@@ -85,9 +85,8 @@ this file *will* be replaced with it. You have been warned.
#include <asm/system.h> #include <asm/system.h>
#include <asm/uaccess.h> #include <asm/uaccess.h>
#include <video/fbcon.h> #include "fbcon.h"
#include <video/font.h> #include "font.h"
#include "sti-bmode.h" #include "sti-bmode.h"
/* The latency of the STI functions cannot really be reduced by setting /* The latency of the STI functions cannot really be reduced by setting
......
...@@ -180,6 +180,13 @@ static const char __init *vgacon_startup(void) ...@@ -180,6 +180,13 @@ static const char __init *vgacon_startup(void)
#endif #endif
} }
/* VGA16 modes are not handled by VGACON */
if ((ORIG_VIDEO_MODE == 0x0D) || /* 320x200/4 */
(ORIG_VIDEO_MODE == 0x0E) || /* 640x200/4 */
(ORIG_VIDEO_MODE == 0x10) || /* 640x350/4 */
(ORIG_VIDEO_MODE == 0x12) || /* 640x480/4 */
(ORIG_VIDEO_MODE == 0x6A)) /* 800x600/4, 0x6A is very common */
goto no_vga;
vga_video_num_lines = ORIG_VIDEO_LINES; vga_video_num_lines = ORIG_VIDEO_LINES;
vga_video_num_columns = ORIG_VIDEO_COLS; vga_video_num_columns = ORIG_VIDEO_COLS;
......
...@@ -15,8 +15,6 @@ ...@@ -15,8 +15,6 @@
#include <linux/fb.h> #include <linux/fb.h>
#include <linux/module.h> #include <linux/module.h>
#include <video/fbcon.h>
/* apollo video HW definitions */ /* apollo video HW definitions */
/* /*
...@@ -111,7 +109,6 @@ ...@@ -111,7 +109,6 @@
#endif #endif
static struct fb_info fb_info; static struct fb_info fb_info;
static struct display disp;
/* frame buffer operations */ /* frame buffer operations */
...@@ -120,13 +117,11 @@ static void dnfb_copyarea(struct fb_info *info, struct fb_copyarea *area); ...@@ -120,13 +117,11 @@ static void dnfb_copyarea(struct fb_info *info, struct fb_copyarea *area);
static struct fb_ops dn_fb_ops = { static struct fb_ops dn_fb_ops = {
.owner = THIS_MODULE, .owner = THIS_MODULE,
.fb_set_var = gen_set_var,
.fb_get_cmap = gen_get_cmap,
.fb_set_cmap = gen_set_cmap,
.fb_blank = dnfb_blank, .fb_blank = dnfb_blank,
.fb_fillrect = cfb_fillrect, .fb_fillrect = cfb_fillrect,
.fb_copyarea = dnfb_copyarea, .fb_copyarea = dnfb_copyarea,
.fb_imageblit = cfb_imageblit, .fb_imageblit = cfb_imageblit,
.fb_cursor = cfb_cursor,
}; };
struct fb_var_screeninfo dnfb_var __initdata = { struct fb_var_screeninfo dnfb_var __initdata = {
...@@ -239,22 +234,13 @@ unsigned long __init dnfb_init(unsigned long mem_start) ...@@ -239,22 +234,13 @@ unsigned long __init dnfb_init(unsigned long mem_start)
{ {
int err; int err;
strcpy(fb_info.modename, dnfb_fix.id);
fb_info.changevar = NULL;
fb_info.fontname[0] = 0;
fb_info.disp = &disp;
fb_info.switch_con = gen_switch;
fb_info.updatevar = gen_update_var;
fb_info.node = NODEV; fb_info.node = NODEV;
fb_info.fbops = &dn_fb_ops; fb_info.fbops = &dn_fb_ops;
fb_info.currcon = -1;
fb_info.fix = dnfb_fix; fb_info.fix = dnfb_fix;
fb_info.var = dnfb_var; fb_info.var = dnfb_var;
fb_info.screen_base = (u_char *) fb_info.fix.smem_start;
fb_alloc_cmap(&fb_info.cmap, 2, 0); fb_alloc_cmap(&fb_info.cmap, 2, 0);
gen_set_disp(-1, &fb_info);
fb_info.screen_base = (u_char *) fb_info.fix.smem_start;
err = register_framebuffer(&fb_info); err = register_framebuffer(&fb_info);
if (err < 0) if (err < 0)
......
...@@ -181,62 +181,6 @@ void fb_copy_cmap(struct fb_cmap *from, struct fb_cmap *to, int fsfromto) ...@@ -181,62 +181,6 @@ void fb_copy_cmap(struct fb_cmap *from, struct fb_cmap *to, int fsfromto)
} }
} }
/**
* fb_get_cmap - get a colormap
* @cmap: frame buffer colormap
* @kspc: boolean, 0 copy local, 1 put_user() function
* @getcolreg: pointer to a function to get a color register
* @info: frame buffer info structure
*
* Get a colormap @cmap for a screen of device @info.
*
* Returns negative errno on error, or zero on success.
*
*/
int fb_get_cmap(struct fb_cmap *cmap, int kspc,
int (*getcolreg)(u_int, u_int *, u_int *, u_int *, u_int *,
struct fb_info *),
struct fb_info *info)
{
int i, start;
u16 *red, *green, *blue, *transp;
u_int hred, hgreen, hblue, htransp;
red = cmap->red;
green = cmap->green;
blue = cmap->blue;
transp = cmap->transp;
start = cmap->start;
if (start < 0)
return -EINVAL;
for (i = 0; i < cmap->len; i++) {
if (getcolreg(start++, &hred, &hgreen, &hblue, &htransp, info))
return 0;
if (kspc) {
*red = hred;
*green = hgreen;
*blue = hblue;
if (transp)
*transp = htransp;
} else {
put_user(hred, red);
put_user(hgreen, green);
put_user(hblue, blue);
if (transp)
put_user(htransp, transp);
}
red++;
green++;
blue++;
if (transp)
transp++;
}
return 0;
}
/** /**
* fb_set_cmap - set the colormap * fb_set_cmap - set the colormap
* @cmap: frame buffer colormap structure * @cmap: frame buffer colormap structure
...@@ -353,7 +297,6 @@ void fb_invert_cmaps(void) ...@@ -353,7 +297,6 @@ void fb_invert_cmaps(void)
EXPORT_SYMBOL(fb_alloc_cmap); EXPORT_SYMBOL(fb_alloc_cmap);
EXPORT_SYMBOL(fb_copy_cmap); EXPORT_SYMBOL(fb_copy_cmap);
EXPORT_SYMBOL(fb_get_cmap);
EXPORT_SYMBOL(fb_set_cmap); EXPORT_SYMBOL(fb_set_cmap);
EXPORT_SYMBOL(fb_default_cmap); EXPORT_SYMBOL(fb_default_cmap);
EXPORT_SYMBOL(fb_invert_cmaps); EXPORT_SYMBOL(fb_invert_cmaps);
/*
* linux/drivers/video/cfb16.c -- Low level frame buffer operations for 16 bpp
* truecolor packed pixels
*
* Created 5 Apr 1997 by 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.
*/
#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-cfb16.h>
/*
* 16 bpp packed pixels
*/
static u32 tab_cfb16[] = {
#if defined(__BIG_ENDIAN)
0x00000000, 0x0000ffff, 0xffff0000, 0xffffffff
#elif defined(__LITTLE_ENDIAN)
0x00000000, 0xffff0000, 0x0000ffff, 0xffffffff
#else
#error FIXME: No endianness??
#endif
};
void fbcon_cfb16_setup(struct display *p)
{
p->next_line = p->fb_info->fix.line_length ? p->fb_info->fix.line_length : p->var.xres_virtual<<1;
p->next_plane = 0;
}
void fbcon_cfb16_bmove(struct display *p, int sy, int sx, int dy, int dx,
int height, int width)
{
int bytes = p->next_line, linesize = bytes * fontheight(p), rows;
u8 *src, *dst;
if (sx == 0 && dx == 0 && width * fontwidth(p) * 2 == bytes) {
fb_memmove(p->fb_info->screen_base + dy * linesize,
p->fb_info->screen_base + sy * linesize,
height * linesize);
return;
}
if (fontwidthlog(p)) {
sx <<= fontwidthlog(p)+1;
dx <<= fontwidthlog(p)+1;
width <<= fontwidthlog(p)+1;
} else {
sx *= fontwidth(p)*2;
dx *= fontwidth(p)*2;
width *= fontwidth(p)*2;
}
if (dy < sy || (dy == sy && dx < sx)) {
src = p->fb_info->screen_base + sy * linesize + sx;
dst = p->fb_info->screen_base + dy * linesize + dx;
for (rows = height * fontheight(p); rows--;) {
fb_memmove(dst, src, width);
src += bytes;
dst += bytes;
}
} else {
src = p->fb_info->screen_base + (sy+height) * linesize + sx - bytes;
dst = p->fb_info->screen_base + (dy+height) * linesize + dx - bytes;
for (rows = height * fontheight(p); rows--;) {
fb_memmove(dst, src, width);
src -= bytes;
dst -= bytes;
}
}
}
static inline void rectfill(u8 *dest, int width, int height, u32 data,
int linesize)
{
int i;
data |= data<<16;
while (height-- > 0) {
u32 *p = (u32 *)dest;
for (i = 0; i < width/4; i++) {
fb_writel(data, p++);
fb_writel(data, p++);
}
if (width & 2)
fb_writel(data, p++);
if (width & 1)
fb_writew(data, (u16*)p);
dest += linesize;
}
}
void fbcon_cfb16_clear(struct vc_data *conp, struct display *p, int sy, int sx,
int height, int width)
{
u8 *dest;
int bytes = p->next_line, lines = height * fontheight(p);
u32 bgx;
dest = p->fb_info->screen_base + sy * fontheight(p) * bytes + sx * fontwidth(p) * 2;
bgx = ((u16 *)p->dispsw_data)[attr_bgcol_ec(p, conp)];
width *= fontwidth(p)/4;
if (width * 8 == bytes)
rectfill(dest, lines * width * 4, 1, bgx, bytes);
else
rectfill(dest, width * 4, lines, bgx, bytes);
}
void fbcon_cfb16_putc(struct vc_data *conp, struct display *p, int c, int yy,
int xx)
{
u8 *dest, *cdat, bits;
int bytes = p->next_line, rows;
u32 eorx, fgx, bgx;
dest = p->fb_info->screen_base + yy * fontheight(p) * bytes + xx * fontwidth(p) * 2;
fgx = ((u16 *)p->dispsw_data)[attr_fgcol(p, c)];
bgx = ((u16 *)p->dispsw_data)[attr_bgcol(p, c)];
fgx |= (fgx << 16);
bgx |= (bgx << 16);
eorx = fgx ^ bgx;
switch (fontwidth(p)) {
case 4:
case 8:
cdat = p->fontdata + (c & p->charmask) * fontheight(p);
for (rows = fontheight(p); rows--; dest += bytes) {
bits = *cdat++;
fb_writel((tab_cfb16[bits >> 6] & eorx) ^ bgx, dest);
fb_writel((tab_cfb16[bits >> 4 & 3] & eorx) ^ bgx, dest+4);
if (fontwidth(p) == 8) {
fb_writel((tab_cfb16[bits >> 2 & 3] & eorx) ^ bgx, dest+8);
fb_writel((tab_cfb16[bits & 3] & eorx) ^ bgx, dest+12);
}
}
break;
case 12:
case 16:
cdat = p->fontdata + ((c & p->charmask) * fontheight(p) << 1);
for (rows = fontheight(p); rows--; dest += bytes) {
bits = *cdat++;
fb_writel((tab_cfb16[bits >> 6] & eorx) ^ bgx, dest);
fb_writel((tab_cfb16[bits >> 4 & 3] & eorx) ^ bgx, dest+4);
fb_writel((tab_cfb16[bits >> 2 & 3] & eorx) ^ bgx, dest+8);
fb_writel((tab_cfb16[bits & 3] & eorx) ^ bgx, dest+12);
bits = *cdat++;
fb_writel((tab_cfb16[bits >> 6] & eorx) ^ bgx, dest+16);
fb_writel((tab_cfb16[bits >> 4 & 3] & eorx) ^ bgx, dest+20);
if (fontwidth(p) == 16) {
fb_writel((tab_cfb16[bits >> 2 & 3] & eorx) ^ bgx, dest+24);
fb_writel((tab_cfb16[bits & 3] & eorx) ^ bgx, dest+28);
}
}
break;
}
}
void fbcon_cfb16_putcs(struct vc_data *conp, struct display *p,
const unsigned short *s, int count, int yy, int xx)
{
u8 *cdat, *dest, *dest0;
u16 c;
int rows, bytes = p->next_line;
u32 eorx, fgx, bgx;
dest0 = p->fb_info->screen_base + yy * fontheight(p) * bytes + xx * fontwidth(p) * 2;
c = scr_readw(s);
fgx = ((u16 *)p->dispsw_data)[attr_fgcol(p, c)];
bgx = ((u16 *)p->dispsw_data)[attr_bgcol(p, c)];
fgx |= (fgx << 16);
bgx |= (bgx << 16);
eorx = fgx ^ bgx;
switch (fontwidth(p)) {
case 4:
case 8:
while (count--) {
c = scr_readw(s++) & p->charmask;
cdat = p->fontdata + c * fontheight(p);
for (rows = fontheight(p), dest = dest0; rows--; dest += bytes) {
u8 bits = *cdat++;
fb_writel((tab_cfb16[bits >> 6] & eorx) ^ bgx, dest);
fb_writel((tab_cfb16[bits >> 4 & 3] & eorx) ^ bgx, dest+4);
if (fontwidth(p) == 8) {
fb_writel((tab_cfb16[bits >> 2 & 3] & eorx) ^ bgx, dest+8);
fb_writel((tab_cfb16[bits & 3] & eorx) ^ bgx, dest+12);
}
}
dest0 += fontwidth(p)*2;;
}
break;
case 12:
case 16:
while (count--) {
c = scr_readw(s++) & p->charmask;
cdat = p->fontdata + (c * fontheight(p) << 1);
for (rows = fontheight(p), dest = dest0; rows--; dest += bytes) {
u8 bits = *cdat++;
fb_writel((tab_cfb16[bits >> 6] & eorx) ^ bgx, dest);
fb_writel((tab_cfb16[bits >> 4 & 3] & eorx) ^ bgx, dest+4);
fb_writel((tab_cfb16[bits >> 2 & 3] & eorx) ^ bgx, dest+8);
fb_writel((tab_cfb16[bits & 3] & eorx) ^ bgx, dest+12);
bits = *cdat++;
fb_writel((tab_cfb16[bits >> 6] & eorx) ^ bgx, dest+16);
fb_writel((tab_cfb16[bits >> 4 & 3] & eorx) ^ bgx, dest+20);
if (fontwidth(p) == 16) {
fb_writel((tab_cfb16[bits >> 2 & 3] & eorx) ^ bgx, dest+24);
fb_writel((tab_cfb16[bits & 3] & eorx) ^ bgx, dest+28);
}
}
dest0 += fontwidth(p)*2;
}
break;
}
}
void fbcon_cfb16_revc(struct display *p, int xx, int yy)
{
u8 *dest;
int bytes = p->next_line, rows;
dest = p->fb_info->screen_base + yy * fontheight(p) * bytes + xx * fontwidth(p)*2;
for (rows = fontheight(p); rows--; dest += bytes) {
switch (fontwidth(p)) {
case 16:
fb_writel(fb_readl(dest+24) ^ 0xffffffff, dest+24);
fb_writel(fb_readl(dest+28) ^ 0xffffffff, dest+28);
/* FALL THROUGH */
case 12:
fb_writel(fb_readl(dest+16) ^ 0xffffffff, dest+16);
fb_writel(fb_readl(dest+20) ^ 0xffffffff, dest+20);
/* FALL THROUGH */
case 8:
fb_writel(fb_readl(dest+8) ^ 0xffffffff, dest+8);
fb_writel(fb_readl(dest+12) ^ 0xffffffff, dest+12);
/* FALL THROUGH */
case 4:
fb_writel(fb_readl(dest+0) ^ 0xffffffff, dest+0);
fb_writel(fb_readl(dest+4) ^ 0xffffffff, dest+4);
}
}
}
void fbcon_cfb16_clear_margins(struct vc_data *conp, struct display *p,
int bottom_only)
{
int bytes = p->next_line;
u32 bgx;
unsigned int right_start = conp->vc_cols*fontwidth(p);
unsigned int bottom_start = conp->vc_rows*fontheight(p);
unsigned int right_width, bottom_width;
bgx = ((u16 *)p->dispsw_data)[attr_bgcol_ec(p, conp)];
if (!bottom_only && (right_width = p->var.xres-right_start))
rectfill(p->fb_info->screen_base+right_start*2, right_width,
p->var.yres_virtual, bgx, bytes);
if ((bottom_width = p->var.yres-bottom_start))
rectfill(p->fb_info->screen_base+(p->var.yoffset+bottom_start)*bytes,
right_start, bottom_width, bgx, bytes);
}
/*
* `switch' for the low level operations
*/
struct display_switch fbcon_cfb16 = {
setup: fbcon_cfb16_setup,
bmove: fbcon_cfb16_bmove,
clear: fbcon_cfb16_clear,
putc: fbcon_cfb16_putc,
putcs: fbcon_cfb16_putcs,
revc: fbcon_cfb16_revc,
clear_margins: fbcon_cfb16_clear_margins,
fontwidthmask: FONTWIDTH(4)|FONTWIDTH(8)|FONTWIDTH(12)|FONTWIDTH(16)
};
#ifdef MODULE
MODULE_LICENSE("GPL");
int init_module(void)
{
return 0;
}
void cleanup_module(void)
{}
#endif /* MODULE */
/*
* Visible symbols for modules
*/
EXPORT_SYMBOL(fbcon_cfb16);
EXPORT_SYMBOL(fbcon_cfb16_setup);
EXPORT_SYMBOL(fbcon_cfb16_bmove);
EXPORT_SYMBOL(fbcon_cfb16_clear);
EXPORT_SYMBOL(fbcon_cfb16_putc);
EXPORT_SYMBOL(fbcon_cfb16_putcs);
EXPORT_SYMBOL(fbcon_cfb16_revc);
EXPORT_SYMBOL(fbcon_cfb16_clear_margins);
/*
* linux/drivers/video/cfb2.c -- Low level frame buffer operations for 2 bpp
* packed pixels
*
* Created 26 Dec 1997 by Michael Schmitz
* Based on cfb4.c
*
* 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 <video/fbcon.h>
#include <video/fbcon-cfb2.h>
/*
* 2 bpp packed pixels
*/
/*
* IFF the font is even pixel aligned (that is to say each
* character start is a byte start in the pixel pairs). That
* avoids us having to mask bytes and means we won't be here
* all week. On a MacII that matters _lots_
*/
static u_char nibbletab_cfb2[]={
#if defined(__BIG_ENDIAN)
0x00,0x03,0x0c,0x0f,
0x30,0x33,0x3c,0x3f,
0xc0,0xc3,0xcc,0xcf,
0xf0,0xf3,0xfc,0xff
#elif defined(__LITTLE_ENDIAN)
0x00,0xc0,0x30,0xf0,
0x0c,0xcc,0x3c,0xfc,
0x03,0xc3,0x33,0xf3,
0x0f,0xcf,0x3f,0xff
#else
#error FIXME: No endianness??
#endif
};
void fbcon_cfb2_setup(struct display *p)
{
p->next_line = p->fb_info->fix.line_length ? p->fb_info->fix.line_length : p->var.xres_virtual>>2;
p->next_plane = 0;
}
void fbcon_cfb2_bmove(struct display *p, int sy, int sx, int dy, int dx,
int height, int width)
{
int bytes = p->next_line, linesize = bytes * fontheight(p), rows;
u8 *src,*dst;
if (sx == 0 && dx == 0 && width * 2 == bytes) {
fb_memmove(p->fb_info->screen_base + dy * linesize,
p->fb_info->screen_base + sy * linesize,
height * linesize);
}
else {
if (dy < sy || (dy == sy && dx < sx)) {
src = p->fb_info->screen_base + sy * linesize + sx * 2;
dst = p->fb_info->screen_base + dy * linesize + dx * 2;
for (rows = height * fontheight(p) ; rows-- ;) {
fb_memmove(dst, src, width * 2);
src += bytes;
dst += bytes;
}
}
else {
src = p->fb_info->screen_base + (sy+height) * linesize + sx * 2 - bytes;
dst = p->fb_info->screen_base + (dy+height) * linesize + dx * 2 - bytes;
for (rows = height * fontheight(p) ; rows-- ;) {
fb_memmove(dst, src, width * 2);
src -= bytes;
dst -= bytes;
}
}
}
}
void fbcon_cfb2_clear(struct vc_data *conp, struct display *p, int sy, int sx,
int height, int width)
{
u8 *dest0,*dest;
int bytes=p->next_line,lines=height * fontheight(p), rows, i;
u32 bgx;
dest = p->fb_info->screen_base + sy * fontheight(p) * bytes + sx * 2;
bgx=attr_bgcol_ec(p,conp);
bgx |= (bgx << 2); /* expand the colour to 16 bits */
bgx |= (bgx << 4);
bgx |= (bgx << 8);
if (sx == 0 && width * 2 == bytes) {
for (i = 0 ; i < lines * width ; i++) {
fb_writew (bgx, dest);
dest+=2;
}
} else {
dest0=dest;
for (rows = lines; rows-- ; dest0 += bytes) {
dest=dest0;
for (i = 0 ; i < width ; i++) {
/* memset ?? */
fb_writew (bgx, dest);
dest+=2;
}
}
}
}
void fbcon_cfb2_putc(struct vc_data *conp, struct display *p, int c, int yy,
int xx)
{
u8 *dest,*cdat;
int bytes=p->next_line,rows;
u32 eorx,fgx,bgx;
dest = p->fb_info->screen_base + yy * fontheight(p) * bytes + xx * 2;
cdat = p->fontdata + (c & p->charmask) * fontheight(p);
fgx=3;/*attr_fgcol(p,c);*/
bgx=attr_bgcol(p,c);
fgx |= (fgx << 2); /* expand color to 8 bits */
fgx |= (fgx << 4);
bgx |= (bgx << 2);
bgx |= (bgx << 4);
eorx = fgx ^ bgx;
for (rows = fontheight(p) ; rows-- ; dest += bytes) {
fb_writeb((nibbletab_cfb2[*cdat >> 4] & eorx) ^ bgx, dest+0);
fb_writeb((nibbletab_cfb2[*cdat++ & 0xf] & eorx) ^ bgx, dest+1);
}
}
void fbcon_cfb2_putcs(struct vc_data *conp, struct display *p, const unsigned short *s,
int count, int yy, int xx)
{
u8 *cdat, *dest, *dest0;
u16 c;
int rows,bytes=p->next_line;
u32 eorx, fgx, bgx;
dest0 = p->fb_info->screen_base + yy * fontheight(p) * bytes + xx * 2;
c = scr_readw(s);
fgx = 3/*attr_fgcol(p, c)*/;
bgx = attr_bgcol(p, c);
fgx |= (fgx << 2);
fgx |= (fgx << 4);
bgx |= (bgx << 2);
bgx |= (bgx << 4);
eorx = fgx ^ bgx;
while (count--) {
c = scr_readw(s++) & p->charmask;
cdat = p->fontdata + c * fontheight(p);
for (rows = fontheight(p), dest = dest0; rows-- ; dest += bytes) {
fb_writeb((nibbletab_cfb2[*cdat >> 4] & eorx) ^ bgx, dest+0);
fb_writeb((nibbletab_cfb2[*cdat++ & 0xf] & eorx) ^ bgx, dest+1);
}
dest0+=2;
}
}
void fbcon_cfb2_revc(struct display *p, int xx, int yy)
{
u8 *dest;
int bytes=p->next_line, rows;
dest = p->fb_info->screen_base + yy * fontheight(p) * bytes + xx * 2;
for (rows = fontheight(p) ; rows-- ; dest += bytes) {
fb_writew(fb_readw(dest) ^ 0xffff, dest);
}
}
/*
* `switch' for the low level operations
*/
struct display_switch fbcon_cfb2 = {
setup: fbcon_cfb2_setup,
bmove: fbcon_cfb2_bmove,
clear: fbcon_cfb2_clear,
putc: fbcon_cfb2_putc,
putcs: fbcon_cfb2_putcs,
revc: fbcon_cfb2_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_cfb2);
EXPORT_SYMBOL(fbcon_cfb2_setup);
EXPORT_SYMBOL(fbcon_cfb2_bmove);
EXPORT_SYMBOL(fbcon_cfb2_clear);
EXPORT_SYMBOL(fbcon_cfb2_putc);
EXPORT_SYMBOL(fbcon_cfb2_putcs);
EXPORT_SYMBOL(fbcon_cfb2_revc);
/*
* linux/drivers/video/cfb24.c -- Low level frame buffer operations for 24 bpp
* truecolor packed pixels
*
* Created 7 Mar 1998 by 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.
*/
#include <linux/module.h>
#include <linux/tty.h>
#include <linux/console.h>
#include <linux/string.h>
#include <linux/fb.h>
#include <video/fbcon.h>
#include <video/fbcon-cfb24.h>
/*
* 24 bpp packed pixels
*/
void fbcon_cfb24_setup(struct display *p)
{
struct fb_info *info = p->fb_info;
p->next_line = info->fix.line_length ? info->fix.line_length : p->var.xres_virtual*3;
p->next_plane = 0;
}
void fbcon_cfb24_bmove(struct display *p, int sy, int sx, int dy, int dx,
int height, int width)
{
int bytes = p->next_line, linesize = bytes * fontheight(p), rows;
u8 *src, *dst;
if (sx == 0 && dx == 0 && width * fontwidth(p) * 3 == bytes) {
fb_memmove(p->fb_info->screen_base + dy * linesize,
p->fb_info->screen_base + sy * linesize,
height * linesize);
return;
}
if (fontwidthlog(p)) {
sx <<= fontwidthlog(p);
dx <<= fontwidthlog(p);
width <<= fontwidthlog(p);
} else {
sx *= fontwidth(p);
dx *= fontwidth(p);
width *= fontwidth(p);
}
sx *= 3; dx *= 3; width *= 3;
if (dy < sy || (dy == sy && dx < sx)) {
src = p->fb_info->screen_base + sy * linesize + sx;
dst = p->fb_info->screen_base + dy * linesize + dx;
for (rows = height * fontheight(p); rows--;) {
fb_memmove(dst, src, width);
src += bytes;
dst += bytes;
}
} else {
src = p->fb_info->screen_base + (sy+height) * linesize + sx - bytes;
dst = p->fb_info->screen_base + (dy+height) * linesize + dx - bytes;
for (rows = height * fontheight(p); rows--;) {
fb_memmove(dst, src, width);
src -= bytes;
dst -= bytes;
}
}
}
#if defined(__BIG_ENDIAN)
#define convert4to3(in1, in2, in3, in4, out1, out2, out3) \
do { \
out1 = (in1<<8) | (in2>>16); \
out2 = (in2<<16) | (in3>>8); \
out3 = (in3<<24) | in4; \
} while (0);
#elif defined(__LITTLE_ENDIAN)
#define convert4to3(in1, in2, in3, in4, out1, out2, out3) \
do { \
out1 = in1 | (in2<<24); \
out2 = (in2>> 8) | (in3<<16); \
out3 = (in3>>16) | (in4<< 8); \
} while (0);
#else
#error FIXME: No endianness??
#endif
static inline void store4pixels(u32 d1, u32 d2, u32 d3, u32 d4, u32 *dest)
{
u32 o1, o2, o3;
convert4to3(d1, d2, d3, d4, o1, o2, o3);
fb_writel (o1, dest++);
fb_writel (o2, dest++);
fb_writel (o3, dest);
}
static inline void rectfill(u8 *dest, int width, int height, u32 data,
int linesize)
{
u32 d1, d2, d3;
int i;
convert4to3(data, data, data, data, d1, d2, d3);
while (height-- > 0) {
u32 *p = (u32 *)dest;
for (i = 0; i < width/4; i++) {
fb_writel(d1, p++);
fb_writel(d2, p++);
fb_writel(d3, p++);
}
dest += linesize;
}
}
void fbcon_cfb24_clear(struct vc_data *conp, struct display *p, int sy, int sx,
int height, int width)
{
u8 *dest;
int bytes = p->next_line, lines = height * fontheight(p);
u32 bgx;
dest = p->fb_info->screen_base + sy * fontheight(p) * bytes + sx * fontwidth(p) * 3;
bgx = ((u32 *)p->dispsw_data)[attr_bgcol_ec(p, conp)];
width *= fontwidth(p)/4;
if (width * 12 == bytes)
rectfill(dest, lines * width * 4, 1, bgx, bytes);
else
rectfill(dest, width * 4, lines, bgx, bytes);
}
void fbcon_cfb24_putc(struct vc_data *conp, struct display *p, int c, int yy,
int xx)
{
u8 *dest, *cdat, bits;
int bytes = p->next_line, rows;
u32 eorx, fgx, bgx, d1, d2, d3, d4;
dest = p->fb_info->screen_base + yy * fontheight(p) * bytes + xx * fontwidth(p) * 3;
if (fontwidth(p) <= 8)
cdat = p->fontdata + (c & p->charmask) * fontheight(p);
else
cdat = p->fontdata + ((c & p->charmask) * fontheight(p) << 1);
fgx = ((u32 *)p->dispsw_data)[attr_fgcol(p, c)];
bgx = ((u32 *)p->dispsw_data)[attr_bgcol(p, c)];
eorx = fgx ^ bgx;
for (rows = fontheight(p); rows--; dest += bytes) {
bits = *cdat++;
d1 = (-(bits >> 7) & eorx) ^ bgx;
d2 = (-(bits >> 6 & 1) & eorx) ^ bgx;
d3 = (-(bits >> 5 & 1) & eorx) ^ bgx;
d4 = (-(bits >> 4 & 1) & eorx) ^ bgx;
store4pixels(d1, d2, d3, d4, (u32 *)dest);
if (fontwidth(p) < 8)
continue;
d1 = (-(bits >> 3 & 1) & eorx) ^ bgx;
d2 = (-(bits >> 2 & 1) & eorx) ^ bgx;
d3 = (-(bits >> 1 & 1) & eorx) ^ bgx;
d4 = (-(bits & 1) & eorx) ^ bgx;
store4pixels(d1, d2, d3, d4, (u32 *)(dest+12));
if (fontwidth(p) < 12)
continue;
bits = *cdat++;
d1 = (-(bits >> 7) & eorx) ^ bgx;
d2 = (-(bits >> 6 & 1) & eorx) ^ bgx;
d3 = (-(bits >> 5 & 1) & eorx) ^ bgx;
d4 = (-(bits >> 4 & 1) & eorx) ^ bgx;
store4pixels(d1, d2, d3, d4, (u32 *)(dest+24));
if (fontwidth(p) < 16)
continue;
d1 = (-(bits >> 3 & 1) & eorx) ^ bgx;
d2 = (-(bits >> 2 & 1) & eorx) ^ bgx;
d3 = (-(bits >> 1 & 1) & eorx) ^ bgx;
d4 = (-(bits & 1) & eorx) ^ bgx;
store4pixels(d1, d2, d3, d4, (u32 *)(dest+36));
}
}
void fbcon_cfb24_putcs(struct vc_data *conp, struct display *p,
const unsigned short *s, int count, int yy, int xx)
{
u8 *cdat, *dest, *dest0, bits;
u16 c;
int rows, bytes = p->next_line;
u32 eorx, fgx, bgx, d1, d2, d3, d4;
dest0 = p->fb_info->screen_base + yy * fontheight(p) * bytes + xx * fontwidth(p) * 3;
c = scr_readw(s);
fgx = ((u32 *)p->dispsw_data)[attr_fgcol(p, c)];
bgx = ((u32 *)p->dispsw_data)[attr_bgcol(p, c)];
eorx = fgx ^ bgx;
while (count--) {
c = scr_readw(s++) & p->charmask;
if (fontwidth(p) <= 8)
cdat = p->fontdata + c * fontheight(p);
else
cdat = p->fontdata + (c * fontheight(p) << 1);
for (rows = fontheight(p), dest = dest0; rows--; dest += bytes) {
bits = *cdat++;
d1 = (-(bits >> 7) & eorx) ^ bgx;
d2 = (-(bits >> 6 & 1) & eorx) ^ bgx;
d3 = (-(bits >> 5 & 1) & eorx) ^ bgx;
d4 = (-(bits >> 4 & 1) & eorx) ^ bgx;
store4pixels(d1, d2, d3, d4, (u32 *)dest);
if (fontwidth(p) < 8)
continue;
d1 = (-(bits >> 3 & 1) & eorx) ^ bgx;
d2 = (-(bits >> 2 & 1) & eorx) ^ bgx;
d3 = (-(bits >> 1 & 1) & eorx) ^ bgx;
d4 = (-(bits & 1) & eorx) ^ bgx;
store4pixels(d1, d2, d3, d4, (u32 *)(dest+12));
if (fontwidth(p) < 12)
continue;
bits = *cdat++;
d1 = (-(bits >> 7) & eorx) ^ bgx;
d2 = (-(bits >> 6 & 1) & eorx) ^ bgx;
d3 = (-(bits >> 5 & 1) & eorx) ^ bgx;
d4 = (-(bits >> 4 & 1) & eorx) ^ bgx;
store4pixels(d1, d2, d3, d4, (u32 *)(dest+24));
if (fontwidth(p) < 16)
continue;
d1 = (-(bits >> 3 & 1) & eorx) ^ bgx;
d2 = (-(bits >> 2 & 1) & eorx) ^ bgx;
d3 = (-(bits >> 1 & 1) & eorx) ^ bgx;
d4 = (-(bits & 1) & eorx) ^ bgx;
store4pixels(d1, d2, d3, d4, (u32 *)(dest+36));
}
dest0 += fontwidth(p)*3;
}
}
void fbcon_cfb24_revc(struct display *p, int xx, int yy)
{
u8 *dest;
int bytes = p->next_line, rows;
dest = p->fb_info->screen_base + yy * fontheight(p) * bytes + xx * fontwidth(p) * 3;
for (rows = fontheight(p); rows--; dest += bytes) {
switch (fontwidth(p)) {
case 16:
fb_writel(fb_readl(dest+36) ^ 0xffffffff, dest+36);
fb_writel(fb_readl(dest+40) ^ 0xffffffff, dest+40);
fb_writel(fb_readl(dest+44) ^ 0xffffffff, dest+44);
/* FALL THROUGH */
case 12:
fb_writel(fb_readl(dest+24) ^ 0xffffffff, dest+24);
fb_writel(fb_readl(dest+28) ^ 0xffffffff, dest+28);
fb_writel(fb_readl(dest+32) ^ 0xffffffff, dest+32);
/* FALL THROUGH */
case 8:
fb_writel(fb_readl(dest+12) ^ 0xffffffff, dest+12);
fb_writel(fb_readl(dest+16) ^ 0xffffffff, dest+16);
fb_writel(fb_readl(dest+20) ^ 0xffffffff, dest+20);
/* FALL THROUGH */
case 4:
fb_writel(fb_readl(dest+0) ^ 0xffffffff, dest+0);
fb_writel(fb_readl(dest+4) ^ 0xffffffff, dest+4);
fb_writel(fb_readl(dest+8) ^ 0xffffffff, dest+8);
}
}
}
void fbcon_cfb24_clear_margins(struct vc_data *conp, struct display *p,
int bottom_only)
{
int bytes = p->next_line;
u32 bgx;
unsigned int right_start = conp->vc_cols*fontwidth(p);
unsigned int bottom_start = conp->vc_rows*fontheight(p);
unsigned int right_width, bottom_width;
bgx = ((u32 *)p->dispsw_data)[attr_bgcol_ec(p, conp)];
if (!bottom_only && (right_width = p->var.xres-right_start))
rectfill(p->fb_info->screen_base+right_start*3, right_width,
p->var.yres_virtual, bgx, bytes);
if ((bottom_width = p->var.yres-bottom_start))
rectfill(p->fb_info->screen_base+(p->var.yoffset+bottom_start)*bytes,
right_start, bottom_width, bgx, bytes);
}
/*
* `switch' for the low level operations
*/
struct display_switch fbcon_cfb24 = {
setup: fbcon_cfb24_setup,
bmove: fbcon_cfb24_bmove,
clear: fbcon_cfb24_clear,
putc: fbcon_cfb24_putc,
putcs: fbcon_cfb24_putcs,
revc: fbcon_cfb24_revc,
clear_margins: fbcon_cfb24_clear_margins,
fontwidthmask: FONTWIDTH(4)|FONTWIDTH(8)|FONTWIDTH(12)|FONTWIDTH(16)
};
#ifdef MODULE
MODULE_LICENSE("GPL");
int init_module(void)
{
return 0;
}
void cleanup_module(void)
{}
#endif /* MODULE */
/*
* Visible symbols for modules
*/
EXPORT_SYMBOL(fbcon_cfb24);
EXPORT_SYMBOL(fbcon_cfb24_setup);
EXPORT_SYMBOL(fbcon_cfb24_bmove);
EXPORT_SYMBOL(fbcon_cfb24_clear);
EXPORT_SYMBOL(fbcon_cfb24_putc);
EXPORT_SYMBOL(fbcon_cfb24_putcs);
EXPORT_SYMBOL(fbcon_cfb24_revc);
EXPORT_SYMBOL(fbcon_cfb24_clear_margins);
/*
* linux/drivers/video/cfb32.c -- Low level frame buffer operations for 32 bpp
* truecolor packed pixels
*
* Created 28 Dec 1997 by 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.
*/
#include <linux/module.h>
#include <linux/tty.h>
#include <linux/console.h>
#include <linux/string.h>
#include <linux/fb.h>
#include <video/fbcon.h>
#include <video/fbcon-cfb32.h>
/*
* 32 bpp packed pixels
*/
void fbcon_cfb32_setup(struct display *p)
{
p->next_line = p->fb_info->fix.line_length ? p->fb_info->fix.line_length : p->var.xres_virtual<<2;
p->next_plane = 0;
}
void fbcon_cfb32_bmove(struct display *p, int sy, int sx, int dy, int dx,
int height, int width)
{
int bytes = p->next_line, linesize = bytes * fontheight(p), rows;
u8 *src, *dst;
if (sx == 0 && dx == 0 && width * fontwidth(p) * 4 == bytes) {
fb_memmove(p->fb_info->screen_base + dy * linesize,
p->fb_info->screen_base + sy * linesize,
height * linesize);
return;
}
if (fontwidthlog(p)) {
sx <<= fontwidthlog(p)+2;
dx <<= fontwidthlog(p)+2;
width <<= fontwidthlog(p)+2;
} else {
sx *= fontwidth(p)*4;
dx *= fontwidth(p)*4;
width *= fontwidth(p)*4;
}
if (dy < sy || (dy == sy && dx < sx)) {
src = p->fb_info->screen_base + sy * linesize + sx;
dst = p->fb_info->screen_base + dy * linesize + dx;
for (rows = height * fontheight(p); rows--;) {
fb_memmove(dst, src, width);
src += bytes;
dst += bytes;
}
} else {
src = p->fb_info->screen_base + (sy+height) * linesize + sx - bytes;
dst = p->fb_info->screen_base + (dy+height) * linesize + dx - bytes;
for (rows = height * fontheight(p); rows--;) {
fb_memmove(dst, src, width);
src -= bytes;
dst -= bytes;
}
}
}
static inline void rectfill(u8 *dest, int width, int height, u32 data,
int linesize)
{
int i;
while (height-- > 0) {
u32 *p = (u32 *)dest;
for (i = 0; i < width/4; i++) {
fb_writel(data, p++);
fb_writel(data, p++);
fb_writel(data, p++);
fb_writel(data, p++);
}
if (width & 2) {
fb_writel(data, p++);
fb_writel(data, p++);
}
if (width & 1)
fb_writel(data, p++);
dest += linesize;
}
}
void fbcon_cfb32_clear(struct vc_data *conp, struct display *p, int sy, int sx,
int height, int width)
{
u8 *dest;
int bytes = p->next_line, lines = height * fontheight(p);
u32 bgx;
dest = p->fb_info->screen_base + sy * fontheight(p) * bytes + sx * fontwidth(p) * 4;
bgx = ((u32 *)p->dispsw_data)[attr_bgcol_ec(p, conp)];
width *= fontwidth(p)/4;
if (width * 16 == bytes)
rectfill(dest, lines * width * 4, 1, bgx, bytes);
else
rectfill(dest, width * 4, lines, bgx, bytes);
}
void fbcon_cfb32_putc(struct vc_data *conp, struct display *p, int c, int yy,
int xx)
{
u8 *dest, *cdat, bits;
int bytes = p->next_line, rows;
u32 eorx, fgx, bgx, *pt;
dest = p->fb_info->screen_base + yy * fontheight(p) * bytes + xx * fontwidth(p) * 4;
if (fontwidth(p) <= 8)
cdat = p->fontdata + (c & p->charmask) * fontheight(p);
else
cdat = p->fontdata + ((c & p->charmask) * fontheight(p) << 1);
fgx = ((u32 *)p->dispsw_data)[attr_fgcol(p, c)];
bgx = ((u32 *)p->dispsw_data)[attr_bgcol(p, c)];
eorx = fgx ^ bgx;
for (rows = fontheight(p); rows--; dest += bytes) {
bits = *cdat++;
pt = (u32 *) dest;
fb_writel((-(bits >> 7) & eorx) ^ bgx, pt++);
fb_writel((-(bits >> 6 & 1) & eorx) ^ bgx, pt++);
fb_writel((-(bits >> 5 & 1) & eorx) ^ bgx, pt++);
fb_writel((-(bits >> 4 & 1) & eorx) ^ bgx, pt++);
if (fontwidth(p) < 8)
continue;
fb_writel((-(bits >> 3 & 1) & eorx) ^ bgx, pt++);
fb_writel((-(bits >> 2 & 1) & eorx) ^ bgx, pt++);
fb_writel((-(bits >> 1 & 1) & eorx) ^ bgx, pt++);
fb_writel((-(bits & 1) & eorx) ^ bgx, pt++);
if (fontwidth(p) < 12)
continue;
bits = *cdat++;
fb_writel((-(bits >> 7) & eorx) ^ bgx, pt++);
fb_writel((-(bits >> 6 & 1) & eorx) ^ bgx, pt++);
fb_writel((-(bits >> 5 & 1) & eorx) ^ bgx, pt++);
fb_writel((-(bits >> 4 & 1) & eorx) ^ bgx, pt++);
if (fontwidth(p) < 16)
continue;
fb_writel((-(bits >> 3 & 1) & eorx) ^ bgx, pt++);
fb_writel((-(bits >> 2 & 1) & eorx) ^ bgx, pt++);
fb_writel((-(bits >> 1 & 1) & eorx) ^ bgx, pt++);
fb_writel((-(bits & 1) & eorx) ^ bgx, pt++);
}
}
void fbcon_cfb32_putcs(struct vc_data *conp, struct display *p,
const unsigned short *s, int count, int yy, int xx)
{
u8 *cdat, *dest, *dest0, bits;
u16 c;
int rows, bytes = p->next_line;
u32 eorx, fgx, bgx, *pt;
dest0 = p->fb_info->screen_base + yy * fontheight(p) * bytes + xx * fontwidth(p) * 4;
c = scr_readw(s);
fgx = ((u32 *)p->dispsw_data)[attr_fgcol(p, c)];
bgx = ((u32 *)p->dispsw_data)[attr_bgcol(p, c)];
eorx = fgx ^ bgx;
while (count--) {
c = scr_readw(s++) & p->charmask;
if (fontwidth(p) <= 8)
cdat = p->fontdata + c * fontheight(p);
else
cdat = p->fontdata + (c * fontheight(p) << 1);
for (rows = fontheight(p), dest = dest0; rows--; dest += bytes) {
bits = *cdat++;
pt = (u32 *) dest;
fb_writel((-(bits >> 7) & eorx) ^ bgx, pt++);
fb_writel((-(bits >> 6 & 1) & eorx) ^ bgx, pt++);
fb_writel((-(bits >> 5 & 1) & eorx) ^ bgx, pt++);
fb_writel((-(bits >> 4 & 1) & eorx) ^ bgx, pt++);
if (fontwidth(p) < 8)
continue;
fb_writel((-(bits >> 3 & 1) & eorx) ^ bgx, pt++);
fb_writel((-(bits >> 2 & 1) & eorx) ^ bgx, pt++);
fb_writel((-(bits >> 1 & 1) & eorx) ^ bgx, pt++);
fb_writel((-(bits & 1) & eorx) ^ bgx, pt++);
if (fontwidth(p) < 12)
continue;
bits = *cdat++;
fb_writel((-(bits >> 7) & eorx) ^ bgx, pt++);
fb_writel((-(bits >> 6 & 1) & eorx) ^ bgx, pt++);
fb_writel((-(bits >> 5 & 1) & eorx) ^ bgx, pt++);
fb_writel((-(bits >> 4 & 1) & eorx) ^ bgx, pt++);
if (fontwidth(p) < 16)
continue;
fb_writel((-(bits >> 3 & 1) & eorx) ^ bgx, pt++);
fb_writel((-(bits >> 2 & 1) & eorx) ^ bgx, pt++);
fb_writel((-(bits >> 1 & 1) & eorx) ^ bgx, pt++);
fb_writel((-(bits & 1) & eorx) ^ bgx, pt++);
}
dest0 += fontwidth(p)*4;
}
}
void fbcon_cfb32_revc(struct display *p, int xx, int yy)
{
u8 *dest;
int bytes = p->next_line, rows;
dest = p->fb_info->screen_base + yy * fontheight(p) * bytes + xx * fontwidth(p) * 4;
for (rows = fontheight(p); rows--; dest += bytes) {
switch (fontwidth(p)) {
case 16:
fb_writel(fb_readl(dest+(4*12)) ^ 0xffffffff, dest+(4*12));
fb_writel(fb_readl(dest+(4*13)) ^ 0xffffffff, dest+(4*13));
fb_writel(fb_readl(dest+(4*14)) ^ 0xffffffff, dest+(4*14));
fb_writel(fb_readl(dest+(4*15)) ^ 0xffffffff, dest+(4*15));
/* FALL THROUGH */
case 12:
fb_writel(fb_readl(dest+(4*8)) ^ 0xffffffff, dest+(4*8));
fb_writel(fb_readl(dest+(4*9)) ^ 0xffffffff, dest+(4*9));
fb_writel(fb_readl(dest+(4*10)) ^ 0xffffffff, dest+(4*10));
fb_writel(fb_readl(dest+(4*11)) ^ 0xffffffff, dest+(4*11));
/* FALL THROUGH */
case 8:
fb_writel(fb_readl(dest+(4*4)) ^ 0xffffffff, dest+(4*4));
fb_writel(fb_readl(dest+(4*5)) ^ 0xffffffff, dest+(4*5));
fb_writel(fb_readl(dest+(4*6)) ^ 0xffffffff, dest+(4*6));
fb_writel(fb_readl(dest+(4*7)) ^ 0xffffffff, dest+(4*7));
/* FALL THROUGH */
case 4:
fb_writel(fb_readl(dest+(4*0)) ^ 0xffffffff, dest+(4*0));
fb_writel(fb_readl(dest+(4*1)) ^ 0xffffffff, dest+(4*1));
fb_writel(fb_readl(dest+(4*2)) ^ 0xffffffff, dest+(4*2));
fb_writel(fb_readl(dest+(4*3)) ^ 0xffffffff, dest+(4*3));
/* FALL THROUGH */
}
}
}
void fbcon_cfb32_clear_margins(struct vc_data *conp, struct display *p,
int bottom_only)
{
int bytes = p->next_line;
u32 bgx;
unsigned int right_start = conp->vc_cols*fontwidth(p);
unsigned int bottom_start = conp->vc_rows*fontheight(p);
unsigned int right_width, bottom_width;
bgx = ((u32 *)p->dispsw_data)[attr_bgcol_ec(p, conp)];
if (!bottom_only && (right_width = p->var.xres-right_start))
rectfill(p->fb_info->screen_base+right_start*4, right_width,
p->var.yres_virtual, bgx, bytes);
if ((bottom_width = p->var.yres-bottom_start))
rectfill(p->fb_info->screen_base+(p->var.yoffset+bottom_start)*bytes,
right_start, bottom_width, bgx, bytes);
}
/*
* `switch' for the low level operations
*/
struct display_switch fbcon_cfb32 = {
setup: fbcon_cfb32_setup,
bmove: fbcon_cfb32_bmove,
clear: fbcon_cfb32_clear,
putc: fbcon_cfb32_putc,
putcs: fbcon_cfb32_putcs,
revc: fbcon_cfb32_revc,
clear_margins: fbcon_cfb32_clear_margins,
fontwidthmask: FONTWIDTH(4)|FONTWIDTH(8)|FONTWIDTH(12)|FONTWIDTH(16)
};
#ifdef MODULE
MODULE_LICENSE("GPL");
int init_module(void)
{
return 0;
}
void cleanup_module(void)
{}
#endif /* MODULE */
/*
* Visible symbols for modules
*/
EXPORT_SYMBOL(fbcon_cfb32);
EXPORT_SYMBOL(fbcon_cfb32_setup);
EXPORT_SYMBOL(fbcon_cfb32_bmove);
EXPORT_SYMBOL(fbcon_cfb32_clear);
EXPORT_SYMBOL(fbcon_cfb32_putc);
EXPORT_SYMBOL(fbcon_cfb32_putcs);
EXPORT_SYMBOL(fbcon_cfb32_revc);
EXPORT_SYMBOL(fbcon_cfb32_clear_margins);
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
...@@ -21,8 +21,6 @@ ...@@ -21,8 +21,6 @@
#include <linux/zorro.h> #include <linux/zorro.h>
#include <asm/io.h> #include <asm/io.h>
#include <video/fbcon.h>
/* /*
* Some technical notes: * Some technical notes:
* *
...@@ -133,7 +131,6 @@ static volatile unsigned char *fm2fb_reg; ...@@ -133,7 +131,6 @@ static volatile unsigned char *fm2fb_reg;
static struct fb_info fb_info; static struct fb_info fb_info;
static u32 pseudo_palette[17]; static u32 pseudo_palette[17];
static struct display display;
static struct fb_fix_screeninfo fb_fix __initdata = { static struct fb_fix_screeninfo fb_fix __initdata = {
.smem_len = FRAMEMASTER_REG, .smem_len = FRAMEMASTER_REG,
...@@ -176,14 +173,12 @@ static int fm2fb_blank(int blank, struct fb_info *info); ...@@ -176,14 +173,12 @@ static int fm2fb_blank(int blank, struct fb_info *info);
static struct fb_ops fm2fb_ops = { static struct fb_ops fm2fb_ops = {
.owner = THIS_MODULE, .owner = THIS_MODULE,
.fb_set_var = gen_set_var,
.fb_get_cmap = gen_get_cmap,
.fb_set_cmap = gen_set_cmap,
.fb_setcolreg = fm2fb_setcolreg, .fb_setcolreg = fm2fb_setcolreg,
.fb_blank = fm2fb_blank, .fb_blank = fm2fb_blank,
.fb_fillrect = cfb_fillrect, .fb_fillrect = cfb_fillrect,
.fb_copyarea = cfb_copyarea, .fb_copyarea = cfb_copyarea,
.fb_imageblit = cfb_imageblit, .fb_imageblit = cfb_imageblit,
.fb_cursor = cfb_cursor,
}; };
/* /*
...@@ -264,7 +259,6 @@ int __init fm2fb_init(void) ...@@ -264,7 +259,6 @@ int __init fm2fb_init(void)
if (fm2fb_mode == -1) if (fm2fb_mode == -1)
fm2fb_mode = FM2FB_MODE_PAL; fm2fb_mode = FM2FB_MODE_PAL;
strcpy(fb_info.modename, fb_fix.id);
fb_info.node = NODEV; fb_info.node = NODEV;
fb_info.fbops = &fm2fb_ops; fb_info.fbops = &fm2fb_ops;
fb_info.var = fb_var_modes[fm2fb_mode]; fb_info.var = fb_var_modes[fm2fb_mode];
...@@ -274,15 +268,8 @@ int __init fm2fb_init(void) ...@@ -274,15 +268,8 @@ int __init fm2fb_init(void)
fb_info.flags = FBINFO_FLAG_DEFAULT; fb_info.flags = FBINFO_FLAG_DEFAULT;
/* The below feilds will go away !!!! */ /* The below feilds will go away !!!! */
fb_info.currcon = -1;
strcpy(fb_info.modename, fb_info.fix.id);
fb_info.disp = &display;
fb_info.switch_con = gen_switch;
fb_info.updatevar = gen_update_var;
fb_alloc_cmap(&fb_info.cmap, 16, 0); fb_alloc_cmap(&fb_info.cmap, 16, 0);
gen_set_disp(-1, &fb_info);
if (register_framebuffer(&fb_info) < 0) if (register_framebuffer(&fb_info) < 0)
return -EINVAL; return -EINVAL;
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
...@@ -20,8 +20,7 @@ ...@@ -20,8 +20,7 @@
#include <linux/fb.h> #include <linux/fb.h>
#include <linux/string.h> #include <linux/string.h>
#include <video/fbcon.h> #include "macmodes.h"
#include <video/macmodes.h>
/* /*
* MacOS video mode definitions * MacOS video mode definitions
......
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