Commit 6bd20e27 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 d236fbb8 7a356301
......@@ -236,25 +236,25 @@ if [ "$CONFIG_FB" = "y" ]; then
if [ "$CONFIG_FB_ACORN" = "y" -o "$CONFIG_FB_AMIGA" = "y" -o \
"$CONFIG_FB_ATARI" = "y" -o "$CONFIG_FB_CYBER" = "y" -o \
"$CONFIG_FB_MAC" = "y" -o "$CONFIG_FB_RETINAZ3" = "y" -o \
"$CONFIG_FB_VIRGE" = "y" -o "$CONFIG_FB_TX3912" = "y" -o \
"$CONFIG_FB_BWTWO" = "y" -o "$CONFIG_FB_CLGEN" = "y" ]; then
"$CONFIG_FB_VIRGE" = "y" -o "$CONFIG_FB_CLGEN" = "y" -o \
"$CONFIG_FB_BWTWO" = "y" ]; then
define_tristate CONFIG_FBCON_MFB y
else
if [ "$CONFIG_FB_ACORN" = "m" -o "$CONFIG_FB_AMIGA" = "m" -o \
"$CONFIG_FB_ATARI" = "m" -o "$CONFIG_FB_CYBER" = "m" -o \
"$CONFIG_FB_MAC" = "m" -o "$CONFIG_FB_RETINAZ3" = "m" -o \
"$CONFIG_FB_VIRGE" = "m" -o "$CONFIG_FB_TX3912" = "m" -o \
"$CONFIG_FB_BWTWO" = "m" -o "$CONFIG_FB_CLGEN" = "m" ]; then
"$CONFIG_FB_VIRGE" = "m" -o "$CONFIG_FB_CLGEN" = "m" -o \
"$CONFIG_FB_BWTWO" = "m" ]; then
define_tristate CONFIG_FBCON_MFB m
fi
fi
if [ "$CONFIG_FB_ACORN" = "y" -o "$CONFIG_FB_MAC" = "y" -o \
"$CONFIG_FB_SA1100" = "y" -o "$CONFIG_FB_TX3912" = "y" ]; then
"$CONFIG_FB_SA1100" = "y" ]; then
define_tristate CONFIG_FBCON_CFB2 y
define_tristate CONFIG_FBCON_CFB4 y
else
if [ "$CONFIG_FB_ACORN" = "m" -o "$CONFIG_FB_MAC" = "m" -o \
"$CONFIG_FB_SA1100" = "m" -o "$CONFIG_FB_TX3912" = "m" ]; then
"$CONFIG_FB_SA1100" = "m" ]; then
define_tristate CONFIG_FBCON_CFB2 m
define_tristate CONFIG_FBCON_CFB4 m
fi
......@@ -262,7 +262,7 @@ if [ "$CONFIG_FB" = "y" ]; then
if [ "$CONFIG_FB_ACORN" = "y" -o "$CONFIG_FB_ATARI" = "y" -o \
"$CONFIG_FB_ATY" = "y" -o "$CONFIG_FB_MAC" = "y" -o \
"$CONFIG_FB_OF" = "y" -o "$CONFIG_FB_TGA" = "y" -o \
"$CONFIG_FB_NEOMAGIC" = "y" -o "$CONFIG_FB_PM3" = "y" -o \
"$CONFIG_FB_SIS" = "y" -o "$CONFIG_FB_PM3" = "y" -o \
"$CONFIG_FB_TCX" = "y" -o "$CONFIG_FB_CGTHREE" = "y" -o \
"$CONFIG_FB_CONTROL" = "y" -o "$CONFIG_FB_CLGEN" = "y" -o \
"$CONFIG_FB_CGFOURTEEN" = "y" -o "$CONFIG_FB_TRIDENT" = "y" -o \
......@@ -273,15 +273,13 @@ if [ "$CONFIG_FB" = "y" ]; then
"$CONFIG_FB_P9100" = "y" -o "$CONFIG_FB_ATY128" = "y" -o \
"$CONFIG_FB_RIVA" = "y" -o "$CONFIG_FB_RADEON" = "y" -o \
"$CONFIG_FB_SGIVW" = "y" -o "$CONFIG_FB_CYBER2000" = "y" -o \
"$CONFIG_FB_SA1100" = "y" -o "$CONFIG_FB_SIS" = "y" -o \
"$CONFIG_FB_PMAG_BA" = "y" -o "$CONFIG_FB_PMAGB_B" = "y" -o \
"$CONFIG_FB_MAXINE" = "y" -o "$CONFIG_FB_TX3912" = "y" ]; then
"$CONFIG_FB_SA1100" = "y" ]; then
define_tristate CONFIG_FBCON_CFB8 y
else
if [ "$CONFIG_FB_ACORN" = "m" -o "$CONFIG_FB_ATARI" = "m" -o \
"$CONFIG_FB_ATY" = "m" -o "$CONFIG_FB_MAC" = "m" -o \
"$CONFIG_FB_OF" = "m" -o "$CONFIG_FB_TGA" = "m" -o \
"$CONFIG_FB_NEOMAGIC" = "m" -o "$CONFIG_FB_PM3" = "m" -o \
"$CONFIG_FB_SIS" = "m" -o "$CONFIG_FB_PM3" = "m" -o \
"$CONFIG_FB_TCX" = "m" -o "$CONFIG_FB_CGTHREE" = "m" -o \
"$CONFIG_FB_CONTROL" = "m" -o "$CONFIG_FB_CLGEN" = "m" -o \
"$CONFIG_FB_CGFOURTEEN" = "m" -o "$CONFIG_FB_TRIDENT" = "m" -o \
......@@ -290,16 +288,14 @@ if [ "$CONFIG_FB" = "y" ]; then
"$CONFIG_FB_IGA" = "m" -o "$CONFIG_FB_MATROX" = "m" -o \
"$CONFIG_FB_CT65550" = "m" -o "$CONFIG_FB_PM2" = "m" -o \
"$CONFIG_FB_P9100" = "m" -o "$CONFIG_FB_ATY128" = "m" -o \
"$CONFIG_FB_RIVA" = "m" -o "$CONFIG_FB_TX3912" = "m" -o \
"$CONFIG_FB_RIVA" = "m" -o "$CONFIG_FB_RADEON" = "m" -o \
"$CONFIG_FB_SGIVW" = "m" -o "$CONFIG_FB_CYBER2000" = "m" -o \
"$CONFIG_FB_PMAG_BA" = "m" -o "$CONFIG_FB_PMAGB_B" = "m" -o \
"$CONFIG_FB_MAXINE" = "m" -o "$CONFIG_FB_RADEON" = "m" -o \
"$CONFIG_FB_SA1100" = "m" -o "$CONFIG_FB_SIS" = "m" ]; then
"$CONFIG_FB_SA1100" = "m" ]; then
define_tristate CONFIG_FBCON_CFB8 m
fi
fi
if [ "$CONFIG_FB_ATARI" = "y" -o "$CONFIG_FB_ATY" = "y" -o \
"$CONFIG_FB_MAC" = "y" -o "$CONFIG_FB_NEOMAGIC" = "y" -o \
"$CONFIG_FB_MAC" = "y" -o "$CONFIG_FB_PVR2" = "y" -o \
"$CONFIG_FB_TRIDENT" = "y" -o "$CONFIG_FB_TBOX" = "y" -o \
"$CONFIG_FB_VOODOO1" = "y" -o "$CONFIG_FB_RADEON" = "y" -o \
"$CONFIG_FB_CONTROL" = "y" -o "$CONFIG_FB_CLGEN" = "y" -o \
......@@ -309,12 +305,11 @@ if [ "$CONFIG_FB" = "y" ]; then
"$CONFIG_FB_PM2" = "y" -o "$CONFIG_FB_SGIVW" = "y" -o \
"$CONFIG_FB_RIVA" = "y" -o "$CONFIG_FB_ATY128" = "y" -o \
"$CONFIG_FB_CYBER2000" = "y" -o "$CONFIG_FB_PM3" = "y" -o \
"$CONFIG_FB_SIS" = "y" -o "$CONFIG_FB_SA1100" = "y" -o \
"$CONFIG_FB_PVR2" = "y" ]; then
"$CONFIG_FB_SIS" = "y" -o "$CONFIG_FB_SA1100" = "y" ]; then
define_tristate CONFIG_FBCON_CFB16 y
else
if [ "$CONFIG_FB_ATARI" = "m" -o "$CONFIG_FB_ATY" = "m" -o \
"$CONFIG_FB_MAC" = "m" -o "$CONFIG_FB_NEOMAGIC" = "m" -o \
"$CONFIG_FB_MAC" = "m" -o "$CONFIG_FB_PVR2" = "m" -o \
"$CONFIG_FB_TRIDENT" = "m" -o "$CONFIG_FB_TBOX" = "m" -o \
"$CONFIG_FB_VOODOO1" = "m" -o "$CONFIG_FB_PM3" = "m" -o \
"$CONFIG_FB_CONTROL" = "m" -o "$CONFIG_FB_CLGEN" = "m" -o \
......@@ -324,8 +319,7 @@ if [ "$CONFIG_FB" = "y" ]; then
"$CONFIG_FB_PM2" = "m" -o "$CONFIG_FB_SGIVW" = "m" -o \
"$CONFIG_FB_RIVA" = "m" -o "$CONFIG_FB_ATY128" = "m" -o \
"$CONFIG_FB_CYBER2000" = "m" -o "$CONFIG_FB_SIS" = "m" -o \
"$CONFIG_FB_SA1100" = "m" -o "$CONFIG_FB_RADEON" = "m" -o \
"$CONFIG_FB_PVR2" = "m" ]; then
"$CONFIG_FB_SA1100" = "m" -o "$CONFIG_FB_RADEON" = "m" ]; then
define_tristate CONFIG_FBCON_CFB16 m
fi
fi
......@@ -374,7 +368,9 @@ if [ "$CONFIG_FB" = "y" ]; then
"$CONFIG_FB_HP300" = "y" -o "$CONFIG_FB_Q40" = "y" -o \
"$CONFIG_FB_ANAKIN" = "y" -o "$CONFIG_FB_G364" = "y" -o \
"$CONFIG_FB_VIRTUAL" = "y" -o "$CONFIG_FB_CLPS711X" = "y" -o \
"$CONFIG_FB_3DFX" = "y" ]; then
"$CONFIG_FB_PMAG_BA" = "y" -o "$CONFIG_FB_PMAGB_B" = "y" -o \
"$CONFIG_FB_3DFX" = "y" -o "$CONFIG_FB_TX3912" = "y" -o \
"$CONFIG_FB_MAXINE" = "y" -o "$CONFIG_FB_APOLLO" = "y" ]; then
define_tristate CONFIG_FBCON_ACCEL y
else
if [ "$CONFIG_FB_NEOMAGIC" = "m" -o "$CONFIG_FB_HIT" = "m" -o \
......
......@@ -7,13 +7,13 @@ mod-subdirs := matrox
# 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 \
fbcon-afb.o fbcon-ilbm.o fbcon-accel.o \
fbcon-vga.o fbcon-iplan2p2.o fbcon-iplan2p4.o \
fbcon-iplan2p8.o fbcon-vga-planes.o fbcon-cfb16.o \
fbcon-cfb2.o fbcon-cfb24.o fbcon-cfb32.o fbcon-cfb4.o \
fbcon-cfb8.o fbcon-mac.o fbcon-mfb.o \
cyber2000fb.o sa1100fb.o fbcon-hga.o fbgen.o
export-objs := fbmem.o fbcmap.o fbcon.o fbmon.o modedb.o \
fbcon-afb.o fbcon-ilbm.o fbcon-accel.o \
fbcon-vga.o fbcon-iplan2p2.o fbcon-iplan2p4.o \
fbcon-iplan2p8.o fbcon-vga-planes.o fbcon-cfb16.o \
fbcon-cfb2.o fbcon-cfb24.o fbcon-cfb32.o fbcon-cfb4.o \
fbcon-cfb8.o fbcon-mac.o fbcon-mfb.o \
cyber2000fb.o sa1100fb.o fbcon-hga.o fbgen.o
# Each configuration option enables a list of files.
......@@ -43,18 +43,18 @@ obj-$(CONFIG_FB_ACORN) += acornfb.o
obj-$(CONFIG_FB_AMIGA) += amifb.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 cfbfillrect.o cfbimgblt.o
obj-$(CONFIG_FB_Q40) += q40fb.o cfbfillrect.o cfbcopyarea.o cfbimgblt.o
obj-$(CONFIG_FB_ATARI) += atafb.o
obj-$(CONFIG_FB_ATY128) += aty128fb.o
obj-$(CONFIG_FB_RADEON) += radeonfb.o
obj-$(CONFIG_FB_NEOMAGIC) += neofb.o
obj-$(CONFIG_FB_NEOMAGIC) += neofb.o cfbfillrect.o cfbcopyarea.o cfbimgblt.o
obj-$(CONFIG_FB_IGA) += igafb.o
obj-$(CONFIG_FB_CONTROL) += controlfb.o
obj-$(CONFIG_FB_PLATINUM) += platinumfb.o
obj-$(CONFIG_FB_VALKYRIE) += valkyriefb.o
obj-$(CONFIG_FB_CT65550) += chipsfb.o
obj-$(CONFIG_FB_ANAKIN) += anakinfb.o
obj-$(CONFIG_FB_ANAKIN) += anakinfb.o cfbfillrect.o cfbcopyarea.o cfbimgblt.o
obj-$(CONFIG_FB_CLPS711X) += clps711xfb.o cfbfillrect.o cfbcopyarea.o cfbimgblt.o
obj-$(CONFIG_FB_CYBER) += cyberfb.o
obj-$(CONFIG_FB_CYBER2000) += cyber2000fb.o
......@@ -83,10 +83,10 @@ obj-$(CONFIG_FB_CGFOURTEEN) += cgfourteenfb.o sbusfb.o
obj-$(CONFIG_FB_P9100) += p9100fb.o sbusfb.o
obj-$(CONFIG_FB_LEO) += leofb.o sbusfb.o
obj-$(CONFIG_FB_STI) += stifb.o sticore.o
obj-$(CONFIG_FB_PMAG_BA) += pmag-ba-fb.o
obj-$(CONFIG_FB_PMAGB_B) += pmagb-b-fb.o
obj-$(CONFIG_FB_MAXINE) += maxinefb.o
obj-$(CONFIG_FB_TX3912) += tx3912fb.o
obj-$(CONFIG_FB_PMAG_BA) += pmag-ba-fb.o cfbfillrect.o cfbcopyarea.o cfbimgblt.o
obj-$(CONFIG_FB_PMAGB_B) += pmagb-b-fb.o cfbfillrect.o cfbcopyarea.o cfbimgblt.o
obj-$(CONFIG_FB_MAXINE) += maxinefb.o cfbfillrect.o cfbcopyarea.o cfbimgblt.o
obj-$(CONFIG_FB_TX3912) += tx3912fb.o cfbfillrect.o cfbcopyarea.o cfbimgblt.o
obj-$(CONFIG_FB_MATROX) += matrox/
obj-$(CONFIG_FB_RIVA) += riva/
......
......@@ -21,7 +21,6 @@
#include <asm/io.h>
#include <video/fbcon.h>
#include <video/fbcon-cfb16.h>
static u32 colreg[16];
static struct fb_info fb_info;
......@@ -84,7 +83,8 @@ anakinfb_init(void)
memset(&display, 0, sizeof(struct display));
strcpy(fb_info.modename, anakinfb_fix.id);
fb_info.node = fb_info.currcon = -1;
fb_info.node = NODEV;
fb_info.currcon = -1;
fb_info.flags = FBINFO_FLAG_DEFAULT;
fb_info.fbops = &anakinfb_ops;
fb_info.var = anakinfb_var;
......
......@@ -1659,7 +1659,7 @@ aty128_init(struct fb_info_aty128 *info, const char *name)
{
struct fb_var_screeninfo var;
u32 dac;
int j, k;
int j, k, size;
u8 chip_rev;
const struct aty128_chip_info *aci = &aty128_pci_probe_list[0];
char *video_card = "Rage128";
......@@ -1772,6 +1772,9 @@ aty128_init(struct fb_info_aty128 *info, const char *name)
board_list = aty128_board_list_add(board_list, info);
size = (fb_display[con].var.bits_per_pixel <= 8) ? 256 : 32;
fb_alloc_cmap(info->fb_info.cmap, size, 0);
if (register_framebuffer(&info->fb_info) < 0)
return 0;
......
......@@ -31,7 +31,7 @@
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);
int 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;
......@@ -102,7 +102,7 @@ void cfb_copyarea(struct fb_info *p, struct fb_copyarea *area)
end_mask = -1 << ((bpl - end_index) << 3);
n -= end_index;
}
n = n / bpl;
n /= bpl;
if (n <= 0) {
if (start_mask) {
......
......@@ -107,12 +107,11 @@ void cfb_imageblit(struct fb_info *p, struct fb_image *image)
dst++;
}
if (n) {
if (n) {
end_mask = 0;
for (j = n; j > 0; j--) {
end_mask = 0;
if (test_bit(l, src))
end_mask |= (tmp >> (p->var.bits_per_pixel*(k-1)));
end_mask |= (tmp >> (p->var.bits_per_pixel*(j-1)));
l--;
if (l < 0) { l = 7; src++; }
}
......@@ -125,9 +124,6 @@ void cfb_imageblit(struct fb_info *p, struct fb_image *image)
} 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;
}
}
......@@ -203,6 +203,9 @@ static struct fb_ops clps7111fb_ops = {
fb_get_cmap: gen_get_cmap,
fb_setcolreg: clps7111fb_setcolreg,
fb_blank: clps7111fb_blank,
fb_fillrect: cfb_fillrect,
fb_copyarea: cfb_copyarea,
fb_imageblit: cfb_imageblit,
};
static int
......
......@@ -1729,8 +1729,9 @@ static int cyberpro_pci_resume(struct pci_dev *dev)
}
static struct pci_device_id cyberpro_pci_table[] __devinitdata = {
{ PCI_VENDOR_ID_INTERG, PCI_DEVICE_ID_INTERG_1682,
PCI_ANY_ID, PCI_ANY_ID, 0, 0, ID_IGA_1682 },
// Not yet
// { PCI_VENDOR_ID_INTERG, PCI_DEVICE_ID_INTERG_1682,
// PCI_ANY_ID, PCI_ANY_ID, 0, 0, ID_IGA_1682 },
{ PCI_VENDOR_ID_INTERG, PCI_DEVICE_ID_INTERG_2000,
PCI_ANY_ID, PCI_ANY_ID, 0, 0, ID_CYBERPRO_2000 },
{ PCI_VENDOR_ID_INTERG, PCI_DEVICE_ID_INTERG_2010,
......
#ifndef _DN_ACCEL_H_
#define _DN_ACCEL_H_
#include <linux/fb.h>
void dn_bitblt(struct display *p,int x_src,int y_src, int x_dest, int y_dest,
int x_count, int y_count);
#endif
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
......@@ -150,7 +150,7 @@ void fb_copy_cmap(struct fb_cmap *from, struct fb_cmap *to, int fsfromto)
else
tooff = from->start-to->start;
size = to->len-tooff;
if (size > from->len-fromoff)
if (size > (int) (from->len - fromoff))
size = from->len-fromoff;
if (size <= 0)
return;
......
......@@ -132,6 +132,7 @@ extern int pmagbafb_init(void);
extern int pmagbbfb_init(void);
extern void maxinefb_init(void);
extern int tx3912fb_init(void);
extern int tx3912fb_setup(char*);
extern int radeonfb_init(void);
extern int radeonfb_setup(char*);
extern int e1355fb_init(void);
......@@ -300,7 +301,7 @@ static struct {
{ "hitfb", hitfb_init, NULL },
#endif
#ifdef CONFIG_FB_TX3912
{ "tx3912", tx3912fb_init, NULL },
{ "tx3912", tx3912fb_init, tx3912fb_setup },
#endif
#ifdef CONFIG_FB_E1355
{ "e1355fb", e1355fb_init, e1355fb_setup },
......
......@@ -23,7 +23,6 @@
*
*/
#include <linux/module.h>
#include <linux/kernel.h>
#include <linux/sched.h>
......@@ -42,48 +41,32 @@
/* whether are really running on a maxine, KM */
#include <asm/bootinfo.h>
#include <video/fbcon-mfb.h>
#include <video/fbcon-cfb2.h>
#include <video/fbcon-cfb4.h>
#include <video/fbcon-cfb8.h>
#define arraysize(x) (sizeof(x)/sizeof(*(x)))
static struct display disp;
static struct fb_info fb_info;
unsigned long fb_start, fb_size = 1024 * 768, fb_line_length = 1024;
unsigned long fb_regs;
unsigned char fb_bitmask;
static struct display disp;
static struct fb_var_screeninfo maxinefb_defined = {
0, 0, 0, 0, /* W,H, W, H (virtual) load xres,xres_virtual */
0, 0, /* virtual -> visible no offset */
0, /* depth -> load bits_per_pixel */
0, /* greyscale ? */
{0, 0, 0}, /* R */
{0, 0, 0}, /* G */
{0, 0, 0}, /* B */
{0, 0, 0}, /* transparency */
0, /* standard pixel format */
FB_ACTIVATE_NOW,
274, 195, /* 14" monitor */
FB_ACCEL_NONE,
0L, 0L, 0L, 0L, 0L,
0L, 0L, 0, /* No sync info */
FB_VMODE_NONINTERLACED,
{0, 0, 0, 0, 0, 0}
};
struct maxinefb_par {
xres: 1024,
yres: 768,
xres_virtual: 1024,
yres_virtual: 768,
bits_per_pixel: 8,
activate: FB_ACTIVATE_NOW,
height: -1,
width: -1,
vmode: FB_VMODE_NONINTERLACED,
};
struct maxinefb_par current_par;
static struct fb_fix_screeninfo maxinefb_fix = {
id: "Maxine onboard graphics 1024x768x8",
smem_len: (1024*768),
type: FB_TYPE_PACKED_PIXELS,
visual: FB_VISUAL_PSEUDOCOLOR,
line_length: 1024,
}
/* Reference to machine type set in arch/mips/dec/prom/identify.c, KM */
extern unsigned long mips_machtype;
/* Handle the funny Inmos RamDAC/video controller ... */
void maxinefb_ims332_write_register(int regno, register unsigned int val)
......@@ -109,212 +92,41 @@ unsigned int maxinefb_ims332_read_register(int regno)
return (j & 0xffff) | ((k & 0xff00) << 8);
}
static void maxinefb_encode_var(struct fb_var_screeninfo *var,
struct maxinefb_par *par)
{
int i = 0;
var->xres = 1024;
var->yres = 768;
var->xres_virtual = 1024;
var->yres_virtual = 768;
var->xoffset = 0;
var->yoffset = 0;
var->bits_per_pixel = 8;
var->grayscale = 0;
var->transp.offset = 0;
var->transp.length = 0;
var->transp.msb_right = 0;
var->nonstd = 0;
var->activate = 1;
var->height = -1;
var->width = -1;
var->vmode = FB_VMODE_NONINTERLACED;
var->pixclock = 0;
var->sync = 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;
for (i = 0; i < arraysize(var->reserved); i++)
var->reserved[i] = 0;
}
static void maxinefb_get_par(struct maxinefb_par *par)
{
*par = current_par;
}
static int maxinefb_fb_update_var(int con, struct fb_info *info)
{
return 0;
}
static int maxinefb_do_fb_set_var(struct fb_var_screeninfo *var,
int isactive)
{
struct maxinefb_par par;
maxinefb_get_par(&par);
maxinefb_encode_var(var, &par);
return 0;
}
/* Get the palette */
static int maxinefb_get_cmap(struct fb_cmap *cmap, int kspc, int con,
struct fb_info *info)
{
unsigned int i;
unsigned long hw_colorvalue = 0; /* raw color value from the register */
unsigned int length;
if (((cmap->start) + (cmap->len)) >= 256) {
length = 256 - (cmap->start);
} else {
length = cmap->len;
}
for (i = 0; i < length; i++) {
hw_colorvalue =
maxinefb_ims332_read_register(IMS332_REG_COLOR_PALETTE
+ cmap->start + i);
(cmap->red[i]) = ((hw_colorvalue & 0x0000ff));
(cmap->green[i]) = ((hw_colorvalue & 0x00ff00) >> 8);
(cmap->blue[i]) = ((hw_colorvalue & 0xff0000) >> 16);
}
return 0;
}
/* Set the palette */
static int maxinefb_set_cmap(struct fb_cmap *cmap, int kspc, int con,
struct fb_info *info)
{
unsigned int i;
unsigned long hw_colorvalue; /* value to be written into the palette reg. */
unsigned short cmap_red;
unsigned short cmap_green;
unsigned short cmap_blue;
unsigned int length;
hw_colorvalue = 0;
if (((cmap->start) + (cmap->len)) >= 256) {
length = 256 - (cmap->start);
} else {
length = cmap->len;
}
for (i = 0; i < length; i++) {
cmap_red = ((cmap->red[i]) >> 8); /* The cmap fields are 16 bits */
cmap_green = ((cmap->green[i]) >> 8); /* wide, but the harware colormap */
cmap_blue = ((cmap->blue[i]) >> 8); /* registers are only 8 bits wide */
hw_colorvalue =
(cmap_blue << 16) + (cmap_green << 8) + (cmap_red);
maxinefb_ims332_write_register(IMS332_REG_COLOR_PALETTE +
cmap->start + i,
hw_colorvalue);
}
return 0;
}
static int maxinefb_get_var(struct fb_var_screeninfo *var, int con,
struct fb_info *info)
static int maxinefb_setcolreg(unsigned regno, unsigned red, unsigned green,
unsigned blue, unsigned transp, struct fb_info *info)
{
struct maxinefb_par par;
if (con == -1) {
maxinefb_get_par(&par);
maxinefb_encode_var(var, &par);
} else
*var = fb_display[con].var;
return 0;
}
/* value to be written into the palette reg. */
unsigned long hw_colorvalue = 0;
red >>= 8; /* The cmap fields are 16 bits */
green >>= 8; /* wide, but the harware colormap */
blue >>= 8; /* registers are only 8 bits wide */
static int maxinefb_set_var(struct fb_var_screeninfo *var, int con,
struct fb_info *info)
{
int err;
if ((err = maxinefb_do_fb_set_var(var, 1)))
return err;
hw_colorvalue = (blue << 16) + (green << 8) + (red);
maxinefb_ims332_write_register(IMS332_REG_COLOR_PALETTE + regno,
hw_colorvalue);
return 0;
}
static void maxinefb_encode_fix(struct fb_fix_screeninfo *fix,
struct maxinefb_par *par)
{
memset(fix, 0, sizeof(struct fb_fix_screeninfo));
strcpy(fix->id, "maxinefb");
/* fix->id is a char[16], so a maximum of 15 characters, KM */
fix->smem_start = (char *) fb_start; /* display memory base address, KM */
fix->smem_len = fb_size;
fix->type = FB_TYPE_PACKED_PIXELS;
fix->visual = FB_VISUAL_PSEUDOCOLOR;
fix->xpanstep = 0;
fix->ypanstep = 0;
fix->ywrapstep = 0;
fix->line_length = fb_line_length;
}
static int maxinefb_get_fix(struct fb_fix_screeninfo *fix, int con,
struct fb_info *info)
{
struct maxinefb_par par;
maxinefb_get_par(&par);
maxinefb_encode_fix(fix, &par);
return 0;
}
static int maxinefb_switch(int con, struct fb_info *info)
{
maxinefb_do_fb_set_var(&fb_display[con].var, 1);
info->currcon = con;
return 0;
}
static void maxinefb_set_disp(int con)
{
struct fb_fix_screeninfo fix;
struct display *display;
if (con >= 0)
display = &fb_display[con];
else
display = &disp; /* used during initialization */
maxinefb_get_fix(&fix, con, 0);
display->visual = fix.visual;
display->type = fix.type;
display->type_aux = fix.type_aux;
display->ypanstep = fix.ypanstep;
display->ywrapstep = fix.ywrapstep;
display->line_length = fix.line_length;
display->next_line = fix.line_length;
display->can_soft_blank = 0;
display->inverse = 0;
display->dispsw = &fbcon_cfb8;
}
static struct fb_ops maxinefb_ops = {
owner: THIS_MODULE,
fb_get_fix: maxinefb_get_fix,
fb_get_var: maxinefb_get_var,
fb_set_var: maxinefb_set_var,
fb_get_cmap: maxinefb_get_cmap,
fb_set_cmap: maxinefb_set_cmap,
fb_get_fix: gen_get_fix,
fb_get_var: gen_get_var,
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,
fb_imageblit: cfb_imageblit,
};
int __init maxinefb_init(void)
{
volatile unsigned char *fboff;
unsigned long fb_start;
int i;
/* Validate we're on the proper machine type */
......@@ -332,6 +144,8 @@ int __init maxinefb_init(void)
for (fboff = fb_start; fboff < fb_start + 0x1ffff; fboff++)
*fboff = 0x0;
maxinefb_fix.smem_start = fb_start;
/* erase hardware cursor */
for (i = 0; i < 512; i++) {
maxinefb_ims332_write_register(IMS332_REG_CURSOR_RAM + i,
......@@ -344,34 +158,26 @@ int __init maxinefb_init(void)
*/
}
/* Fill in the available video resolution */
maxinefb_defined.xres = 1024;
maxinefb_defined.yres = 768;
maxinefb_defined.xres_virtual = 1024;
maxinefb_defined.yres_virtual = 768;
maxinefb_defined.bits_per_pixel = 8;
/* Let there be consoles... */
strcpy(fb_info.modename, "Maxine onboard graphics 1024x768x8");
/* fb_info.modename: maximum of 39 characters + trailing nullbyte, KM */
fb_info.changevar = NULL;
fb_info.node = NODEV;
fb_info.fbops = &maxinefb_ops;
fb_info.screen_base = (char *) fb_start;
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 = &maxinefb_switch;
fb_info.updatevar = &maxinefb_fb_update_var;
fb_info.switch_con = gen_switch;
fb_info.updatevar = gen_update_var;
fb_info.flags = FBINFO_FLAG_DEFAULT;
maxinefb_do_fb_set_var(&maxinefb_defined, 1);
maxinefb_get_var(&disp.var, -1, &fb_info);
maxinefb_set_disp(-1);
fb_alloc_cmap(&fb_info.cmap, 256, 0);
gen_set_disp(-1, &fb_info);
if (register_framebuffer(&fb_info) < 0)
return 1;
return 0;
}
......
This diff is collapsed.
This diff is collapsed.
......@@ -37,12 +37,6 @@
#include "pmag-ba-fb.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>
#define arraysize(x) (sizeof(x)/sizeof(*(x)))
struct pmag_ba_ramdac_regs {
unsigned char addr_low;
......@@ -54,316 +48,119 @@ struct pmag_ba_ramdac_regs {
unsigned char cmap;
};
struct pmag_ba_my_fb_info {
struct fb_info info;
struct pmag_ba_ramdac_regs *bt459_regs;
unsigned long pmagba_fb_start;
unsigned long pmagba_fb_size;
unsigned long pmagba_fb_line_length;
};
static struct display disp;
/*
* Max 3 TURBOchannel slots -> max 3 PMAG-BA :)
*/
static struct pmag_ba_my_fb_info pmagba_fb_info[3];
static struct fb_info pmagba_fb_info[3];
static struct display pmagba_disp[3];
static struct fb_var_screeninfo pmagbafb_defined = {
0, 0, 0, 0, /* W,H, W, H (virtual) load xres,xres_virtual */
0, 0, /* virtual -> visible no offset */
0, /* depth -> load bits_per_pixel */
0, /* greyscale ? */
{0, 0, 0}, /* R */
{0, 0, 0}, /* G */
{0, 0, 0}, /* B */
{0, 0, 0}, /* transparency */
0, /* standard pixel format */
FB_ACTIVATE_NOW,
274, 195, /* 14" monitor */
FB_ACCEL_NONE,
0L, 0L, 0L, 0L, 0L,
0L, 0L, 0, /* No sync info */
FB_VMODE_NONINTERLACED,
{0, 0, 0, 0, 0, 0}
};
struct pmagbafb_par {
};
struct pmagbafb_par current_par;
static void pmagbafb_encode_var(struct fb_var_screeninfo *var,
struct pmagbafb_par *par)
{
int i = 0;
var->xres = 1024;
var->yres = 864;
var->xres_virtual = 1024;
var->yres_virtual = 864;
var->xoffset = 0;
var->yoffset = 0;
var->bits_per_pixel = 8;
var->grayscale = 0;
var->transp.offset = 0;
var->transp.length = 0;
var->transp.msb_right = 0;
var->nonstd = 0;
var->activate = 1;
var->height = -1;
var->width = -1;
var->vmode = FB_VMODE_NONINTERLACED;
var->pixclock = 0;
var->sync = 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;
for (i = 0; i < arraysize(var->reserved); i++)
var->reserved[i] = 0;
}
static void pmagbafb_get_par(struct pmagbafb_par *par)
{
*par = current_par;
}
static int pmagba_fb_update_var(int con, struct fb_info *info)
{
return 0;
}
static int pmagba_do_fb_set_var(struct fb_var_screeninfo *var,
int isactive)
{
struct pmagbafb_par par;
pmagbafb_get_par(&par);
pmagbafb_encode_var(var, &par);
return 0;
xres: 1024,
yres: 864,
xres_virtual: 1024,
yres_virtual: 864,
bits_per_pixel: 8,
activate: FB_ACTIVATE_NOW,
height: 274,
width: 195,
accel: FB_ACCEL_NONE,
vmode: FB_VMODE_NONINTERLACED,
}
static struct fb_fix_screeninfo pmagbafb_fix = {
id: "PMAG-BA",
smem_len: (1024 * 864),
type: FB_TYPE_PACKED_PIXELS,
visual: FB_VISUAL_PSEUDOCOLOR,
line_length: 1024,
}
/*
* Turn hardware cursor off
*/
void pmagbafb_erase_cursor(struct pmag_ba_my_fb_info *info)
{
info->bt459_regs->addr_low = 0;
info->bt459_regs->addr_hi = 3;
info->bt459_regs->data = 0;
}
/*
* Write to a Bt459 color map register
*/
void pmag_ba_bt459_write_colormap(struct pmag_ba_my_fb_info *info,
int reg, __u8 red, __u8 green, __u8 blue)
{
info->bt459_regs->addr_low = (__u8) reg;
info->bt459_regs->addr_hi = 0;
info->bt459_regs->cmap = red;
info->bt459_regs->cmap = green;
info->bt459_regs->cmap = blue;
}
/*
* Get the palette
*/
static int pmagbafb_get_cmap(struct fb_cmap *cmap, int kspc, int con,
struct fb_info *info)
void pmagbafb_erase_cursor(struct pmag_ba_ramdac_regs *bt459_regs)
{
unsigned int i;
unsigned int length;
if (((cmap->start) + (cmap->len)) >= 256) {
length = 256 - (cmap->start);
} else {
length = cmap->len;
}
for (i = 0; i < length; i++) {
/*
* TODO
*/
}
return 0;
bt459_regs->addr_low = 0;
bt459_regs->addr_hi = 3;
bt459_regs->data = 0;
}
/*
* Set the palette.
*/
static int pmagbafb_set_cmap(struct fb_cmap *cmap, int kspc, int con,
struct fb_info *info)
static int pmagbafb_setcolreg(unsigned regno, unsigned red, unsigned green,
unsigned blue, unsigned transp,
struct fb_info *info)
{
unsigned int i;
__u8 cmap_red, cmap_green, cmap_blue;
unsigned int length;
if (((cmap->start) + (cmap->len)) >= 256)
length = 256 - (cmap->start);
else
length = cmap->len;
struct pmag_ba_ramdac_regs *bt459_regs = (struct pmag_ba_ramdac_regs *) info->par;
for (i = 0; i < length; i++) {
cmap_red = ((cmap->red[i]) >> 8); /* The cmap fields are 16 bits */
cmap_green = ((cmap->green[i]) >> 8); /* wide, but the harware colormap */
cmap_blue = ((cmap->blue[i]) >> 8); /* registers are only 8 bits wide */
pmag_ba_bt459_write_colormap((struct pmag_ba_my_fb_info *)
info, cmap->start + i,
cmap_red, cmap_green,
cmap_blue);
}
return 0;
}
static int pmagbafb_get_var(struct fb_var_screeninfo *var, int con,
struct fb_info *info)
{
struct pmagbafb_par par;
if (con == -1) {
pmagbafb_get_par(&par);
pmagbafb_encode_var(var, &par);
} else
*var = fb_display[con].var;
return 0;
}
static int pmagbafb_set_var(struct fb_var_screeninfo *var, int con,
struct fb_info *info)
{
int err;
if ((err = pmagba_do_fb_set_var(var, 1)))
return err;
return 0;
}
static void pmagbafb_encode_fix(struct fb_fix_screeninfo *fix,
struct pmagbafb_par *par,
struct pmag_ba_my_fb_info *info)
{
memset(fix, 0, sizeof(struct fb_fix_screeninfo));
strcpy(fix->id, "PMAG-BA");
fix->smem_start = info->pmagba_fb_start;
fix->smem_len = info->pmagba_fb_size;
fix->type = FB_TYPE_PACKED_PIXELS;
fix->visual = FB_VISUAL_PSEUDOCOLOR;
fix->xpanstep = 0;
fix->ypanstep = 0;
fix->ywrapstep = 0;
fix->line_length = info->pmagba_fb_line_length;
}
static int pmagbafb_get_fix(struct fb_fix_screeninfo *fix, int con,
struct fb_info *info)
{
struct pmagbafb_par par;
if (regno >= info->cmap.len)
return 1;
pmagbafb_get_par(&par);
pmagbafb_encode_fix(fix, &par, (struct pmag_ba_my_fb_info *) info);
red >>= 8; /* The cmap fields are 16 bits */
green >>= 8; /* wide, but the harware colormap */
blue >>= 8; /* registers are only 8 bits wide */
bt459_regs->addr_low = (__u8) regno;
bt459_regs->addr_hi = 0;
bt459_regs->cmap = red;
bt459_regs->cmap = green;
bt459_regs->cmap = blue;
return 0;
}
static int pmagbafb_switch(int con, struct fb_info *info)
{
pmagba_do_fb_set_var(&fb_display[con].var, 1);
info->currcon = con;
return 0;
}
static void pmagbafb_set_disp(int con, struct pmag_ba_my_fb_info *info)
{
struct fb_fix_screeninfo fix;
struct display *display;
if (con >= 0)
display = &fb_display[con];
else
display = &disp; /* used during initialization */
pmagbafb_get_fix(&fix, con, (struct fb_info *) info);
display->visual = fix.visual;
display->type = fix.type;
display->type_aux = fix.type_aux;
display->ypanstep = fix.ypanstep;
display->ywrapstep = fix.ywrapstep;
display->line_length = fix.line_length;
display->next_line = fix.line_length;
display->can_soft_blank = 0;
display->inverse = 0;
display->dispsw = &fbcon_cfb8;
}
static struct fb_ops pmagbafb_ops = {
owner: THIS_MODULE,
fb_get_fix: pmagbafb_get_fix,
fb_get_var: pmagbafb_get_var,
fb_set_var: pmagbafb_set_var,
fb_get_cmap: pmagbafb_get_cmap,
fb_set_cmap: pmagbafb_set_cmap,
};
fb_get_fix: gen_get_fix,
fb_get_var: gen_get_var,
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,
fb_imageblit: cfb_imageblit,
}
int __init pmagbafb_init_one(int slot)
{
unsigned long base_addr = get_tc_base_addr(slot);
struct pmag_ba_my_fb_info *ip =
(struct pmag_ba_my_fb_info *) &pmagba_fb_info[slot];
struct fb_info *info = &pmagba_fb_info[slot];
struct display *disp = &pmagba_disp[slot];
printk("PMAG-BA framebuffer in slot %d\n", slot);
/*
* Framebuffer display memory base address and friends
*/
ip->bt459_regs =
(struct pmag_ba_ramdac_regs *) (base_addr +
PMAG_BA_BT459_OFFSET);
ip->pmagba_fb_start = base_addr + PMAG_BA_ONBOARD_FBMEM_OFFSET;
ip->pmagba_fb_size = 1024 * 864;
ip->pmagba_fb_line_length = 1024;
pmagbafb_fix.smem_start = base_addr + PMAG_BA_ONBOARD_FBMEM_OFFSET;
info->par = (base_addr + PMAG_BA_BT459_OFFSET);
/*
* Configure the Bt459 RAM DAC
*/
pmagbafb_erase_cursor(ip);
/*
* Fill in the available video resolution
*/
pmagbafb_defined.xres = 1024;
pmagbafb_defined.yres = 864;
pmagbafb_defined.xres_virtual = 1024;
pmagbafb_defined.yres_virtual = 864;
pmagbafb_defined.bits_per_pixel = 8;
pmagbafb_erase_cursor((struct pmag_ba_ramdac_regs *) info->par);
/*
* Let there be consoles..
*/
strcpy(ip->info.modename, "PMAG-BA");
ip->info.changevar = NULL;
ip->info.node = NODEV;
ip->info.fbops = &pmagbafb_ops;
ip->info.screen_base = ip->pmagba_fb_start;
ip->info.disp = &disp;
ip->info.currcon = -1;
ip->info.switch_con = &pmagbafb_switch;
ip->info.updatevar = &pmagba_fb_update_var;
ip->info.flags = FBINFO_FLAG_DEFAULT;
pmagba_do_fb_set_var(&pmagbafb_defined, 1);
pmagbafb_get_var(&disp.var, -1, (struct fb_info *) ip);
pmagbafb_set_disp(-1, ip);
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((struct fb_info *) ip) < 0)
if (register_framebuffer(info) < 0)
return 1;
return 0;
}
......
......@@ -40,12 +40,6 @@
#include "pmagb-b-fb.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>
#define arraysize(x) (sizeof(x)/sizeof(*(x)))
struct pmagb_b_ramdac_regs {
unsigned char addr_low;
......@@ -57,317 +51,119 @@ struct pmagb_b_ramdac_regs {
unsigned char cmap;
};
struct pmagb_b_my_fb_info {
struct fb_info info;
struct pmagb_b_ramdac_regs *bt459_regs;
unsigned long pmagbb_fb_start;
unsigned long pmagbb_fb_size;
unsigned long pmagbb_fb_line_length;
};
static struct display disp;
/*
* Max 3 TURBOchannel slots -> max 3 PMAGB-B :)
*/
static struct pmagb_b_my_fb_info pmagbb_fb_info[3];
static struct fb_info pmagbb_fb_info[3];
static struct display pmagbb_disp[3];
static struct fb_var_screeninfo pmagbbfb_defined = {
0, 0, 0, 0, /* W,H, W, H (virtual) load xres,xres_virtual */
0, 0, /* virtual -> visible no offset */
0, /* depth -> load bits_per_pixel */
0, /* greyscale ? */
{0, 0, 0}, /* R */
{0, 0, 0}, /* G */
{0, 0, 0}, /* B */
{0, 0, 0}, /* transparency */
0, /* standard pixel format */
FB_ACTIVATE_NOW,
274, 195, /* 14" monitor */
FB_ACCEL_NONE,
0L, 0L, 0L, 0L, 0L,
0L, 0L, 0, /* No sync info */
FB_VMODE_NONINTERLACED,
{0, 0, 0, 0, 0, 0}
};
struct pmagbbfb_par {
xres: 1280,
yres: 1024,
xres_virtual: 1280,
yres_virtual: 1024,
bits_per_pixel: 8,
activate: FB_ACTIVATE_NOW,
height: 274,
width: 195,
accel_flags: FB_ACCEL_NONE,
vmode: FB_VMODE_NONINTERLACED,
};
struct pmagbbfb_par current_par;
static void pmagbbfb_encode_var(struct fb_var_screeninfo *var,
struct pmagbbfb_par *par)
{
int i = 0;
var->xres = 1280;
var->yres = 1024;
var->xres_virtual = 1280;
var->yres_virtual = 1024;
var->xoffset = 0;
var->yoffset = 0;
var->bits_per_pixel = 8;
var->grayscale = 0;
var->transp.offset = 0;
var->transp.length = 0;
var->transp.msb_right = 0;
var->nonstd = 0;
var->activate = 1;
var->height = -1;
var->width = -1;
var->vmode = FB_VMODE_NONINTERLACED;
var->pixclock = 0;
var->sync = 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;
for (i = 0; i < arraysize(var->reserved); i++)
var->reserved[i] = 0;
}
static void pmagbbfb_get_par(struct pmagbbfb_par *par)
{
*par = current_par;
}
static int pmagbb_fb_update_var(int con, struct fb_info *info)
{
return 0;
}
static int pmagbb_do_fb_set_var(struct fb_var_screeninfo *var,
int isactive)
{
struct pmagbbfb_par par;
pmagbbfb_get_par(&par);
pmagbbfb_encode_var(var, &par);
return 0;
static struct fb_fix_screeninfo pmagbafb_fix = {
id: "PMAGB-BA",
smem_len: (1280 * 1024),
type: FB_TYPE_PACKED_PIXELS,
visual: FB_VISUAL_PSEUDOCOLOR,
line_length: 1280,
}
/*
* Turn hardware cursor off
*/
void pmagbbfb_erase_cursor(struct pmagb_b_my_fb_info *info)
void pmagbbfb_erase_cursor(struct pmagb_b_ramdac_regs *bt459_regs)
{
info->bt459_regs->addr_low = 0;
info->bt459_regs->addr_hi = 3;
info->bt459_regs->data = 0;
}
/*
* Write to a Bt459 color map register
*/
void pmagb_b_bt459_write_colormap(struct pmagb_b_my_fb_info *info,
int reg, __u8 red, __u8 green, __u8 blue)
{
info->bt459_regs->addr_low = (__u8) reg;
info->bt459_regs->addr_hi = 0;
info->bt459_regs->cmap = red;
info->bt459_regs->cmap = green;
info->bt459_regs->cmap = blue;
}
/*
* Get the palette
*/
static int pmagbbfb_get_cmap(struct fb_cmap *cmap, int kspc, int con,
struct fb_info *info)
{
unsigned int i;
unsigned int length;
if (((cmap->start) + (cmap->len)) >= 256) {
length = 256 - (cmap->start);
} else {
length = cmap->len;
}
for (i = 0; i < length; i++) {
/*
* TODO
*/
}
return 0;
bt459_regs->addr_low = 0;
bt459_regs->addr_hi = 3;
bt459_regs->data = 0;
}
/*
* Set the palette.
*/
static int pmagbbfb_set_cmap(struct fb_cmap *cmap, int kspc, int con,
struct fb_info *info)
{
unsigned int i;
__u8 cmap_red, cmap_green, cmap_blue;
unsigned int length;
if (((cmap->start) + (cmap->len)) >= 256)
length = 256 - (cmap->start);
else
length = cmap->len;
for (i = 0; i < length; i++) {
cmap_red = ((cmap->red[i]) >> 8); /* The cmap fields are 16 bits */
cmap_green = ((cmap->green[i]) >> 8); /* wide, but the harware colormap */
cmap_blue = ((cmap->blue[i]) >> 8); /* registers are only 8 bits wide */
pmagb_b_bt459_write_colormap((struct pmagb_b_my_fb_info *)
info, cmap->start + i,
cmap_red, cmap_green,
cmap_blue);
}
return 0;
}
static int pmagbbfb_get_var(struct fb_var_screeninfo *var, int con,
struct fb_info *info)
{
struct pmagbbfb_par par;
if (con == -1) {
pmagbbfb_get_par(&par);
pmagbbfb_encode_var(var, &par);
} else
*var = fb_display[con].var;
return 0;
}
static int pmagbbfb_set_var(struct fb_var_screeninfo *var, int con,
struct fb_info *info)
{
int err;
if ((err = pmagbb_do_fb_set_var(var, 1)))
return err;
return 0;
}
static void pmagbbfb_encode_fix(struct fb_fix_screeninfo *fix,
struct pmagbbfb_par *par,
struct pmagb_b_my_fb_info *info)
{
memset(fix, 0, sizeof(struct fb_fix_screeninfo));
strcpy(fix->id, "PMAGB-BA");
fix->smem_start = info->pmagbb_fb_start;
fix->smem_len = info->pmagbb_fb_size;
fix->type = FB_TYPE_PACKED_PIXELS;
fix->visual = FB_VISUAL_PSEUDOCOLOR;
fix->xpanstep = 0;
fix->ypanstep = 0;
fix->ywrapstep = 0;
fix->line_length = info->pmagbb_fb_line_length;
}
static int pmagbbfb_get_fix(struct fb_fix_screeninfo *fix, int con,
struct fb_info *info)
static int pmagbbfb_setcolreg(unsigned regno, unsigned red, unsigned green,
unsigned blue, unsigned transp,
struct fb_info *info)
{
struct pmagbbfb_par par;
struct pmagb_b_ramdac_regs *bt459_regs = (struct pmagb_b_ramdac_regs *) info->par;
if (regno >= info->cmap.len)
return 1;
pmagbbfb_get_par(&par);
pmagbbfb_encode_fix(fix, &par, (struct pmagb_b_my_fb_info *) info);
red >>= 8; /* The cmap fields are 16 bits */
green >>= 8; /* wide, but the harware colormap */
blue >>= 8; /* registers are only 8 bits wide */
bt459_regs->addr_low = (__u8) regno;
bt459_regs->addr_hi = 0;
bt459_regs->cmap = red;
bt459_regs->cmap = green;
bt459_regs->cmap = blue;
return 0;
}
static int pmagbbfb_switch(int con, struct fb_info *info)
{
pmagbb_do_fb_set_var(&fb_display[con].var, 1);
info->currcon = con;
return 0;
}
static void pmagbbfb_set_disp(int con, struct pmagb_b_my_fb_info *info)
{
struct fb_fix_screeninfo fix;
struct display *display;
if (con >= 0)
display = &fb_display[con];
else
display = &disp; /* used during initialization */
pmagbbfb_get_fix(&fix, con, (struct fb_info *) info);
display->visual = fix.visual;
display->type = fix.type;
display->type_aux = fix.type_aux;
display->ypanstep = fix.ypanstep;
display->ywrapstep = fix.ywrapstep;
display->line_length = fix.line_length;
display->next_line = fix.line_length;
display->can_soft_blank = 0;
display->inverse = 0;
display->dispsw = &fbcon_cfb8;
}
static struct fb_ops pmagbbfb_ops = {
owner: THIS_MODULE,
fb_get_fix: pmagbbfb_get_fix,
fb_get_var: pmagbbfb_get_var,
fb_set_var: pmagbbfb_set_var,
fb_get_cmap: pmagbbfb_get_cmap,
fb_set_cmap: pmagbbfb_set_cmap,
fb_get_fix: gen_get_fix,
fb_get_var: gen_get_var,
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,
fb_imageblit: cfb_imageblit,
};
int __init pmagbbfb_init_one(int slot)
{
unsigned long base_addr = get_tc_base_addr(slot);
struct pmagb_b_my_fb_info *ip =
(struct pmagb_b_my_fb_info *) &pmagbb_fb_info[slot];
struct fb_info *info = &pmagbb_fb_info[slot];
struct display *disp = &pmagbb_disp[slot];
printk("PMAGB-BA framebuffer in slot %d\n", slot);
/*
* Framebuffer display memory base address and friends
*/
ip->bt459_regs =
(struct pmagb_b_ramdac_regs *) (base_addr +
PMAGB_B_BT459_OFFSET);
ip->pmagbb_fb_start = base_addr + PMAGB_B_ONBOARD_FBMEM_OFFSET;
ip->pmagbb_fb_size = 1280 * 1024;
ip->pmagbb_fb_line_length = 1280;
pmagbbfb_fix.smem_start = base_addr + PMAGB_B_ONBOARD_FBMEM_OFFSET;
info->par = (base_addr + PMAGB_B_BT459_OFFSET);
/*
* Configure the Bt459 RAM DAC
*/
pmagbbfb_erase_cursor(ip);
/*
* Fill in the available video resolution
*/
pmagbbfb_defined.xres = 1280;
pmagbbfb_defined.yres = 1024;
pmagbbfb_defined.xres_virtual = 1280;
pmagbbfb_defined.yres_virtual = 1024;
pmagbbfb_defined.bits_per_pixel = 8;
pmagbbfb_erase_cursor((struct pmagb_b_ramdac_regs *) info->par);
/*
* Let there be consoles..
*/
strcpy(ip->info.modename, "PMAGB-BA");
ip->info.changevar = NULL;
ip->info.node = NODEV;
ip->info.fbops = &pmagbbfb_ops;
ip->info.screen_base = (char *) ip->pmagbb_fb_start;
fix->smem_len = info->pmagbb_fb_size;
ip->info.disp = &disp;
ip->info.currcon = -1;
ip->info.switch_con = &pmagbbfb_switch;
ip->info.updatevar = &pmagbb_fb_update_var;
ip->info.flags = FBINFO_FLAG_DEFAULT;
pmagbb_do_fb_set_var(&pmagbbfb_defined, 1);
pmagbbfb_get_var(&disp.var, -1, (struct fb_info *) ip);
pmagbbfb_set_disp(-1, ip);
if (register_framebuffer((struct fb_info *) ip) < 0)
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;
return 0;
}
......
......@@ -298,7 +298,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,
static int xxxfb_pan_display(struct fb_var_screeninfo *var, int con,
const struct fb_info *info)
{
/* ... */
......
This diff is collapsed.
This diff is collapsed.
......@@ -90,7 +90,7 @@ 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,
static int vfb_pan_display(struct fb_var_screeninfo *var, int con,
struct fb_info *info);
static int vfb_mmap(struct fb_info *info, struct file *file,
struct vm_area_struct *vma);
......@@ -358,7 +358,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,
static int vfb_pan_display(struct fb_var_screeninfo *var, int con,
struct fb_info *info)
{
if (var->vmode & FB_VMODE_YWRAP) {
......
/*
* linux/drivers/video/neofb.h -- NeoMagic Framebuffer Driver
* linux/include/video/neo_reg.h -- NeoMagic Framebuffer Driver
*
* Copyright (c) 2001 Denis Oliver Kropp <dok@convergence.de>
*
......@@ -8,6 +8,54 @@
* archive for more details.
*/
#define NEO_BS0_BLT_BUSY 0x00000001
#define NEO_BS0_FIFO_AVAIL 0x00000002
#define NEO_BS0_FIFO_PEND 0x00000004
#define NEO_BC0_DST_Y_DEC 0x00000001
#define NEO_BC0_X_DEC 0x00000002
#define NEO_BC0_SRC_TRANS 0x00000004
#define NEO_BC0_SRC_IS_FG 0x00000008
#define NEO_BC0_SRC_Y_DEC 0x00000010
#define NEO_BC0_FILL_PAT 0x00000020
#define NEO_BC0_SRC_MONO 0x00000040
#define NEO_BC0_SYS_TO_VID 0x00000080
#define NEO_BC1_DEPTH8 0x00000100
#define NEO_BC1_DEPTH16 0x00000200
#define NEO_BC1_X_320 0x00000400
#define NEO_BC1_X_640 0x00000800
#define NEO_BC1_X_800 0x00000c00
#define NEO_BC1_X_1024 0x00001000
#define NEO_BC1_X_1152 0x00001400
#define NEO_BC1_X_1280 0x00001800
#define NEO_BC1_X_1600 0x00001c00
#define NEO_BC1_DST_TRANS 0x00002000
#define NEO_BC1_MSTR_BLT 0x00004000
#define NEO_BC1_FILTER_Z 0x00008000
#define NEO_BC2_WR_TR_DST 0x00800000
#define NEO_BC3_SRC_XY_ADDR 0x01000000
#define NEO_BC3_DST_XY_ADDR 0x02000000
#define NEO_BC3_CLIP_ON 0x04000000
#define NEO_BC3_FIFO_EN 0x08000000
#define NEO_BC3_BLT_ON_ADDR 0x10000000
#define NEO_BC3_SKIP_MAPPING 0x80000000
#define NEO_MODE1_DEPTH8 0x0100
#define NEO_MODE1_DEPTH16 0x0200
#define NEO_MODE1_DEPTH24 0x0300
#define NEO_MODE1_X_320 0x0400
#define NEO_MODE1_X_640 0x0800
#define NEO_MODE1_X_800 0x0c00
#define NEO_MODE1_X_1024 0x1000
#define NEO_MODE1_X_1152 0x1400
#define NEO_MODE1_X_1280 0x1800
#define NEO_MODE1_X_1600 0x1c00
#define NEO_MODE1_BLT_ON_ADDR 0x2000
#ifdef __KERNEL__
#ifdef NEOFB_DEBUG
# define DBG(x) printk (KERN_DEBUG "neofb: %s\n", (x));
......@@ -15,7 +63,6 @@
# define DBG(x)
#endif
#define PCI_CHIP_NM2070 0x0001
#define PCI_CHIP_NM2090 0x0002
#define PCI_CHIP_NM2093 0x0003
......@@ -77,9 +124,7 @@ typedef volatile struct {
#define NEO_EXT_GR_MAX 0xC7
struct neofb_par {
int depth;
unsigned char MiscOutReg; /* Misc */
unsigned char CRTC[25]; /* Crtc Controller */
unsigned char Sequencer[5]; /* Video Sequencer */
......@@ -113,31 +158,11 @@ struct neofb_par {
unsigned char VCLK3NumeratorHigh;
unsigned char VCLK3Denominator;
unsigned char VerticalExt;
};
struct neofb_info {
struct fb_info fb;
struct display_switch *dispsw;
struct pci_dev *pcidev;
int accel;
char *name;
struct {
u8 *vbase;
u32 pbase;
u32 len;
#ifdef CONFIG_MTRR
int mtrr;
int mtrr;
#endif
} video;
struct {
u8 *vbase;
u32 pbase;
u32 len;
} mmio;
u8 *mmio_vbase;
Neo2200 *neo2200;
......@@ -151,20 +176,14 @@ struct neofb_info {
int lcd_stretch;
int internal_display;
int external_display;
struct {
u16 red, green, blue, transp;
} palette[NR_PALETTE];
};
typedef struct {
int x_res;
int y_res;
int mode;
} biosMode;
/* vga IO functions */
static inline u8 VGArCR (u8 index)
{
......@@ -241,51 +260,5 @@ static inline void VGAwMISC (u8 value)
{
outb (value, 0x3c2);
}
#endif
#define NEO_BS0_BLT_BUSY 0x00000001
#define NEO_BS0_FIFO_AVAIL 0x00000002
#define NEO_BS0_FIFO_PEND 0x00000004
#define NEO_BC0_DST_Y_DEC 0x00000001
#define NEO_BC0_X_DEC 0x00000002
#define NEO_BC0_SRC_TRANS 0x00000004
#define NEO_BC0_SRC_IS_FG 0x00000008
#define NEO_BC0_SRC_Y_DEC 0x00000010
#define NEO_BC0_FILL_PAT 0x00000020
#define NEO_BC0_SRC_MONO 0x00000040
#define NEO_BC0_SYS_TO_VID 0x00000080
#define NEO_BC1_DEPTH8 0x00000100
#define NEO_BC1_DEPTH16 0x00000200
#define NEO_BC1_X_320 0x00000400
#define NEO_BC1_X_640 0x00000800
#define NEO_BC1_X_800 0x00000c00
#define NEO_BC1_X_1024 0x00001000
#define NEO_BC1_X_1152 0x00001400
#define NEO_BC1_X_1280 0x00001800
#define NEO_BC1_X_1600 0x00001c00
#define NEO_BC1_DST_TRANS 0x00002000
#define NEO_BC1_MSTR_BLT 0x00004000
#define NEO_BC1_FILTER_Z 0x00008000
#define NEO_BC2_WR_TR_DST 0x00800000
#define NEO_BC3_SRC_XY_ADDR 0x01000000
#define NEO_BC3_DST_XY_ADDR 0x02000000
#define NEO_BC3_CLIP_ON 0x04000000
#define NEO_BC3_FIFO_EN 0x08000000
#define NEO_BC3_BLT_ON_ADDR 0x10000000
#define NEO_BC3_SKIP_MAPPING 0x80000000
#define NEO_MODE1_DEPTH8 0x0100
#define NEO_MODE1_DEPTH16 0x0200
#define NEO_MODE1_DEPTH24 0x0300
#define NEO_MODE1_X_320 0x0400
#define NEO_MODE1_X_640 0x0800
#define NEO_MODE1_X_800 0x0c00
#define NEO_MODE1_X_1024 0x1000
#define NEO_MODE1_X_1152 0x1400
#define NEO_MODE1_X_1280 0x1800
#define NEO_MODE1_X_1600 0x1c00
#define NEO_MODE1_BLT_ON_ADDR 0x2000
/*
* Permedia2 framebuffer driver definitions.
* Copyright (c) 1998-2000 Ilario Nardinocchi (nardinoc@CS.UniBO.IT)
* --------------------------------------------------------------------------
* $Id: pm2fb.h,v 1.26 2000/09/19 00:11:53 illo Exp $
* --------------------------------------------------------------------------
* This file is subject to the terms and conditions of the GNU General Public
* License. See the file COPYING in the main directory of this archive
* for more details.
*/
#ifndef PM2FB_H
#define PM2FB_H
#define PM2_REFERENCE_CLOCK 14318 /* in KHz */
#define PM2_MAX_PIXCLOCK 230000 /* in KHz */
#define PM2_REGS_SIZE 0x10000
#define PM2TAG(r) (u32 )(((r)-0x8000)>>3)
/*****************************************************************************
* Permedia2 registers used in the framebuffer
*****************************************************************************/
#define PM2R_RESET_STATUS 0x0000
#define PM2R_IN_FIFO_SPACE 0x0018
#define PM2R_OUT_FIFO_WORDS 0x0020
#define PM2R_APERTURE_ONE 0x0050
#define PM2R_APERTURE_TWO 0x0058
#define PM2R_FIFO_DISCON 0x0068
#define PM2R_CHIP_CONFIG 0x0070
#define PM2R_REBOOT 0x1000
#define PM2R_MEM_CONTROL 0x1040
#define PM2R_BOOT_ADDRESS 0x1080
#define PM2R_MEM_CONFIG 0x10c0
#define PM2R_BYPASS_WRITE_MASK 0x1100
#define PM2R_FRAMEBUFFER_WRITE_MASK 0x1140
#define PM2R_OUT_FIFO 0x2000
#define PM2R_SCREEN_BASE 0x3000
#define PM2R_SCREEN_STRIDE 0x3008
#define PM2R_H_TOTAL 0x3010
#define PM2R_HG_END 0x3018
#define PM2R_HB_END 0x3020
#define PM2R_HS_START 0x3028
#define PM2R_HS_END 0x3030
#define PM2R_V_TOTAL 0x3038
#define PM2R_VB_END 0x3040
#define PM2R_VS_START 0x3048
#define PM2R_VS_END 0x3050
#define PM2R_VIDEO_CONTROL 0x3058
#define PM2R_LINE_COUNT 0x3070
#define PM2R_FIFO_CONTROL 0x3078
#define PM2R_RD_PALETTE_WRITE_ADDRESS 0x4000
#define PM2R_RD_PALETTE_DATA 0x4008
#define PM2R_RD_PIXEL_MASK 0x4010
#define PM2R_RD_PALETTE_READ_ADDRESS 0x4018
#define PM2R_RD_INDEXED_DATA 0x4050
#define PM2R_START_X_DOM 0x8000
#define PM2R_D_X_DOM 0x8008
#define PM2R_START_X_SUB 0x8010
#define PM2R_D_X_SUB 0x8018
#define PM2R_START_Y 0x8020
#define PM2R_D_Y 0x8028
#define PM2R_COUNT 0x8030
#define PM2R_RENDER 0x8038
#define PM2R_RASTERIZER_MODE 0x80a0
#define PM2R_RECTANGLE_ORIGIN 0x80d0
#define PM2R_RECTANGLE_SIZE 0x80d8
#define PM2R_PACKED_DATA_LIMITS 0x8150
#define PM2R_SCISSOR_MODE 0x8180
#define PM2R_SCREEN_SIZE 0x8198
#define PM2R_AREA_STIPPLE_MODE 0x81a0
#define PM2R_WINDOW_ORIGIN 0x81c8
#define PM2R_TEXTURE_ADDRESS_MODE 0x8380
#define PM2R_TEXTURE_MAP_FORMAT 0x8588
#define PM2R_TEXTURE_DATA_FORMAT 0x8590
#define PM2R_TEXTURE_READ_MODE 0x8670
#define PM2R_TEXEL_LUT_MODE 0x8678
#define PM2R_TEXTURE_COLOR_MODE 0x8680
#define PM2R_FOG_MODE 0x8690
#define PM2R_COLOR_DDA_MODE 0x87e0
#define PM2R_ALPHA_BLEND_MODE 0x8810
#define PM2R_DITHER_MODE 0x8818
#define PM2R_FB_SOFT_WRITE_MASK 0x8820
#define PM2R_LOGICAL_OP_MODE 0x8828
#define PM2R_LB_READ_MODE 0x8880
#define PM2R_LB_READ_FORMAT 0x8888
#define PM2R_LB_SOURCE_OFFSET 0x8890
#define PM2R_LB_WINDOW_BASE 0x88b8
#define PM2R_LB_WRITE_FORMAT 0x88c8
#define PM2R_STENCIL_MODE 0x8988
#define PM2R_DEPTH_MODE 0x89a0
#define PM2R_FB_READ_MODE 0x8a80
#define PM2R_FB_SOURCE_OFFSET 0x8a88
#define PM2R_FB_PIXEL_OFFSET 0x8a90
#define PM2R_FB_WINDOW_BASE 0x8ab0
#define PM2R_FB_WRITE_MODE 0x8ab8
#define PM2R_FB_HARD_WRITE_MASK 0x8ac0
#define PM2R_FB_BLOCK_COLOR 0x8ac8
#define PM2R_FB_READ_PIXEL 0x8ad0
#define PM2R_FILTER_MODE 0x8c00
#define PM2R_SYNC 0x8c40
#define PM2R_YUV_MODE 0x8f00
#define PM2R_STATISTICS_MODE 0x8c08
#define PM2R_FB_SOURCE_DELTA 0x8d88
#define PM2R_CONFIG 0x8d90
#define PM2R_DELTA_MODE 0x9300
/* Permedia2v */
#define PM2VR_RD_INDEX_LOW 0x4020
#define PM2VR_RD_INDEX_HIGH 0x4028
#define PM2VR_RD_INDEXED_DATA 0x4030
/* Permedia2 RAMDAC indexed registers */
#define PM2I_RD_CURSOR_CONTROL 0x06
#define PM2I_RD_COLOR_MODE 0x18
#define PM2I_RD_MODE_CONTROL 0x19
#define PM2I_RD_MISC_CONTROL 0x1e
#define PM2I_RD_PIXEL_CLOCK_A1 0x20
#define PM2I_RD_PIXEL_CLOCK_A2 0x21
#define PM2I_RD_PIXEL_CLOCK_A3 0x22
#define PM2I_RD_PIXEL_CLOCK_STATUS 0x29
#define PM2I_RD_MEMORY_CLOCK_1 0x30
#define PM2I_RD_MEMORY_CLOCK_2 0x31
#define PM2I_RD_MEMORY_CLOCK_3 0x32
#define PM2I_RD_MEMORY_CLOCK_STATUS 0x33
#define PM2I_RD_COLOR_KEY_CONTROL 0x40
#define PM2I_RD_OVERLAY_KEY 0x41
#define PM2I_RD_RED_KEY 0x42
#define PM2I_RD_GREEN_KEY 0x43
#define PM2I_RD_BLUE_KEY 0x44
/* Permedia2v extensions */
#define PM2VI_RD_MISC_CONTROL 0x000
#define PM2VI_RD_SYNC_CONTROL 0x001
#define PM2VI_RD_DAC_CONTROL 0x002
#define PM2VI_RD_PIXEL_SIZE 0x003
#define PM2VI_RD_COLOR_FORMAT 0x004
#define PM2VI_RD_CURSOR_MODE 0x005
#define PM2VI_RD_CURSOR_X_LOW 0x007
#define PM2VI_RD_CURSOR_X_HIGH 0x008
#define PM2VI_RD_CURSOR_Y_LOW 0x009
#define PM2VI_RD_CURSOR_Y_HIGH 0x00A
#define PM2VI_RD_CURSOR_X_HOT 0x00B
#define PM2VI_RD_CURSOR_Y_HOT 0x00C
#define PM2VI_RD_CLK0_PRESCALE 0x201
#define PM2VI_RD_CLK0_FEEDBACK 0x202
#define PM2VI_RD_CLK0_POSTSCALE 0x203
#define PM2VI_RD_CLK1_PRESCALE 0x204
#define PM2VI_RD_CLK1_FEEDBACK 0x205
#define PM2VI_RD_CLK1_POSTSCALE 0x206
#define PM2VI_RD_CURSOR_PALETTE 0x303
#define PM2VI_RD_CURSOR_PATTERN 0x400
/* Fields and flags */
#define PM2F_RENDER_AREASTIPPLE (1L<<0)
#define PM2F_RENDER_FASTFILL (1L<<3)
#define PM2F_RENDER_PRIMITIVE_MASK (3L<<6)
#define PM2F_RENDER_LINE 0
#define PM2F_RENDER_TRAPEZOID (1L<<6)
#define PM2F_RENDER_POINT (2L<<6)
#define PM2F_RENDER_RECTANGLE (3L<<6)
#define PM2F_SYNCHRONIZATION (1L<<10)
#define PM2F_PLL_LOCKED 0x10
#define PM2F_BEING_RESET (1L<<31)
#define PM2F_DATATYPE_COLOR 0x8000
#define PM2F_VGA_ENABLE 0x02
#define PM2F_VGA_FIXED 0x04
#define PM2F_FB_WRITE_ENABLE 0x01
#define PM2F_FB_READ_SOURCE_ENABLE 0x0200
#define PM2F_RD_PALETTE_WIDTH_8 0x02
#define PM2F_PART_PROD_MASK 0x01ff
#define PM2F_SCREEN_SCISSOR_ENABLE 0x02
#define PM2F_DATA_64_ENABLE 0x00010000
#define PM2F_BLANK_LOW 0x02
#define PM2F_HSYNC_MASK 0x18
#define PM2F_VSYNC_MASK 0x60
#define PM2F_HSYNC_ACT_HIGH 0x08
#define PM2F_HSYNC_FORCED_LOW 0x10
#define PM2F_HSYNC_ACT_LOW 0x18
#define PM2F_VSYNC_ACT_HIGH 0x20
#define PM2F_VSYNC_FORCED_LOW 0x40
#define PM2F_VSYNC_ACT_LOW 0x60
#define PM2F_LINE_DOUBLE 0x04
#define PM2F_VIDEO_ENABLE 0x01
#define PM2F_RD_GUI_ACTIVE 0x10
#define PM2F_RD_COLOR_MODE_RGB 0x20
#define PM2F_DELTA_ORDER_RGB (1L<<18)
#define PM2F_RD_TRUECOLOR 0x80
#define PM2F_NO_ALPHA_BUFFER 0x10
#define PM2F_TEXTEL_SIZE_16 0x00080000
#define PM2F_TEXTEL_SIZE_32 0x00100000
#define PM2F_TEXTEL_SIZE_4 0x00180000
#define PM2F_TEXTEL_SIZE_24 0x00200000
#define PM2F_INCREASE_X (1L<<21)
#define PM2F_INCREASE_Y (1L<<22)
#define PM2F_CONFIG_FB_WRITE_ENABLE (1L<<3)
#define PM2F_CONFIG_FB_PACKED_DATA (1L<<2)
#define PM2F_CONFIG_FB_READ_DEST_ENABLE (1L<<1)
#define PM2F_CONFIG_FB_READ_SOURCE_ENABLE (1L<<0)
#define PM2F_COLOR_KEY_TEST_OFF (1L<<4)
#define PM2F_MEM_CONFIG_RAM_MASK (3L<<29)
#define PM2F_MEM_BANKS_1 0L
#define PM2F_MEM_BANKS_2 (1L<<29)
#define PM2F_MEM_BANKS_3 (2L<<29)
#define PM2F_MEM_BANKS_4 (3L<<29)
typedef enum {
PM2_TYPE_PERMEDIA2,
PM2_TYPE_PERMEDIA2V
} pm2type_t;
#endif /* PM2FB_H */
/*****************************************************************************
* That's all folks!
*****************************************************************************/
/*
* linux/drivers/video/tx3912fb.h
* linux/include/video/tx3912.h
*
* Copyright (C) 2001 Steven Hill (sjhill@realitydiluted.com)
*
......@@ -60,69 +60,3 @@
/* Video Control 4 Register */
#define TX3912_VIDCTRL4_VIDBASELO_MASK 0x000ffff0
/*
* Begin platform specific configurations
*/
#if defined(CONFIG_NINO_4MB) || defined(CONFIG_NINO_8MB)
#define FB_X_RES 240
#define FB_Y_RES 320
#if defined(CONFIG_FBCON_CFB4)
#define FB_BPP 4
#else
#if defined(CONFIG_FBCON_CFB2)
#define FB_BPP 2
#else
#define FB_BPP 1
#endif
#endif
#define FB_IS_GREY 1
#define FB_IS_INVERSE 0
#endif
#ifdef CONFIG_NINO_16MB
#define FB_X_RES 240
#define FB_Y_RES 320
#define FB_BPP 8
#define FB_IS_GREY 0
#define FB_IS_INVERSE 0
#endif
/*
* Define virtual resolutions if necessary
*/
#ifndef FB_X_VIRTUAL_RES
#define FB_X_VIRTUAL_RES FB_X_RES
#endif
#ifndef FB_Y_VIRTUAL_RES
#define FB_Y_VIRTUAL_RES FB_Y_RES
#endif
/*
* Framebuffer address and size
*/
u_long tx3912fb_paddr = 0;
u_long tx3912fb_vaddr = 0;
u_long tx3912fb_size = (FB_X_RES * FB_Y_RES * FB_BPP / 8);
/*
* Framebuffer info structure
*/
static struct fb_var_screeninfo tx3912fb_info = {
FB_X_RES, FB_Y_RES,
FB_X_VIRTUAL_RES, FB_Y_VIRTUAL_RES,
0, 0,
FB_BPP, FB_IS_GREY,
{0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0},
0, FB_ACTIVATE_NOW,
-1, -1, 0, 20000,
64, 64, 32, 32, 64, 2,
0, FB_VMODE_NONINTERLACED,
{0,0,0,0,0,0}
};
/*
* Framebuffer name
*/
static char TX3912FB_NAME[16] = "tx3912fb";
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