Commit 715c66c4 authored by James Simmons's avatar James Simmons

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

into maxwell.earthlink.net:/usr/src/fbdev-2.5
parents 81997a2e 3c7f4c76
......@@ -2785,6 +2785,19 @@ S: Klosterweg 28 / i309
S: 76131 Karlsruhe
S: Germany
N: James Simmons
E: jsimmons@users.sf.net
D: Frame buffer device maintainer
D: input layer developement
D: tty/console layer
D: various mipsel devices
S: 115 Carmel Avenue
S: El Cerrito CA 94530
S: USA
N: Chris Vance
E: cvance@tislabs.com
N: Jaspreet Singh
E: jaspreet@sangoma.com
W: www.sangoma.com
......
......@@ -591,6 +591,13 @@ M: kevin.curtis@farsite.co.uk
W: http://www.farsite.co.uk/
S: Supported
FRAMEBUFFER LAYER
P: James Simmons, Geert Uytterhoeven
M: jsimmons@users.sf.net, geert@linux-m68k.org
L: linux-fbdev-devel@lists.sourceforge.net
W: http://www.linux-fbdev.org
S: Supported
FILE LOCKING (flock() and fcntl()/lockf())
P: Matthew Wilcox
M: matthew@wil.cx
......
......@@ -672,32 +672,6 @@ CONFIG_FBCON_MFB
This is the low level frame buffer console driver for monochrome
(2 colors) packed pixels.
CONFIG_FBCON_CFB2
This is the low level frame buffer console driver for 2 bits per
pixel (4 colors) packed pixels.
CONFIG_FBCON_CFB4
This is the low level frame buffer console driver for 4 bits per
pixel (16 colors) packed pixels.
CONFIG_FBCON_CFB8
This is the low level frame buffer console driver for 8 bits per
pixel (256 colors) packed pixels.
CONFIG_FBCON_CFB16
This is the low level frame buffer console driver for 15 or 16 bits
per pixel (32K or 64K colors, also known as `hicolor') packed
pixels.
CONFIG_FBCON_CFB24
This is the low level frame buffer console driver for 24 bits per
pixel (16M colors, also known as `truecolor') packed pixels. It is
NOT for `sparse' 32 bits per pixel mode.
CONFIG_FBCON_CFB32
This is the low level frame buffer console driver for 32 bits per
pixel (16M colors, also known as `truecolor') sparse packed pixels.
CONFIG_FBCON_AFB
This is the low level frame buffer console driver for 1 to 8
bitplanes (2 to 256 colors) on Amiga.
......
This diff is collapsed.
......@@ -5,12 +5,10 @@
# All of the (potential) objects that export symbols.
# This list comes from 'grep -l EXPORT_SYMBOL *.[hc]'.
export-objs := fbmem.o fbcmap.o fbcon.o fbmon.o modedb.o \
export-objs := fbmem.o fbcmap.o fbcon.o fbmon.o modedb.o fbgen.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
fbcon-iplan2p2.o fbcon-iplan2p4.o fbcon-iplan2p8.o \
fbcon-vga-planes.o fbcon-vga8-planes.o fbcon-hga.o
# Each configuration option enables a list of files.
......@@ -60,7 +58,7 @@ obj-$(CONFIG_FB_SGIVW) += sgivwfb.o cfbfillrect.o cfbcopyarea.o cfbim
obj-$(CONFIG_FB_3DFX) += tdfxfb.o
obj-$(CONFIG_FB_MAC) += macfb.o macmodes.o cfbfillrect.o cfbcopyarea.o cfbimgblt.o
obj-$(CONFIG_FB_HP300) += hpfb.o cfbfillrect.o cfbimgblt.o
obj-$(CONFIG_FB_OF) += offb.o cfbfillrect.o cfbimgblit.o cfbcopyarea.o
obj-$(CONFIG_FB_OF) += offb.o cfbfillrect.o cfbimgblt.o cfbcopyarea.o
obj-$(CONFIG_FB_IMSTT) += imsttfb.o
obj-$(CONFIG_FB_RETINAZ3) += retz3fb.o
obj-$(CONFIG_FB_CLGEN) += clgenfb.o
......@@ -68,7 +66,7 @@ obj-$(CONFIG_FB_TRIDENT) += tridentfb.o
obj-$(CONFIG_FB_S3TRIO) += S3triofb.o
obj-$(CONFIG_FB_TGA) += tgafb.o
obj-$(CONFIG_FB_VESA) += vesafb.o cfbfillrect.o cfbcopyarea.o cfbimgblt.o
obj-$(CONFIG_FB_VGA16) += vga16fb.o fbcon-vga-planes.o
obj-$(CONFIG_FB_VGA16) += vga16fb.o fbcon-vga-planes.o fbcon-vga8-planes.o
obj-$(CONFIG_FB_VIRGE) += virgefb.o
obj-$(CONFIG_FB_G364) += g364fb.o cfbfillrect.o cfbcopyarea.o cfbimgblt.o
obj-$(CONFIG_FB_FM2) += fm2fb.o cfbfillrect.o cfbcopyarea.o cfbimgblt.o
......@@ -104,17 +102,10 @@ 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
......
......@@ -20,11 +20,8 @@
#include <asm/io.h>
#include <video/fbcon.h>
static u32 colreg[16];
static struct fb_info fb_info;
static struct display display;
static struct fb_var_screeninfo anakinfb_var = {
.xres = 400,
......@@ -65,9 +62,6 @@ anakinfb_setcolreg(u_int regno, u_int red, u_int green, u_int blue,
static struct fb_ops anakinfb_ops = {
.owner = THIS_MODULE,
.fb_set_var = gen_set_var,
.fb_get_cmap = gen_get_cmap,
.fb_set_cmap = gen_set_cmap,
.fb_setcolreg = anakinfb_setcolreg,
.fb_fillrect = cfb_fillrect,
.fb_copyarea = cfb_copyarea,
......@@ -78,20 +72,13 @@ int __init
anakinfb_init(void)
{
memset(&fb_info, 0, sizeof(struct fb_info));
memset(&display, 0, sizeof(struct display));
strcpy(fb_info.modename, anakinfb_fix.id);
fb_info.node = NODEV;
fb_info.currcon = -1;
fb_info.flags = FBINFO_FLAG_DEFAULT;
fb_info.fbops = &anakinfb_ops;
fb_info.var = anakinfb_var;
fb_info.fix = anakinfb_fix;
fb_info.disp = &display;
strcpy(fb_info.fontname, "VGA8x16");
fb_info.changevar = NULL;
fb_info.switch_con = gen_switch_con;
fb_info.updatevar = gen_update_var;
if (!(request_mem_region(VGA_START, VGA_SIZE, "vga")))
return -ENOMEM;
if (fb_info.screen_base = ioremap(VGA_START, VGA_SIZE)) {
......@@ -100,10 +87,9 @@ anakinfb_init(void)
}
fb_alloc_cmap(&fb_info.cmap, 16, 0);
gen_set_disp(-1, &fb_info);
if (register_framebuffer(&fb_info) < 0) {
iounmap(display.screen_base);
iounmap(fb_info.screen_base);
release_mem_region(VGA_START, VGA_SIZE);
return -EINVAL;
}
......
......@@ -65,9 +65,6 @@
#include <asm/io.h>
#include <asm/uaccess.h>
#include <video/fbcon.h>
#include "../fbcon-accel.h"
#include <video/mach64.h>
#include "atyfb.h"
......@@ -149,11 +146,11 @@ static int atyfb_check_var(struct fb_var_screeninfo *var,
static int atyfb_set_par(struct fb_info *info);
static int atyfb_setcolreg(u_int regno, u_int red, u_int green, u_int blue,
u_int transp, struct fb_info *info);
static int atyfb_pan_display(struct fb_var_screeninfo *var, int con,
static int atyfb_pan_display(struct fb_var_screeninfo *var,
struct fb_info *info);
static int atyfb_blank(int blank, struct fb_info *info);
static int atyfb_ioctl(struct inode *inode, struct file *file, u_int cmd,
u_long arg, int con, struct fb_info *info);
u_long arg, struct fb_info *info);
extern void atyfb_fillrect(struct fb_info *info, struct fb_fillrect *rect);
extern void atyfb_copyarea(struct fb_info *info, struct fb_copyarea *area);
extern void atyfb_imageblit(struct fb_info *info, struct fb_image *image);
......@@ -198,21 +195,12 @@ int atyfb_init(void);
int atyfb_setup(char *);
#endif
int gen_get_var(struct fb_var_screeninfo *var, int con, struct fb_info *info)
{
*var = info->var;
return 0;
}
static struct fb_ops atyfb_ops = {
.owner = THIS_MODULE,
.fb_open = atyfb_open,
.fb_release = atyfb_release,
.fb_set_var = gen_set_var,
.fb_check_var = atyfb_check_var,
.fb_set_par = atyfb_set_par,
.fb_get_cmap = gen_get_cmap,
.fb_set_cmap = gen_set_cmap,
.fb_setcolreg = atyfb_setcolreg,
.fb_pan_display = atyfb_pan_display,
.fb_blank = atyfb_blank,
......@@ -694,6 +682,13 @@ static int aty_crtc_to_var(const struct crtc *crtc,
(v_sync_pol ? 0 : FB_SYNC_VERT_HIGH_ACT) |
(c_sync ? FB_SYNC_COMP_HIGH_ACT : 0);
var->red.msb_right = 0;
var->green.msb_right = 0;
var->blue.offset = 0;
var->blue.msb_right = 0;
var->transp.offset = 0;
var->transp.length = 0;
var->transp.msb_right = 0;
switch (pix_width) {
#if 0
case CRTC_PIX_WIDTH_4BPP:
......@@ -702,10 +697,7 @@ static int aty_crtc_to_var(const struct crtc *crtc,
var->red.length = 8;
var->green.offset = 0;
var->green.length = 8;
var->blue.offset = 0;
var->blue.length = 8;
var->transp.offset = 0;
var->transp.length = 0;
break;
#endif
case CRTC_PIX_WIDTH_8BPP:
......@@ -714,10 +706,7 @@ static int aty_crtc_to_var(const struct crtc *crtc,
var->red.length = 8;
var->green.offset = 0;
var->green.length = 8;
var->blue.offset = 0;
var->blue.length = 8;
var->transp.offset = 0;
var->transp.length = 0;
break;
case CRTC_PIX_WIDTH_15BPP: /* RGB 555 */
bpp = 16;
......@@ -725,10 +714,7 @@ static int aty_crtc_to_var(const struct crtc *crtc,
var->red.length = 5;
var->green.offset = 5;
var->green.length = 5;
var->blue.offset = 0;
var->blue.length = 5;
var->transp.offset = 0;
var->transp.length = 0;
break;
#if 0
case CRTC_PIX_WIDTH_16BPP: /* RGB 565 */
......@@ -737,10 +723,7 @@ static int aty_crtc_to_var(const struct crtc *crtc,
var->red.length = 5;
var->green.offset = 5;
var->green.length = 6;
var->blue.offset = 0;
var->blue.length = 5;
var->transp.offset = 0;
var->transp.length = 0;
break;
#endif
case CRTC_PIX_WIDTH_24BPP: /* RGB 888 */
......@@ -749,10 +732,7 @@ static int aty_crtc_to_var(const struct crtc *crtc,
var->red.length = 8;
var->green.offset = 8;
var->green.length = 8;
var->blue.offset = 0;
var->blue.length = 8;
var->transp.offset = 0;
var->transp.length = 0;
break;
case CRTC_PIX_WIDTH_32BPP: /* ARGB 8888 */
bpp = 32;
......@@ -760,7 +740,6 @@ static int aty_crtc_to_var(const struct crtc *crtc,
var->red.length = 8;
var->green.offset = 8;
var->green.length = 8;
var->blue.offset = 0;
var->blue.length = 8;
var->transp.offset = 24;
var->transp.length = 8;
......@@ -870,8 +849,7 @@ static int atyfb_set_par(struct fb_info *info)
#ifdef CONFIG_BOOTX_TEXT
btext_update_display(info->fix.smem_start,
(((par->crtc.h_tot_disp >> 16) & 0xff) +
1) * 8,
(((par->crtc.h_tot_disp >> 16) & 0xff) + 1) * 8,
((par->crtc.v_tot_disp >> 16) & 0x7ff) + 1,
info->var.bits_per_pixel,
par->crtc.vxres * info->var.bits_per_pixel / 8);
......@@ -905,14 +883,13 @@ static int atyfb_encode_var(struct fb_var_screeninfo *var,
{
int err;
memset(var, 0, sizeof(struct fb_var_screeninfo));
if ((err = aty_crtc_to_var(&par->crtc, var)))
return err;
var->pixclock = par->pll_ops->pll_to_var(info, &par->pll);
var->height = -1;
var->width = -1;
var->nonstd = 0;
return 0;
}
......@@ -1018,7 +995,7 @@ static int atyfb_release(struct fb_info *info, int user)
* This call looks only at xoffset, yoffset and the FB_VMODE_YWRAP flag
*/
static int atyfb_pan_display(struct fb_var_screeninfo *var, int con,
static int atyfb_pan_display(struct fb_var_screeninfo *var,
struct fb_info *info)
{
struct atyfb_par *par = (struct atyfb_par *) info->par;
......@@ -1060,7 +1037,7 @@ struct atyclk {
#endif
static int atyfb_ioctl(struct inode *inode, struct file *file, u_int cmd,
u_long arg, int con, struct fb_info *info)
u_long arg, struct fb_info *info)
{
#if defined(__sparc__) || (defined(DEBUG) && defined(CONFIG_FB_ATY_CT))
struct atyfb_par *par = (struct atyfb_par *) info->par;
......@@ -1442,15 +1419,15 @@ static int aty_power_mgmt(int sleep, struct atyfb_par *par)
static int aty_sleep_notify(struct pmu_sleep_notifier *self, int when)
{
struct fb_info *info;
struct atyfb_par *par = (struct atyfb_par *) info->fb.par;
struct atyfb_par *par;
int result;
result = PBOOK_SLEEP_OK;
for (info = first_display; info != NULL; info = par->next) {
struct fb_fix_screeninfo fix;
int nb;
par = (struct atyfb_par *) info->par;
nb = fb_display[fg_console].var.yres * info->fix.line_length;
switch (when) {
......@@ -1469,7 +1446,7 @@ static int aty_sleep_notify(struct pmu_sleep_notifier *self, int when)
if (par->blitter_may_be_busy)
wait_for_idle(par);
/* Stop accel engine (stop bus mastering) */
if (par->accel_flags & FB_ACCELF_TEXT)
if (info->var.accel_flags & FB_ACCELF_TEXT)
aty_reset_engine(par);
/* Backup fb content */
......@@ -1562,7 +1539,6 @@ static int __init aty_init(struct fb_info *info, const char *name)
const char *chipname = NULL, *ramname = NULL, *xtal;
int j, pll, mclk, gtb_memsize;
struct fb_var_screeninfo var;
struct display *disp;
u32 chip_id, i;
u16 type;
u8 rev;
......@@ -1843,18 +1819,10 @@ static int __init aty_init(struct fb_info *info, const char *name)
fb_memset((void *) info->screen_base, 0,
info->fix.smem_len);
disp = info->disp;
strcpy(info->modename, info->fix.id);
info->node = NODEV;
info->fbops = &atyfb_ops;
info->disp = disp;
info->pseudo_palette = pseudo_palette;
info->currcon = -1;
strcpy(info->fontname, fontname);
info->changevar = NULL;
info->switch_con = gen_switch;
info->updatevar = gen_update_var;
info->flags = FBINFO_FLAG_DEFAULT;
#ifdef CONFIG_PMAC_BACKLIGHT
......@@ -1979,8 +1947,6 @@ static int __init aty_init(struct fb_info *info, const char *name)
fb_alloc_cmap(&info->cmap, 256, 0);
gen_set_var(&var, -1, info);
if (register_framebuffer(info) < 0)
return 0;
......@@ -2029,27 +1995,17 @@ int __init atyfb_init(void)
info =
kmalloc(sizeof(struct fb_info) +
sizeof(struct display), GFP_ATOMIC);
sizeof(struct atyfb_par), GFP_ATOMIC);
if (!info) {
printk
("atyfb_init: can't alloc fb_info\n");
return -ENXIO;
}
memset(info, 0,
sizeof(struct fb_info) +
sizeof(struct display));
memset(info, 0, sizeof(struct fb_info) +
sizeof(struct atyfb_par));
default_par =
kmalloc(sizeof(struct atyfb_par), GFP_ATOMIC);
if (!default_par) {
printk
("atyfb_init: can't alloc atyfb_par\n");
kfree(info);
return -ENXIO;
}
memset(default_par, 0, sizeof(struct atyfb_par));
default_par = (struct atyfb_par *) (info + 1);
info->disp = (struct display *) (info + 1);
info->fix = atyfb_fix;
info->par = default_par;
......@@ -2383,7 +2339,6 @@ int __init atyfb_init(void)
if (first_display == NULL)
pmu_register_sleep_notifier
(&aty_sleep_notifier);
/* FIXME info->next = first_display; */
default_par->next = first_display;
#endif
}
......@@ -2421,7 +2376,7 @@ int __init atyfb_init(void)
info->fix.smem_start = info->screen_base; /* Fake! */
default_par->ati_regbase = (unsigned long)ioremap(phys_guiregbase[m64_num],
0x10000) + 0xFC00ul;
info->fix.mmio_start = par->ati_regbase; /* Fake! */
info->fix.mmio_start = default_par->ati_regbase; /* Fake! */
aty_st_le32(CLOCK_CNTL, 0x12345678, default_par);
clock_r = aty_ld_le32(CLOCK_CNTL, default_par);
......
......@@ -7,8 +7,6 @@
#include <asm/io.h>
#include <video/fbcon.h>
#include <video/mach64.h>
#include "atyfb.h"
......
......@@ -11,8 +11,6 @@
#include <asm/io.h>
#include <asm/uaccess.h>
#include <video/fbcon.h>
#ifdef __sparc__
#include <asm/pbm.h>
#include <asm/fbio.h>
......
......@@ -9,8 +9,6 @@
#include <asm/io.h>
#include <video/fbcon.h>
#include <video/mach64.h>
#include "atyfb.h"
......
......@@ -40,10 +40,10 @@ void cfb_copyarea(struct fb_info *p, struct fb_copyarea *area)
{
int x2, y2, lineincr, shift, shift_right, shift_left, old_dx, old_dy;
int j, linesize = p->fix.line_length, bpl = sizeof(unsigned long);
unsigned long start_index, end_index, start_mask, end_mask, last;
unsigned long start_index, end_index, start_mask, end_mask, last, tmp;
unsigned long *dst = NULL, *src = NULL;
char *src1, *dst1;
int tmp, height;
int height;
/* clip the destination */
old_dx = area->dx;
......
......@@ -20,7 +20,6 @@
#include <linux/string.h>
#include <linux/fb.h>
#include <asm/types.h>
#include <video/fbcon.h>
#if BITS_PER_LONG == 32
#define FB_READ fb_readl
......
......@@ -31,8 +31,6 @@
#include <linux/fb.h>
#include <asm/types.h>
#include <video/fbcon.h>
#define DEBUG
#ifdef DEBUG
......
......@@ -26,8 +26,6 @@
#include <linux/init.h>
#include <linux/proc_fs.h>
#include <video/fbcon.h>
#include <asm/hardware.h>
#include <asm/mach-types.h>
#include <asm/uaccess.h>
......@@ -196,9 +194,6 @@ static struct fb_ops clps7111fb_ops = {
.owner = THIS_MODULE,
.fb_check_var = clps7111fb_check_var,
.fb_set_par = clps7111fb_set_par,
.fb_set_var = gen_set_var,
.fb_set_cmap = gen_set_cmap,
.fb_get_cmap = gen_get_cmap,
.fb_setcolreg = clps7111fb_setcolreg,
.fb_blank = clps7111fb_blank,
.fb_fillrect = cfb_fillrect,
......@@ -261,15 +256,13 @@ int __init clps711xfb_init(void)
{
int err = -ENOMEM;
cfb = kmalloc(sizeof(*cfb) + sizeof(struct display), GFP_KERNEL);
cfb = kmalloc(sizeof(*cfb), GFP_KERNEL);
if (!cfb)
goto out;
memset(cfb, 0, sizeof(*cfb) + sizeof(struct display));
memset(cfb, 0, sizeof(*cfb));
memset((void *)PAGE_OFFSET, 0, 0x14000);
cfb->currcon = -1;
strcpy(cfb->fix.id, "clps7111");
cfb->screen_base = (void *)PAGE_OFFSET;
cfb->fix.smem_start = PAGE_OFFSET;
......@@ -287,11 +280,7 @@ int __init clps711xfb_init(void)
cfb->var.width = -1;
cfb->fbops = &clps7111fb_ops;
cfb->changevar = NULL;
cfb->switch_con = gen_switch;
cfb->updatevar = gen_update_var;
cfb->flags = FBINFO_FLAG_DEFAULT;
cfb->disp = (struct display *)(cfb + 1);
fb_alloc_cmap(&cfb->cmap, CMAP_SIZE, 0);
......@@ -332,7 +321,6 @@ int __init clps711xfb_init(void)
clps_writeb(clps_readb(PDDR) | EDB_PD3_LCDBL, PDDR);
}
gen_set_var(&cfb->var, -1, cfb);
err = register_framebuffer(cfb);
out: return err;
......
......@@ -1114,8 +1114,6 @@ static struct fb_ops cyber2000fb_ops = {
.fb_setcolreg = cyber2000fb_setcolreg,
.fb_pan_display = cyber2000fb_pan_display,
.fb_blank = cyber2000fb_blank,
.fb_get_cmap = gen_get_cmap,
.fb_set_cmap = gen_set_cmap,
};
/*
......
......@@ -15,8 +15,6 @@
#include <linux/fb.h>
#include <linux/module.h>
#include <video/fbcon.h>
/* apollo video HW definitions */
/*
......@@ -111,7 +109,6 @@
#endif
static struct fb_info fb_info;
static struct display disp;
/* frame buffer operations */
......@@ -120,9 +117,6 @@ static void dnfb_copyarea(struct fb_info *info, struct fb_copyarea *area);
static struct fb_ops dn_fb_ops = {
.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_fillrect = cfb_fillrect,
.fb_copyarea = dnfb_copyarea,
......@@ -239,22 +233,14 @@ unsigned long __init dnfb_init(unsigned long mem_start)
{
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.fbops = &dn_fb_ops;
fb_info.currcon = -1;
fb_info.fix = dnfb_fix;
fb_info.var = dnfb_var;
fb_info.screen_base = (u_char *) fb_info.fix.smem_start;
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);
if (err < 0)
......
......@@ -82,9 +82,10 @@ void fbcon_accel_putcs(struct vc_data *vc, struct display *p,
unsigned short charmask = p->charmask;
unsigned int width = ((fontwidth(p)+7)>>3);
struct fb_image image;
u16 c = scr_readw(s);
image.fg_color = attr_fgcol(p, *s);
image.bg_color = attr_bgcol(p, *s);
image.fg_color = attr_fgcol(p, c);
image.bg_color = attr_bgcol(p, c);
image.dx = xx * fontwidth(p);
image.dy = yy * fontheight(p);
image.width = fontwidth(p);
......
/*
* 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);
/*
* linux/drivers/video/cfb4.c -- Low level frame buffer operations for 4 bpp
* packed pixels
*
* Created 26 Dec 1997 by Michael Schmitz
* Based on the old macfb.c 4bpp code by Alan Cox
*
* 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-cfb4.h>
/*
* 4 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 u16 nibbletab_cfb4[] = {
#if defined(__BIG_ENDIAN)
0x0000,0x000f,0x00f0,0x00ff,
0x0f00,0x0f0f,0x0ff0,0x0fff,
0xf000,0xf00f,0xf0f0,0xf0ff,
0xff00,0xff0f,0xfff0,0xffff
#elif defined(__LITTLE_ENDIAN)
0x0000,0xf000,0x0f00,0xff00,
0x00f0,0xf0f0,0x0ff0,0xfff0,
0x000f,0xf00f,0x0f0f,0xff0f,
0x00ff,0xf0ff,0x0fff,0xffff
#else
#error FIXME: No endianness??
#endif
};
void fbcon_cfb4_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_cfb4_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 * 4 == 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 * 4;
dst = p->fb_info->screen_base + dy * linesize + dx * 4;
for (rows = height * fontheight(p) ; rows-- ;) {
fb_memmove(dst, src, width * 4);
src += bytes;
dst += bytes;
}
}
else {
src = p->fb_info->screen_base + (sy+height) * linesize + sx * 4 - bytes;
dst = p->fb_info->screen_base + (dy+height) * linesize + dx * 4 - bytes;
for (rows = height * fontheight(p) ; rows-- ;) {
fb_memmove(dst, src, width * 4);
src -= bytes;
dst -= bytes;
}
}
}
}
void fbcon_cfb4_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;
/* if(p->fb_info->screen_base!=0xFDD00020)
mac_boom(1);*/
dest = p->fb_info->screen_base + sy * fontheight(p) * bytes + sx * 4;
bgx=attr_bgcol_ec(p,conp);
bgx |= (bgx << 4); /* expand the colour to 32bits */
bgx |= (bgx << 8);
bgx |= (bgx << 16);
if (sx == 0 && width * 4 == bytes) {
for (i = 0 ; i < lines * width ; i++) {
fb_writel (bgx, dest);
dest+=4;
}
} else {
dest0=dest;
for (rows = lines; rows-- ; dest0 += bytes) {
dest=dest0;
for (i = 0 ; i < width ; i++) {
/* memset ?? */
fb_writel (bgx, dest);
dest+=4;
}
}
}
}
void fbcon_cfb4_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 * 4;
cdat = p->fontdata + (c & p->charmask) * fontheight(p);
fgx=attr_fgcol(p,c);
bgx=attr_bgcol(p,c);
fgx |= (fgx << 4);
fgx |= (fgx << 8);
bgx |= (bgx << 4);
bgx |= (bgx << 8);
eorx = fgx ^ bgx;
for (rows = fontheight(p) ; rows-- ; dest += bytes) {
fb_writew((nibbletab_cfb4[*cdat >> 4] & eorx) ^ bgx, dest+0);
fb_writew((nibbletab_cfb4[*cdat++ & 0xf] & eorx) ^ bgx, dest+2);
}
}
void fbcon_cfb4_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 * 4;
c = scr_readw(s);
fgx = attr_fgcol(p, c);
bgx = attr_bgcol(p, c);
fgx |= (fgx << 4);
fgx |= (fgx << 8);
fgx |= (fgx << 16);
bgx |= (bgx << 4);
bgx |= (bgx << 8);
bgx |= (bgx << 16);
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_writew((nibbletab_cfb4[*cdat >> 4] & eorx) ^ bgx, dest+0);
fb_writew((nibbletab_cfb4[*cdat++ & 0xf] & eorx) ^ bgx, dest+2);
}
dest0+=4;
}
}
void fbcon_cfb4_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 * 4;
for (rows = fontheight(p) ; rows-- ; dest += bytes) {
fb_writel(fb_readl(dest+0) ^ 0xffffffff, dest+0);
}
}
/*
* `switch' for the low level operations
*/
struct display_switch fbcon_cfb4 = {
setup: fbcon_cfb4_setup,
bmove: fbcon_cfb4_bmove,
clear: fbcon_cfb4_clear,
putc: fbcon_cfb4_putc,
putcs: fbcon_cfb4_putcs,
revc: fbcon_cfb4_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_cfb4);
EXPORT_SYMBOL(fbcon_cfb4_setup);
EXPORT_SYMBOL(fbcon_cfb4_bmove);
EXPORT_SYMBOL(fbcon_cfb4_clear);
EXPORT_SYMBOL(fbcon_cfb4_putc);
EXPORT_SYMBOL(fbcon_cfb4_putcs);
EXPORT_SYMBOL(fbcon_cfb4_revc);
/*
* linux/drivers/video/cfb8.c -- Low level frame buffer operations for 8 bpp
* 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 <video/fbcon.h>
#include <video/fbcon-cfb8.h>
/*
* 8 bpp packed pixels
*/
static u32 nibbletab_cfb8[] = {
#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
};
void fbcon_cfb8_setup(struct display *p)
{
p->next_line = p->fb_info->fix.line_length ? p->fb_info->fix.line_length : p->var.xres_virtual;
p->next_plane = 0;
}
void fbcon_cfb8_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) == 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);
}
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, u8 data,
int linesize)
{
while (height-- > 0) {
fb_memset(dest, data, width);
dest += linesize;
}
}
void fbcon_cfb8_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);
u8 bgx;
dest = p->fb_info->screen_base + sy * fontheight(p) * bytes + sx * fontwidth(p);
bgx=attr_bgcol_ec(p,conp);
width *= fontwidth(p);
if (width == bytes)
rectfill(dest, lines * width, 1, bgx, bytes);
else
rectfill(dest, width, lines, bgx, bytes);
}
void fbcon_cfb8_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 * fontwidth(p);
if (fontwidth(p) <= 8)
cdat = p->fontdata + (c & p->charmask) * fontheight(p);
else
cdat = p->fontdata + ((c & p->charmask) * fontheight(p) << 1);
fgx=attr_fgcol(p,c);
bgx=attr_bgcol(p,c);
fgx |= (fgx << 8);
fgx |= (fgx << 16);
bgx |= (bgx << 8);
bgx |= (bgx << 16);
eorx = fgx ^ bgx;
switch (fontwidth(p)) {
case 4:
for (rows = fontheight(p) ; rows-- ; dest += bytes)
fb_writel((nibbletab_cfb8[*cdat++ >> 4] & eorx) ^ bgx, dest);
break;
case 8:
for (rows = fontheight(p) ; rows-- ; dest += bytes) {
fb_writel((nibbletab_cfb8[*cdat >> 4] & eorx) ^ bgx, dest);
fb_writel((nibbletab_cfb8[*cdat++ & 0xf] & eorx) ^ bgx, dest+4);
}
break;
case 12:
case 16:
for (rows = fontheight(p) ; rows-- ; dest += bytes) {
fb_writel((nibbletab_cfb8[*cdat >> 4] & eorx) ^ bgx, dest);
fb_writel((nibbletab_cfb8[*cdat++ & 0xf] & eorx) ^ bgx, dest+4);
fb_writel((nibbletab_cfb8[(*cdat >> 4) & 0xf] & eorx) ^ bgx, dest+8);
if (fontwidth(p) == 16)
fb_writel((nibbletab_cfb8[*cdat & 0xf] & eorx) ^ bgx, dest+12);
cdat++;
}
break;
}
}
void fbcon_cfb8_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);
c = scr_readw(s);
fgx = attr_fgcol(p, c);
bgx = attr_bgcol(p, c);
fgx |= (fgx << 8);
fgx |= (fgx << 16);
bgx |= (bgx << 8);
bgx |= (bgx << 16);
eorx = fgx ^ bgx;
switch (fontwidth(p)) {
case 4:
while (count--) {
c = scr_readw(s++) & p->charmask;
cdat = p->fontdata + c * fontheight(p);
for (rows = fontheight(p), dest = dest0; rows-- ; dest += bytes)
fb_writel((nibbletab_cfb8[*cdat++ >> 4] & eorx) ^ bgx, dest);
dest0+=4;
}
break;
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) {
fb_writel((nibbletab_cfb8[*cdat >> 4] & eorx) ^ bgx, dest);
fb_writel((nibbletab_cfb8[*cdat++ & 0xf] & eorx) ^ bgx, dest+4);
}
dest0+=8;
}
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) {
fb_writel((nibbletab_cfb8[*cdat >> 4] & eorx) ^ bgx, dest);
fb_writel((nibbletab_cfb8[*cdat++ & 0xf] & eorx) ^ bgx, dest+4);
fb_writel((nibbletab_cfb8[(*cdat >> 4) & 0xf] & eorx) ^ bgx, dest+8);
if (fontwidth(p) == 16)
fb_writel((nibbletab_cfb8[*cdat & 0xf] & eorx) ^ bgx, dest+12);
cdat++;
}
dest0+=fontwidth(p);
}
break;
}
}
void fbcon_cfb8_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);
for (rows = fontheight(p) ; rows-- ; dest += bytes) {
switch (fontwidth(p)) {
case 16: fb_writel(fb_readl(dest+12) ^ 0x0f0f0f0f, dest+12); /* fall thru */
case 12: fb_writel(fb_readl(dest+8) ^ 0x0f0f0f0f, dest+8); /* fall thru */
case 8: fb_writel(fb_readl(dest+4) ^ 0x0f0f0f0f, dest+4); /* fall thru */
case 4: fb_writel(fb_readl(dest) ^ 0x0f0f0f0f, dest); /* fall thru */
default: break;
}
}
}
void fbcon_cfb8_clear_margins(struct vc_data *conp, struct display *p,
int bottom_only)
{
int bytes=p->next_line;
u8 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=attr_bgcol_ec(p,conp);
if (!bottom_only && (right_width = p->var.xres-right_start))
rectfill(p->fb_info->screen_base+right_start, 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_cfb8 = {
setup: fbcon_cfb8_setup,
bmove: fbcon_cfb8_bmove,
clear: fbcon_cfb8_clear,
putc: fbcon_cfb8_putc,
putcs: fbcon_cfb8_putcs,
revc: fbcon_cfb8_revc,
clear_margins: fbcon_cfb8_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_cfb8);
EXPORT_SYMBOL(fbcon_cfb8_setup);
EXPORT_SYMBOL(fbcon_cfb8_bmove);
EXPORT_SYMBOL(fbcon_cfb8_clear);
EXPORT_SYMBOL(fbcon_cfb8_putc);
EXPORT_SYMBOL(fbcon_cfb8_putcs);
EXPORT_SYMBOL(fbcon_cfb8_revc);
EXPORT_SYMBOL(fbcon_cfb8_clear_margins);
/*
* linux/drivers/video/mfb.c -- Low level frame buffer operations for
* monochrome
*
* 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 <video/fbcon.h>
#include <video/fbcon-mfb.h>
/*
* Monochrome
*/
void fbcon_mfb_setup(struct display *p)
{
if (p->fb_info->fix.line_length)
p->next_line = p->fb_info->fix.line_length;
else
p->next_line = p->var.xres_virtual>>3;
p->next_plane = 0;
}
void fbcon_mfb_bmove(struct display *p, int sy, int sx, int dy, int dx,
int height, int width)
{
u8 *src, *dest;
u_int rows;
if (sx == 0 && dx == 0 && width == p->next_line) {
src = p->fb_info->screen_base+sy*fontheight(p)*width;
dest = p->fb_info->screen_base+dy*fontheight(p)*width;
fb_memmove(dest, src, height*fontheight(p)*width);
} else if (dy <= sy) {
src = p->fb_info->screen_base+sy*fontheight(p)*p->next_line+sx;
dest = p->fb_info->screen_base+dy*fontheight(p)*p->next_line+dx;
for (rows = height*fontheight(p); rows--;) {
fb_memmove(dest, src, width);
src += p->next_line;
dest += p->next_line;
}
} else {
src = p->fb_info->screen_base+((sy+height)*fontheight(p)-1)*p->next_line+sx;
dest = p->fb_info->screen_base+((dy+height)*fontheight(p)-1)*p->next_line+dx;
for (rows = height*fontheight(p); rows--;) {
fb_memmove(dest, src, width);
src -= p->next_line;
dest -= p->next_line;
}
}
}
void fbcon_mfb_clear(struct vc_data *conp, struct display *p, int sy, int sx,
int height, int width)
{
u8 *dest;
u_int rows;
int inverse = conp ? attr_reverse(p,conp->vc_video_erase_char) : 0;
dest = p->fb_info->screen_base+sy*fontheight(p)*p->next_line+sx;
if (sx == 0 && width == p->next_line) {
if (inverse)
fb_memset255(dest, height*fontheight(p)*width);
else
fb_memclear(dest, height*fontheight(p)*width);
} else
for (rows = height*fontheight(p); rows--; dest += p->next_line)
if (inverse)
fb_memset255(dest, width);
else
fb_memclear_small(dest, width);
}
void fbcon_mfb_putc(struct vc_data *conp, struct display *p, int c, int yy,
int xx)
{
u8 *dest, *cdat;
u_int rows, bold, revs, underl;
u8 d;
dest = p->fb_info->screen_base+yy*fontheight(p)*p->next_line+xx;
cdat = p->fontdata+(c&p->charmask)*fontheight(p);
bold = attr_bold(p,c);
revs = attr_reverse(p,c);
underl = attr_underline(p,c);
for (rows = fontheight(p); rows--; dest += p->next_line) {
d = *cdat++;
if (underl && !rows)
d = 0xff;
else if (bold)
d |= d>>1;
if (revs)
d = ~d;
fb_writeb (d, dest);
}
}
void fbcon_mfb_putcs(struct vc_data *conp, struct display *p,
const unsigned short *s, int count, int yy, int xx)
{
u8 *dest, *dest0, *cdat;
u_int rows, bold, revs, underl;
u8 d;
u16 c;
dest0 = p->fb_info->screen_base+yy*fontheight(p)*p->next_line+xx;
c = scr_readw(s);
bold = attr_bold(p, c);
revs = attr_reverse(p, c);
underl = attr_underline(p, c);
while (count--) {
c = scr_readw(s++) & p->charmask;
dest = dest0++;
cdat = p->fontdata+c*fontheight(p);
for (rows = fontheight(p); rows--; dest += p->next_line) {
d = *cdat++;
if (underl && !rows)
d = 0xff;
else if (bold)
d |= d>>1;
if (revs)
d = ~d;
fb_writeb (d, dest);
}
}
}
void fbcon_mfb_revc(struct display *p, int xx, int yy)
{
u8 *dest, d;
u_int rows;
dest = p->fb_info->screen_base+yy*fontheight(p)*p->next_line+xx;
for (rows = fontheight(p); rows--; dest += p->next_line) {
d = fb_readb(dest);
fb_writeb (~d, dest);
}
}
void fbcon_mfb_clear_margins(struct vc_data *conp, struct display *p,
int bottom_only)
{
u8 *dest;
int height, bottom;
int inverse = conp ? attr_reverse(p,conp->vc_video_erase_char) : 0;
/* XXX Need to handle right margin? */
height = p->var.yres - conp->vc_rows * fontheight(p);
if (!height)
return;
bottom = conp->vc_rows + p->yscroll;
if (bottom >= p->vrows)
bottom -= p->vrows;
dest = p->fb_info->screen_base + bottom * fontheight(p) * p->next_line;
if (inverse)
fb_memset255(dest, height * p->next_line);
else
fb_memclear(dest, height * p->next_line);
}
/*
* `switch' for the low level operations
*/
struct display_switch fbcon_mfb = {
setup: fbcon_mfb_setup,
bmove: fbcon_mfb_bmove,
clear: fbcon_mfb_clear,
putc: fbcon_mfb_putc,
putcs: fbcon_mfb_putcs,
revc: fbcon_mfb_revc,
clear_margins: fbcon_mfb_clear_margins,
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_mfb);
EXPORT_SYMBOL(fbcon_mfb_setup);
EXPORT_SYMBOL(fbcon_mfb_bmove);
EXPORT_SYMBOL(fbcon_mfb_clear);
EXPORT_SYMBOL(fbcon_mfb_putc);
EXPORT_SYMBOL(fbcon_mfb_putcs);
EXPORT_SYMBOL(fbcon_mfb_revc);
EXPORT_SYMBOL(fbcon_mfb_clear_margins);
......@@ -105,10 +105,9 @@ void fbcon_vga_planes_setup(struct display *p)
void fbcon_vga_planes_bmove(struct display *p, int sy, int sx, int dy, int dx,
int height, int width)
{
char *src;
char *dest;
int line_ofs;
int x;
struct fb_info *info = p->fb_info;
char *dest, *src;
int line_ofs, x;
setmode(1);
setop(0);
......@@ -119,9 +118,9 @@ void fbcon_vga_planes_bmove(struct display *p, int sy, int sx, int dy, int dx,
height *= fontheight(p);
if (dy < sy || (dy == sy && dx < sx)) {
line_ofs = p->fb_info->fix.line_length - width;
dest = p->fb_info->screen_base + dx + dy * p->fb_info->fix.line_length;
src = p->fb_info->screen_base + sx + sy * p->fb_info->fix.line_length;
line_ofs = info->fix.line_length - width;
dest = info->screen_base + dx + dy * info->fix.line_length;
src = info->screen_base + sx + sy * info->fix.line_length;
while (height--) {
for (x = 0; x < width; x++) {
readb(src);
......@@ -133,9 +132,9 @@ void fbcon_vga_planes_bmove(struct display *p, int sy, int sx, int dy, int dx,
dest += line_ofs;
}
} else {
line_ofs = p->fb_info->fix.line_length - width;
dest = p->fb_info->screen_base + dx + width + (dy + height - 1) * p->fb_info->fix.line_length;
src = p->fb_info->screen_base + sx + width + (sy + height - 1) * p->fb_info->fix.line_length;
line_ofs = info->fix.line_length - width;
dest = info->screen_base + dx + width + (dy + height - 1) * info->fix.line_length;
src = info->screen_base + sx + width + (sy + height - 1) * info->fix.line_length;
while (height--) {
for (x = 0; x < width; x++) {
dest--;
......@@ -177,137 +176,48 @@ void fbcon_vga_planes_clear(struct vc_data *conp, struct display *p, int sy, int
}
}
void fbcon_ega_planes_putc(struct vc_data *conp, struct display *p, int c, int yy, int xx)
{
int fg = attr_fgcol(p,c);
int bg = attr_bgcol(p,c);
int y;
u8 *cdat = p->fontdata + (c & p->charmask) * fontheight(p);
char *where = p->fb_info->screen_base + xx + yy * p->fb_info->fix.line_length * fontheight(p);
setmode(0);
setop(0);
setsr(0xf);
setcolor(bg);
selectmask();
setmask(0xff);
for (y = 0; y < fontheight(p); y++, where += p->fb_info->fix.line_length)
rmw(where);
where -= p->fb_info->fix.line_length * y;
setcolor(fg);
selectmask();
for (y = 0; y < fontheight(p); y++, where += p->fb_info->fix.line_length)
if (cdat[y]) {
setmask(cdat[y]);
rmw(where);
}
}
void fbcon_vga_planes_putc(struct vc_data *conp, struct display *p, int c, int yy, int xx)
{
int fg = attr_fgcol(p,c);
int bg = attr_bgcol(p,c);
int y;
u8 *cdat = p->fontdata + (c & p->charmask) * fontheight(p);
char *where = p->fb_info->screen_base + xx + yy * p->fb_info->fix.line_length * fontheight(p);
setmode(2);
setop(0);
setsr(0xf);
setcolor(fg);
selectmask();
setmask(0xff);
writeb(bg, where);
rmb();
readb(where); /* fill latches */
setmode(3);
wmb();
for (y = 0; y < fontheight(p); y++, where += p->fb_info->fix.line_length)
writeb(cdat[y], where);
wmb();
}
/* 28.50 in my test */
void fbcon_ega_planes_putcs(struct vc_data *conp, struct display *p, const unsigned short *s,
int count, int yy, int xx)
void fbcon_accel_putc(struct vc_data *vc, struct display *p, int c, int yy,
int xx)
{
u16 c = scr_readw(s);
int fg = attr_fgcol(p, c);
int bg = attr_bgcol(p, c);
char *where;
int n;
setmode(2);
setop(0);
selectmask();
setmask(0xff);
where = p->fb_info->screen_base + xx + yy * p->fb_info->fix.line_length * fontheight(p);
writeb(bg, where);
rmb();
readb(where); /* fill latches */
wmb();
selectmask();
for (n = 0; n < count; n++) {
int c = scr_readw(s++) & p->charmask;
u8 *cdat = p->fontdata + c * fontheight(p);
u8 *end = cdat + fontheight(p);
while (cdat < end) {
outb(*cdat++, GRAPHICS_DATA_REG);
wmb();
writeb(fg, where);
where += p->fb_info->fix.line_length;
}
where += 1 - p->fb_info->fix.line_length * fontheight(p);
}
wmb();
struct fb_info *info = p->fb_info;
unsigned short charmask = p->charmask;
unsigned int width = ((fontwidth(p)+7)>>3);
struct fb_image image;
image.fg_color = attr_fgcol(p, c);
image.bg_color = attr_bgcol(p, c);
image.dx = xx * fontwidth(p);
image.dy = yy * fontheight(p);
image.width = fontwidth(p);
image.height = fontheight(p);
image.depth = 1;
image.data = p->fontdata + (c & charmask)*fontheight(p)*width;
info->fbops->fb_imageblit(info, &image);
}
/* 6.96 in my test */
void fbcon_vga_planes_putcs(struct vc_data *conp, struct display *p, const unsigned short *s,
int count, int yy, int xx)
void fbcon_accel_putcs(struct vc_data *vc, struct display *p,
const unsigned short *s, int count, int yy, int xx)
{
u16 c = scr_readw(s);
int fg = attr_fgcol(p, c);
int bg = attr_bgcol(p, c);
char *where;
int n;
setmode(2);
setop(0);
setsr(0xf);
setcolor(fg);
selectmask();
setmask(0xff);
where = p->fb_info->screen_base + xx + yy * p->fb_info->fix.line_length * fontheight(p);
writeb(bg, where);
rmb();
readb(where); /* fill latches */
setmode(3);
wmb();
for (n = 0; n < count; n++) {
int y;
int c = scr_readw(s++) & p->charmask;
u8 *cdat = p->fontdata + (c & p->charmask) * fontheight(p);
for (y = 0; y < fontheight(p); y++, cdat++) {
writeb (*cdat, where);
where += p->fb_info->fix.line_length;
struct fb_info *info = p->fb_info;
unsigned short charmask = p->charmask;
unsigned int width = ((fontwidth(p)+7)>>3);
struct fb_image image;
image.fg_color = attr_fgcol(p, *s);
image.bg_color = attr_bgcol(p, *s);
image.dx = xx * fontwidth(p);
image.dy = yy * fontheight(p);
image.width = fontwidth(p);
image.height = fontheight(p);
image.depth = 1;
while (count--) {
image.data = p->fontdata +
(scr_readw(s++) & charmask) * fontheight(p) * width;
info->fbops->fb_imageblit(info, &image);
image.dx += fontwidth(p);
}
where += 1 - p->fb_info->fix.line_length * fontheight(p);
}
wmb();
}
void fbcon_vga_planes_revc(struct display *p, int xx, int yy)
......@@ -332,18 +242,8 @@ struct display_switch fbcon_vga_planes = {
setup: fbcon_vga_planes_setup,
bmove: fbcon_vga_planes_bmove,
clear: fbcon_vga_planes_clear,
putc: fbcon_vga_planes_putc,
putcs: fbcon_vga_planes_putcs,
revc: fbcon_vga_planes_revc,
fontwidthmask: FONTWIDTH(8)
};
struct display_switch fbcon_ega_planes = {
setup: fbcon_vga_planes_setup,
bmove: fbcon_vga_planes_bmove,
clear: fbcon_vga_planes_clear,
putc: fbcon_ega_planes_putc,
putcs: fbcon_ega_planes_putcs,
putc: fbcon_accel_putc,
putcs: fbcon_accel_putcs,
revc: fbcon_vga_planes_revc,
fontwidthmask: FONTWIDTH(8)
};
......@@ -369,14 +269,8 @@ EXPORT_SYMBOL(fbcon_vga_planes);
EXPORT_SYMBOL(fbcon_vga_planes_setup);
EXPORT_SYMBOL(fbcon_vga_planes_bmove);
EXPORT_SYMBOL(fbcon_vga_planes_clear);
EXPORT_SYMBOL(fbcon_vga_planes_putc);
EXPORT_SYMBOL(fbcon_vga_planes_putcs);
EXPORT_SYMBOL(fbcon_vga_planes_revc);
EXPORT_SYMBOL(fbcon_ega_planes);
EXPORT_SYMBOL(fbcon_ega_planes_putc);
EXPORT_SYMBOL(fbcon_ega_planes_putcs);
/*
* Overrides for Emacs so that we follow Linus's tabbing style.
* ---------------------------------------------------------------------------
......
This diff is collapsed.
......@@ -21,14 +21,6 @@
#include <asm/io.h>
#include <video/fbcon.h>
#include <video/fbcon-mfb.h>
#include <video/fbcon-cfb2.h>
#include <video/fbcon-cfb4.h>
#include <video/fbcon-cfb8.h>
#include <video/fbcon-cfb16.h>
#include <video/fbcon-cfb24.h>
#include <video/fbcon-cfb32.h>
#include "fbcon-accel.h"
int gen_set_var(struct fb_var_screeninfo *var, int con, struct fb_info *info)
{
......@@ -51,52 +43,15 @@ int gen_set_var(struct fb_var_screeninfo *var, int con, struct fb_info *info)
info->fbops->fb_set_par(info);
if (info->fbops->fb_pan_display)
info->fbops->fb_pan_display(&info->var, con, info);
gen_set_disp(con, info);
info->fbops->fb_pan_display(&info->var, info);
fb_set_cmap(&info->cmap, 1, info);
}
if (info->changevar)
info->changevar(con);
}
}
return 0;
}
int gen_get_cmap(struct fb_cmap *cmap, int kspc, int con, struct fb_info *info)
{
fb_copy_cmap (&info->cmap, cmap, kspc ? 0 : 2);
return 0;
}
int gen_set_cmap(struct fb_cmap *cmap, int kspc, int con,
struct fb_info *info)
{
struct display *disp = (con < 0) ? info->disp : (fb_display + con);
struct fb_cmap *dcmap = &disp->cmap;
int err = 0;
/* No colormap allocated ? */
if (!dcmap->len) {
int size = info->cmap.len;
err = fb_alloc_cmap(dcmap, size, 0);
}
if (!err && con == info->currcon) {
err = fb_set_cmap(cmap, kspc, info);
dcmap = &info->cmap;
}
if (!err)
fb_copy_cmap(cmap, dcmap, kspc ? 0 : 1);
return err;
}
int fbgen_pan_display(struct fb_var_screeninfo *var, int con,
struct fb_info *info)
int fbgen_pan_display(struct fb_var_screeninfo *var, struct fb_info *info)
{
int xoffset = var->xoffset;
int yoffset = var->yoffset;
......@@ -106,11 +61,10 @@ int fbgen_pan_display(struct fb_var_screeninfo *var, int con,
xoffset + info->var.xres > info->var.xres_virtual ||
yoffset + info->var.yres > info->var.yres_virtual)
return -EINVAL;
if (con == info->currcon) {
if (info->fbops->fb_pan_display) {
if ((err = info->fbops->fb_pan_display(var, con, info)))
if ((err = info->fbops->fb_pan_display(var, info)))
return err;
} else
else
return -EINVAL;
}
info->var.xoffset = var->xoffset;
......@@ -125,123 +79,19 @@ int fbgen_pan_display(struct fb_var_screeninfo *var, int con,
/* ---- Helper functions --------------------------------------------------- */
void gen_set_disp(int con, struct fb_info *info)
{
struct display *display = (con < 0) ? info->disp : (fb_display + con);
if (info->fix.visual == FB_VISUAL_PSEUDOCOLOR ||
info->fix.visual == FB_VISUAL_DIRECTCOLOR) {
display->can_soft_blank = info->fbops->fb_blank ? 1 : 0;
display->dispsw_data = NULL;
} else {
display->can_soft_blank = 0;
display->dispsw_data = info->pseudo_palette;
}
display->var = info->var;
/*
* If we are setting all the virtual consoles, also set
* the defaults used to create new consoles.
*/
if (con < 0 || info->var.activate & FB_ACTIVATE_ALL)
info->disp->var = info->var;
if (info->var.bits_per_pixel == 24) {
#ifdef FBCON_HAS_CFB24
display->scrollmode = SCROLL_YREDRAW;
display->dispsw = &fbcon_cfb24;
return;
#endif
}
#ifdef FBCON_HAS_ACCEL
display->scrollmode = SCROLL_YNOMOVE;
display->dispsw = &fbcon_accel;
#else
display->dispsw = &fbcon_dummy;
#endif
return;
}
/**
* do_install_cmap - install the current colormap
* @con: virtual console number
* @info: generic frame buffer info structure
*
* Installs the current colormap for virtual console @con on
* device @info.
*
*/
void do_install_cmap(int con, struct fb_info *info)
{
if (con != info->currcon)
return;
if (fb_display[con].cmap.len)
fb_set_cmap(&fb_display[con].cmap, 1, info);
else {
int size = fb_display[con].var.bits_per_pixel == 16 ? 64 : 256;
fb_set_cmap(fb_default_cmap(size), 1, info);
}
}
int gen_update_var(int con, struct fb_info *info)
{
struct display *disp = (con < 0) ? info->disp : (fb_display + con);
int err;
if (con == info->currcon) {
info->var.xoffset = disp->var.xoffset;
info->var.yoffset = disp->var.yoffset;
info->var.vmode = disp->var.vmode;
if (info->fbops->fb_pan_display) {
if ((err = info->fbops->fb_pan_display(&info->var, con, info)))
if ((err = info->fbops->fb_pan_display(&info->var, info)))
return err;
}
}
return 0;
}
int gen_switch(int con, struct fb_info *info)
{
struct display *disp;
struct fb_cmap *cmap;
if (info->currcon >= 0) {
disp = fb_display + info->currcon;
/*
* Save the old colormap and graphics mode.
*/
disp->var = info->var;
if (disp->cmap.len)
fb_copy_cmap(&info->cmap, &disp->cmap, 0);
}
info->currcon = con;
disp = fb_display + con;
/*
* Install the new colormap and change the graphics mode. By default
* fbcon sets all the colormaps and graphics modes to the default
* values at bootup.
*
* Really, we want to set the colormap size depending on the
* depth of the new grpahics mode. For now, we leave it as its
* default 256 entry.
*/
if (disp->cmap.len)
cmap = &disp->cmap;
else
cmap = fb_default_cmap(1 << disp->var.bits_per_pixel);
fb_copy_cmap(cmap, &info->cmap, 0);
disp->var.activate = FB_ACTIVATE_NOW;
info->fbops->fb_set_var(&disp->var, con, info);
return 0;
}
/**
* fbgen_blank - blank the screen
* @blank: boolean, 0 unblank, 1 blank
......@@ -267,20 +117,22 @@ int fbgen_blank(int blank, struct fb_info *info)
cmap.start = 0;
cmap.len = 16;
fb_set_cmap(&cmap, 1, info);
} else
do_install_cmap(info->currcon, info);
} else {
if (info->cmap.len)
fb_set_cmap(&info->cmap, 1, info);
else {
int size = info->var.bits_per_pixel == 16 ? 64 : 256;
fb_set_cmap(fb_default_cmap(size), 1, info);
}
}
return 0;
}
/* generic frame buffer operations */
EXPORT_SYMBOL(gen_set_var);
EXPORT_SYMBOL(gen_get_cmap);
EXPORT_SYMBOL(gen_set_cmap);
EXPORT_SYMBOL(fbgen_pan_display);
/* helper functions */
EXPORT_SYMBOL(do_install_cmap);
EXPORT_SYMBOL(gen_update_var);
EXPORT_SYMBOL(gen_switch);
EXPORT_SYMBOL(fbgen_blank);
MODULE_LICENSE("GPL");
......@@ -377,7 +377,7 @@ static int fbmem_read_proc(char *buf, char **start, off_t offset,
if (*fi)
clen += sprintf(buf + clen, "%d %s\n",
GET_FB_IDX((*fi)->node),
(*fi)->modename);
(*fi)->fix.id);
*start = buf + offset;
if (clen > offset)
clen -= offset;
......@@ -481,11 +481,14 @@ fb_ioctl(struct inode *inode, struct file *file, unsigned int cmd,
case FBIOPUT_VSCREENINFO:
if (copy_from_user(&var, (void *) arg, sizeof(var)))
return -EFAULT;
i = var.activate & FB_ACTIVATE_ALL
? set_all_vcs(fbidx, fb, &var, info)
: fb->fb_set_var(&var, PROC_CONSOLE(info), info);
if (i)
return i;
if (var.activate & FB_ACTIVATE_ALL) {
i = set_all_vcs(fbidx, fb, &var, info);
if (i) return i;
} else {
i = gen_set_var(&var, PROC_CONSOLE(info), info);
if (i) return i;
gen_set_disp(PROC_CONSOLE(info), info);
}
if (copy_to_user((void *) arg, &var, sizeof(var)))
return -EFAULT;
return 0;
......@@ -494,17 +497,17 @@ fb_ioctl(struct inode *inode, struct file *file, unsigned int cmd,
case FBIOPUTCMAP:
if (copy_from_user(&cmap, (void *) arg, sizeof(cmap)))
return -EFAULT;
return (fb->fb_set_cmap(&cmap, 0, PROC_CONSOLE(info), info));
return (fb_set_cmap(&cmap, 0, info));
case FBIOGETCMAP:
if (copy_from_user(&cmap, (void *) arg, sizeof(cmap)))
return -EFAULT;
return (fb->fb_get_cmap(&cmap, 0, PROC_CONSOLE(info), info));
fb_copy_cmap(&info->cmap, &cmap, 0);
case FBIOPAN_DISPLAY:
if (copy_from_user(&var, (void *) arg, sizeof(var)))
return -EFAULT;
if (fb->fb_pan_display == NULL)
return (var.xoffset || var.yoffset) ? -EINVAL : 0;
if ((i=fb->fb_pan_display(&var, PROC_CONSOLE(info), info)))
if ((i=fb->fb_pan_display(&var, info)))
return i;
if (copy_to_user((void *) arg, &var, sizeof(var)))
return -EFAULT;
......@@ -544,8 +547,7 @@ fb_ioctl(struct inode *inode, struct file *file, unsigned int cmd,
default:
if (fb->fb_ioctl == NULL)
return -EINVAL;
return fb->fb_ioctl(inode, file, cmd, arg, PROC_CONSOLE(info),
info);
return fb->fb_ioctl(inode, file, cmd, arg, info);
}
}
......@@ -746,6 +748,7 @@ register_framebuffer(struct fb_info *fb_info)
if (!registered_fb[i])
break;
fb_info->node = mk_kdev(FB_MAJOR, i);
fb_info->currcon = -1;
registered_fb[i] = fb_info;
if (!fb_ever_opened[i]) {
struct module *owner = fb_info->fbops->owner;
......
......@@ -21,8 +21,6 @@
#include <linux/zorro.h>
#include <asm/io.h>
#include <video/fbcon.h>
/*
* Some technical notes:
*
......@@ -133,7 +131,6 @@ static volatile unsigned char *fm2fb_reg;
static struct fb_info fb_info;
static u32 pseudo_palette[17];
static struct display display;
static struct fb_fix_screeninfo fb_fix __initdata = {
.smem_len = FRAMEMASTER_REG,
......@@ -176,9 +173,6 @@ static int fm2fb_blank(int blank, struct fb_info *info);
static struct fb_ops fm2fb_ops = {
.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_blank = fm2fb_blank,
.fb_fillrect = cfb_fillrect,
......@@ -264,7 +258,6 @@ int __init fm2fb_init(void)
if (fm2fb_mode == -1)
fm2fb_mode = FM2FB_MODE_PAL;
strcpy(fb_info.modename, fb_fix.id);
fb_info.node = NODEV;
fb_info.fbops = &fm2fb_ops;
fb_info.var = fb_var_modes[fm2fb_mode];
......@@ -274,15 +267,8 @@ int __init fm2fb_init(void)
fb_info.flags = FBINFO_FLAG_DEFAULT;
/* 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);
gen_set_disp(-1, &fb_info);
if (register_framebuffer(&fb_info) < 0)
return -EINVAL;
......
......@@ -31,8 +31,6 @@
#include <asm/io.h>
#include <asm/jazz.h>
#include <video/fbcon.h>
/*
* Various defines for the G364
*/
......@@ -74,7 +72,6 @@
#define MON_ID_REG 0xe4100000 /* unused */
#define RESET_REG 0xe4180000 /* Write only */
static struct display disp;
static struct fb_info fb_info;
static struct fb_fix_screeninfo fb_fix __initdata = {
......@@ -109,7 +106,7 @@ static struct fb_var_screeninfo fb_var __initdata = {
*/
int g364fb_init(void);
static int g364fb_pan_display(struct fb_var_screeninfo *var, int con,
static int g364fb_pan_display(struct fb_var_screeninfo *var,
struct fb_info *info);
static int g364fb_setcolreg(u_int regno, u_int red, u_int green,
u_int blue, u_int transp,
......@@ -118,9 +115,6 @@ static int g364fb_blank(int blank, struct fb_info *info);
static struct fb_ops g364fb_ops = {
.owner = THIS_MODULE,
.fb_set_var = gen_set_var,
.fb_get_cmap = gen_get_cmap,
.fb_set_cmap = gen_set_cmap,
.fb_setcolreg = g364fb_setcolreg,
.fb_pan_display = g364fb_pan_display,
.fb_blank = g364fb_blank,
......@@ -151,7 +145,7 @@ void fbcon_g364fb_cursor(struct display *p, int mode, int x, int y)
*
* This call looks only at xoffset, yoffset and the FB_VMODE_YWRAP flag
*/
static int g364fb_pan_display(struct fb_var_screeninfo *var, int con,
static int g364fb_pan_display(struct fb_var_screeninfo *var,
struct fb_info *info)
{
if (var->xoffset || var->yoffset + var->yres > var->yres_virtual)
......@@ -239,7 +233,6 @@ int __init g364fb_init(void)
fb_fix.smem_len = (1 << (mem * 2)) * 512 * 1024;
fb_var.yres_virtual = fb_fix.smem_len / fb_var.xres;
strcpy(fb_info.modename, fb_fix.id);
fb_info.node = NODEV;
fb_info.fbops = &g364fb_ops;
fb_info.screen_base = (char *) G364_MEM_BASE; /* virtual kernel address */
......@@ -247,15 +240,8 @@ int __init g364fb_init(void)
fb_info.fix = fb_fix;
fb_info.flags = FBINFO_FLAG_DEFAULT;
fb_info.disp = &disp;
fb_info.currcon = -1;
fb_info.fontname[0] = '\0';
fb_info.changevar = NULL;
fb_info.switch_con = gen_switch;
fb_info.updatevar = gen_update_var;
fb_alloc_cmap(&fb_info.cmap, 255, 0);
gen_set_disp(-1, &fb_info);
if (register_framebuffer(&fb_info) < 0)
return -EINVAL;
......
......@@ -29,8 +29,6 @@
#include <asm/io.h>
#include <asm/hd64461.h>
#include <video/fbcon.h>
static struct fb_var_screeninfo hitfb_var __initdata = {
.activate = FB_ACTIVATE_NOW,
.height = -1,
......@@ -46,7 +44,6 @@ static struct fb_fix_screeninfo hitfb_fix __initdata = {
};
static u16 pseudo_palette[17];
static struct display display;
struct fb_info fb_info;
static int hitfb_check_var(struct fb_var_screeninfo *var, struct fb_info *info)
......@@ -125,9 +122,6 @@ static int hitfb_setcolreg(unsigned regno, unsigned red, unsigned green,
static struct fb_ops hitfb_ops = {
.owner = THIS_MODULE,
.fb_set_var = gen_set_var,
.fb_get_cmap = gen_get_cmap,
.fb_set_cmap = gen_set_cmap,
.fb_check_var = hitfb_check_var,
.fb_set_par = hitfb_set_par,
.fb_setcolreg = hitfb_setcolreg,
......@@ -167,19 +161,11 @@ int __init hitfb_init(void)
fb_info.pseudo_palette = pseudo_palette;
fb_info.flags = FBINFO_FLAG_DEFAULT;
strcpy(fb_info.modename, fb_info.fix.id);
fb_info.currcon = -1;
fb_info.disp = &display;
fb_info.changevar = NULL;
fb_info.switch_con = gen_switch;
fb_info.updatevar = gen_update_var;
fb_info.screen_base = (void *) hitfb_fix.smem_start;
size = (fb_info.var.bits_per_pixel == 8) ? 256 : 16;
fb_alloc_cmap(&fb_info.cmap, size, 0);
gen_set_var(&fb_info.var, -1, &fb_info);
if (register_framebuffer(&fb_info) < 0)
return -EINVAL;
......
......@@ -19,8 +19,6 @@
#include <asm/blinken.h>
#include <asm/hwtest.h>
#include <video/fbcon.h>
static struct fb_info fb_info;
unsigned long fb_regs;
......@@ -67,8 +65,6 @@ static struct fb_var_screeninfo hpfb_defined = {
.vmode = FB_VMODE_NONINTERLACED,
};
static struct display display;
/*
* Set the palette. This may not work on all boards but only experimentation
* will tell.
......@@ -105,9 +101,6 @@ void hpfb_copyarea(struct fb_info *info, struct fb_copyarea *area)
static struct fb_ops hpfb_ops = {
.owner = THIS_MODULE,
.fb_set_var = gen_set_var,
.fb_get_cmap = gen_get_cmap,
.fb_set_cmap = gen_set_cmap,
.fb_setcolreg = hpfb_setcolreg,
.fb_fillrect = cfb_fillrect,
.fb_copyarea = hpfb_copyarea,
......@@ -164,16 +157,8 @@ int __init hpfb_init_one(unsigned long base)
fb_info.fix = hpfb_fix;
fb_info.screen_base = (char *)hpfb_fix.smem_start; // FIXME
/* 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, 256, 0);
gen_set_disp(-1, &fb_info);
if (register_framebuffer(&fb_info) < 0)
return 1;
return 0;
......
......@@ -40,8 +40,6 @@
#include <asm/io.h>
#include <asm/machw.h>
#include <video/fbcon.h>
/* Common DAC base address for the LC, RBV, Valkyrie, and IIvx */
#define DAC_BASE 0x50f24000
......@@ -173,7 +171,6 @@ static struct fb_fix_screeninfo macfb_fix = {
.accel = FB_ACCEL_NONE,
};
static struct display disp;
static struct fb_info fb_info;
static u32 pseudo_palette[17];
static int inverse = 0;
......@@ -225,7 +222,7 @@ static int dafb_setpalette (unsigned int regno, unsigned int red,
local_irq_save(flags);
/* fbcon will set an entire colourmap, but X won't. Hopefully
/* fbdev will set an entire colourmap, but X won't. Hopefully
this should accomodate both of them */
if (regno != lastreg+1) {
int i;
......@@ -588,9 +585,6 @@ static int macfb_setcolreg(unsigned regno, unsigned red, unsigned green,
static struct fb_ops macfb_ops = {
.owner = THIS_MODULE,
.fb_set_var = gen_set_var,
.fb_get_cmap = gen_get_cmap,
.fb_set_cmap = gen_set_cmap,
.fb_setcolreg = macfb_setcolreg,
.fb_fillrect = cfb_fillrect,
.fb_copyarea = cfb_copyarea,
......@@ -952,21 +946,14 @@ void __init macfb_init(void)
break;
}
strcpy(fb_info.modename, macfb_fix.id);
fb_info.changevar = NULL;
fb_info.node = NODEV;
fb_info.fbops = &macfb_ops;
fb_info.var = macfb_defined;
fb_info.fix = macfb_fix;
fb_info.currcon = -1;
fb_info.disp = &disp;
fb_info.switch_con = gen_switch;
fb_info.updatevar = gen_update_var;
fb_info.pseudo_palette = pseudo_palette;
fb_info.flags = FBINFO_FLAG_DEFAULT;
fb_alloc_cmap(&fb_info.cmap, video_cmap_len, 0);
gen_set_disp(-1, &fb_info);
if (register_framebuffer(&fb_info) < 0)
return;
......
......@@ -42,7 +42,6 @@
#include <asm/bootinfo.h>
static struct fb_info fb_info;
static struct display disp;
static struct fb_var_screeninfo maxinefb_defined = {
.xres = 1024,
......@@ -112,9 +111,6 @@ static int maxinefb_setcolreg(unsigned regno, unsigned red, unsigned green,
static struct fb_ops maxinefb_ops = {
.owner = THIS_MODULE,
.fb_set_var = gen_set_var,
.fb_get_cmap = gen_get_cmap,
.fb_set_cmap = gen_set_cmap,
.fb_setcolreg = maxinefb_setcolreg,
.fb_fillrect = cfb_fillrect,
.fb_copyarea = cfb_copyarea,
......@@ -156,23 +152,14 @@ int __init maxinefb_init(void)
*/
}
/* Let there be consoles... */
strcpy(fb_info.modename, "Maxine onboard graphics 1024x768x8");
fb_info.changevar = NULL;
fb_info.node = NODEV;
fb_info.fbops = &maxinefb_ops;
fb_info.screen_base = (char *) maxinefb_fix.smem_start;
fb_info.var = maxinefb_defined;
fb_info.fix = maxinefb_fix;
fb_info.disp = &disp;
fb_info.currcon = -1;
fb_info.switch_con = gen_switch;
fb_info.updatevar = gen_update_var;
fb_info.flags = FBINFO_FLAG_DEFAULT;
fb_alloc_cmap(&fb_info.cmap, 256, 0);
gen_set_disp(-1, &fb_info);
if (register_framebuffer(&fb_info) < 0)
return 1;
......
......@@ -16,8 +16,6 @@
#include <linux/fb.h>
#include <linux/sched.h>
#include <video/fbcon.h>
#undef DEBUG
#define name_matches(v, s, l) \
......@@ -277,7 +275,7 @@ static int __init my_atoi(const char *name)
int __fb_try_mode(struct fb_var_screeninfo *var, struct fb_info *info,
const struct fb_videomode *mode, unsigned int bpp)
{
int err;
int err = 1;
DPRINTK("Trying mode %s %dx%d-%d@%d\n", mode->name ? mode->name : "noname",
mode->xres, mode->yres, bpp, mode->refresh);
......@@ -298,7 +296,8 @@ int __fb_try_mode(struct fb_var_screeninfo *var, struct fb_info *info,
var->vsync_len = mode->vsync_len;
var->sync = mode->sync;
var->vmode = mode->vmode;
err = info->fbops->fb_set_var(var, PROC_CONSOLE(info), info);
if (info->fbops->fb_check_var)
err = info->fbops->fb_check_var(var, info);
var->activate &= ~FB_ACTIVATE_TEST;
return !err;
}
......
......@@ -67,7 +67,6 @@
#include <asm/mtrr.h>
#endif
#include <video/fbcon.h>
#include <video/neomagic.h>
#define NEOFB_VERSION "0.3.3"
......@@ -1165,10 +1164,9 @@ static void neofb_update_start(struct fb_info *info,
/*
* Pan or Wrap the Display
*/
static int neofb_pan_display(struct fb_var_screeninfo *var, int con,
struct fb_info *fb)
static int neofb_pan_display(struct fb_var_screeninfo *var,
struct fb_info *info)
{
struct fb_info *info = (struct fb_info *) fb;
u_int y_bottom;
y_bottom = var->yoffset;
......@@ -1389,9 +1387,6 @@ static struct fb_ops neofb_ops = {
.owner = THIS_MODULE,
.fb_check_var = neofb_check_var,
.fb_set_par = neofb_set_par,
.fb_set_var = gen_set_var,
.fb_get_cmap = gen_get_cmap,
.fb_set_cmap = gen_set_cmap,
.fb_setcolreg = neofb_setcolreg,
.fb_pan_display = neofb_pan_display,
.fb_blank = neofb_blank,
......@@ -1750,18 +1745,17 @@ static struct fb_info *__devinit neo_alloc_fb_info(struct pci_dev *dev, const st
struct fb_info *info;
struct neofb_par *par;
info = kmalloc(sizeof(struct fb_info) + sizeof(struct display) +
sizeof(u32) * 16, GFP_KERNEL);
info = kmalloc(sizeof(struct fb_info) +
sizeof(u32) * 17, GFP_KERNEL);
if (!info)
return NULL;
memset(info, 0, sizeof(struct fb_info) + sizeof(struct display));
memset(info, 0, sizeof(struct fb_info) + sizeof(u32) * 17);
par = &default_par;
memset(par, 0, sizeof(struct neofb_par));
info->currcon = -1;
info->fix.accel = id->driver_data;
par->pci_burst = !nopciburst;
......@@ -1818,16 +1812,11 @@ static struct fb_info *__devinit neo_alloc_fb_info(struct pci_dev *dev, const st
info->var.width = -1;
info->var.accel_flags = 0;
strcpy(info->modename, info->fix.id);
info->fbops = &neofb_ops;
info->changevar = NULL;
info->switch_con = gen_switch;
info->updatevar = gen_update_var;
info->flags = FBINFO_FLAG_DEFAULT;
info->par = par;
info->disp = (struct display *) (info + 1);
info->pseudo_palette = (void *) (info->disp + 1);
info->pseudo_palette = (void *) (info + 1);
fb_alloc_cmap(&info->cmap, NR_PALETTE, 0);
......
......@@ -24,7 +24,6 @@
#include <linux/delay.h>
#include <linux/interrupt.h>
#include <linux/fb.h>
#include <linux/selection.h>
#include <linux/init.h>
#include <linux/ioport.h>
#include <asm/io.h>
......@@ -33,7 +32,6 @@
#include <asm/bootx.h>
#endif
#include <video/fbcon.h>
#include <video/macmodes.h>
/* Supported palette hacks */
......@@ -83,9 +81,6 @@ static void offb_init_fb(const char *name, const char *full_name,
static struct fb_ops offb_ops = {
.owner = THIS_MODULE,
.fb_set_var = gen_set_var,
.fb_get_cmap = gen_get_cmap,
.fb_set_cmap = gen_set_cmap,
.fb_setcolreg = offb_setcolreg,
.fb_blank = offb_blank,
.fb_fillrect = cfb_fillrect,
......@@ -411,7 +406,7 @@ static void __init offb_init_fb(const char *name, const char *full_name,
return;
}
size = sizeof(struct fb_info) + sizeof(struct display) + sizeof(u32) * 17;
size = sizeof(struct fb_info) + sizeof(u32) * 17;
info = kmalloc(size, GFP_ATOMIC);
......@@ -528,24 +523,16 @@ static void __init offb_init_fb(const char *name, const char *full_name,
strcpy(fix->id, "OFfb ");
strncat(fix->id, full_name, sizeof(fix->id));
strcpy(info->modename, fix->id);
info->node = NODEV;
info->fbops = &offb_ops;
info->screen_base = ioremap(address, fix->smem_len);
info->par = par;
info->disp = (struct display *) (info + 1);
info->pseudo_palette = (void *) (info->disp + 1);
info->currcon = -1;
info->pseudo_palette = (void *) (info + 1);
info->fontname[0] = '\0';
info->changevar = NULL;
info->switch_con = gen_switch;
info->updatevar = gen_update_var;
info->flags = FBINFO_FLAG_DEFAULT;
fb_alloc_cmap(&info->cmap, 256, 0);
gen_set_disp(-1, info);
if (register_framebuffer(info) < 0) {
kfree(info);
release_mem_region(res_start, res_size);
......
......@@ -36,8 +36,6 @@
#include <asm/dec/tc.h>
#include "pmag-ba-fb.h"
#include <video/fbcon.h>
struct pmag_ba_ramdac_regs {
unsigned char addr_low;
unsigned char pad0[3];
......@@ -52,7 +50,6 @@ struct pmag_ba_ramdac_regs {
* Max 3 TURBOchannel slots -> max 3 PMAG-BA :)
*/
static struct fb_info pmagba_fb_info[3];
static struct display pmagba_disp[3];
static struct fb_var_screeninfo pmagbafb_defined = {
.xres = 1024,
......@@ -111,9 +108,6 @@ static int pmagbafb_setcolreg(unsigned regno, unsigned red, unsigned green,
static struct fb_ops pmagbafb_ops = {
.owner = THIS_MODULE,
.fb_set_var = gen_set_var,
.fb_get_cmap = gen_get_cmap,
.fb_set_cmap = gen_set_cmap,
.fb_setcolreg = pmagbafb_setcolreg,
.fb_fillrect = cfb_fillrect,
.fb_copyarea = cfb_copyarea,
......@@ -124,7 +118,6 @@ int __init pmagbafb_init_one(int slot)
{
unsigned long base_addr = get_tc_base_addr(slot);
struct fb_info *info = &pmagba_fb_info[slot];
struct display *disp = &pmagba_disp[slot];
printk("PMAG-BA framebuffer in slot %d\n", slot);
/*
......@@ -141,21 +134,14 @@ int __init pmagbafb_init_one(int slot)
/*
* Let there be consoles..
*/
strcpy(info->modename, pmagbafb_fix.id);
info->changevar = NULL;
info->node = NODEV;
info->fbops = &pmagbafb_ops;
info->var = pmagbafb_defined;
info->fix = pmagbafb_fix;
info->screen_base = pmagbafb_fix.smem_start;
info->disp = &disp;
info->currcon = -1;
info->switch_con = gen_switch;
info->updatevar = gen_update_var;
info->flags = FBINFO_FLAG_DEFAULT;
fb_alloc_cmap(&fb_info.cmap, 256, 0);
gen_set_disp(-1, info);
if (register_framebuffer(info) < 0)
return 1;
......
......@@ -39,8 +39,6 @@
#include <asm/dec/tc.h>
#include "pmagb-b-fb.h"
#include <video/fbcon.h>
struct pmagb_b_ramdac_regs {
unsigned char addr_low;
unsigned char pad0[3];
......@@ -55,7 +53,6 @@ struct pmagb_b_ramdac_regs {
* Max 3 TURBOchannel slots -> max 3 PMAGB-B :)
*/
static struct fb_info pmagbb_fb_info[3];
static struct display pmagbb_disp[3];
static struct fb_var_screeninfo pmagbbfb_defined = {
.xres = 1280,
......@@ -114,9 +111,6 @@ static int pmagbbfb_setcolreg(unsigned regno, unsigned red, unsigned green,
static struct fb_ops pmagbbfb_ops = {
.owner = THIS_MODULE,
.fb_set_var = gen_set_var,
.fb_get_cmap = gen_get_cmap,
.fb_set_cmap = gen_set_cmap,
.fb_setcolreg = pmagbbfb_setcolreg,
.fb_fillrect = cfb_fillrect,
.fb_copyarea = cfb_copyarea,
......@@ -127,7 +121,6 @@ int __init pmagbbfb_init_one(int slot)
{
unsigned long base_addr = get_tc_base_addr(slot);
struct fb_info *info = &pmagbb_fb_info[slot];
struct display *disp = &pmagbb_disp[slot];
printk("PMAGB-BA framebuffer in slot %d\n", slot);
/*
......@@ -144,21 +137,14 @@ int __init pmagbbfb_init_one(int slot)
/*
* Let there be consoles..
*/
strcpy(info->modename, pmagbbfb_fix.id);
info->changevar = NULL;
info->node = NODEV;
info->fbops = &pmagbbfb_ops;
info->var = pmagbbfb_defined;
info->fix = pmagbbfb_fix;
info->screen_base = pmagbbfb_fix.smem_start;
info->disp = &disp;
info->currcon = -1;
info->switch_con = gen_switch;
info->updatevar = gen_update_var;
info->flags = FBINFO_FLAG_DEFAULT;
fb_alloc_cmap(&fb_info.cmap, 256, 0);
gen_set_disp(-1, info);
if (register_framebuffer(info) < 0)
return 1;
......
......@@ -28,13 +28,10 @@
#include <linux/module.h>
#include <asm/pgtable.h>
#include <video/fbcon.h>
#define Q40_PHYS_SCREEN_ADDR 0xFE800000
static u32 pseudo_palette[17];
static struct fb_info fb_info;
static struct display display;
static struct fb_fix_screeninfo q40fb_fix __initdata = {
.id = "Q40",
......@@ -69,9 +66,6 @@ static int q40fb_setcolreg(unsigned regno, unsigned red, unsigned green,
static struct fb_ops q40fb_ops = {
.owner = THIS_MODULE,
.fb_set_var = gen_set_var,
.fb_get_cmap = gen_get_cmap,
.fb_set_cmap = gen_set_cmap,
.fb_setcolreg = q40fb_setcolreg,
.fb_fillrect = cfb_fillrect,
.fb_copyarea = cfb_copyarea,
......@@ -117,15 +111,8 @@ int q40fb_init(void)
fb_info.screen_base = (char *) q40fb_fix.smem_start;
/* 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);
gen_set_disp(-1, &fb_info);
master_outb(3, DISPLAY_CONTROL_REG);
if (register_framebuffer(&fb_info) < 0) {
......
......@@ -1432,7 +1432,7 @@ static void sa1100fb_disable_controller(struct sa1100fb_info *fbi)
LCCR0 &= ~LCCR0_LEN; /* Disable LCD Controller */
schedule_timeout(20 * HZ / 1000);
current->state = TASK_RUNNING;
set_current_state(TASK_RUNNING);
remove_wait_queue(&fbi->ctrlr_wait, &wait);
}
......
......@@ -26,8 +26,6 @@
#include <asm/io.h>
#include <asm/mtrr.h>
#include <video/fbcon.h>
#define INCLUDE_TIMING_TABLE_DATA
#define DBE_REG_BASE regs
#include <video/sgivw.h>
......@@ -85,9 +83,6 @@ static struct fb_var_screeninfo sgivwfb_var __initdata = {
.vmode = FB_VMODE_NONINTERLACED
};
/* console related variables */
static struct display disp;
/*
* Interface used by the world
*/
......@@ -105,8 +100,6 @@ static int sgivwfb_mmap(struct fb_info *info, struct file *file,
static struct fb_ops sgivwfb_ops = {
.owner = THIS_MODULE,
.fb_set_var = gen_set_var,
.fb_get_cmap = gen_get_cmap,
.fb_set_cmap = gen_set_cmap,
.fb_check_var = sgivwfb_check_var,
.fb_set_par = sgivwfb_set_par,
.fb_setcolreg = sgivwfb_setcolreg,
......@@ -240,8 +233,8 @@ static int sgivwfb_check_var(struct fb_var_screeninfo *var,
if (var->vmode & FB_VMODE_CONUPDATE) {
var->vmode |= FB_VMODE_YWRAP;
var->xoffset = display->var.xoffset;
var->yoffset = display->var.yoffset;
var->xoffset = info->var.xoffset;
var->yoffset = info->var.yoffset;
}
/* XXX FIXME - forcing var's */
......@@ -720,18 +713,12 @@ int __init sgivwfb_init(void)
sgivwfb_fix.ywrapstep = ywrap;
sgivwfb_fix.ypanstep = ypan;
strcpy(fb_info.modename, sgivwfb_fix.id);
fb_info.changevar = NULL;
fb_info.node = NODEV;
fb_info.fix = sgivwfb_fix;
fb_info.var = sgivwfb_var;
fb_info.fbops = &sgivwfb_ops;
fb_info.pseudo_palette = pseudo_palette;
fb_info.par = &default_par;
fb_info.disp = &disp;
fb_info.currcon = -1;
fb_info.switch_con = gen_switch;
fb_info.updatevar = gen_update_var;
fb_info.flags = FBINFO_FLAG_DEFAULT;
fb_info.screen_base =
......@@ -742,8 +729,7 @@ int __init sgivwfb_init(void)
goto fail_ioremap_fbmem;
}
/* turn on default video mode */
gen_set_var(&fb_info->var, -1, &fb_info);
fb_alloc_cmap(&fb_info.cmap, 256, 0);
if (register_framebuffer(&fb_info) < 0) {
printk(KERN_ERR
......
......@@ -125,9 +125,6 @@ static struct fb_info info;
*/
static struct xxx_par __initdata current_par;
/* To go away in the near future */
static struct display disp;
int xxxfb_init(void);
int xxxfb_setup(char*);
......@@ -298,7 +295,7 @@ static int xxxfb_setcolreg(unsigned regno, unsigned red, unsigned green,
* Returns negative errno on error, or zero on success.
*
*/
static int xxxfb_pan_display(struct fb_var_screeninfo *var, int con,
static int xxxfb_pan_display(struct fb_var_screeninfo *var,
const struct fb_info *info)
{
/* ... */
......@@ -421,15 +418,6 @@ int __init xxxfb_init(void)
info.flags = FBINFO_FLAG_DEFAULT;
info.par = current_par;
/* The following has to be set but in th efuture will go away */
strcpy(info.modename, xxxfb_fix.id);
info.changevar = NULL;
info.currcon = -1;
info.disp = &disp;
info.switch_con = gen_switch;
info.updatevar = gen_update_var;
/*
* This should give a reasonable default video mode. The following is
* done when we can set a video mode.
......@@ -450,7 +438,6 @@ int __init xxxfb_init(void)
* mode. If we are setting the mode ourselves we don't call this.
*/
info.var = xxxfb_var;
gen_set_disp(-1, &fb_info);
if (register_framebuffer(&info) < 0)
return -EINVAL;
......@@ -510,11 +497,6 @@ static struct fb_ops xxxfb_ops = {
.owner = THIS_MODULE,
.fb_open = xxxfb_open, /* only if you need it to do something */
.fb_release = xxxfb_release, /* only if you need it to do something */
/* Stuff to go away. Use generic functions for now */
.fb_set_var = gen_set_var,
.fb_get_cmap = gen_get_cmap,
.fb_set_cmap = gen_set_cmap,
.fb_check_var = xxxfb_check_var,
.fb_set_par = xxxfb_set_par, /* optional */
.fb_setcolreg = xxxfb_setcolreg,
......
This diff is collapsed.
......@@ -21,7 +21,6 @@
#include <linux/init.h>
#include <linux/pm.h>
#include <linux/fb.h>
#include <video/fbcon.h>
#include <asm/io.h>
#include <asm/bootinfo.h>
#include <asm/uaccess.h>
......@@ -33,7 +32,6 @@
*/
static struct fb_info fb_info;
static u32 cfb8[16];
static struct display disp;
static struct fb_fix_screeninfo tx3912fb_fix __initdata = {
.id = "tx3912fb",
......@@ -96,9 +94,6 @@ static int tx3912fb_setcolreg(u_int regno, u_int red, u_int green,
*/
static struct fb_ops tx3912fb_ops = {
.owner = THIS_MODULE,
.fb_set_var = gen_set_var,
.fb_get_cmap = gen_get_cmap,
.fb_set_cmap = gen_set_cmap,
.fb_setcolreg = tx3912fb_setcolreg,
.fb_fillrect = cfb_fillrect,
.fb_copyarea = cfb_copyarea,
......@@ -215,6 +210,7 @@ static int tx3912fb_setcolreg(u_int regno, u_int red, u_int green,
int __init tx3912fb_init(void)
{
u_long tx3912fb_paddr = 0;
int size = (info->var.bits_per_pixel == 8) ? 256 : 16;
/* Disable the video logic */
outl(inl(TX3912_VIDEO_CTRL1) &
......@@ -295,17 +291,11 @@ int __init tx3912fb_init(void)
if ((tx3912fb_fix.line_length * tx3912fb_var.yres_virtual) > tx3912fb_fix.smem_len)
return -ENOMEM;
strcpy(fb_info.modename, tx3912fb_fix.id);
fb_info.changevar = NULL;
fb_info.node = NODEV;
fb_info.currcon = -1;
fb_info.fbops = &tx3912fb_ops;
fb_info.var = tx3912fb_var;
fb_info.fix = tx3912fb_fix;
fb_info.pseudo_palette = pseudo_palette;
fb_info.disp = &disp;
fb_info.switch_con = gen_switch;
fb_info.updatevar = gen_update_var;
fb_info.flags = FBINFO_FLAG_DEFAULT;
/* Clear the framebuffer */
......@@ -313,7 +303,6 @@ int __init tx3912fb_init(void)
udelay(200);
fb_alloc_cmap(&info->cmap, size, 0);
gen_set_disp(-1, &disp);
if (register_framebuffer(&fb_info) < 0)
return -1;
......
......@@ -17,16 +17,12 @@
#include <linux/slab.h>
#include <linux/delay.h>
#include <linux/fb.h>
#include <linux/console.h>
#include <linux/selection.h>
#include <linux/ioport.h>
#include <linux/init.h>
#include <asm/io.h>
#include <asm/mtrr.h>
#include <video/fbcon.h>
#define dac_reg (0x3c8)
#define dac_val (0x3c9)
......@@ -49,7 +45,6 @@ static struct fb_fix_screeninfo vesafb_fix __initdata = {
.accel = FB_ACCEL_NONE,
};
static struct display disp;
static struct fb_info fb_info;
static u32 pseudo_palette[17];
......@@ -64,7 +59,7 @@ static void (*pmi_pal)(void);
/* --------------------------------------------------------------------- */
static int vesafb_pan_display(struct fb_var_screeninfo *var, int con,
static int vesafb_pan_display(struct fb_var_screeninfo *var,
struct fb_info *info)
{
int offset;
......@@ -175,9 +170,6 @@ static int vesafb_setcolreg(unsigned regno, unsigned red, unsigned green,
static struct fb_ops vesafb_ops = {
.owner = THIS_MODULE,
.fb_set_var = gen_set_var,
.fb_get_cmap = gen_get_cmap,
.fb_set_cmap = gen_set_cmap,
.fb_setcolreg = vesafb_setcolreg,
.fb_pan_display = vesafb_pan_display,
.fb_fillrect = cfb_fillrect,
......@@ -351,21 +343,14 @@ int __init vesafb_init(void)
}
}
strcpy(fb_info.modename, vesafb_fix.id);
fb_info.changevar = NULL;
fb_info.node = NODEV;
fb_info.fbops = &vesafb_ops;
fb_info.var = vesafb_defined;
fb_info.fix = vesafb_fix;
fb_info.currcon = -1;
fb_info.disp = &disp;
fb_info.switch_con = gen_switch;
fb_info.updatevar = gen_update_var;
fb_info.pseudo_palette = pseudo_palette;
fb_info.flags = FBINFO_FLAG_DEFAULT;
fb_alloc_cmap(&fb_info.cmap, video_cmap_len, 0);
gen_set_disp(-1, &fb_info);
if (register_framebuffer(&fb_info)<0)
return -EINVAL;
......
......@@ -24,8 +24,6 @@
#include <linux/fb.h>
#include <linux/init.h>
#include <video/fbcon.h>
/*
* RAM we reserve for the frame buffer. This defines the maximum screen
* size
......@@ -42,7 +40,6 @@ static const char *mode_option __initdata = NULL;
static struct fb_info fb_info;
static u32 vfb_pseudo_palette[17];
static struct display disp;
static struct fb_var_screeninfo vfb_default __initdata = {
.xres = 640,
......@@ -90,15 +87,12 @@ static int vfb_check_var(struct fb_var_screeninfo *var,
static int vfb_set_par(struct fb_info *info);
static int vfb_setcolreg(u_int regno, u_int red, u_int green, u_int blue,
u_int transp, struct fb_info *info);
static int vfb_pan_display(struct fb_var_screeninfo *var, int con,
static int vfb_pan_display(struct fb_var_screeninfo *var,
struct fb_info *info);
static int vfb_mmap(struct fb_info *info, struct file *file,
struct vm_area_struct *vma);
static struct fb_ops vfb_ops = {
.fb_set_var gen_set_var,
.fb_get_cmap gen_set_cmap,
.fb_set_cmap gen_set_cmap,
.fb_check_var vfb_check_var,
.fb_set_par vfb_set_par,
.fb_setcolreg vfb_setcolreg,
......@@ -356,7 +350,7 @@ static int vfb_setcolreg(u_int regno, u_int red, u_int green, u_int blue,
* This call looks only at xoffset, yoffset and the FB_VMODE_YWRAP flag
*/
static int vfb_pan_display(struct fb_var_screeninfo *var, int con,
static int vfb_pan_display(struct fb_var_screeninfo *var,
struct fb_info *info)
{
if (var->vmode & FB_VMODE_YWRAP) {
......@@ -444,13 +438,6 @@ int __init vfb_init(void)
fb_info.pseudo_palette = &vfb_pseudo_palette;
fb_info.flags = FBINFO_FLAG_DEFAULT;
strcpy(fb_info.modename, vfb_fix.id);
fb_info.changevar = NULL;
fb_info.currcon = -1;
fb_info.disp = &disp;
fb_info.switch_con = gen_switch;
fb_info.updatevar = gen_update_var;
fb_alloc_cmap(&fb_info.cmap, 256, 0);
if (register_framebuffer(&fb_info) < 0) {
......
This diff is collapsed.
......@@ -180,6 +180,13 @@ static const char __init *vgacon_startup(void)
#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_columns = ORIG_VIDEO_COLS;
......
......@@ -3,6 +3,7 @@
#include <linux/tty.h>
#include <asm/types.h>
#include <asm/io.h>
/* Definitions of frame buffers */
......@@ -264,10 +265,10 @@ struct fb_vblank {
struct fb_copyarea {
__u32 sx; /* screen-relative */
__u32 sy;
__u32 width;
__u32 height;
__u32 dx;
__u32 dy;
__u32 width;
__u32 height;
};
struct fb_fillrect {
......@@ -280,10 +281,10 @@ struct fb_fillrect {
};
struct fb_image {
__u32 dx; /* Where to place image */
__u32 dy;
__u32 width; /* Size of image */
__u32 height;
__u16 dx; /* Where to place image */
__u16 dy;
__u32 fg_color; /* Only used when a mono bitmap */
__u32 bg_color;
__u8 depth; /* Dpeth of the image */
......@@ -316,15 +317,6 @@ struct fb_ops {
struct module *owner;
int (*fb_open)(struct fb_info *info, int user);
int (*fb_release)(struct fb_info *info, int user);
/* set settable parameters */
int (*fb_set_var)(struct fb_var_screeninfo *var, int con,
struct fb_info *info);
/* get colormap */
int (*fb_get_cmap)(struct fb_cmap *cmap, int kspc, int con,
struct fb_info *info);
/* set colormap */
int (*fb_set_cmap)(struct fb_cmap *cmap, int kspc, int con,
struct fb_info *info);
/* checks var and creates a par based on it */
int (*fb_check_var)(struct fb_var_screeninfo *var, struct fb_info *info);
/* set the video mode according to par */
......@@ -335,7 +327,7 @@ struct fb_ops {
/* blank display */
int (*fb_blank)(int blank, struct fb_info *info);
/* pan display */
int (*fb_pan_display)(struct fb_var_screeninfo *var, int con, struct fb_info *info);
int (*fb_pan_display)(struct fb_var_screeninfo *var, struct fb_info *info);
/* draws a rectangle */
void (*fb_fillrect)(struct fb_info *info, struct fb_fillrect *rect);
/* Copy data from area to another */
......@@ -346,7 +338,7 @@ struct fb_ops {
int (*fb_poll)(struct fb_info *info, poll_table *wait);
/* perform fb specific ioctl (optional) */
int (*fb_ioctl)(struct inode *inode, struct file *file, unsigned int cmd,
unsigned long arg, int con, struct fb_info *info);
unsigned long arg, struct fb_info *info);
/* perform fb specific mmap */
int (*fb_mmap)(struct fb_info *info, struct file *file, struct vm_area_struct *vma);
/* switch to/from raster image mode */
......@@ -354,7 +346,6 @@ struct fb_ops {
};
struct fb_info {
char modename[40]; /* default video mode */
kdev_t node;
int flags;
int open; /* Has this been open already ? */
......@@ -365,17 +356,11 @@ struct fb_info {
struct fb_cmap cmap; /* Current cmap */
struct fb_ops *fbops;
char *screen_base; /* Virtual address */
struct display *disp; /* initial display variable */
struct vc_data *display_fg; /* Console visible on this display */
int currcon; /* Current VC. */
char fontname[40]; /* default font name */
devfs_handle_t devfs_handle; /* Devfs handle for new name */
devfs_handle_t devfs_lhandle; /* Devfs handle for compat. symlink */
int (*changevar)(int); /* tell console var has changed */
int (*switch_con)(int, struct fb_info*);
/* tell fb to switch consoles */
int (*updatevar)(int, struct fb_info*);
/* tell fb to update the vars */
void *pseudo_palette; /* Fake palette of 16 colors and
the cursor's color for non
palette mode */
......@@ -387,6 +372,42 @@ struct fb_info {
#define FBINFO_FLAG_DEFAULT FBINFO_FLAG_MODULE
#else
#define FBINFO_FLAG_DEFAULT 0
#endif
#if defined(__sparc__)
/* We map all of our framebuffers such that big-endian accesses
* are what we want, so the following is sufficient.
*/
#define fb_readb sbus_readb
#define fb_readw sbus_readw
#define fb_readl sbus_readl
#define fb_writeb sbus_writeb
#define fb_writew sbus_writew
#define fb_writel sbus_writel
#define fb_memset sbus_memset_io
#elif defined(__i386__) || defined(__alpha__) || defined(__x86_64__)
#define fb_readb __raw_readb
#define fb_readw __raw_readw
#define fb_readl __raw_readl
#define fb_writeb __raw_writeb
#define fb_writew __raw_writew
#define fb_writel __raw_writel
#define fb_memset memset_io
#else
#define fb_readb(addr) (*(volatile u8 *) (addr))
#define fb_readw(addr) (*(volatile u16 *) (addr))
#define fb_readl(addr) (*(volatile u32 *) (addr))
#define fb_writeb(b,addr) (*(volatile u8 *) (addr) = (b))
#define fb_writew(b,addr) (*(volatile u16 *) (addr) = (b))
#define fb_writel(b,addr) (*(volatile u32 *) (addr) = (b))
#define fb_memset memset
#endif
/*
......@@ -395,14 +416,10 @@ struct fb_info {
extern int gen_set_var(struct fb_var_screeninfo *var, int con,
struct fb_info *info);
extern int gen_get_cmap(struct fb_cmap *cmap, int kspc, int con,
struct fb_info *info);
extern int gen_set_cmap(struct fb_cmap *cmap, int kspc, int con,
struct fb_info *info);
extern int fb_pan_display(struct fb_var_screeninfo *var, int con,
struct fb_info *info);
extern void cfb_fillrect(struct fb_info *info, struct fb_fillrect *rect);
extern void cfb_copyarea(struct fb_info *info, struct fb_copyarea *region);
extern void cfb_copyarea(struct fb_info *info, struct fb_copyarea *area);
extern void cfb_imageblit(struct fb_info *info, struct fb_image *image);
/*
......@@ -412,7 +429,6 @@ extern void cfb_imageblit(struct fb_info *info, struct fb_image *image);
extern void do_install_cmap(int con, struct fb_info *info);
extern int gen_update_var(int con, struct fb_info *info);
extern int fb_blank(int blank, struct fb_info *info);
extern int gen_switch(int con, struct fb_info *info);
extern void gen_set_disp(int con, struct fb_info *info);
/* drivers/video/fbmem.c */
......
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.
......@@ -18,6 +18,7 @@
#endif
extern struct display_switch fbcon_vga_planes;
extern struct display_switch fbcon_vga8_planes;
extern struct display_switch fbcon_ega_planes;
extern void fbcon_vga_planes_setup(struct display *p);
extern void fbcon_vga_planes_bmove(struct display *p, int sy, int sx, int dy, int dx,
......
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