From: James S. <jsi...@us...> - 2002-06-03 22:45:02
|
Update of /cvsroot/linuxconsole/ruby/linux/drivers/video In directory usw-pr-cvs1:/tmp/cvs-serv23928/linux/drivers/video Modified Files: Config.in Makefile anakinfb.c cfbimgblt.c fbmem.c fm2fb.c g364fb.c hitfb.c hpfb.c pm3fb.c pm3fb.h q40fb.c skeletonfb.c vesafb.c vfb.c Removed Files: hgafb.c Log Message: Synced to 2.5.19 Index: Config.in =================================================================== RCS file: /cvsroot/linuxconsole/ruby/linux/drivers/video/Config.in,v retrieving revision 1.61 retrieving revision 1.62 diff -u -d -r1.61 -r1.62 --- Config.in 16 Apr 2002 17:41:51 -0000 1.61 +++ Config.in 3 Jun 2002 22:44:58 -0000 1.62 @@ -15,10 +15,6 @@ comment 'Frame-buffer support' if [ "$CONFIG_EXPERIMENTAL" = "y" ]; then - if [ "$CONFIG_PCI" = "y" ]; then - tristate ' nVidia Riva support (EXPERIMENTAL)' CONFIG_FB_RIVA - tristate ' Permedia3 support (EXPERIMENTAL)' CONFIG_FB_PM3 - fi if [ "$CONFIG_AMIGA" = "y" -o "$CONFIG_PCI" = "y" ]; then tristate ' Cirrus Logic support (EXPERIMENTAL)' CONFIG_FB_CLGEN tristate ' Permedia2 support (EXPERIMENTAL)' CONFIG_FB_PM2 @@ -142,6 +138,7 @@ fi fi if [ "$CONFIG_PCI" != "n" ]; then + tristate ' nVidia Riva support (EXPERIMENTAL)' CONFIG_FB_RIVA tristate ' Matrox acceleration (EXPERIMENTAL)' CONFIG_FB_MATROX if [ "$CONFIG_FB_MATROX" != "n" ]; then bool ' Millennium I/II support' CONFIG_FB_MATROX_MILLENIUM @@ -168,6 +165,7 @@ tristate ' 3Dfx Banshee/Voodoo3 display support (EXPERIMENTAL)' CONFIG_FB_3DFX tristate ' 3Dfx Voodoo Graphics (sst1) support (EXPERIMENTAL)' CONFIG_FB_VOODOO1 fi + tristate ' Permedia3 support (EXPERIMENTAL)' CONFIG_FB_PM3 dep_tristate ' SIS acceleration (EXPERIMENTAL)' CONFIG_FB_SIS $CONFIG_EXPERIMENTAL if [ "$CONFIG_FB_SIS" != "n" ]; then bool ' SIS 630/540/730 support' CONFIG_FB_SIS_300 Index: Makefile =================================================================== RCS file: /cvsroot/linuxconsole/ruby/linux/drivers/video/Makefile,v retrieving revision 1.47 retrieving revision 1.48 diff -u -d -r1.47 -r1.48 --- Makefile 25 May 2002 20:32:03 -0000 1.47 +++ Makefile 3 Jun 2002 22:44:58 -0000 1.48 @@ -40,8 +40,8 @@ obj-$(CONFIG_FB_AMIGA) += amifb.o obj-$(CONFIG_FB_PM2) += pm2fb.o obj-$(CONFIG_FB_PM3) += pm3fb.o cfbfillrect.o cfbcopyarea.o cfbimgblt.o -obj-$(CONFIG_FB_APOLLO) += dnfb.o -obj-$(CONFIG_FB_Q40) += q40fb.o +obj-$(CONFIG_FB_APOLLO) += dnfb.o cfbfillrect.o cfbcopyarea.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 cfbfillrect.o cfbcopyarea.o cfbimgblt.o obj-$(CONFIG_FB_RADEON) += radeonfb.o @@ -50,13 +50,13 @@ 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_CLPS711X) += clps711xfb.o -obj-$(CONFIG_FB_CYBER) += cyberfb.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 obj-$(CONFIG_FB_SGIVW) += sgivwfb.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 cfbfillrect.o cfbcopyarea.o cfbimgblt.o obj-$(CONFIG_FB_IMSTT) += imsttfb.o obj-$(CONFIG_FB_RETINAZ3) += retz3fb.o @@ -66,8 +66,8 @@ obj-$(CONFIG_FB_VESA) += vesafb.o cfbfillrect.o cfbcopyarea.o cfbimgblt.o obj-$(CONFIG_FB_VGA16) += vga16fb.o vga.o obj-$(CONFIG_FB_VIRGE) += virgefb.o -obj-$(CONFIG_FB_G364) += g364fb.o -obj-$(CONFIG_FB_FM2) += fm2fb.o +obj-$(CONFIG_FB_G364) += g364fb.o cfbfillrect.o cfbcopyarea.o cfbimgblt.o +obj-$(CONFIG_FB_FM2) += fm2fb.o cfbfillrect.o cfbcopyarea.o cfbimgblt.o obj-$(CONFIG_FB_CREATOR) += creatorfb.o sbusfb.o obj-$(CONFIG_FB_CGSIX) += cgsixfb.o sbusfb.o obj-$(CONFIG_FB_BWTWO) += bwtwofb.o sbusfb.o @@ -77,9 +77,9 @@ 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_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 obj-$(CONFIG_FB_MATROX) += matrox/ @@ -97,7 +97,7 @@ obj-$(CONFIG_FB_E1355) += epson1355fb.o obj-$(CONFIG_FB_PVR2) += pvr2fb.o obj-$(CONFIG_FB_VOODOO1) += sstfb.o -obj-$(CONFIG_FB_ANAKIN) += anakinfb.o +obj-$(CONFIG_FB_ANAKIN) += anakinfb.o cfbfillrect.o cfbcopyarea.o cfbimgblt.o obj-$(CONFIG_FB_SIMPLE) += sfb.o cfbfillrect.o cfbcopyarea.o cfbimgblt.o obj-$(CONFIG_FB_SED1345) += sed1345fb.o cfbfillrect.o cfbcopyarea.o cfbimgblt.o obj-$(CONFIG_FB_R3912) += r3912fb.o cfbfillrect.o cfbcopyarea.o cfbimgblt.o Index: anakinfb.c =================================================================== RCS file: /cvsroot/linuxconsole/ruby/linux/drivers/video/anakinfb.c,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- anakinfb.c 24 Apr 2002 18:56:51 -0000 1.2 +++ anakinfb.c 3 Jun 2002 22:44:58 -0000 1.3 @@ -20,7 +20,7 @@ #include <asm/io.h> -static u16 colreg[16]; +static u32 colreg[16]; static struct fb_info fb_info; static struct fb_var_screeninfo anakinfb_var = { @@ -73,20 +73,21 @@ { memset(&fb_info, 0, sizeof(struct fb_info)); - fb_info.node = -1; + fb_info.node = NODEV; fb_info.flags = FBINFO_FLAG_DEFAULT; fb_info.fbops = &anakinfb_ops; fb_info.var = anakinfb_var; fb_info.fix = anakinfb_fix; - + if (!(request_mem_region(VGA_START, VGA_SIZE, "vga"))) 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); return -EIO; } + if (register_framebuffer(&fb_info) < 0) { - iounmap(fb_info.screen_base); + iounmap(display.screen_base); release_mem_region(VGA_START, VGA_SIZE); return -EINVAL; } Index: cfbimgblt.c =================================================================== RCS file: /cvsroot/linuxconsole/ruby/linux/drivers/video/cfbimgblt.c,v retrieving revision 1.13 retrieving revision 1.14 diff -u -d -r1.13 -r1.14 --- cfbimgblt.c 25 May 2002 20:32:03 -0000 1.13 +++ cfbimgblt.c 3 Jun 2002 22:44:58 -0000 1.14 @@ -46,7 +46,7 @@ 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, mask; + unsigned long end_index, end_mask; unsigned long *dst = NULL; u8 *dst1, *src; @@ -89,24 +89,45 @@ 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--) { - mask = 0; + end_mask = 0; for (k = ppw; k > 0; k--) { if (test_bit(l, src)) - mask |= (tmp >> (p->var.bits_per_pixel*(k-1))); + end_mask |= (tmp >> (p->var.bits_per_pixel*(k-1))); l--; if (l < 0) { l = 7; src++; } } - fb_writel((mask & eorx)^bgx, dst); + 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; } } Index: fbmem.c =================================================================== RCS file: /cvsroot/linuxconsole/ruby/linux/drivers/video/fbmem.c,v retrieving revision 1.63 retrieving revision 1.64 diff -u -d -r1.63 -r1.64 --- fbmem.c 6 May 2002 17:29:59 -0000 1.63 +++ fbmem.c 3 Jun 2002 22:44:58 -0000 1.64 @@ -130,10 +130,15 @@ extern int rivafb_setup(char*); extern int tdfxfb_init(void); extern int tdfxfb_setup(char*); +extern int tridentfb_init(void); +extern int tridentfb_setup(char*); extern int sisfb_init(void); extern int sisfb_setup(char*); extern int stifb_init(void); 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_setup(char*); @@ -240,6 +245,9 @@ #ifdef CONFIG_FB_SIS { "sisfb", sisfb_init, sisfb_setup }, #endif +#ifdef CONFIG_FB_TRIDENT + { "trident", tridentfb_init, tridentfb_setup }, +#endif /* * Generic drivers that are used as fallbacks @@ -308,8 +316,8 @@ #ifdef CONFIG_FB_HIT { "hitfb", hitfb_init, NULL }, #endif -#ifdef CONFIG_FB_ANAKIN - { "anakinfb", anakinfb_init, NULL }, +#ifdef CONFIG_FB_TX3912 + { "tx3912", tx3912fb_init, NULL }, #endif #ifdef CONFIG_FB_E1355 { "e1355fb", e1355fb_init, e1355fb_setup }, @@ -317,6 +325,18 @@ #ifdef CONFIG_FB_PVR2 { "pvr2", pvr2fb_init, pvr2fb_setup }, #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 + { "sst", sstfb_init, sstfb_setup }, +#endif #ifdef CONFIG_FB_SED1345 { "sed1345fb", sed1345fb_init, NULL }, #endif @@ -328,9 +348,6 @@ #endif #ifdef CONFIG_FB_VR4181 { "vr4181fb", vr4181fb_init, NULL }, -#endif -#ifdef CONFIG_FB_TX3912 - { "tx3912", tx3912fb_init, NULL }, #endif /* Index: fm2fb.c =================================================================== RCS file: /cvsroot/linuxconsole/ruby/linux/drivers/video/fm2fb.c,v retrieving revision 1.10 retrieving revision 1.11 diff -u -d -r1.10 -r1.11 --- fm2fb.c 27 Mar 2002 20:58:09 -0000 1.10 +++ fm2fb.c 3 Jun 2002 22:44:58 -0000 1.11 @@ -127,8 +127,6 @@ static volatile unsigned char *fm2fb_reg; -#define arraysize(x) (sizeof(x)/sizeof(*(x))) - static struct fb_info fb_info; static u32 pseudo_palette[17]; @@ -257,7 +255,6 @@ if (fm2fb_mode == -1) fm2fb_mode = FM2FB_MODE_PAL; - strcpy(fb_info.modename, fb_fix.id); fb_info.node = NODEV; fb_info.fbops = &fm2fb_ops; fb_info.var = fb_var_modes[fm2fb_mode]; @@ -265,8 +262,6 @@ fb_info.pseudo_palette = pseudo_palette; fb_info.fix = fb_fix; fb_info.flags = FBINFO_FLAG_DEFAULT; - - fb_alloc_cmap(&fb_info.cmap, 16, 0); if (register_framebuffer(&fb_info) < 0) return -EINVAL; Index: g364fb.c =================================================================== RCS file: /cvsroot/linuxconsole/ruby/linux/drivers/video/g364fb.c,v retrieving revision 1.7 retrieving revision 1.8 diff -u -d -r1.7 -r1.8 --- g364fb.c 21 May 2002 04:06:06 -0000 1.7 +++ g364fb.c 3 Jun 2002 22:44:58 -0000 1.8 @@ -36,9 +36,9 @@ */ #define G364_MEM_BASE 0xe4400000 #define G364_PORT_BASE 0xe4000000 -#define ID_REG 0xe4000000 /* Read only */ +#define ID_REG 0xe4000000 /* Read only */ #define BOOT_REG 0xe4080000 -#define TIMING_REG 0xe4080108 /* to 0x080170 - DON'T TOUCH! */ +#define TIMING_REG 0xe4080108 /* to 0x080170 - DON'T TOUCH! */ #define DISPLAY_REG 0xe4080118 #define VDISPLAY_REG 0xe4080150 #define MASK_REG 0xe4080200 @@ -62,15 +62,15 @@ #define OP_MODE 0x000008 #define INTL_STAND 0x000004 #define SCRN_FORM 0x000002 -#define ENABLE_VTG 0x000001 +#define ENABLE_VTG 0x000001 #define TOP_REG 0xe4080400 -#define CURS_PAL_REG 0xe4080508 /* to 0x080518 */ -#define CHKSUM_REG 0xe4080600 /* to 0x080610 - unused */ +#define CURS_PAL_REG 0xe4080508 /* to 0x080518 */ +#define CHKSUM_REG 0xe4080600 /* to 0x080610 - unused */ #define CURS_POS_REG 0xe4080638 #define CLR_PAL_REG 0xe4080800 /* to 0x080ff8 */ #define CURS_PAT_REG 0xe4081000 /* to 0x081ff8 */ -#define MON_ID_REG 0xe4100000 /* unused */ -#define RESET_REG 0xe4180000 /* Write only */ +#define MON_ID_REG 0xe4100000 /* unused */ +#define RESET_REG 0xe4180000 /* Write only */ static struct fb_info fb_info; @@ -84,21 +84,21 @@ }; static struct fb_var_screeninfo fb_var __initdata = { - bits_per_pixel: 8, - red: {0, 8, 0}, - green: {0, 8, 0}, - blue: {0, 8, 0}, - activate: FB_ACTIVATE_NOW, - height: -1, - width: -1, - pixclock: 39722, - left_margin: 40, - right_margin: 24, - upper_margin: 32, - lower_margin: 11, - hsync_len: 96, - vsync_len: 2, - vmode: FB_VMODE_NONINTERLACED, + bits_per_pixel: 8, + red: { 0, 8, 0 }, + green: { 0, 8, 0 }, + blue: { 0, 8, 0 }, + activate: FB_ACTIVATE_NOW, + height: -1, + width: -1, + pixclock: 39722, + left_margin: 40, + right_margin: 24, + upper_margin: 32, + lower_margin: 11, + hsync_len: 96, + vsync_len: 2, + vmode: FB_VMODE_NONINTERLACED, }; /* @@ -108,13 +108,13 @@ static int g364fb_pan_display(struct fb_var_screeninfo *var, int con, struct fb_info *info); -static int g364fb_setcolreg(u_int regno, u_int red, u_int green, u_int blue, - u_int transp, struct fb_info *info); +static int g364fb_setcolreg(u_int regno, u_int red, u_int green, + u_int blue, u_int transp, + struct fb_info *info); static int g364fb_blank(int blank, struct fb_info *info); static struct fb_ops g364fb_ops = { owner: THIS_MODULE, - //fb_cursor: g364fb_cursor, fb_setcolreg: g364fb_setcolreg, fb_pan_display: g364fb_pan_display, fb_blank: g364fb_blank, @@ -123,27 +123,37 @@ fb_imageblit: cfb_imageblit, }; -void g364fb_cursor(struct fb_info *info, struct fb_cursor *cursor) +/* +void fbcon_g364fb_cursor(struct display *p, int mode, int x, int y) { - if (info->cursor.enable) { - *(unsigned int *) CTLA_REG &= ~CURS_TOGGLE; - *(unsigned int *) CURS_POS_REG = ((x * fontwidth(p)) << 12) | ((y * fontheight(p))-p->var.yoffset); - } else + switch (mode) { + case CM_ERASE: *(unsigned int *) CTLA_REG |= CURS_TOGGLE; + break; + + case CM_MOVE: + case CM_DRAW: + *(unsigned int *) CTLA_REG &= ~CURS_TOGGLE; + *(unsigned int *) CURS_POS_REG = + ((x * fontwidth(p)) << 12) | ((y * fontheight(p)) - + p->var.yoffset); + break; + } } +*/ /* * Pan or Wrap the Display * * This call looks only at xoffset, yoffset and the FB_VMODE_YWRAP flag */ -static int g364fb_pan_display(struct fb_var_screeninfo *var, int con, +static int g364fb_pan_display(struct fb_var_screeninfo *var, struct fb_info *info) { - if (var->xoffset || var->yoffset+var->yres > var->yres_virtual) + if (var->xoffset || var->yoffset + var->yres > var->yres_virtual) return -EINVAL; - - *(unsigned int *)TOP_REG = var->yoffset * var->xres; + + *(unsigned int *) TOP_REG = var->yoffset * var->xres; return 0; } @@ -153,17 +163,17 @@ static int g364fb_blank(int blank, struct fb_info *info) { if (blank) - *(unsigned int *) CTLA_REG |= FORCE_BLANK; + *(unsigned int *) CTLA_REG |= FORCE_BLANK; else - *(unsigned int *) CTLA_REG &= ~FORCE_BLANK; - return 0; + *(unsigned int *) CTLA_REG &= ~FORCE_BLANK; + return 0; } /* * Set a single color register. Return != 0 for invalid regno. */ -static int g364fb_setcolreg(u_int regno, u_int red, u_int green, u_int blue, - u_int transp, struct fb_info *info) +static int g364fb_setcolreg(u_int regno, u_int red, u_int green, + u_int blue, u_int transp, struct fb_info *info) { volatile unsigned int *ptr = (volatile unsigned int *) CLR_PAL_REG; @@ -172,9 +182,10 @@ red >>= 8; green >>= 8; - blue >>=8; - + blue >>= 8; + ptr[regno << 1] = (red << 16) | (green << 8) | blue; + return 0; } @@ -183,17 +194,21 @@ */ int __init g364fb_init(void) { - volatile unsigned int *curs_pal_ptr = (volatile unsigned int *) CURS_PAL_REG; - volatile unsigned int *pal_ptr = (volatile unsigned int *) CLR_PAL_REG; + volatile unsigned int *pal_ptr = + (volatile unsigned int *) CLR_PAL_REG; + volatile unsigned int *curs_pal_ptr = + (volatile unsigned int *) CURS_PAL_REG; int mem, i, j; /* TBD: G364 detection */ - + /* get the resolution set by ARC console */ - *(volatile unsigned int *)CTLA_REG &= ~ENABLE_VTG; - fb_var.xres = (*((volatile unsigned int*)DISPLAY_REG) & 0x00ffffff) * 4; - fb_var.yres = (*((volatile unsigned int*)VDISPLAY_REG) & 0x00ffffff)/2; - *(volatile unsigned int *)CTLA_REG |= ENABLE_VTG; + *(volatile unsigned int *) CTLA_REG &= ~ENABLE_VTG; + fb_var.xres = + (*((volatile unsigned int *) DISPLAY_REG) & 0x00ffffff) * 4; + fb_var.yres = + (*((volatile unsigned int *) VDISPLAY_REG) & 0x00ffffff) / 2; + *(volatile unsigned int *) CTLA_REG |= ENABLE_VTG; /* setup cursor */ curs_pal_ptr[0] |= 0x00ffffff; @@ -201,46 +216,37 @@ curs_pal_ptr[4] |= 0x00ffffff; /* - * first set the whole cursor to transparent - */ + * first set the whole cursor to transparent + */ for (i = 0; i < 512; i++) - *(unsigned short *)(CURS_PAT_REG+i*8) = 0; + *(unsigned short *) (CURS_PAT_REG + i * 8) = 0; /* * switch the last two lines to cursor palette 3 * we assume here, that FONTSIZE_X is 8 */ - *(unsigned short *)(CURS_PAT_REG + 14*64) = 0xffff; - *(unsigned short *)(CURS_PAT_REG + 15*64) = 0xffff; + *(unsigned short *) (CURS_PAT_REG + 14 * 64) = 0xffff; + *(unsigned short *) (CURS_PAT_REG + 15 * 64) = 0xffff; fb_var.xres_virtual = fbvar.xres; - fb_fix.line_length = (fb_var.xres / 8) * fb_var.bits_per_pixel; + fb_fix.line_length = (xres / 8) * fb_var.bits_per_pixel; + fb_fix.smem_start = 0x40000000; /* physical address */ /* get size of video memory; this is special for the JAZZ hardware */ mem = (r4030_read_reg32(JAZZ_R4030_CONFIG) >> 8) & 3; - fb_fix.smem_len = (1 << (mem*2)) * 512 * 1024; + fb_fix.smem_len = (1 << (mem * 2)) * 512 * 1024; fb_var.yres_virtual = fb_fix.smem_len / fb_var.xres; - strcpy(fb_info.modename, fb_fix.id); fb_info.node = NODEV; - fb_info.screen_base = (char *)G364_MEM_BASE;/* virtual kernel address */ fb_info.fbops = &g364fb_ops; - fb_info.currcon = -1; + fb_info.screen_base = (char *) G364_MEM_BASE; /* virtual kernel address */ fb_info.var = fb_var; - fb_info.fix = fb_fix; - fb_info.disp = &disp; - fb_info.fontname[0] = '\0'; - fb_info.changevar = NULL; - fb_info.switch_con = gen_switch; - fb_info.updatevar = gen_update_var; + fb_info.fix = fb_fix; fb_info.flags = FBINFO_FLAG_DEFAULT; - fb_alloc_cmap(&fb_info.cmap, 255, 0); - gen_set_disp(-1, &fb_info); - if (register_framebuffer(&fb_info) < 0) return -EINVAL; printk("fb%d: %s frame buffer device\n", GET_FB_IDX(fb_info.node), - fb_info.fix.id); + fb_info.fix.id); return 0; } Index: hitfb.c =================================================================== RCS file: /cvsroot/linuxconsole/ruby/linux/drivers/video/hitfb.c,v retrieving revision 1.7 retrieving revision 1.8 diff -u -d -r1.7 -r1.8 --- hitfb.c 27 Mar 2002 20:58:09 -0000 1.7 +++ hitfb.c 3 Jun 2002 22:44:58 -0000 1.8 @@ -162,11 +162,6 @@ fb_info.flags = FBINFO_FLAG_DEFAULT; fb_info.screen_base = (void *) hitfb_fix.smem_start; - size = (fb_info.var.bits_per_pixel == 8) ? 256 : 16; - fb_alloc_cmap(&fb_info.cmap, size, 0); - - gen_get_var(&fb_info.var, -1, &fb_info); - if (register_framebuffer(&fb_info) < 0) return -EINVAL; Index: hpfb.c =================================================================== RCS file: /cvsroot/linuxconsole/ruby/linux/drivers/video/hpfb.c,v retrieving revision 1.10 retrieving revision 1.11 diff -u -d -r1.10 -r1.11 --- hpfb.c 27 Mar 2002 20:58:09 -0000 1.10 +++ hpfb.c 3 Jun 2002 22:44:58 -0000 1.11 @@ -156,8 +156,6 @@ fb_info.fix = hpfb_fix; fb_info.screen_base = hpfb_fix.smem_start; - fb_alloc_cmap(&fb_info.cmap, 256, 0); - if (register_framebuffer(&fb_info) < 0) return 1; return 0; Index: pm3fb.c =================================================================== RCS file: /cvsroot/linuxconsole/ruby/linux/drivers/video/pm3fb.c,v retrieving revision 1.21 retrieving revision 1.22 diff -u -d -r1.21 -r1.22 --- pm3fb.c 29 Oct 2001 22:58:43 -0000 1.21 +++ pm3fb.c 3 Jun 2002 22:44:58 -0000 1.22 @@ -5,9 +5,9 @@ * Based on code written by: * Sven Luther, <lu...@dp...> * Alan Hourihane, <al...@fa...> + * Russel King, <rm...@ar...> * Based on linux/drivers/video/skeletonfb.c: * Copyright (C) 1997 Geert Uytterhoeven - * Copyright (C) 2001 James Simmons * Based on linux/driver/video/pm2fb.c: * Copyright (C) 1998-1999 Ilario Nardinocchi (nar...@CS...) * Copyright (C) 1999 Jakub Jelinek (ja...@re...) @@ -17,29 +17,108 @@ [...4150 lines suppressed...] fb_size); release_mem_region(l_fb_info-> pIOBase, PM3_REGS_SIZE); +#endif /* KERNEL_2_4 or KERNEL_2_5 */ } - unregister_framebuffer(l_fb_info->current_par->f_fb_info); + unregister_framebuffer(&l_fb_info->gen. + info); } } } return; } -module_init(pm3fb_init_module); -module_exit(pm3fb_cleanup_module); - -MODULE_LICENSE("GPL"); - #endif /* MODULE */ Index: pm3fb.h =================================================================== RCS file: /cvsroot/linuxconsole/ruby/linux/drivers/video/pm3fb.h,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- pm3fb.h 28 Aug 2001 08:34:23 -0000 1.2 +++ pm3fb.h 3 Jun 2002 22:44:58 -0000 1.3 @@ -92,6 +92,7 @@ #define PM3MemBypassWriteMask 0x1008 #define PM3MemScratch 0x1010 #define PM3LocalMemCaps 0x1018 + #define PM3LocalMemCaps_NoWriteMask (1 << 28) #define PM3LocalMemTimings 0x1020 #define PM3LocalMemControl 0x1028 #define PM3LocalMemRefresh 0x1030 @@ -1118,10 +1119,41 @@ /* ***** pm3fb useful define and macro ***** */ /* ***************************************** */ +/* kernel -specific definitions */ +/* what kernel is this ? */ +#if ((LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,0)) && (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,0))) +#define KERNEL_2_5 +#endif + +#if ((LINUX_VERSION_CODE >= KERNEL_VERSION(2,4,0)) && (LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0))) +#define KERNEL_2_4 +#endif + +#if ((LINUX_VERSION_CODE >= KERNEL_VERSION(2,2,0)) && (LINUX_VERSION_CODE < KERNEL_VERSION(2,3,0))) +#define KERNEL_2_2 +/* pci_resource_start, available in 2.2.18 */ +#include <linux/kcomp.h> +#ifdef CONFIG_FB_OF +#define SUPPORT_FB_OF +#endif +#endif + +#if (!defined(KERNEL_2_2)) && (!defined(KERNEL_2_4)) && (!defined(KERNEL_2_5)) +#error "Only kernel 2.2.x, kernel 2.4.y and kernel 2.5.z might work" +#endif + +/* not sure if/why it's needed. doesn't work without on my PowerMac... */ +#ifdef __BIG_ENDIAN +#define MUST_BYTESWAP +#endif + +/* for compatibility between 2.5, 2.4 and 2.2 */ +#ifndef B_FREE +#define B_FREE -1 +#endif + /* permedia3 -specific definitions */ #define PM3_SCALE_TO_CLOCK(pr, fe, po) ((2 * PM3_REF_CLOCK * fe) / (pr * (1 << (po)))) -#define PICOS2KHZ(a) (1000000000UL/(a)) -#define KHZ2PICOS(a) (1000000000UL/(a)) /* in case it's not in linux/pci.h */ #ifndef PCI_DEVICE_ID_3DLABS_PERMEDIA3 @@ -1176,9 +1208,20 @@ /* ******************************************** */ /* ***** A bunch of register-access macro ***** */ /* ******************************************** */ -/* we're in 2.4.x or more */ +#ifdef KERNEL_2_2 +#ifdef MUST_BYTESWAP /* we are writing big_endian to big_endian through a little_endian macro */ +#define PM3_READ_REG(r) __swab32(readl((l_fb_info->vIOBase + r))) +#define PM3_WRITE_REG(r, v) writel(__swab32(v), (l_fb_info->vIOBase + r)) +#else /* MUST_BYTESWAP */ +#define PM3_WRITE_REG(r, v) writel(v, (l_fb_info->vIOBase + r)) +#define PM3_READ_REG(r) readl((l_fb_info->vIOBase + r)) +#endif /* MUST_BYTESWAP */ +#endif /* KERNEL_2_2 */ +#if (defined KERNEL_2_4) || (defined KERNEL_2_5) /* native-endian access */ #define PM3_WRITE_REG(r, v) fb_writel(v, (l_fb_info->vIOBase + r)) #define PM3_READ_REG(r) fb_readl((l_fb_info->vIOBase + r)) +#endif /* KERNEL_2_4 or KERNEL_2_5 */ + #define depth2bpp(d) ((d + 7L) & ~7L) #define depth2ByPP(d) (depth2bpp(d) / 8) Index: q40fb.c =================================================================== RCS file: /cvsroot/linuxconsole/ruby/linux/drivers/video/q40fb.c,v retrieving revision 1.8 retrieving revision 1.9 diff -u -d -r1.8 -r1.9 --- q40fb.c 27 Mar 2002 20:58:09 -0000 1.8 +++ q40fb.c 3 Jun 2002 22:44:58 -0000 1.9 @@ -30,7 +30,7 @@ #define Q40_PHYS_SCREEN_ADDR 0xFE800000 -static u16 pseudo_palette[17]; +static u32 pseudo_palette[17]; static struct fb_info fb_info; static struct fb_fix_screeninfo q40fb_fix __initdata = { @@ -82,9 +82,9 @@ * Return != 0 for invalid regno. */ - red>>=11; - green>>=11; - blue>>=10; + red >>=11; + green >>=11; + blue >>=10; if (regno < 16) { info->pseudo_palette[regno] = ((red & 31) <<6) | @@ -110,8 +110,6 @@ fb_info.pseudo_palette = pseudo_palette; fb_info.screen_base = (char *) q40fb_fix.smem_start; - fb_alloc_cmap(&fb_info.cmap, 16, 0); - master_outb(3, DISPLAY_CONTROL_REG); if (register_framebuffer(&fb_info) < 0) { Index: skeletonfb.c =================================================================== RCS file: /cvsroot/linuxconsole/ruby/linux/drivers/video/skeletonfb.c,v retrieving revision 1.16 retrieving revision 1.17 diff -u -d -r1.16 -r1.17 --- skeletonfb.c 14 Feb 2002 20:27:28 -0000 1.16 +++ skeletonfb.c 3 Jun 2002 22:44:58 -0000 1.17 @@ -80,8 +80,13 @@ * to get a fb_var_screeninfo. Otherwise define a default var as well. */ static struct fb_fix_screeninfo xxxfb_fix __initdata = { - "FB's name", (unsigned long) NULL, 0, FB_TYPE_PACKED_PIXELS, 0, - FB_VISUAL_PSEUDOCOLOR, 1, 1, 1, 0, (unsigned long) NULL, 0, FB_ACCEL_NONE + id: "FB's name", + type: FB_TYPE_PACKED_PIXELS, + visual: FB_VISUAL_PSEUDOCOLOR, + xpanstep: 1, + ypanstep: 1, + ywrapstep: 1, + accel: FB_ACCEL_NONE, }; /* @@ -120,9 +125,6 @@ */ static struct xxx_par __initdata current_par; - /* To go away in the near future */ -static struct display disp; - int xxxfb_init(void); int xxxfb_setup(char*); @@ -164,10 +166,11 @@ * xxxfb_check_var is always called before xxxfb_set_par to ensure this. * */ -static void xxxfb_set_par(struct fb_info *info) +static int xxxfb_set_par(struct fb_info *info) { struct xxx_par *par = (struct xxx_par *) info->par; /* ... */ + return 0; } /** @@ -399,7 +402,7 @@ int __init xxxfb_init(void) { - int retval; + int cmap_len, retval; /* * Here we set the screen_base to the vitrual memory address @@ -408,12 +411,17 @@ * space via ioremap. Consult ioport.h. */ info.screen_base = framebuffer_virtual_memory; - info.node = -1; + info.node = NODEV; info.fbops = &xxxfb_ops; info.fix = xxxfb_fix; - info.par = current_par; + info.pseudo_palette = pseudo_palette; info.flags = FBINFO_FLAG_DEFAULT; - /* This should give a reasonable default video mode */ + info.par = current_par; + + /* + * This should give a reasonable default video mode. The following is + * done when we can set a video mode. + */ if (!mode_option) mode_option = "640x480@60"; @@ -422,7 +430,11 @@ if (!retval || retval == 4) return -EINVAL; - info.cmap = fb_default_cmap(1<<info.var.bits_per_pixel); + /* + * The following is done in the case of having hardware with a static + * mode. If we are setting the mode ourselves we don't call this. + */ + info.var = xxxfb_var; if (register_framebuffer(&info) < 0) return -EINVAL; @@ -483,11 +495,11 @@ fb_open: xxxfb_open, /* only if you need it to do something */ fb_release: xxxfb_release, /* only if you need it to do something */ /* Stuff to go away. Use generic functions for now */ - fb_get_fix: fbgen_get_fix, - fb_get_var: fbgen_get_var, - fb_set_var: fbgen_set_var, - fb_get_cmap: fbgen_get_cmap, - fb_set_cmap: fbgen_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_check_var: xxxfb_check_var, fb_set_par: xxxfb_set_par, /* optional */ Index: vesafb.c =================================================================== RCS file: /cvsroot/linuxconsole/ruby/linux/drivers/video/vesafb.c,v retrieving revision 1.21 retrieving revision 1.22 diff -u -d -r1.21 -r1.22 --- vesafb.c 23 Mar 2002 00:22:58 -0000 1.21 +++ vesafb.c 3 Jun 2002 22:44:58 -0000 1.22 @@ -195,6 +195,8 @@ pmi_setpal=0; else if (! strcmp(this_opt, "pmipal")) pmi_setpal=1; + else if (! strcmp(this_opt, "mtrr")) + mtrr=1; } return 0; } @@ -344,13 +346,11 @@ fb_info.pseudo_palette = pseudo_palette; fb_info.flags = FBINFO_FLAG_DEFAULT; - fb_alloc_cmap(&fb_info.cmap, video_cmap_len, 0); - if (register_framebuffer(&fb_info)<0) return -EINVAL; printk(KERN_INFO "fb%d: %s frame buffer device\n", - minor(fb_info.node), fb_info.fix.id); + GET_FB_IDX(fb_info.node), fb_info.fix.id); return 0; } Index: vfb.c =================================================================== RCS file: /cvsroot/linuxconsole/ruby/linux/drivers/video/vfb.c,v retrieving revision 1.33 retrieving revision 1.34 diff -u -d -r1.33 -r1.34 --- vfb.c 22 May 2002 19:52:57 -0000 1.33 +++ vfb.c 3 Jun 2002 22:44:58 -0000 1.34 @@ -24,8 +24,6 @@ #include <linux/fb.h> #include <linux/init.h> -#include <linux/fbcon.h> - /* * RAM we reserve for the frame buffer. This defines the maximum screen * size @@ -334,7 +332,7 @@ case 8: break; case 16: - ((u16 *) (info->pseudo_palette))[regno] = v; + ((u32 *) (info->pseudo_palette))[regno] = v; break; case 24: case 32: @@ -428,7 +426,7 @@ memset(videomemory, 0, videomemorysize); fb_info.screen_base = videomemory; - fb_info.node = -1; + fb_info.node = NODEV; fb_info.fbops = &vfb_ops; retval = fb_find_mode(&fb_info.var, &fb_info, mode_option, --- hgafb.c DELETED --- |