Commit 7304ada2 authored by Linus Torvalds's avatar Linus Torvalds

Merge http://fbdev.bkbits.net:8080/fbdev-2.5

into home.transmeta.com:/home/torvalds/v2.5/linux
parents cdac1baf 1ecd8afb
Tridentfb is a framebuffer driver for some Trident chip based cards.
The following list of chips is thought to be supported although not all are
tested:
those from the Image series with Cyber in their names - accelerated
those with Blade in their names (Blade3D,CyberBlade...) - accelerated
the newer CyberBladeXP family - nonaccelerated
Only PCI/AGP based cards are supported, none of the older Tridents.
How to use it?
==============
Just do your usual console work :)
When booting you can pass the following parameters
==================================================
noaccel - turns off acceleration (when it doesn't work for your card)
accel - force text acceleration (for boards which by default are noacceled)
fp - use flat panel related stuff
crt - assume monitor is present instead of fp
center - for flat panels and resolutions smaller than native size center the
image, otherwise use
stretch
memsize - integer value in Kb, use if your card's memory size is misdetected.
look at the driver output to see what it says when initializing.
memdiff - integer value in Kb,should be nonzero if your card reports
more memory than it actually has.For instance mine is 192K less than
detection says in all three BIOS selectable situations 2M, 4M, 8M.
Only use if your video memory is taken from main memory hence of
configurable size.Otherwise use memsize.
If in some modes which barely fit the memory you see garbage at the bottom
this might help by not letting change to that mode anymore.
nativex - the width in pixels of the flat panel.If you know it (usually 1024
800 or 1280) and it is not what the driver seems to detect use it.
bpp - bits per pixel (8,16 or 32)
mode - a mode name like 800x600 (as described in Documentation/fb/modedb.txt)
Using insane values for the above parameters will probably result in driver
misbehaviour so take care(for instance memsize=12345678 or memdiff=23784 or
nativex=93)
Contact: jani@astechnix.ro
This diff is collapsed.
...@@ -44,8 +44,9 @@ endif ...@@ -44,8 +44,9 @@ endif
obj-$(CONFIG_FB_ACORN) += acornfb.o obj-$(CONFIG_FB_ACORN) += acornfb.o
obj-$(CONFIG_FB_AMIGA) += amifb.o obj-$(CONFIG_FB_AMIGA) += amifb.o
obj-$(CONFIG_FB_PM2) += pm2fb.o obj-$(CONFIG_FB_PM2) += pm2fb.o
obj-$(CONFIG_FB_PM3) += pm3fb.o
obj-$(CONFIG_FB_APOLLO) += dnfb.o obj-$(CONFIG_FB_APOLLO) += dnfb.o
obj-$(CONFIG_FB_Q40) += q40fb.o obj-$(CONFIG_FB_Q40) += q40fb.o cfbfillrect.o cfbcopyarea.o cfbimgblt.o
obj-$(CONFIG_FB_ATARI) += atafb.o obj-$(CONFIG_FB_ATARI) += atafb.o
obj-$(CONFIG_FB_ATY128) += aty128fb.o obj-$(CONFIG_FB_ATY128) += aty128fb.o
obj-$(CONFIG_FB_RADEON) += radeonfb.o obj-$(CONFIG_FB_RADEON) += radeonfb.o
...@@ -56,24 +57,25 @@ obj-$(CONFIG_FB_PLATINUM) += platinumfb.o ...@@ -56,24 +57,25 @@ obj-$(CONFIG_FB_PLATINUM) += platinumfb.o
obj-$(CONFIG_FB_VALKYRIE) += valkyriefb.o obj-$(CONFIG_FB_VALKYRIE) += valkyriefb.o
obj-$(CONFIG_FB_CT65550) += chipsfb.o obj-$(CONFIG_FB_CT65550) += chipsfb.o
obj-$(CONFIG_FB_ANAKIN) += anakinfb.o obj-$(CONFIG_FB_ANAKIN) += anakinfb.o
obj-$(CONFIG_FB_CLPS711X) += clps711xfb.o obj-$(CONFIG_FB_CLPS711X) += clps711xfb.o cfbfillrect.o cfbcopyarea.o cfbimgblt.o
obj-$(CONFIG_FB_CYBER) += cyberfb.o obj-$(CONFIG_FB_CYBER) += cyberfb.o
obj-$(CONFIG_FB_CYBER2000) += cyber2000fb.o obj-$(CONFIG_FB_CYBER2000) += cyber2000fb.o
obj-$(CONFIG_FB_SGIVW) += sgivwfb.o obj-$(CONFIG_FB_SGIVW) += sgivwfb.o
obj-$(CONFIG_FB_3DFX) += tdfxfb.o obj-$(CONFIG_FB_3DFX) += tdfxfb.o
obj-$(CONFIG_FB_MAC) += macfb.o macmodes.o obj-$(CONFIG_FB_MAC) += macfb.o macmodes.o
obj-$(CONFIG_FB_HP300) += hpfb.o obj-$(CONFIG_FB_HP300) += hpfb.o cfbfillrect.o cfbimgblt.o
obj-$(CONFIG_FB_OF) += offb.o obj-$(CONFIG_FB_OF) += offb.o
obj-$(CONFIG_FB_IMSTT) += imsttfb.o obj-$(CONFIG_FB_IMSTT) += imsttfb.o
obj-$(CONFIG_FB_RETINAZ3) += retz3fb.o obj-$(CONFIG_FB_RETINAZ3) += retz3fb.o
obj-$(CONFIG_FB_CLGEN) += clgenfb.o obj-$(CONFIG_FB_CLGEN) += clgenfb.o
obj-$(CONFIG_FB_TRIDENT) += tridentfb.o
obj-$(CONFIG_FB_S3TRIO) += S3triofb.o obj-$(CONFIG_FB_S3TRIO) += S3triofb.o
obj-$(CONFIG_FB_TGA) += tgafb.o obj-$(CONFIG_FB_TGA) += tgafb.o
obj-$(CONFIG_FB_VESA) += vesafb.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
obj-$(CONFIG_FB_VIRGE) += virgefb.o obj-$(CONFIG_FB_VIRGE) += virgefb.o
obj-$(CONFIG_FB_G364) += g364fb.o obj-$(CONFIG_FB_G364) += g364fb.o cfbfillrect.o cfbcopyarea.o cfbimgblt.o
obj-$(CONFIG_FB_FM2) += fm2fb.o obj-$(CONFIG_FB_FM2) += fm2fb.o cfbfillrect.o cfbcopyarea.o cfbimgblt.o
obj-$(CONFIG_FB_CREATOR) += creatorfb.o sbusfb.o obj-$(CONFIG_FB_CREATOR) += creatorfb.o sbusfb.o
obj-$(CONFIG_FB_CGSIX) += cgsixfb.o sbusfb.o obj-$(CONFIG_FB_CGSIX) += cgsixfb.o sbusfb.o
obj-$(CONFIG_FB_BWTWO) += bwtwofb.o sbusfb.o obj-$(CONFIG_FB_BWTWO) += bwtwofb.o sbusfb.o
...@@ -97,8 +99,8 @@ obj-$(CONFIG_FB_SUN3) += sun3fb.o ...@@ -97,8 +99,8 @@ obj-$(CONFIG_FB_SUN3) += sun3fb.o
obj-$(CONFIG_FB_BWTWO) += bwtwofb.o obj-$(CONFIG_FB_BWTWO) += bwtwofb.o
obj-$(CONFIG_FB_HGA) += hgafb.o obj-$(CONFIG_FB_HGA) += hgafb.o
obj-$(CONFIG_FB_SA1100) += sa1100fb.o obj-$(CONFIG_FB_SA1100) += sa1100fb.o
obj-$(CONFIG_FB_VIRTUAL) += vfb.o obj-$(CONFIG_FB_VIRTUAL) += vfb.o cfbfillrect.o cfbcopyarea.o cfbimgblt.o
obj-$(CONFIG_FB_HIT) += hitfb.o obj-$(CONFIG_FB_HIT) += hitfb.o cfbfillrect.o cfbcopyarea.o cfbimgblt.o
obj-$(CONFIG_FB_E1355) += epson1355fb.o obj-$(CONFIG_FB_E1355) += epson1355fb.o
obj-$(CONFIG_FB_PVR2) += pvr2fb.o obj-$(CONFIG_FB_PVR2) += pvr2fb.o
obj-$(CONFIG_FB_VOODOO1) += sstfb.o obj-$(CONFIG_FB_VOODOO1) += sstfb.o
...@@ -122,6 +124,7 @@ obj-$(CONFIG_FBCON_MFB) += fbcon-mfb.o ...@@ -122,6 +124,7 @@ obj-$(CONFIG_FBCON_MFB) += fbcon-mfb.o
obj-$(CONFIG_FBCON_VGA) += fbcon-vga.o obj-$(CONFIG_FBCON_VGA) += fbcon-vga.o
obj-$(CONFIG_FBCON_HGA) += fbcon-hga.o obj-$(CONFIG_FBCON_HGA) += fbcon-hga.o
obj-$(CONFIG_FBCON_STI) += fbcon-sti.o obj-$(CONFIG_FBCON_STI) += fbcon-sti.o
obj-$(CONFIG_FBCON_ACCEL) += fbcon-accel.o
include $(TOPDIR)/Rules.make include $(TOPDIR)/Rules.make
......
...@@ -23,23 +23,34 @@ ...@@ -23,23 +23,34 @@
#include <video/fbcon.h> #include <video/fbcon.h>
#include <video/fbcon-cfb16.h> #include <video/fbcon-cfb16.h>
static u16 colreg[16]; static u32 colreg[16];
static struct fb_info fb_info; static struct fb_info fb_info;
static struct display display; static struct display display;
static int static struct fb_var_screeninfo anakinfb_var = {
anakinfb_getcolreg(u_int regno, u_int *red, u_int *green, u_int *blue, xres: 400,
u_int *transp, struct fb_info *info) yres: 234,
{ xres_virtual: 400,
if (regno > 15) yres_virtual: 234,
return 1; bits_per_pixel: 16,
red: { 11, 5, 0 },
green: { 5, 6, 0 },
blue: { 0, 5, 0 },
activate: FB_ACTIVATE_NOW,
height: -1,
width: -1,
vmode: FB_VMODE_NONINTERLACED,
};
*red = colreg[regno] & 0xf800; static struct fb_fix_screeninfo anakinfb_fix = {
*green = colreg[regno] & 0x7e0 << 5; id: "AnakinFB",
*blue = colreg[regno] & 0x1f << 11; smem_start: VGA_START,
*transp = 0; smem_len: VGA_SIZE,
return 0; type: FB_TYPE_PACKED_PIXELS,
} visual: FB_VISUAL_TRUECOLOR,
line_length: 400*2,
accel: FB_ACCEL_NONE,
};
static int static int
anakinfb_setcolreg(u_int regno, u_int red, u_int green, u_int blue, anakinfb_setcolreg(u_int regno, u_int red, u_int green, u_int blue,
...@@ -53,153 +64,48 @@ anakinfb_setcolreg(u_int regno, u_int red, u_int green, u_int blue, ...@@ -53,153 +64,48 @@ anakinfb_setcolreg(u_int regno, u_int red, u_int green, u_int blue,
return 0; return 0;
} }
static int
anakinfb_get_fix(struct fb_fix_screeninfo *fix, int con, struct fb_info *info)
{
memset(fix, 0, sizeof(struct fb_fix_screeninfo));
strcpy(fix->id, "AnakinFB");
fix->smem_start = VGA_START;
fix->smem_len = VGA_SIZE;
fix->type = FB_TYPE_PACKED_PIXELS;
fix->type_aux = 0;
fix->visual = FB_VISUAL_TRUECOLOR;
fix->xpanstep = 0;
fix->ypanstep = 0;
fix->ywrapstep = 0;
fix->line_length = 400 * 2;
fix->accel = FB_ACCEL_NONE;
return 0;
}
static int
anakinfb_get_var(struct fb_var_screeninfo *var, int con, struct fb_info *info)
{
memset(var, 0, sizeof(struct fb_var_screeninfo));
var->xres = 400;
var->yres = 234;
var->xres_virtual = 400;
var->yres_virtual = 234;
var->xoffset = 0;
var->yoffset = 0;
var->bits_per_pixel = 16;
var->grayscale = 0;
var->red.offset = 11;
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;
var->nonstd = 0;
var->activate = FB_ACTIVATE_NOW;
var->height = -1;
var->width = -1;
var->pixclock = 0;
var->left_margin = 0;
var->right_margin = 0;
var->upper_margin = 0;
var->lower_margin = 0;
var->hsync_len = 0;
var->vsync_len = 0;
var->sync = 0;
var->vmode = FB_VMODE_NONINTERLACED;
return 0;
}
static int
anakinfb_set_var(struct fb_var_screeninfo *var, int con, struct fb_info *info)
{
return -EINVAL;
}
static int
anakinfb_get_cmap(struct fb_cmap *cmap, int kspc, int con,
struct fb_info *info)
{
if (con == info->currcon)
return fb_get_cmap(cmap, kspc, anakinfb_getcolreg, info);
else if (fb_display[con].cmap.len)
fb_copy_cmap(&fb_display[con].cmap, cmap, kspc ? 0 : 2);
else
fb_copy_cmap(fb_default_cmap(16), cmap, kspc ? 0 : 2);
return 0;
}
static int
anakinfb_switch_con(int con, struct fb_info *info)
{
info->currcon = con;
return 0;
}
static int
anakinfb_updatevar(int con, struct fb_info *info)
{
return 0;
}
static void
anakinfb_blank(int blank, struct fb_info *info)
{
/*
* TODO: use I2C to blank/unblank the screen
*/
}
static struct fb_ops anakinfb_ops = { static struct fb_ops anakinfb_ops = {
owner: THIS_MODULE, owner: THIS_MODULE,
fb_get_fix: anakinfb_get_fix, fb_get_fix: gen_get_fix,
fb_get_var: anakinfb_get_var, fb_get_var: gen_get_var,
fb_set_var: anakinfb_set_var, fb_set_var: gen_set_var,
fb_get_cmap: anakinfb_get_cmap, fb_get_cmap: gen_get_cmap,
fb_set_cmap: gen_set_cmap, fb_set_cmap: gen_set_cmap,
fb_setcolreg: anakinfb_setcolreg, fb_setcolreg: anakinfb_setcolreg,
fb_blank: anakinfb_blank, fb_fillrect: cfb_fillrect,
fb_copyarea: cfb_copyarea,
fb_imageblit: cfb_imageblit,
}; };
int __init int __init
anakinfb_init(void) anakinfb_init(void)
{ {
memset(&fb_info, 0, sizeof(struct fb_info)); memset(&fb_info, 0, sizeof(struct fb_info));
strcpy(fb_info.modename, "AnakinFB"); memset(&display, 0, sizeof(struct display));
fb_info.node = NODEV;
strcpy(fb_info.modename, anakinfb_fix.id);
fb_info.node = fb_info.currcon = -1;
fb_info.flags = FBINFO_FLAG_DEFAULT; fb_info.flags = FBINFO_FLAG_DEFAULT;
fb_info.fbops = &anakinfb_ops; fb_info.fbops = &anakinfb_ops;
fb_info.currcon = -1; fb_info.var = anakinfb_var;
fb_info.fix = anakinfb_fix;
fb_info.disp = &display; fb_info.disp = &display;
strcpy(fb_info.fontname, "VGA8x16"); strcpy(fb_info.fontname, "VGA8x16");
fb_info.changevar = NULL; fb_info.changevar = NULL;
fb_info.switch_con = &anakinfb_switch_con; fb_info.switch_con = gen_switch_con;
fb_info.updatevar = &anakinfb_updatevar; fb_info.updatevar = gen_update_var;
memset(&display, 0, sizeof(struct display));
anakinfb_get_var(&display.var, 0, &fb_info);
if (!(request_mem_region(VGA_START, VGA_SIZE, "vga"))) if (!(request_mem_region(VGA_START, VGA_SIZE, "vga")))
return -ENOMEM; return -ENOMEM;
if (!(fb_info.screen_base = ioremap(VGA_START, VGA_SIZE))) { if (fb_info.screen_base = ioremap(VGA_START, VGA_SIZE)) {
release_mem_region(VGA_START, VGA_SIZE); release_mem_region(VGA_START, VGA_SIZE);
return -EIO; return -EIO;
} }
display.visual = FB_VISUAL_TRUECOLOR;
display.type = FB_TYPE_PACKED_PIXELS;
display.type_aux = 0;
display.ypanstep = 0;
display.ywrapstep = 0;
display.line_length = 400 * 2;
display.can_soft_blank = 1;
display.inverse = 0;
#ifdef FBCON_HAS_CFB16 fb_alloc_cmap(&fb_info.cmap, 16, 0);
display.dispsw = &fbcon_cfb16; gen_set_disp(-1, &fb_info);
display.dispsw_data = colreg;
#else
display.dispsw = &fbcon_dummy;
#endif
if (register_framebuffer(&fb_info) < 0) { if (register_framebuffer(&fb_info) < 0) {
iounmap(fb_info.screen_base); iounmap(display.screen_base);
release_mem_region(VGA_START, VGA_SIZE); release_mem_region(VGA_START, VGA_SIZE);
return -EINVAL; return -EINVAL;
} }
......
/*
* Generic function for frame buffer with packed pixels of any depth.
*
* Copyright (C) June 1999 James Simmons
*
* 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.
*
* NOTES:
*
* This is for cfb packed pixels. Iplan and such are incorporated in the
* drivers that need them.
*
* FIXME
* The code for 24 bit is horrible. It copies byte by byte size instead of
* longs like the other sizes. Needs to be optimized.
*
* Also need to add code to deal with cards endians that are different than
* the native cpu endians. I also need to deal with MSB position in the word.
*
*/
#include <linux/kernel.h>
#include <linux/string.h>
#include <linux/fb.h>
#include <linux/slab.h>
#include <asm/types.h>
#include <asm/io.h>
#include <video/fbcon.h>
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 n, j, linesize = p->fix.line_length, bpl = sizeof(unsigned long);
unsigned long start_index, end_index, start_mask, end_mask, last;
unsigned long *dst = NULL, *src = NULL;
char *src1, *dst1;
int tmp, height;
/* clip the destination */
old_dx = area->dx;
old_dy = area->dy;
/*
* We could use hardware clipping but on many cards you get around
* hardware clipping by writing to framebuffer directly.
*/
x2 = area->dx + area->width;
y2 = area->dy + area->height;
area->dx = area->dx > 0 ? area->dx : 0;
area->dy = area->dy > 0 ? area->dy : 0;
x2 = x2 < p->var.xres_virtual ? x2 : p->var.xres_virtual;
y2 = y2 < p->var.yres_virtual ? y2 : p->var.yres_virtual;
area->width = x2 - area->dx;
area->height = y2 - area->dy;
/* update sx1,sy1 */
area->sx += (area->dx - old_dx);
area->sy += (area->dy - old_dy);
height = area->height;
/* the source must be completely inside the virtual screen */
if (area->sx < 0 || area->sy < 0 ||
(area->sx + area->width) > p->var.xres_virtual ||
(area->sy + area->height) > p->var.yres_virtual)
return;
if (area->dy < area->sy
|| (area->dy == area->sy && area->dx < area->sx)) {
/* start at the top */
src1 = p->screen_base + area->sy * linesize +
((area->sx * p->var.bits_per_pixel) >> 3);
dst1 = p->screen_base + area->dy * linesize +
((area->dx * p->var.bits_per_pixel) >> 3);
lineincr = linesize;
} else {
/* start at the bottom */
src1 = p->screen_base + (area->sy + area->height-1) * linesize
+ (((area->sx + area->width - 1) * p->var.bits_per_pixel) >> 3);
dst1 = p->screen_base + (area->dy + area->height-1) * linesize
+ (((area->dx + area->width - 1) * p->var.bits_per_pixel) >> 3);
lineincr = -linesize;
}
if ((BITS_PER_LONG % p->var.bits_per_pixel) == 0) {
int ppw = BITS_PER_LONG / p->var.bits_per_pixel;
int n = ((area->width * p->var.bits_per_pixel) >> 3);
start_index = ((unsigned long) src1 & (bpl - 1));
end_index = ((unsigned long) (src1 + n) & (bpl - 1));
shift = ((unsigned long) dst1 & (bpl - 1)) -
((unsigned long) src1 & (bpl - 1));
start_mask = end_mask = 0;
if (start_index) {
start_mask = -1 >> (start_index << 3);
n -= (bpl - start_index);
}
if (end_index) {
end_mask = -1 << ((bpl - end_index) << 3);
n -= end_index;
}
n = n / bpl;
if (n <= 0) {
if (start_mask) {
if (end_mask)
end_mask &= start_mask;
else
end_mask = start_mask;
start_mask = 0;
}
n = 0;
}
if (shift) {
if (shift > 0) {
/* dest is over to right more */
shift_right =
shift * p->var.bits_per_pixel;
shift_left =
(ppw - shift) * p->var.bits_per_pixel;
} else {
/* source is to the right more */
shift_right =
(ppw + shift) * p->var.bits_per_pixel;
shift_left =
-shift * p->var.bits_per_pixel;
}
/* general case, positive increment */
if (lineincr > 0) {
if (shift < 0)
n++;
do {
dst = (unsigned long *) dst1;
src = (unsigned long *) src1;
last = (fb_readl(src) & start_mask);
if (shift > 0)
fb_writel(fb_readl(dst) | (last >> shift_right), dst);
for (j = 0; j < n; j++) {
dst++;
tmp = fb_readl(src);
src++;
fb_writel((last << shift_left) | (tmp >> shift_right), dst);
last = tmp;
src++;
}
fb_writel(fb_readl(dst) | (last << shift_left), dst);
src1 += lineincr;
dst1 += lineincr;
} while (--height);
} else {
/* general case, negative increment */
if (shift > 0)
n++;
do {
dst = (unsigned long *) dst1;
src = (unsigned long *) src1;
last = (fb_readl(src) & end_mask);
if (shift < 0)
fb_writel(fb_readl(dst) | (last >> shift_right), dst);
for (j = 0; j < n; j++) {
dst--;
tmp = fb_readl(src);
src--;
fb_writel((tmp << shift_left) | (last >> shift_right), dst);
last = tmp;
src--;
}
fb_writel(fb_readl(dst) | (last >> shift_right), dst);
src1 += lineincr;
dst1 += lineincr;
} while (--height);
}
} else {
/* no shift needed */
if (lineincr > 0) {
/* positive increment */
do {
dst = (unsigned long *) (dst1 - start_index);
src = (unsigned long *) (src1 - start_index);
if (start_mask)
fb_writel(fb_readl(src) | start_mask, dst);
for (j = 0; j < n; j++) {
fb_writel(fb_readl(src), dst);
dst++;
src++;
}
if (end_mask)
fb_writel(fb_readl(src) | end_mask, dst);
src1 += lineincr;
dst1 += lineincr;
} while (--height);
} else {
/* negative increment */
do {
dst = (unsigned long *) dst1;
src = (unsigned long *) src1;
if (start_mask)
fb_writel(fb_readl(src) | start_mask, dst);
for (j = 0; j < n; j++) {
fb_writel(fb_readl(src), dst);
dst--;
src--;
}
src1 += lineincr;
dst1 += lineincr;
} while (--height);
}
}
}
}
/*
* Generic fillrect for frame buffers with packed pixels of any depth.
*
* Copyright (C) 2000 James Simmons (jsimmons@linux-fbdev.org)
*
* 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.
*
* NOTES:
*
* The code for depths like 24 that don't have integer number of pixels per
* long is broken and needs to be fixed. For now I turned these types of
* mode off.
*
* Also need to add code to deal with cards endians that are different than
* the native cpu endians. I also need to deal with MSB position in the word.
*
*/
#include <linux/string.h>
#include <linux/fb.h>
#include <asm/types.h>
#include <video/fbcon.h>
void cfb_fillrect(struct fb_info *p, struct fb_fillrect *rect)
{
unsigned long start_index, end_index, start_mask = 0, end_mask = 0;
unsigned long height, ppw, fg, fgcolor;
int i, n, x2, y2, linesize = p->fix.line_length;
int bpl = sizeof(unsigned long);
unsigned long *dst;
char *dst1;
if (!rect->width || !rect->height)
return;
/* We could use hardware clipping but on many cards you get around
* hardware clipping by writing to framebuffer directly. */
x2 = rect->dx + rect->width;
y2 = rect->dy + rect->height;
x2 = x2 < p->var.xres_virtual ? x2 : p->var.xres_virtual;
y2 = y2 < p->var.yres_virtual ? y2 : p->var.yres_virtual;
rect->width = x2 - rect->dx;
height = y2 - rect->dy;
/* Size of the scanline in bytes */
n = (rect->width * (p->var.bits_per_pixel >> 3));
ppw = BITS_PER_LONG / p->var.bits_per_pixel;
dst1 = p->screen_base + (rect->dy * linesize) +
(rect->dx * (p->var.bits_per_pixel >> 3));
start_index = ((unsigned long) dst1 & (bpl - 1));
end_index = ((unsigned long) (dst1 + n) & (bpl - 1));
if (p->fix.visual == FB_VISUAL_TRUECOLOR)
fg = fgcolor = ((u32 *) (p->pseudo_palette))[rect->color];
else
fg = fgcolor = rect->color;
for (i = 0; i < ppw - 1; i++) {
fg <<= p->var.bits_per_pixel;
fg |= fgcolor;
}
if (start_index) {
start_mask = fg << (start_index << 3);
n -= (bpl - start_index);
}
if (end_index) {
end_mask = fg >> ((bpl - end_index) << 3);
n -= end_index;
}
n = n / bpl;
if (n <= 0) {
if (start_mask) {
if (end_mask)
end_mask &= start_mask;
else
end_mask = start_mask;
start_mask = 0;
}
n = 0;
}
if ((BITS_PER_LONG % p->var.bits_per_pixel) == 0) {
switch (rect->rop) {
case ROP_COPY:
do {
/* Word align to increases performace :-) */
dst = (unsigned long *) (dst1 - start_index);
if (start_mask) {
#if BITS_PER_LONG == 32
fb_writel(fb_readl(dst) |
start_mask, dst);
#else
fb_writeq(fb_readq(dst) |
start_mask, dst);
#endif
dst++;
}
for (i = 0; i < n; i++) {
#if BITS_PER_LONG == 32
fb_writel(fg, dst);
#else
fb_writeq(fg, dst);
#endif
dst++;
}
if (end_mask)
#if BITS_PER_LONG == 32
fb_writel(fb_readl(dst) | end_mask,
dst);
#else
fb_writeq(fb_readq(dst) | end_mask,
dst);
#endif
dst1 += linesize;
} while (--height);
break;
case ROP_XOR:
do {
dst = (unsigned long *) (dst1 - start_index);
if (start_mask) {
#if BITS_PER_LONG == 32
fb_writel(fb_readl(dst) ^
start_mask, dst);
#else
fb_writeq(fb_readq(dst) ^
start_mask, dst);
#endif
dst++;
}
for (i = 0; i < n; i++) {
#if BITS_PER_LONG == 32
fb_writel(fb_readl(dst) ^ fg, dst);
#else
fb_writeq(fb_readq(dst) ^ fg, dst);
#endif
dst++;
}
if (end_mask) {
#if BITS_PER_LONG == 32
fb_writel(fb_readl(dst) ^ end_mask,
dst);
#else
fb_writeq(fb_readq(dst) ^ end_mask,
dst);
#endif
}
dst1 += linesize;
} while (--height);
break;
}
} else {
/* Odd modes like 24 or 80 bits per pixel */
start_mask = fg >> (start_index * p->var.bits_per_pixel);
end_mask = fg << (end_index * p->var.bits_per_pixel);
/* start_mask =& PFILL24(x1,fg);
end_mask_or = end_mask & PFILL24(x1+width-1,fg); */
n = (rect->width - start_index - end_index) / ppw;
switch (rect->rop) {
case ROP_COPY:
do {
dst = (unsigned long *) dst1;
if (start_mask)
*dst |= start_mask;
if ((start_index + rect->width) > ppw)
dst++;
/* XXX: slow */
for (i = 0; i < n; i++) {
*dst++ = fg;
}
if (end_mask)
*dst |= end_mask;
dst1 += linesize;
} while (--height);
break;
case ROP_XOR:
do {
dst = (unsigned long *) dst1;
if (start_mask)
*dst ^= start_mask;
if ((start_mask + rect->width) > ppw)
dst++;
for (i = 0; i < n; i++) {
*dst++ ^= fg; /* PFILL24(fg,x1+i); */
}
if (end_mask)
*dst ^= end_mask;
dst1 += linesize;
} while (--height);
break;
}
}
return;
}
/*
* Generic BitBLT function for frame buffer with packed pixels of any depth.
*
* Copyright (C) June 1999 James Simmons
*
* 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.
*
* NOTES:
*
* This function copys a image from system memory to video memory. The
* image can be a bitmap where each 0 represents the background color and
* each 1 represents the foreground color. Great for font handling. It can
* also be a color image. This is determined by image_depth. The color image
* must be laid out exactly in the same format as the framebuffer. Yes I know
* their are cards with hardware that coverts images of various depths to the
* framebuffer depth. But not every card has this. All images must be rounded
* up to the nearest byte. For example a bitmap 12 bits wide must be two
* bytes width.
*
* FIXME
* The code for 24 bit is horrible. It copies byte by byte size instead of
* longs like the other sizes. Needs to be optimized.
*
* Also need to add code to deal with cards endians that are different than
* the native cpu endians. I also need to deal with MSB position in the word.
*
*/
#include <linux/string.h>
#include <linux/fb.h>
#include <asm/types.h>
#include <video/fbcon.h>
#define DEBUG
#ifdef DEBUG
#define DPRINTK(fmt, args...) printk(KERN_DEBUG "%s: " fmt,__FUNCTION__,## args)
#else
#define DPRINTK(fmt, args...)
#endif
void cfb_imageblit(struct fb_info *p, struct fb_image *image)
{
int pad, ppw, shift, shift_right, shift_left, x2, y2, n, i, j, k, l = 7;
unsigned long tmp = ~0 << (BITS_PER_LONG - p->var.bits_per_pixel);
unsigned long fgx, bgx, fgcolor, bgcolor, eorx;
unsigned long end_index, end_mask;
unsigned long *dst = NULL;
u8 *dst1, *src;
/*
* We could use hardware clipping but on many cards you get around hardware
* clipping by writing to framebuffer directly like we are doing here.
*/
x2 = image->dx + image->width;
y2 = image->dy + image->height;
image->dx = image->dx > 0 ? image->dx : 0;
image->dy = image->dy > 0 ? image->dy : 0;
x2 = x2 < p->var.xres_virtual ? x2 : p->var.xres_virtual;
y2 = y2 < p->var.yres_virtual ? y2 : p->var.yres_virtual;
image->width = x2 - image->dx;
image->height = y2 - image->dy;
dst1 = p->screen_base + image->dy * p->fix.line_length +
((image->dx * p->var.bits_per_pixel) >> 3);
ppw = BITS_PER_LONG/p->var.bits_per_pixel;
src = image->data;
if (image->depth == 1) {
if (p->fix.visual == FB_VISUAL_TRUECOLOR) {
fgx = fgcolor = ((u32 *)(p->pseudo_palette))[image->fg_color];
bgx = bgcolor = ((u32 *)(p->pseudo_palette))[image->bg_color];
} else {
fgx = fgcolor = image->fg_color;
bgx = bgcolor = image->bg_color;
}
for (i = 0; i < ppw-1; i++) {
fgx <<= p->var.bits_per_pixel;
bgx <<= p->var.bits_per_pixel;
fgx |= fgcolor;
bgx |= bgcolor;
}
eorx = fgx ^ bgx;
n = ((image->width + 7) >> 3);
pad = (n << 3) - image->width;
n = image->width % ppw;
for (i = 0; i < image->height; i++) {
dst = (unsigned long *) dst1;
for (j = image->width/ppw; j > 0; j--) {
end_mask = 0;
for (k = ppw; k > 0; k--) {
if (test_bit(l, src))
end_mask |= (tmp >> (p->var.bits_per_pixel*(k-1)));
l--;
if (l < 0) { l = 7; src++; }
}
fb_writel((end_mask & eorx)^bgx, dst);
dst++;
}
if (n) {
for (j = n; j > 0; j--) {
end_mask = 0;
if (test_bit(l, src))
end_mask |= (tmp >> (p->var.bits_per_pixel*(k-1)));
l--;
if (l < 0) { l = 7; src++; }
}
fb_writel((end_mask & eorx)^bgx, dst);
dst++;
}
l -= pad;
dst1 += p->fix.line_length;
}
} else {
/* Draw the penguin */
n = ((image->width * p->var.bits_per_pixel) >> 3);
//shift = ((unsigned long) dst1 & (bpl -1));
end_mask = 0;
// n = n/bpl;
}
}
...@@ -74,10 +74,10 @@ struct fb_info_chips { ...@@ -74,10 +74,10 @@ struct fb_info_chips {
#define write_ind(num, val, ap, dp) do { \ #define write_ind(num, val, ap, dp) do { \
outb((num), (ap)); outb((val), (dp)); \ outb((num), (ap)); outb((val), (dp)); \
} while (0); } while (0)
#define read_ind(num, var, ap, dp) do { \ #define read_ind(num, var, ap, dp) do { \
outb((num), (ap)); var = inb((dp)); \ outb((num), (ap)); var = inb((dp)); \
} while (0); } while (0)
/* extension registers */ /* extension registers */
#define write_xr(num, val) write_ind(num, val, 0x3d6, 0x3d7) #define write_xr(num, val) write_ind(num, val, 0x3d6, 0x3d7)
......
...@@ -27,7 +27,6 @@ ...@@ -27,7 +27,6 @@
#include <linux/proc_fs.h> #include <linux/proc_fs.h>
#include <video/fbcon.h> #include <video/fbcon.h>
#include <video/fbcon-cfb4.h>
#include <asm/hardware.h> #include <asm/hardware.h>
#include <asm/mach-types.h> #include <asm/mach-types.h>
...@@ -87,42 +86,13 @@ clps7111fb_setcolreg(u_int regno, u_int red, u_int green, u_int blue, ...@@ -87,42 +86,13 @@ clps7111fb_setcolreg(u_int regno, u_int red, u_int green, u_int blue,
return 0; return 0;
} }
/* /*
* Set the User Defined Part of the Display * Validate the purposed mode.
*/ */
static int static int
clps7111fb_set_var(struct fb_var_screeninfo *var, int con, clps7111fb_check_var(struct fb_var_screeninfo *var, struct fb_info *info)
struct fb_info *info)
{ {
struct display *display;
unsigned int lcdcon, syscon;
int chgvar = 0;
if (var->activate & FB_ACTIVATE_TEST)
return 0;
if ((var->activate & FB_ACTIVATE_MASK) != FB_ACTIVATE_NOW)
return -EINVAL;
if (info->var.xres != var->xres)
chgvar = 1;
if (info->var.yres != var->yres)
chgvar = 1;
if (info->var.xres_virtual != var->xres_virtual)
chgvar = 1;
if (info->var.yres_virtual != var->yres_virtual)
chgvar = 1;
if (info->var.bits_per_pixel != var->bits_per_pixel)
chgvar = 1;
if (con < 0) {
display = info->disp;
chgvar = 0;
} else {
display = fb_display + con;
}
var->transp.msb_right = 0; var->transp.msb_right = 0;
var->transp.offset = 0; var->transp.offset = 0;
var->transp.length = 0; var->transp.length = 0;
...@@ -132,70 +102,37 @@ clps7111fb_set_var(struct fb_var_screeninfo *var, int con, ...@@ -132,70 +102,37 @@ clps7111fb_set_var(struct fb_var_screeninfo *var, int con,
var->green = var->red; var->green = var->red;
var->blue = var->red; var->blue = var->red;
if (var->bits_per_pixel > 4)
return -EINVAL;
}
/*
* Set the hardware state.
*/
static int
clps7111fb_set_par(struct fb_info *info)
{
unsigned int lcdcon, syscon;
switch (var->bits_per_pixel) { switch (var->bits_per_pixel) {
#ifdef FBCON_HAS_MFB
case 1: case 1:
info->fix.visual = FB_VISUAL_MONO01; info->fix.visual = FB_VISUAL_MONO01;
display->dispsw = &fbcon_mfb;
display->dispsw_data = NULL;
break; break;
#endif
#ifdef FBCON_HAS_CFB2
case 2: case 2:
info->fix.visual = FB_VISUAL_PSEUDOCOLOR; info->fix.visual = FB_VISUAL_PSEUDOCOLOR;
display->dispsw = &fbcon_cfb2;
display->dispsw_data = NULL;
break; break;
#endif
#ifdef FBCON_HAS_CFB4
case 4: case 4:
info->fix.visual = FB_VISUAL_PSEUDOCOLOR; info->fix.visual = FB_VISUAL_PSEUDOCOLOR;
display->dispsw = &fbcon_cfb4;
display->dispsw_data = NULL;
break; break;
#endif
default:
return -EINVAL;
} }
display->next_line = var->xres_virtual * var->bits_per_pixel / 8; info->fix.line_length = info->var.xres_virtual * info->var.bits_per_pixel / 8;
info->fix.line_length = display->next_line;
display->line_length = info->fix.line_length;
display->visual = info->fix.visual;
display->type = info->fix.type;
display->type_aux = info->fix.type_aux;
display->ypanstep = info->fix.ypanstep;
display->ywrapstep = info->fix.ywrapstep;
display->can_soft_blank = 1;
display->inverse = 0;
info->var = *var;
info->var.activate &= ~FB_ACTIVATE_ALL;
/*
* Update the old var. The fbcon drivers still use this.
* Once they are using cfb->var, this can be dropped.
* --rmk
*/
display->var = info->var;
/*
* If we are setting all the virtual consoles, also set the
* defaults used to create new consoles.
*/
if (var->activate & FB_ACTIVATE_ALL)
info->disp->var = info->var;
if (chgvar && info && info->changevar)
info->changevar(con);
/* /*
* LCDCON must only be changed while the LCD is disabled * LCDCON must only be changed while the LCD is disabled
*/ */
lcdcon = (var->xres_virtual * var->yres_virtual * var->bits_per_pixel) / 128 - 1; lcdcon = (info->var.xres_virtual * info->var.yres_virtual * info->var.bits_per_pixel) / 128 - 1;
lcdcon |= ((var->xres_virtual / 16) - 1) << 13; lcdcon |= ((info->var.xres_virtual / 16) - 1) << 13;
lcdcon |= 2 << 19; lcdcon |= 2 << 19;
lcdcon |= 13 << 25; lcdcon |= 13 << 25;
lcdcon |= LCDCON_GSEN; lcdcon |= LCDCON_GSEN;
...@@ -205,9 +142,6 @@ clps7111fb_set_var(struct fb_var_screeninfo *var, int con, ...@@ -205,9 +142,6 @@ clps7111fb_set_var(struct fb_var_screeninfo *var, int con,
clps_writel(syscon & ~SYSCON1_LCDEN, SYSCON1); clps_writel(syscon & ~SYSCON1_LCDEN, SYSCON1);
clps_writel(lcdcon, LCDCON); clps_writel(lcdcon, LCDCON);
clps_writel(syscon | SYSCON1_LCDEN, SYSCON1); clps_writel(syscon | SYSCON1_LCDEN, SYSCON1);
fb_set_cmap(&info->cmap, 1, info);
return 0; return 0;
} }
...@@ -260,7 +194,9 @@ static int clps7111fb_blank(int blank, struct fb_info *info) ...@@ -260,7 +194,9 @@ static int clps7111fb_blank(int blank, struct fb_info *info)
static struct fb_ops clps7111fb_ops = { static struct fb_ops clps7111fb_ops = {
owner: THIS_MODULE, owner: THIS_MODULE,
fb_set_var: clps7111fb_set_var, 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_set_cmap: gen_set_cmap,
fb_get_fix: gen_get_fix, fb_get_fix: gen_get_fix,
fb_get_var: gen_get_var, fb_get_var: gen_get_var,
...@@ -269,50 +205,6 @@ static struct fb_ops clps7111fb_ops = { ...@@ -269,50 +205,6 @@ static struct fb_ops clps7111fb_ops = {
fb_blank: clps7111fb_blank, fb_blank: clps7111fb_blank,
}; };
static int clps7111fb_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 video 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 video mode. By default,
* fbcon sets all the colormaps and video modes to the default
* values at bootup.
*/
if (disp->cmap.len)
cmap = &disp->cmap;
else
cmap = fb_default_cmap(CMAP_SIZE);
fb_copy_cmap(cmap, &info->cmap, 0);
info->var = disp->var;
info->var.activate = FB_ACTIVATE_NOW;
clps7111fb_set_var(&info->var, con, info);
return 0;
}
static int clps7111fb_updatevar(int con, struct fb_info *info)
{
return -EINVAL;
}
static int static int
clps7111fb_proc_backlight_read(char *page, char **start, off_t off, clps7111fb_proc_backlight_read(char *page, char **start, off_t off,
int count, int *eof, void *data) int count, int *eof, void *data)
...@@ -395,8 +287,8 @@ int __init clps711xfb_init(void) ...@@ -395,8 +287,8 @@ int __init clps711xfb_init(void)
cfb->fbops = &clps7111fb_ops; cfb->fbops = &clps7111fb_ops;
cfb->changevar = NULL; cfb->changevar = NULL;
cfb->switch_con = clps7111fb_switch; cfb->switch_con = gen_switch;
cfb->updatevar = clps7111fb_updatevar; cfb->updatevar = gen_update_var;
cfb->flags = FBINFO_FLAG_DEFAULT; cfb->flags = FBINFO_FLAG_DEFAULT;
cfb->disp = (struct display *)(cfb + 1); cfb->disp = (struct display *)(cfb + 1);
...@@ -439,7 +331,7 @@ int __init clps711xfb_init(void) ...@@ -439,7 +331,7 @@ int __init clps711xfb_init(void)
clps_writeb(clps_readb(PDDR) | EDB_PD3_LCDBL, PDDR); clps_writeb(clps_readb(PDDR) | EDB_PD3_LCDBL, PDDR);
} }
clps7111fb_set_var(&cfb->var, -1, cfb); gen_set_var(&cfb->var, -1, cfb);
err = register_framebuffer(cfb); err = register_framebuffer(cfb);
out: return err; out: return err;
......
...@@ -1729,9 +1729,8 @@ static int cyberpro_pci_resume(struct pci_dev *dev) ...@@ -1729,9 +1729,8 @@ static int cyberpro_pci_resume(struct pci_dev *dev)
} }
static struct pci_device_id cyberpro_pci_table[] __devinitdata = { static struct pci_device_id cyberpro_pci_table[] __devinitdata = {
// Not yet { PCI_VENDOR_ID_INTERG, PCI_DEVICE_ID_INTERG_1682,
// { PCI_VENDOR_ID_INTERG, PCI_DEVICE_ID_INTERG_1682, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ID_IGA_1682 },
// PCI_ANY_ID, PCI_ANY_ID, 0, 0, ID_IGA_1682 },
{ PCI_VENDOR_ID_INTERG, PCI_DEVICE_ID_INTERG_2000, { PCI_VENDOR_ID_INTERG, PCI_DEVICE_ID_INTERG_2000,
PCI_ANY_ID, PCI_ANY_ID, 0, 0, ID_CYBERPRO_2000 }, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ID_CYBERPRO_2000 },
{ PCI_VENDOR_ID_INTERG, PCI_DEVICE_ID_INTERG_2010, { PCI_VENDOR_ID_INTERG, PCI_DEVICE_ID_INTERG_2010,
......
...@@ -152,7 +152,7 @@ void fb_copy_cmap(struct fb_cmap *from, struct fb_cmap *to, int fsfromto) ...@@ -152,7 +152,7 @@ void fb_copy_cmap(struct fb_cmap *from, struct fb_cmap *to, int fsfromto)
size = to->len-tooff; size = to->len-tooff;
if (size > from->len-fromoff) if (size > from->len-fromoff)
size = from->len-fromoff; size = from->len-fromoff;
if (size < 0) if (size <= 0)
return; return;
size *= sizeof(u16); size *= sizeof(u16);
......
...@@ -158,7 +158,7 @@ struct display_switch fbcon_accel = { ...@@ -158,7 +158,7 @@ struct display_switch fbcon_accel = {
putcs: fbcon_accel_putcs, putcs: fbcon_accel_putcs,
revc: fbcon_accel_revc, revc: fbcon_accel_revc,
clear_margins: fbcon_accel_clear_margins, clear_margins: fbcon_accel_clear_margins,
fontwidthmask: FONTWIDTHRANGE(1, 32) fontwidthmask: FONTWIDTHRANGE(1, 16)
}; };
#ifdef MODULE #ifdef MODULE
......
...@@ -61,6 +61,8 @@ extern int cyberfb_init(void); ...@@ -61,6 +61,8 @@ extern int cyberfb_init(void);
extern int cyberfb_setup(char*); extern int cyberfb_setup(char*);
extern int pm2fb_init(void); extern int pm2fb_init(void);
extern int pm2fb_setup(char*); extern int pm2fb_setup(char*);
extern int pm3fb_init(void);
extern int pm3fb_setup(char*);
extern int clps711xfb_init(void); extern int clps711xfb_init(void);
extern int cyber2000fb_init(void); extern int cyber2000fb_init(void);
extern int cyber2000fb_setup(char*); extern int cyber2000fb_setup(char*);
...@@ -120,10 +122,16 @@ extern int rivafb_init(void); ...@@ -120,10 +122,16 @@ extern int rivafb_init(void);
extern int rivafb_setup(char*); extern int rivafb_setup(char*);
extern int tdfxfb_init(void); extern int tdfxfb_init(void);
extern int tdfxfb_setup(char*); extern int tdfxfb_setup(char*);
extern int tridentfb_init(void);
extern int tridentfb_setup(char*);
extern int sisfb_init(void); extern int sisfb_init(void);
extern int sisfb_setup(char*); extern int sisfb_setup(char*);
extern int stifb_init(void); extern int stifb_init(void);
extern int stifb_setup(char*); extern int stifb_setup(char*);
extern int pmagbafb_init(void);
extern int pmagbbfb_init(void);
extern void maxinefb_init(void);
extern int tx3912fb_init(void);
extern int radeonfb_init(void); extern int radeonfb_init(void);
extern int radeonfb_setup(char*); extern int radeonfb_setup(char*);
extern int e1355fb_init(void); extern int e1355fb_init(void);
...@@ -172,6 +180,9 @@ static struct { ...@@ -172,6 +180,9 @@ static struct {
#ifdef CONFIG_FB_PM2 #ifdef CONFIG_FB_PM2
{ "pm2fb", pm2fb_init, pm2fb_setup }, { "pm2fb", pm2fb_init, pm2fb_setup },
#endif #endif
#ifdef CONFIG_FB_PM3
{ "pm3fb", pm3fb_init, pm3fb_setup },
#endif
#ifdef CONFIG_FB_CLGEN #ifdef CONFIG_FB_CLGEN
{ "clgen", clgenfb_init, clgenfb_setup }, { "clgen", clgenfb_init, clgenfb_setup },
#endif #endif
...@@ -220,6 +231,9 @@ static struct { ...@@ -220,6 +231,9 @@ static struct {
#ifdef CONFIG_FB_SIS #ifdef CONFIG_FB_SIS
{ "sisfb", sisfb_init, sisfb_setup }, { "sisfb", sisfb_init, sisfb_setup },
#endif #endif
#ifdef CONFIG_FB_TRIDENT
{ "trident", tridentfb_init, tridentfb_setup },
#endif
/* /*
* Generic drivers that are used as fallbacks * Generic drivers that are used as fallbacks
...@@ -285,12 +299,24 @@ static struct { ...@@ -285,12 +299,24 @@ static struct {
#ifdef CONFIG_FB_HIT #ifdef CONFIG_FB_HIT
{ "hitfb", hitfb_init, NULL }, { "hitfb", hitfb_init, NULL },
#endif #endif
#ifdef CONFIG_FB_TX3912
{ "tx3912", tx3912fb_init, NULL },
#endif
#ifdef CONFIG_FB_E1355 #ifdef CONFIG_FB_E1355
{ "e1355fb", e1355fb_init, e1355fb_setup }, { "e1355fb", e1355fb_init, e1355fb_setup },
#endif #endif
#ifdef CONFIG_FB_PVR2 #ifdef CONFIG_FB_PVR2
{ "pvr2", pvr2fb_init, pvr2fb_setup }, { "pvr2", pvr2fb_init, pvr2fb_setup },
#endif #endif
#ifdef CONFIG_FB_PMAG_BA
{ "pmagbafb", pmagbafb_init, NULL },
#endif
#ifdef CONFIG_FB_PMAGB_B
{ "pmagbbfb", pmagbbfb_init, NULL },
#endif
#ifdef CONFIG_FB_MAXINE
{ "maxinefb", maxinefb_init, NULL },
#endif
#ifdef CONFIG_FB_VOODOO1 #ifdef CONFIG_FB_VOODOO1
{ "sst", sstfb_init, sstfb_setup }, { "sst", sstfb_init, sstfb_setup },
#endif #endif
......
This diff is collapsed.
This diff is collapsed.
...@@ -386,44 +386,6 @@ static int __init hga_card_detect(void) ...@@ -386,44 +386,6 @@ static int __init hga_card_detect(void)
* *
* ------------------------------------------------------------------------- */ * ------------------------------------------------------------------------- */
/**
* hga_get_fix - get the fixed part of the display
* @fix:struct fb_fix_screeninfo to fill in
* @con:unused
* @info:pointer to fb_info object containing info for current hga board
*
* This wrapper function copies @info->fix to @fix.
* A zero is returned on success and %-EINVAL for failure.
*/
int hga_get_fix(struct fb_fix_screeninfo *fix, int con, struct fb_info *info)
{
CHKINFO(-EINVAL);
DPRINTK("hga_get_fix: con:%d, info:%x, fb_info:%x\n", con, (unsigned)info, (unsigned)&fb_info);
*fix = info->fix;
return 0;
}
/**
* hga_get_var - get the user defined part of the display
* @var:struct fb_var_screeninfo to fill in
* @con:unused
* @info:pointer to fb_info object containing info for current hga board
*
* This wrapper function copies @info->var to @var.
* A zero is returned on success and %-EINVAL for failure.
*/
int hga_get_var(struct fb_var_screeninfo *var, int con, struct fb_info *info)
{
CHKINFO(-EINVAL);
DPRINTK("hga_get_var: con:%d, info:%x, fb_info:%x\n", con, (unsigned)info, (unsigned)&fb_info);
*var = info->var;
return 0;
}
/** /**
* hga_set_var - set the user defined part of the display * hga_set_var - set the user defined part of the display
* @var:new video mode * @var:new video mode
...@@ -596,8 +558,8 @@ static int hgafb_blank(int blank_mode, struct fb_info *info) ...@@ -596,8 +558,8 @@ static int hgafb_blank(int blank_mode, struct fb_info *info)
static struct fb_ops hgafb_ops = { static struct fb_ops hgafb_ops = {
owner: THIS_MODULE, owner: THIS_MODULE,
fb_get_fix: hga_get_fix, fb_get_fix: gen_get_fix,
fb_get_var: hga_get_var, fb_get_var: gen_get_var,
fb_set_var: hga_set_var, fb_set_var: hga_set_var,
fb_get_cmap: hga_get_cmap, fb_get_cmap: hga_get_cmap,
fb_set_cmap: gen_set_cmap, fb_set_cmap: gen_set_cmap,
......
This diff is collapsed.
This diff is collapsed.
...@@ -67,9 +67,6 @@ ...@@ -67,9 +67,6 @@
#define DPRINTK(a,b...) #define DPRINTK(a,b...)
#endif #endif
#define PICOS2KHZ(a) (1000000000UL/(a))
#define KHZ2PICOS(a) (1000000000UL/(a))
/* /*
* The _DEFINITIVE_ memory mapping/unmapping functions. * The _DEFINITIVE_ memory mapping/unmapping functions.
* This is due to the fact that they're changing soooo often... * This is due to the fact that they're changing soooo often...
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
#ifndef TRIDENTFB_DEBUG
#define TRIDENTFB_DEBUG 0
#endif
#if TRIDENTFB_DEBUG
#define debug(f,a...) printk("%s:" f, __FUNCTION__ , ## a)
#else
#define debug(f,a...)
#endif
#define output(f, a...) printk("tridentfb: " f, ## a)
#define Kb (1024)
#define Mb (Kb*Kb)
/* PCI IDS of supported cards temporarily here */
#define CYBER9320 0x9320
#define CYBER9388 0x9388
#define CYBER9397 0x9397
#define CYBER9397DVD 0x939A
#define CYBER9520 0x9520
#define CYBER9525DVD 0x9525
#define IMAGE975 0x9750
#define IMAGE985 0x9850
#define BLADE3D 0x9880
#define CYBERBLADEE4 0x9540
#define CYBERBLADEi7 0x8400
#define CYBERBLADEi7D 0x8420
#define CYBERBLADEi1 0x8500
#define CYBERBLADEi1D 0x8520
#define CYBERBLADEAi1 0x8600
#define CYBERBLADEAi1D 0x8620
#define CYBERBLADEXPAi1 0x8820
#define CYBERBLADEXPm8 0x9910
#define CYBERBLADEXPm16 0x9930
/* acceleration families */
#define IMAGE 0
#define BLADE 1
#define XP 2
#define is_image() (family == IMAGE)
#define is_blade() (family == BLADE)
#define is_xp() (family == XP)
/* these defines are for 'lcd' variable */
#define LCD_STRETCH 0
#define LCD_CENTER 1
#define LCD_BIOS 2
/* display types */
#define DISPLAY_CRT 0
#define DISPLAY_FP 1
#define flatpanel (displaytype == DISPLAY_FP)
/* these are for defaultaccel variable */
#define ACCEL 1
#define NOACCEL 0
#define TRIDENT_IOSIZE 0x20000
#define NTSC 14.31818
#define PAL 17.73448
/* General Registers */
#define SPR 0x1F /* Software Programming Register (videoram) */
/* 3C4 */
#define RevisionID 0x09
#define OldOrNew 0x0B
#define ConfPort1 0x0C
#define ConfPort2 0x0C
#define NewMode2 0x0D
#define NewMode1 0x0E
#define Protection 0x11
#define MCLKLow 0x16
#define MCLKHigh 0x17
#define ClockLow 0x18
#define ClockHigh 0x19
#define SSetup 0x20
#define SKey 0x37
#define SPKey 0x57
/* 0x3x4 */
#define CRTHTotal 0x00
#define CRTHDispEnd 0x01
#define CRTHBlankStart 0x02
#define CRTHBlankEnd 0x03
#define CRTHSyncStart 0x04
#define CRTHSyncEnd 0x05
#define CRTVTotal 0x06
#define CRTVDispEnd 0x12
#define CRTVBlankStart 0x15
#define CRTVBlankEnd 0x16
#define CRTVSyncStart 0x10
#define CRTVSyncEnd 0x11
#define CRTOverflow 0x07
#define CRTPRowScan 0x08
#define CRTMaxScanLine 0x09
#define CRTModeControl 0x17
#define CRTLineCompare 0x18
/* 3x4 */
#define StartAddrHigh 0x0C
#define StartAddrLow 0x0D
#define Offset 0x13
#define Underline 0x14
#define CRTCMode 0x17
#define CRTCModuleTest 0x1E
#define FIFOControl 0x20
#define LinearAddReg 0x21
#define DRAMTiming 0x23
#define New32 0x23
#define RAMDACTiming 0x25
#define CRTHiOrd 0x27
#define AddColReg 0x29
#define InterfaceSel 0x2A
#define HorizOverflow 0x2B
#define GETest 0x2D
#define Performance 0x2F
#define GraphEngReg 0x36
#define I2C 0x37
#define PixelBusReg 0x38
#define PCIReg 0x39
#define DRAMControl 0x3A
#define MiscContReg 0x3C
#define CursorXLow 0x40
#define CursorXHigh 0x41
#define CursorYLow 0x42
#define CursorYHigh 0x43
#define CursorLocLow 0x44
#define CursorLocHigh 0x45
#define CursorXOffset 0x46
#define CursorYOffset 0x47
#define CursorFG1 0x48
#define CursorFG2 0x49
#define CursorFG3 0x4A
#define CursorFG4 0x4B
#define CursorBG1 0x4C
#define CursorBG2 0x4D
#define CursorBG3 0x4E
#define CursorBG4 0x4F
#define CursorControl 0x50
#define PCIRetry 0x55
#define PreEndControl 0x56
#define PreEndFetch 0x57
#define PCIMaster 0x60
#define Enhancement0 0x62
#define NewEDO 0x64
#define TVinterface 0xC0
#define TVMode 0xC1
#define ClockControl 0xCF
/* 3CE */
#define MiscExtFunc 0x0F
#define PowerStatus 0x23
#define MiscIntContReg 0x2F
#define CyberControl 0x30
#define CyberEnhance 0x31
#define FPConfig 0x33
#define VertStretch 0x52
#define HorStretch 0x53
#define BiosMode 0x5c
#define BiosReg 0x5d
This diff is collapsed.
This diff is collapsed.
...@@ -93,7 +93,8 @@ ...@@ -93,7 +93,8 @@
#define FB_ACCEL_IGS_CYBER2010 34 /* CyberPro 2010 */ #define FB_ACCEL_IGS_CYBER2010 34 /* CyberPro 2010 */
#define FB_ACCEL_IGS_CYBER5000 35 /* CyberPro 5000 */ #define FB_ACCEL_IGS_CYBER5000 35 /* CyberPro 5000 */
#define FB_ACCEL_SIS_GLAMOUR 36 /* SiS 300/630/540 */ #define FB_ACCEL_SIS_GLAMOUR 36 /* SiS 300/630/540 */
#define FB_ACCEL_3DLABS_PERMEDIA3 37 /* 3Dlabs Permedia 3 */
#define FB_ACCEL_ATI_RADEON 38 /* ATI Radeon family */
#define FB_ACCEL_NEOMAGIC_NM2070 90 /* NeoMagic NM2070 */ #define FB_ACCEL_NEOMAGIC_NM2070 90 /* NeoMagic NM2070 */
#define FB_ACCEL_NEOMAGIC_NM2090 91 /* NeoMagic NM2090 */ #define FB_ACCEL_NEOMAGIC_NM2090 91 /* NeoMagic NM2090 */
...@@ -169,6 +170,9 @@ struct fb_bitfield { ...@@ -169,6 +170,9 @@ struct fb_bitfield {
#define FB_VMODE_SMOOTH_XPAN 512 /* smooth xpan possible (internally used) */ #define FB_VMODE_SMOOTH_XPAN 512 /* smooth xpan possible (internally used) */
#define FB_VMODE_CONUPDATE 512 /* don't update x/yoffset */ #define FB_VMODE_CONUPDATE 512 /* don't update x/yoffset */
#define PICOS2KHZ(a) (1000000000UL/(a))
#define KHZ2PICOS(a) (1000000000UL/(a))
struct fb_var_screeninfo { struct fb_var_screeninfo {
__u32 xres; /* visible resolution */ __u32 xres; /* visible resolution */
__u32 yres; __u32 yres;
......
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