You can subscribe to this list here.
| 2001 |
Jan
|
Feb
|
Mar
(1) |
Apr
(104) |
May
(81) |
Jun
(248) |
Jul
(133) |
Aug
(33) |
Sep
(53) |
Oct
(82) |
Nov
(166) |
Dec
(71) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2002 |
Jan
(121) |
Feb
(42) |
Mar
(39) |
Apr
(84) |
May
(87) |
Jun
(58) |
Jul
(97) |
Aug
(130) |
Sep
(32) |
Oct
(139) |
Nov
(108) |
Dec
(216) |
| 2003 |
Jan
(299) |
Feb
(136) |
Mar
(392) |
Apr
(141) |
May
(137) |
Jun
(107) |
Jul
(94) |
Aug
(262) |
Sep
(300) |
Oct
(216) |
Nov
(72) |
Dec
(94) |
| 2004 |
Jan
(174) |
Feb
(192) |
Mar
(215) |
Apr
(314) |
May
(319) |
Jun
(293) |
Jul
(205) |
Aug
(161) |
Sep
(192) |
Oct
(226) |
Nov
(308) |
Dec
(89) |
| 2005 |
Jan
(127) |
Feb
(269) |
Mar
(588) |
Apr
(106) |
May
(77) |
Jun
(77) |
Jul
(161) |
Aug
(239) |
Sep
(86) |
Oct
(112) |
Nov
(153) |
Dec
(145) |
| 2006 |
Jan
(87) |
Feb
(57) |
Mar
(129) |
Apr
(109) |
May
(102) |
Jun
(232) |
Jul
(97) |
Aug
(69) |
Sep
(67) |
Oct
(69) |
Nov
(214) |
Dec
(82) |
| 2007 |
Jan
(133) |
Feb
(307) |
Mar
(121) |
Apr
(171) |
May
(229) |
Jun
(156) |
Jul
(185) |
Aug
(160) |
Sep
(122) |
Oct
(130) |
Nov
(78) |
Dec
(27) |
| 2008 |
Jan
(105) |
Feb
(137) |
Mar
(146) |
Apr
(148) |
May
(239) |
Jun
(208) |
Jul
(157) |
Aug
(244) |
Sep
(119) |
Oct
(125) |
Nov
(189) |
Dec
(225) |
| 2009 |
Jan
(157) |
Feb
(139) |
Mar
(106) |
Apr
(130) |
May
(246) |
Jun
(189) |
Jul
(128) |
Aug
(127) |
Sep
(88) |
Oct
(86) |
Nov
(216) |
Dec
(9) |
| 2010 |
Jan
(5) |
Feb
|
Mar
(11) |
Apr
(31) |
May
(3) |
Jun
|
Jul
(7) |
Aug
|
Sep
(1) |
Oct
|
Nov
(1) |
Dec
|
| 2012 |
Jan
|
Feb
|
Mar
(3) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
| 2013 |
Jan
(1) |
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
|
From: Geert U. <Gee...@so...> - 2002-03-04 09:20:06
|
On Sat, 2 Mar 2002, James Simmons wrote:
> +static struct fb_var_screeninfo hitfb_var __initdata = {
> + 0, 0, 0, 0, 0, 0, 0, 0,
> + {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0},
> + 0, FB_ACTIVATE_NOW, -1, -1, 0, 0, 0, 0, 0, 0, 0, 0,
> + 0, FB_VMODE_NONINTERLACED
> };
> +static struct fb_fix_screeninfo hitfb_fix __initdata = {
> + "Hitachi HD64461",(unsigned long) NULL, 0, FB_TYPE_PACKED_PIXELS,
> + 0, FB_VISUAL_TRUECOLOR, 0, 0, 0, 0, (unsigned long) NULL, 0,
> + FB_ACCEL_NONE
> };
Suggestion: use the new-style struct initialization. It's less error-prone, and
you can get rid of the 0/NULL values.
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- ge...@li...
In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds
|
|
From: James S. <jsi...@tr...> - 2002-03-02 17:40:23
|
Hi!
Please test this driver so it can be applied to the dave jones tree.
. ---
|o_o |
|:_/ | Give Micro$oft the Bird!!!!
// \ \ Use Linux!!!!
(| | )
/'_ _/`\
___)=(___/
--- linux-2.5.5-dj2/drivers/video/hitfb.c Wed Feb 27 07:52:04 2002
+++ linux/drivers/video/hitfb.c Sat Mar 2 10:34:58 2002
@@ -21,6 +21,7 @@
#include <linux/delay.h>
#include <linux/nubus.h>
#include <linux/init.h>
+#include <linux/fb.h>
#include <asm/machvec.h>
#include <asm/uaccess.h>
@@ -28,343 +29,160 @@
#include <asm/io.h>
#include <asm/hd64461.h>
-#include <linux/fb.h>
-
#include <video/fbcon.h>
-#include <video/fbcon-cfb8.h>
-#include <video/fbcon-cfb16.h>
-
-struct hitfb_par
-{
- int x, y;
- int bpp;
+static struct fb_var_screeninfo hitfb_var __initdata = {
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0},
+ 0, FB_ACTIVATE_NOW, -1, -1, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, FB_VMODE_NONINTERLACED
};
-
-struct hitfb_info {
- struct fb_info_gen gen;
- struct display disp;
- struct hitfb_par current_par;
- struct fb_var_screeninfo default_var;
- int current_par_valid;
- unsigned long hit_videobase, hit_videosize;
-} fb_info =
- {},
- {},
- {},
- {},
- 0, 0, 0,
- {},
+static struct fb_fix_screeninfo hitfb_fix __initdata = {
+ "Hitachi HD64461",(unsigned long) NULL, 0, FB_TYPE_PACKED_PIXELS,
+ 0, FB_VISUAL_TRUECOLOR, 0, 0, 0, 0, (unsigned long) NULL, 0,
+ FB_ACCEL_NONE
};
static u16 pseudo_palette[17];
+struct fb_info fb_info;
-static void hitfb_set_par(const void *fb_par, struct fb_info_gen *info);
-static int hitfb_encode_var(struct fb_var_screeninfo *var, const void *fb_par,
- struct fb_info_gen *info);
-
-
-static void hitfb_detect(void)
-{
- struct hitfb_par par;
- unsigned short lcdclor, ldr3, ldvntr;
-
- fb_info.hit_videobase = CONFIG_HD64461_IOBASE + 0x02000000;
- fb_info.hit_videosize = (MACH_HP680 || MACH_HP690) ? 1024*1024 : 512*1024;
-
- lcdclor = inw(HD64461_LCDCLOR);
- ldvntr = inw(HD64461_LDVNTR);
- ldr3 = inw(HD64461_LDR3);
-
- switch(ldr3&15) {
- default:
- case 4:
- par.bpp = 8;
- par.x = lcdclor;
- break;
- case 8:
- par.bpp = 16;
- par.x = lcdclor/2;
- break;
- }
-
- par.y = ldvntr+1;
-
- hitfb_set_par(&par, NULL);
- hitfb_encode_var(&fb_info.default_var, &par, NULL);
-}
-
-
-static int hitfb_encode_fix(struct fb_fix_screeninfo *fix, const void *fb_par,
- struct fb_info_gen *info)
+static int hitfb_check_var(struct fb_var_screeninfo *var, struct fb_info *info)
{
- const struct hitfb_par *par = fb_par;
-
- memset(fix, 0, sizeof(struct fb_fix_screeninfo));
-
- strcpy(fix->id, "Hitachi HD64461");
- fix->smem_start = fb_info.hit_videobase;
- fix->smem_len = fb_info.hit_videosize;
- fix->type = FB_TYPE_PACKED_PIXELS;
- fix->type_aux = 0;
- fix->visual = (par->bpp == 8) ?
- FB_VISUAL_PSEUDOCOLOR : FB_VISUAL_TRUECOLOR;
- fix->xpanstep = 0;
- fix->ypanstep = 0;
- fix->ywrapstep = 0;
-
- switch(par->bpp) {
- default:
- case 8:
- fix->line_length = par->x;
- break;
- case 16:
- fix->line_length = par->x*2;
- break;
- }
-
- return 0;
-}
+ var->xres_virtual = var->xres;
+ var->yres_virtual = var->yres;
-
-static int hitfb_decode_var(const struct fb_var_screeninfo *var, void *fb_par,
- struct fb_info_gen *info)
-{
- struct hitfb_par *par = fb_par;
-
- par->x = var->xres;
- par->y = var->yres;
- par->bpp = var->bits_per_pixel;
- return 0;
-}
-
-
-static int hitfb_encode_var(struct fb_var_screeninfo *var, const void *fb_par,
- struct fb_info_gen *info)
-{
- const struct hitfb_par *par = fb_par;
-
- memset(var, 0, sizeof(*var));
-
- var->xres = par->x;
- var->yres = par->y;
- var->xres_virtual = var->xres;
- var->yres_virtual = var->yres;
- var->xoffset = 0;
- var->yoffset = 0;
- var->bits_per_pixel = par->bpp;
- var->grayscale = 0;
- var->transp.offset = 0;
- var->transp.length = 0;
- var->transp.msb_right = 0;
- var->nonstd = 0;
- var->activate = 0;
- 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;
-
- switch (var->bits_per_pixel) {
-
- case 8:
- var->red.offset = 0;
- var->red.length = 8;
- var->green.offset = 0;
- var->green.length = 8;
- var->blue.offset = 0;
- var->blue.length = 8;
- var->transp.offset = 0;
- var->transp.length = 0;
- break;
-
- case 16: /* RGB 565 */
- 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;
- break;
- }
-
- var->red.msb_right = 0;
- var->green.msb_right = 0;
- var->blue.msb_right = 0;
- var->transp.msb_right = 0;
-
- return 0;
+ switch (var->bits_per_pixel) {
+ case 8:
+ var->red.offset = 0;
+ var->red.length = 8;
+ var->green.offset = 0;
+ var->green.length = 8;
+ var->blue.offset = 0;
+ var->blue.length = 8;
+ var->transp.offset = 0;
+ var->transp.length = 0;
+ break;
+ case 16: /* RGB 565 */
+ 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;
+ break;
+ }
+ return 0;
}
-
-static void hitfb_get_par(void *par, struct fb_info_gen *info)
+static int hitfb_set_par(struct fb_info *info)
{
- *(struct hitfb_par *)par = fb_info.current_par;
-}
+ info->fix.visual = (info->var.bits_per_pixel == 8) ?
+ FB_VISUAL_PSEUDOCOLOR : FB_VISUAL_TRUECOLOR;
-
-static void hitfb_set_par(const void *fb_par, struct fb_info_gen *info)
-{
- const struct hitfb_par *par = fb_par;
- fb_info.current_par = *par;
- fb_info.current_par_valid = 1;
-}
-
-
-static int hitfb_getcolreg(unsigned regno, unsigned *red, unsigned *green,
- unsigned *blue, unsigned *transp,
- struct fb_info *info)
-{
- if (regno > 255)
- return 1;
-
- outw(regno<<8, HD64461_CPTRAR);
- *red = inw(HD64461_CPTRDR)<<10;
- *green = inw(HD64461_CPTRDR)<<10;
- *blue = inw(HD64461_CPTRDR)<<10;
- *transp = 0;
-
- return 0;
+ switch(info->var.bits_per_pixel) {
+ default:
+ case 8:
+ info->fix.line_length = info->var.xres;
+ break;
+ case 16:
+ info->fix.line_length = info->var.xres*2;
+ break;
+ }
+ return 0;
}
-
static int hitfb_setcolreg(unsigned regno, unsigned red, unsigned green,
unsigned blue, unsigned transp,
struct fb_info *info)
{
- if (regno > 255)
- return 1;
+ if (regno > 255)
+ return 1;
- outw(regno<<8, HD64461_CPTWAR);
- outw(red>>10, HD64461_CPTWDR);
- outw(green>>10, HD64461_CPTWDR);
- outw(blue>>10, HD64461_CPTWDR);
+ outw(regno << 8, HD64461_CPTWAR);
+ outw(red >> 10, HD64461_CPTWDR);
+ outw(green >> 10, HD64461_CPTWDR);
+ outw(blue >> 10, HD64461_CPTWDR);
- if(regno<16) {
- switch(fb_info.current_par.bpp) {
+ if (regno < 16) {
+ switch(info->var.bits_per_pixel) {
#ifdef FBCON_HAS_CFB16
- case 16:
- ((u16 *)(fb_info.gen.info.pseudo_palette))[regno] =
- ((red & 0xf800) ) |
- ((green & 0xfc00) >> 5) |
- ((blue & 0xf800) >> 11);
- break;
+ case 16:
+ ((u16 *)(info->pseudo_palette))[regno] =
+ ((red & 0xf800) ) |
+ ((green & 0xfc00) >> 5) |
+ ((blue & 0xf800) >> 11);
+ break;
#endif
+ }
}
- }
-
- return 0;
-}
-
-
-static int hitfb_pan_display(const struct fb_var_screeninfo *var,
- struct fb_info_gen *info)
-{
- if (!fb_info.current_par_valid)
- return -EINVAL;
-
- return 0;
-}
-
-
-static int hitfb_blank(int blank_mode, struct fb_info_gen *info)
-{
- if (!fb_info.current_par_valid)
- return 1;
-
- return 0;
-}
-
-
-static void hitfb_set_disp(const void *fb_par, struct display *disp,
- struct fb_info_gen *info)
-{
- const struct hitfb_par *par = fb_par;
-
- disp->scrollmode = SCROLL_YREDRAW;
-
- switch(((struct hitfb_par *)par)->bpp) {
-#ifdef FBCON_HAS_CFB8
- case 8:
- disp->dispsw = &fbcon_cfb8;
- break;
-#endif
-#ifdef FBCON_HAS_CFB16
- case 16:
- disp->dispsw = &fbcon_cfb16;
- disp->dispsw_data = fb_info.gen.info.pseudo_palette;
- break;
-#endif
- default:
- disp->dispsw = &fbcon_dummy;
- }
+ return 0;
}
-
-struct fbgen_hwswitch hitfb_switch = {
- hitfb_detect,
- hitfb_encode_fix,
- hitfb_decode_var,
- hitfb_encode_var,
- hitfb_get_par,
- hitfb_set_par,
- hitfb_getcolreg,
- hitfb_pan_display,
- hitfb_blank,
- hitfb_set_disp
-};
-
-
static struct fb_ops hitfb_ops = {
- owner: THIS_MODULE,
- 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_setcolreg: hitfb_setcolreg,
- fb_pan_display: fbgen_pan_display,
- fb_blank: fbgen_blank,
+ owner: THIS_MODULE,
+ 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: hitfb_check_var,
+ fb_set_par: hitfb_set_par,
+ fb_setcolreg: hitfb_setcolreg,
};
-
int __init hitfb_init(void)
{
- strcpy(fb_info.gen.info.modename, "Hitachi HD64461");
- fb_info.gen.info.node = NODEV;
- fb_info.gen.info.flags = FBINFO_FLAG_DEFAULT;
- fb_info.gen.info.fbops = &hitfb_ops;
- fb_info.gen.info.disp = &fb_info.disp;
- fb_info.gen.info.pseudo_palette = pseudo_palette;
- fb_info.gen.info.changevar = NULL;
- fb_info.gen.info.switch_con = &fbgen_switch;
- fb_info.gen.info.updatevar = &fbgen_update_var;
- fb_info.gen.parsize = sizeof(struct hitfb_par);
- fb_info.gen.fbhw = &hitfb_switch;
- fb_info.gen.fbhw->detect();
- fb_info.gen.info.screen_base = (void *)fb_info.hit_videobase;
-
- fbgen_get_var(&fb_info.disp.var, -1, &fb_info.gen.info);
- fb_info.disp.var.activate = FB_ACTIVATE_NOW;
- fbgen_do_set_var(&fb_info.disp.var, 1, &fb_info.gen);
- fbgen_set_disp(-1, &fb_info.gen);
- do_install_cmap(0, &fb_info.gen.info);
-
- if(register_framebuffer(&fb_info.gen.info)<0) return -EINVAL;
-
- printk(KERN_INFO "fb%d: %s frame buffer device\n",
- GET_FB_IDX(fb_info.gen.info.node), fb_info.gen.info.modename);
-
- return 0;
+ unsigned short lcdclor, ldr3, ldvntr;
+
+ hitfb_fix.smem_start = CONFIG_HD64461_IOBASE + 0x02000000;
+ hitfb_fix.smem_len = (MACH_HP680 || MACH_HP690) ? 1024*1024 : 512*1024;
+
+ lcdclor = inw(HD64461_LCDCLOR);
+ ldvntr = inw(HD64461_LDVNTR);
+ ldr3 = inw(HD64461_LDR3);
+
+ switch (ldr3&15) {
+ default:
+ case 4:
+ hitfb_var.bits_per_pixel = 8;
+ hitfb_var.xres = lcdclor;
+ break;
+ case 8:
+ hitfb_var.bits_per_pixel = 16;
+ hitfb_var.xres = lcdclor/2;
+ break;
+ }
+ hitfb_var.yres = ldvntr+1;
+
+ fb_info.node = NODEV;
+ fb_info.fbops = &hitfb_ops;
+ fb_info.var = hitfb_var;
+ fb_info.fix = hitfb_fix;
+ fb_info.pseudo_palette = pseudo_palette;
+ fb_info.flags = FBINFO_FLAG_DEFAULT;
+
+ strcpy(fb_info.modename, fb_info.fix.id);
+ fb_info.currcon = -1;
+ fb_info.disp = &disp;
+ fb_info.changevar = NULL;
+ fb_info.switch_con = gen_switch;
+ fb_info.updatevar = gen_update_var;
+ fb_info.screen_base = (void *) hitfb_fix.smem_start;
+
+ size = (fb_info.var.bits_per_pixel == 8) ? 256 : 16;
+ fb_alloc_cmap(&fb_info.cmap, size, 0);
+
+ gen_get_var(&fb_info.var, -1, &fb_info);
+
+ if (register_framebuffer(&fb_info) < 0)
+ return -EINVAL;
+
+ printk(KERN_INFO "fb%d: %s frame buffer device\n",
+ GET_FB_IDX(fb_info.node), fb_info.fix.id);
+ return 0;
}
@@ -387,7 +205,6 @@
hitfb_cleanup(void);
}
#endif
-
/*
* Local variables:
|
|
From: James S. <jsi...@tr...> - 2002-03-01 20:58:24
|
Give this patch a try. It is against 2.5.5-dj2.
. ---
|o_o |
|:_/ | Give Micro$oft the Bird!!!!
// \ \ Use Linux!!!!
(| | )
/'_ _/`\
___)=(___/
diff -urN -X /home/jsimmons/dontdiff linux-2.5.5-dj2/drivers/video/fbgen.c linux/drivers/video/fbgen.c
--- linux-2.5.5-dj2/drivers/video/fbgen.c Tue Feb 26 16:04:26 2002
+++ linux/drivers/video/fbgen.c Fri Mar 1 12:53:56 2002
@@ -427,9 +427,9 @@
display->ypanstep = info->fix.ypanstep;
display->ywrapstep = info->fix.ywrapstep;
display->line_length = info->fix.line_length;
- if (info->fbops->fb_blank || info->fix.visual == FB_VISUAL_PSEUDOCOLOR ||
+ if (info->fix.visual == FB_VISUAL_PSEUDOCOLOR ||
info->fix.visual == FB_VISUAL_DIRECTCOLOR) {
- display->can_soft_blank = 1;
+ display->can_soft_blank = info->fbops->fb_blank ? 1 : 0;
display->dispsw_data = NULL;
} else {
display->can_soft_blank = 0;
@@ -444,12 +444,15 @@
if (con < 0 || info->var.activate & FB_ACTIVATE_ALL)
info->disp->var = info->var;
+ if (!info->var.accel_flags) {
+ display->scrollmode = SCROLL_YREDRAW;
#ifdef FBCON_HAS_ACCEL
- if (info->var.accel_flags & FB_ACCELF_TEXT) {
+ } else {
+ display->scrollmode = SCROLL_YNOMOVE;
display->dispsw = &fbcon_accel;
return;
- }
#endif
+ }
switch (info->var.bits_per_pixel)
{
diff -urN -X /home/jsimmons/dontdiff linux-2.5.5-dj2/drivers/video/vesafb.c linux/drivers/video/vesafb.c
--- linux-2.5.5-dj2/drivers/video/vesafb.c Tue Feb 26 16:04:27 2002
+++ linux/drivers/video/vesafb.c Fri Mar 1 13:35:37 2002
@@ -26,37 +26,12 @@
#include <asm/mtrr.h>
#include <video/fbcon.h>
-#include <video/fbcon-cfb8.h>
-#include <video/fbcon-cfb16.h>
-#include <video/fbcon-cfb24.h>
-#include <video/fbcon-cfb32.h>
-#include <video/fbcon-mac.h>
#define dac_reg (0x3c8)
#define dac_val (0x3c9)
/* --------------------------------------------------------------------- */
-/*
- * card parameters
- */
-
-/* card */
-unsigned long video_base; /* physical addr */
-int video_size;
-
-/* mode */
-static int video_bpp;
-static int video_width;
-static int video_height;
-static int video_height_virtual;
-static int video_type = FB_TYPE_PACKED_PIXELS;
-static int video_visual;
-static int video_linelength;
-static int video_cmap_len;
-
-/* --------------------------------------------------------------------- */
-
static struct fb_var_screeninfo vesafb_defined = {
0,0,0,0, /* W,H, W, H (virtual) load xres,xres_virtual*/
0,0, /* virtual -> visible no offset */
@@ -76,20 +51,14 @@
{0,0,0,0,0,0}
};
+static struct fb_fix_screeninfo vesafb_fix = {
+ "VESA VGA", (unsigned long) NULL, 0, FB_TYPE_PACKED_PIXELS, 0,
+ FB_VISUAL_PSEUDOCOLOR, 0, 0, 0, 0, (unsigned long) NULL, 0, FB_ACCEL_NONE
+};
+
static struct display disp;
static struct fb_info fb_info;
-static struct { u_short blue, green, red, pad; } palette[256];
-static union {
-#ifdef FBCON_HAS_CFB16
- u16 cfb16[16];
-#endif
-#ifdef FBCON_HAS_CFB24
- u32 cfb24[16];
-#endif
-#ifdef FBCON_HAS_CFB32
- u32 cfb32[16];
-#endif
-} fbcon_cmap;
+static u32 pseudo_palette[17];
static int inverse = 0;
static int mtrr = 0;
@@ -100,8 +69,6 @@
static void (*pmi_start)(void);
static void (*pmi_pal)(void);
-static struct display_switch vesafb_sw;
-
/* --------------------------------------------------------------------- */
static int vesafb_pan_display(struct fb_var_screeninfo *var, int con,
@@ -118,7 +85,7 @@
if ((ypan==1) && var->yoffset+var->yres > var->yres_virtual)
return -EINVAL;
- offset = (var->yoffset * video_linelength + var->xoffset) / 4;
+ offset = (var->yoffset * info->fix.line_length + var->xoffset) / 4;
__asm__ __volatile__(
"call *(%%edi)"
@@ -140,161 +107,6 @@
return 0;
}
-static int vesafb_get_fix(struct fb_fix_screeninfo *fix, int con,
- struct fb_info *info)
-{
- memset(fix, 0, sizeof(struct fb_fix_screeninfo));
- strcpy(fix->id,"VESA VGA");
-
- fix->smem_start=video_base;
- fix->smem_len=video_size;
- fix->type = video_type;
- fix->visual = video_visual;
- fix->xpanstep = 0;
- fix->ypanstep = ypan ? 1 : 0;
- fix->ywrapstep = (ypan>1) ? 1 : 0;
- fix->line_length=video_linelength;
- return 0;
-}
-
-static int vesafb_get_var(struct fb_var_screeninfo *var, int con,
- struct fb_info *info)
-{
- if(con==-1)
- memcpy(var, &vesafb_defined, sizeof(struct fb_var_screeninfo));
- else
- *var=fb_display[con].var;
- return 0;
-}
-
-static void vesafb_set_disp(int con)
-{
- struct fb_fix_screeninfo fix;
- struct display *display;
- struct display_switch *sw;
-
- if (con >= 0)
- display = &fb_display[con];
- else
- display = &disp; /* used during initialization */
-
- vesafb_get_fix(&fix, con, 0);
-
- memset(display, 0, sizeof(struct display));
- 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 = inverse;
- vesafb_get_var(&display->var, -1, &fb_info);
-
- switch (video_bpp) {
-#ifdef FBCON_HAS_CFB8
- case 8:
- sw = &fbcon_cfb8;
- break;
-#endif
-#ifdef FBCON_HAS_CFB16
- case 15:
- case 16:
- sw = &fbcon_cfb16;
- display->dispsw_data = fbcon_cmap.cfb16;
- break;
-#endif
-#ifdef FBCON_HAS_CFB24
- case 24:
- sw = &fbcon_cfb24;
- display->dispsw_data = fbcon_cmap.cfb24;
- break;
-#endif
-#ifdef FBCON_HAS_CFB32
- case 32:
- sw = &fbcon_cfb32;
- display->dispsw_data = fbcon_cmap.cfb32;
- break;
-#endif
- default:
-#ifdef FBCON_HAS_MAC
- sw = &fbcon_mac;
- break;
-#else
- sw = &fbcon_dummy;
- return;
-#endif
- }
- memcpy(&vesafb_sw, sw, sizeof(*sw));
- display->dispsw = &vesafb_sw;
- if (!ypan) {
- display->scrollmode = SCROLL_YREDRAW;
- vesafb_sw.bmove = fbcon_redraw_bmove;
- }
-}
-
-static int vesafb_set_var(struct fb_var_screeninfo *var, int con,
- struct fb_info *info)
-{
- static int first = 1;
-
- if (var->xres != vesafb_defined.xres ||
- var->yres != vesafb_defined.yres ||
- var->xres_virtual != vesafb_defined.xres_virtual ||
- var->yres_virtual > video_height_virtual ||
- var->yres_virtual < video_height ||
- var->xoffset ||
- var->bits_per_pixel != vesafb_defined.bits_per_pixel ||
- var->nonstd) {
- if (first) {
- printk(KERN_ERR "Vesafb does not support changing the video mode\n");
- first = 0;
- }
- return -EINVAL;
- }
-
- if ((var->activate & FB_ACTIVATE_MASK) == FB_ACTIVATE_TEST)
- return 0;
-
- if (ypan) {
- if (vesafb_defined.yres_virtual != var->yres_virtual) {
- vesafb_defined.yres_virtual = var->yres_virtual;
- if (con != -1) {
- fb_display[con].var = vesafb_defined;
- info->changevar(con);
- }
- }
-
- if (var->yoffset != vesafb_defined.yoffset)
- return vesafb_pan_display(var,con,info);
- return 0;
- }
-
- if (var->yoffset)
- return -EINVAL;
- return 0;
-}
-
-static int vesa_getcolreg(unsigned regno, unsigned *red, unsigned *green,
- unsigned *blue, unsigned *transp,
- struct fb_info *fb_info)
-{
- /*
- * Read a single color register and split it into colors/transparent.
- * Return != 0 for invalid regno.
- */
-
- if (regno >= video_cmap_len)
- return 1;
-
- *red = palette[regno].red;
- *green = palette[regno].green;
- *blue = palette[regno].blue;
- *transp = 0;
- return 0;
-}
-
#ifdef FBCON_HAS_CFB8
static void vesa_setpalette(int regno, unsigned red, unsigned green, unsigned blue)
@@ -328,7 +140,7 @@
static int vesafb_setcolreg(unsigned regno, unsigned red, unsigned green,
unsigned blue, unsigned transp,
- struct fb_info *fb_info)
+ struct fb_info *info)
{
/*
* Set a single color register. The values supplied are
@@ -337,14 +149,10 @@
* != 0 for invalid regno.
*/
- if (regno >= video_cmap_len)
+ if (regno >= info->cmap.len)
return 1;
- palette[regno].red = red;
- palette[regno].green = green;
- palette[regno].blue = blue;
-
- switch (video_bpp) {
+ switch (info->var.bits_per_pixel) {
#ifdef FBCON_HAS_CFB8
case 8:
vesa_setpalette(regno,red,green,blue);
@@ -355,16 +163,16 @@
case 16:
if (vesafb_defined.red.offset == 10) {
/* 1:5:5:5 */
- fbcon_cmap.cfb16[regno] =
- ((red & 0xf800) >> 1) |
- ((green & 0xf800) >> 6) |
- ((blue & 0xf800) >> 11);
+ ((u16*) (info->pseudo_palette))[regno] =
+ ((red & 0xf800) >> 1) |
+ ((green & 0xf800) >> 6) |
+ ((blue & 0xf800) >> 11);
} else {
/* 0:5:6:5 */
- fbcon_cmap.cfb16[regno] =
- ((red & 0xf800) ) |
- ((green & 0xfc00) >> 5) |
- ((blue & 0xf800) >> 11);
+ ((u16*) (info->pseudo_palette))[regno] =
+ ((red & 0xf800) ) |
+ ((green & 0xfc00) >> 5) |
+ ((blue & 0xf800) >> 11);
}
break;
#endif
@@ -373,7 +181,7 @@
red >>= 8;
green >>= 8;
blue >>= 8;
- fbcon_cmap.cfb24[regno] =
+ ((u32 *)(info->pseudo_palette))[regno] =
(red << vesafb_defined.red.offset) |
(green << vesafb_defined.green.offset) |
(blue << vesafb_defined.blue.offset);
@@ -384,7 +192,7 @@
red >>= 8;
green >>= 8;
blue >>= 8;
- fbcon_cmap.cfb32[regno] =
+ ((u32 *)(info->pseudo_palette))[regno] =
(red << vesafb_defined.red.offset) |
(green << vesafb_defined.green.offset) |
(blue << vesafb_defined.blue.offset);
@@ -394,26 +202,13 @@
return 0;
}
-static int vesafb_get_cmap(struct fb_cmap *cmap, int kspc, int con,
- struct fb_info *info)
-{
- if (con == info->currcon) /* current console? */
- return fb_get_cmap(cmap, kspc, vesa_getcolreg, info);
- else if (fb_display[con].cmap.len) /* non default colormap? */
- fb_copy_cmap(&fb_display[con].cmap, cmap, kspc ? 0 : 2);
- else
- fb_copy_cmap(fb_default_cmap(video_cmap_len),
- cmap, kspc ? 0 : 2);
- return 0;
-}
-
static struct fb_ops vesafb_ops = {
owner: THIS_MODULE,
- fb_get_fix: vesafb_get_fix,
- fb_get_var: vesafb_get_var,
- fb_set_var: vesafb_set_var,
- fb_get_cmap: vesafb_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_setcolreg: vesafb_setcolreg,
fb_pan_display: vesafb_pan_display,
};
@@ -450,59 +245,46 @@
return 0;
}
-static int vesafb_switch(int con, struct fb_info *info)
-{
- /* Do we have to save the colormap? */
- if (fb_display[info->currcon].cmap.len)
- fb_get_cmap(&fb_display[info->currcon].cmap, 1, vesa_getcolreg,
- info);
-
- info->currcon = con;
- /* Install new colormap */
- do_install_cmap(con, info);
- vesafb_update_var(con,info);
- return 1;
-}
-
int __init vesafb_init(void)
{
- int i,j;
+ int video_cmap_len;
+ int i;
if (screen_info.orig_video_isVGA != VIDEO_TYPE_VLFB)
return -ENXIO;
- video_base = screen_info.lfb_base;
- video_bpp = screen_info.lfb_depth;
- if (15 == video_bpp)
- video_bpp = 16;
- video_width = screen_info.lfb_width;
- video_height = screen_info.lfb_height;
- video_linelength = screen_info.lfb_linelength;
- video_size = screen_info.lfb_size * 65536;
- video_visual = (video_bpp == 8) ?
+ vesafb_fix.smem_start = screen_info.lfb_base;
+ vesafb_defined.bits_per_pixel = screen_info.lfb_depth;
+ if (15 == vesafb_defined.bits_per_pixel)
+ vesafb_defined.bits_per_pixel = 16;
+ vesafb_defined.xres = screen_info.lfb_width;
+ vesafb_defined.yres = screen_info.lfb_height;
+ vesafb_fix.line_length = screen_info.lfb_linelength;
+ vesafb_fix.smem_len = screen_info.lfb_size * 65536;
+ vesafb_fix.visual = (vesafb_defined.bits_per_pixel == 8) ?
FB_VISUAL_PSEUDOCOLOR : FB_VISUAL_TRUECOLOR;
- if (!request_mem_region(video_base, video_size, "vesafb")) {
+ if (!request_mem_region(vesafb_fix.smem_start, vesafb_fix.smem_len, "vesafb")) {
printk(KERN_WARNING
"vesafb: abort, cannot reserve video memory at 0x%lx\n",
- video_base);
+ vesafb_fix.smem_start);
/* We cannot make this fatal. Sometimes this comes from magic
spaces our resource handlers simply don't know about */
}
- fb_info.screen_base = ioremap(video_base, video_size);
+ fb_info.screen_base = ioremap(vesafb_fix.smem_start, vesafb_fix.smem_len);
if (!fb_info.screen_base) {
- release_mem_region(video_base, video_size);
+ release_mem_region(vesafb_fix.smem_start, vesafb_fix.smem_len);
printk(KERN_ERR
"vesafb: abort, cannot ioremap video memory 0x%x @ 0x%lx\n",
- video_size, video_base);
+ vesafb_fix.smem_len, vesafb_fix.smem_start);
return -EIO;
}
printk(KERN_INFO "vesafb: framebuffer at 0x%lx, mapped to 0x%p, size %dk\n",
- video_base, fb_info.screen_base, video_size/1024);
+ vesafb_fix.smem_start, fb_info.screen_base, vesafb_fix.smem_len/1024);
printk(KERN_INFO "vesafb: mode is %dx%dx%d, linelength=%d, pages=%d\n",
- video_width, video_height, video_bpp, video_linelength, screen_info.pages);
+ vesafb_defined.xres, vesafb_defined.yres, vesafb_defined.bits_per_pixel, vesafb_fix.line_length, screen_info.pages);
if (screen_info.vesapm_seg) {
printk(KERN_INFO "vesafb: protected mode interface info at %04x:%04x\n",
@@ -535,32 +317,27 @@
}
}
- vesafb_defined.xres=video_width;
- vesafb_defined.yres=video_height;
- vesafb_defined.xres_virtual=video_width;
- vesafb_defined.yres_virtual=video_size / video_linelength;
- vesafb_defined.bits_per_pixel=video_bpp;
-
- if (ypan && vesafb_defined.yres_virtual > video_height) {
+ vesafb_defined.xres_virtual = vesafb_defined.xres;
+ vesafb_defined.yres_virtual = vesafb_fix.smem_len / vesafb_fix.line_length;
+ if (ypan && vesafb_defined.yres_virtual > vesafb_defined.yres) {
printk(KERN_INFO "vesafb: scrolling: %s using protected mode interface, yres_virtual=%d\n",
(ypan > 1) ? "ywrap" : "ypan",vesafb_defined.yres_virtual);
} else {
printk(KERN_INFO "vesafb: scrolling: redraw\n");
- vesafb_defined.yres_virtual = video_height;
+ vesafb_defined.yres_virtual = vesafb_defined.yres;
ypan = 0;
}
- video_height_virtual = vesafb_defined.yres_virtual;
-
+
/* some dummy values for timing to make fbset happy */
- vesafb_defined.pixclock = 10000000 / video_width * 1000 / video_height;
- vesafb_defined.left_margin = (video_width / 8) & 0xf8;
+ vesafb_defined.pixclock = 10000000 / vesafb_defined.xres * 1000 / vesafb_defined.yres;
+ vesafb_defined.left_margin = (vesafb_defined.xres / 8) & 0xf8;
vesafb_defined.right_margin = 32;
vesafb_defined.upper_margin = 16;
vesafb_defined.lower_margin = 4;
- vesafb_defined.hsync_len = (video_width / 8) & 0xf8;
+ vesafb_defined.hsync_len = (vesafb_defined.xres / 8) & 0xf8;
vesafb_defined.vsync_len = 4;
- if (video_bpp > 8) {
+ if (vesafb_defined.bits_per_pixel > 8) {
vesafb_defined.red.offset = screen_info.red_pos;
vesafb_defined.red.length = screen_info.red_size;
vesafb_defined.green.offset = screen_info.green_pos;
@@ -584,46 +361,48 @@
vesafb_defined.red.length = 6;
vesafb_defined.green.length = 6;
vesafb_defined.blue.length = 6;
- for(i = 0; i < 16; i++) {
- j = color_table[i];
- palette[i].red = default_red[j];
- palette[i].green = default_grn[j];
- palette[i].blue = default_blu[j];
- }
video_cmap_len = 256;
}
+ vesafb_fix.ypanstep = ypan ? 1 : 0;
+ vesafb_fix.ywrapstep = (ypan>1) ? 1 : 0;
+
/* request failure does not faze us, as vgacon probably has this
* region already (FIXME) */
request_region(0x3c0, 32, "vesafb");
if (mtrr) {
- int temp_size = video_size;
+ int temp_size = vesafb_fix.smem_len;
/* Find the largest power-of-two */
while (temp_size & (temp_size - 1))
temp_size &= (temp_size - 1);
/* Try and find a power of two to add */
- while (temp_size && mtrr_add(video_base, temp_size, MTRR_TYPE_WRCOMB, 1)==-EINVAL) {
+ while (temp_size && mtrr_add(vesafb_fix.smem_start, temp_size, MTRR_TYPE_WRCOMB, 1)==-EINVAL) {
temp_size >>= 1;
}
}
- strcpy(fb_info.modename, "VESA VGA");
+ strcpy(fb_info.modename, vesafb_fix.id);
fb_info.changevar = NULL;
fb_info.node = NODEV;
fb_info.fbops = &vesafb_ops;
- fb_info.disp=&disp;
- fb_info.switch_con=&vesafb_switch;
- fb_info.updatevar=&vesafb_update_var;
+ fb_info.var = vesafb_defined;
+ fb_info.fix = vesafb_fix;
+ fb_info.disp = &disp;
+ fb_info.switch_con = gen_switch;
+ fb_info.updatevar = &vesafb_update_var;
+ fb_info.pseudo_palette = pseudo_palette;
fb_info.flags=FBINFO_FLAG_DEFAULT;
- vesafb_set_disp(-1);
+
+ fb_alloc_cmap(&fb_info.cmap, video_cmap_len, 0);
+ gen_set_disp(-1, &fb_info);
if (register_framebuffer(&fb_info)<0)
return -EINVAL;
printk(KERN_INFO "fb%d: %s frame buffer device\n",
- GET_FB_IDX(fb_info.node), fb_info.modename);
+ GET_FB_IDX(fb_info.node), fb_info.fix.id);
return 0;
}
|
|
From: Jurriaan on A. <thu...@xs...> - 2002-03-01 07:20:00
|
From: Dave Jones <da...@su...> Date: Thu, Feb 28, 2002 at 10:08:47PM +0100 > On Thu, Feb 28, 2002 at 01:00:04PM -0800, James Simmons wrote: > > > > The patch is against 2.5.5-dj2 > > > > http://www.transvirtual.com/~jsimmons/tdfx.diff > > > Is this one different to the one I saw last time? > > Actually no. I think the driver hasn't changed. I does work for me. Did > > you try it out again. > > Ok. I didn't look too deeply last time, but it died immediately > on switching the display, and was really dead, no keyboard leds, > nada. > That was my experience also (Voodoo 4500 pci/Alpha architecture). However, the VIDCFG_2X handling in his patch worked, and the kernel (pre-2.4.18) didn't. Luckily, a small patch was accepted to change that. I'm willing to test any patches for tdfxfb on Alpha. Good luck, Jurriaan -- One guide for speakers of Klingon advises them to begin by purchasing a large supply of napkins. Robert O'Reilly [Gowron] on speaking Klingon. GNU/Linux 2.4.19pre1 on Debian/Alpha 988 bogomips load:1.64 1.33 0.76 |
|
From: <jh...@ri...> - 2002-03-01 02:26:53
|
> Now that you mention the penguin, I was reminded of something. > Normally with this box, when the fb starts, the top 3rd of the > screen has a large white rectangle blitted onto it for reasons > I never figured out. Its purely cosmetic (it disappears when scrolling > begins), so it wasn't something I really bothered investigating. Attila Kesmarki's v0.2.0 patch for tdfxfb fixed this problem for me when I tested it about a year and a half ago, but I don't think his updates were ever integrated -- I don't know if there were issues with the changes or not. Anyway, the patches still seem to be up: http://www.medex.hu/~danthe/tdfx/ -- Joseph Fannin jh...@ri... "I think I said something eloquent, like 'Fuck.'" -- Rusty Russell |
|
From: Dave J. <da...@su...> - 2002-02-28 21:11:58
|
On Thu, Feb 28, 2002 at 12:44:26PM -0800, James Simmons wrote: > Their are a few changes. I tested it last night and it worked for me. That > doesn't mean much so if you could give it a try. BTW the penguin will not > show up. I need to expand the imageblit function but it is not top > priority right now. Now that you mention the penguin, I was reminded of something. Normally with this box, when the fb starts, the top 3rd of the screen has a large white rectangle blitted onto it for reasons I never figured out. Its purely cosmetic (it disappears when scrolling begins), so it wasn't something I really bothered investigating. It could be that with your reworking, this bug has taken on a new form, and is now doing something more dramatic. -- | Dave Jones. http://www.codemonkey.org.uk | SuSE Labs |
|
From: Dave J. <da...@su...> - 2002-02-28 21:08:52
|
On Thu, Feb 28, 2002 at 01:00:04PM -0800, James Simmons wrote: > > > The patch is against 2.5.5-dj2 > > > http://www.transvirtual.com/~jsimmons/tdfx.diff > > Is this one different to the one I saw last time? > Actually no. I think the driver hasn't changed. I does work for me. Did > you try it out again. Ok. I didn't look too deeply last time, but it died immediately on switching the display, and was really dead, no keyboard leds, nada. I'll take another look later if I get chance -- | Dave Jones. http://www.codemonkey.org.uk | SuSE Labs |
|
From: James S. <jsi...@tr...> - 2002-02-28 21:00:12
|
> On Thu, Feb 28, 2002 at 08:22:30AM -0800, James Simmons wrote: > > > > As you can see I have ported the 3dfx fbdev driver to the new api. It has > > been tested on my home system and it works. I like others to try it out. > > The patch is against 2.5.5-dj2 > > http://www.transvirtual.com/~jsimmons/tdfx.diff > > Is this one different to the one I saw last time? Actually no. I think the driver hasn't changed. I does work for me. Did you try it out again. |
|
From: James S. <jsi...@tr...> - 2002-02-28 20:44:34
|
> > As you can see I have ported the 3dfx fbdev driver to the new api. It has > > been tested on my home system and it works. I like others to try it out. > > The patch is against 2.5.5-dj2 > > http://www.transvirtual.com/~jsimmons/tdfx.diff > > Is this one different to the one I saw last time? Their are a few changes. I tested it last night and it worked for me. That doesn't mean much so if you could give it a try. BTW the penguin will not show up. I need to expand the imageblit function but it is not top priority right now. |
|
From: Dave J. <da...@su...> - 2002-02-28 20:40:52
|
On Thu, Feb 28, 2002 at 08:22:30AM -0800, James Simmons wrote: > > As you can see I have ported the 3dfx fbdev driver to the new api. It has > been tested on my home system and it works. I like others to try it out. > The patch is against 2.5.5-dj2 > http://www.transvirtual.com/~jsimmons/tdfx.diff Is this one different to the one I saw last time? -- | Dave Jones. http://www.codemonkey.org.uk | SuSE Labs |
|
From: James S. <jsi...@tr...> - 2002-02-28 18:38:25
|
Please test this driver so it can be included into the dave jones tree. It
is against 2.5.5-dj1
. ---
|o_o |
|:_/ | Give Micro$oft the Bird!!!!
// \ \ Use Linux!!!!
(| | )
/'_ _/`\
___)=(___/
--- linux-2.5.5-dj2/drivers/video/q40fb.c Tue Feb 26 16:04:26 2002
+++ linux/drivers/video/q40fb.c Thu Feb 28 11:33:22 2002
@@ -1,3 +1,15 @@
+/*
+ * linux/drivers/video/q40fb.c -- Q40 frame buffer device
+ *
+ * Copyright (C) 2001
+ *
+ * Richard Zidlicky <Ric...@st...>
+ *
+ * This file is subject to the terms and conditions of the GNU General Public
+ * License. See the file COPYING in the main directory of this archive for
+ * more details.
+ */
+
#include <linux/kernel.h>
#include <linux/errno.h>
#include <linux/string.h>
@@ -9,179 +21,54 @@
#include <asm/uaccess.h>
#include <asm/setup.h>
+#include <asm/segment.h>
#include <asm/system.h>
-/*#include <asm/irq.h>*/
#include <asm/q40_master.h>
#include <linux/fb.h>
#include <linux/module.h>
#include <asm/pgtable.h>
#include <video/fbcon.h>
-#include <video/fbcon-cfb16.h>
-
-#define FBIOSETSCROLLMODE 0x4611
#define Q40_PHYS_SCREEN_ADDR 0xFE800000
static u16 pseudo_palette[17];
+static struct fb_info fb_info;
+static struct display display;
-/* frame buffer operations */
+static struct fb_fix_screeninfo q40fb_fix __initdata = {
+ "Q40", (unsigned long) NULL, 1024*1024, FB_TYPE_PACKED_PIXELS, 0,
+ FB_VISUAL_TRUECOLOR, 0, 0, 0, 1024*2, (unsigned long) NULL, 0, FB_ACCEL_NONE
+};
-static int q40fb_get_fix(struct fb_fix_screeninfo *fix, int con,
- struct fb_info *info);
-static int q40fb_get_var(struct fb_var_screeninfo *var, int con,
- struct fb_info *info);
-static int q40fb_set_var(struct fb_var_screeninfo *var, int con,
- struct fb_info *info);
-static int q40fb_get_cmap(struct fb_cmap *cmap,int kspc,int con,
- struct fb_info *info);
-static int q40fb_setcolreg(unsigned regno, unsigned red, unsigned green,
- unsigned blue, unsigned transp,
- const struct fb_info *info);
+static struct fb_var_screeninfo q40fb_var __initdata = {
+ /* 1024x512, 16 bpp */
+ 1024, 512, 1024, 512, 0, 0, 16, 0,
+ {6, 5, 0}, {11, 5, 0}, {0, 6, 0}, {0, 0, 0},
+ 0, FB_ACTIVATE_NOW, 230, 300, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, FB_VMODE_NONINTERLACED
+};
-static int q40con_switch(int con, struct fb_info *info);
-static int q40con_updatevar(int con, struct fb_info *info);
+/* frame buffer operations */
+int q40fb_init(void);
-static void q40fb_set_disp(int con, struct fb_info *info);
+static int q40fb_setcolreg(unsigned regno, unsigned red, unsigned green,
+ unsigned blue, unsigned transp,
+ struct fb_info *info);
-static struct display disp[MAX_NR_CONSOLES];
-static struct fb_info fb_info;
static struct fb_ops q40fb_ops = {
owner: THIS_MODULE,
- fb_get_fix: q40fb_get_fix,
- fb_get_var: q40fb_get_var,
- fb_set_var: q40fb_set_var,
- fb_get_cmap: q40fb_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_setcolreg: q40fb_setcolreg,
};
-static char q40fb_name[]="Q40";
-
-static int q40fb_get_fix(struct fb_fix_screeninfo *fix, int con,
- struct fb_info *info)
-{
- memset(fix, 0, sizeof(struct fb_fix_screeninfo));
-
- strcpy(fix->id,"Q40");
- fix->smem_start = info->screen_base;
- fix->smem_len=1024*1024;
- fix->type=FB_TYPE_PACKED_PIXELS;
- fix->type_aux=0;
- fix->visual=FB_VISUAL_TRUECOLOR; /* good approximation so far ..*/;
- fix->xpanstep=0;
- fix->ypanstep=0;
- fix->ywrapstep=0;
- fix->line_length=1024*2;
-
- /* no mmio,accel ...*/
-
- return 0;
-
-}
-
-static int q40fb_get_var(struct fb_var_screeninfo *var, int con,
- struct fb_info *info)
-{
- memset(var, 0, sizeof(struct fb_var_screeninfo));
-
- var->xres=1024;
- var->yres=512;
- var->xres_virtual=1024;
- var->yres_virtual=512;
- var->xoffset=0;
- var->yoffset=0;
- var->bits_per_pixel=16;
- var->grayscale=0;
- var->nonstd=0;
- var->activate=FB_ACTIVATE_NOW;
- var->height=230; /* approx for my 17" monitor, more important */
- var->width=300; /* than the absolute values is the unusual aspect ratio*/
-
- var->red.offset=6; /*6*/
- var->red.length=5;
- var->green.offset=11; /*11*/
- var->green.length=5;
- var->blue.offset=0;
- var->blue.length=6;
- var->transp.length=0;
-
- var->pixclock=0;
- var->left_margin=0;
- var->right_margin=0;
- var->hsync_len=0;
- var->vsync_len=0;
- var->sync=0;
- var->vmode=FB_VMODE_NONINTERLACED;
-
- return 0;
-
-}
-
-static int q40fb_set_var(struct fb_var_screeninfo *var, int con,
- struct fb_info *info)
-{
- if(var->xres!=1024)
- return -EINVAL;
- if(var->yres!=512)
- return -EINVAL;
- if(var->xres_virtual!=1024)
- return -EINVAL;
- if(var->yres_virtual!=512)
- return -EINVAL;
- if(var->xoffset!=0)
- return -EINVAL;
- if(var->yoffset!=0)
- return -EINVAL;
- if(var->bits_per_pixel!=16)
- return -EINVAL;
- if(var->grayscale!=0)
- return -EINVAL;
- if(var->nonstd!=0)
- return -EINVAL;
- if(var->activate!=FB_ACTIVATE_NOW)
- return -EINVAL;
- if(var->pixclock!=0)
- return -EINVAL;
- if(var->left_margin!=0)
- return -EINVAL;
- if(var->right_margin!=0)
- return -EINVAL;
- if(var->hsync_len!=0)
- return -EINVAL;
- if(var->vsync_len!=0)
- return -EINVAL;
- if(var->sync!=0)
- return -EINVAL;
- if(var->vmode!=FB_VMODE_NONINTERLACED)
- return -EINVAL;
-
- return 0;
-
-}
-
-static int q40_getcolreg(unsigned regno, unsigned *red, unsigned *green,
- unsigned *blue, unsigned *transp,
- struct fb_info *info)
-{
- /*
- * Read a single color register and split it into colors/transparent.
- * The return values must have a 16 bit magnitude.
- * Return != 0 for invalid regno.
- */
- if (regno>=16) return 1;
-
- *transp=0;
- *green = ((info->pseudo_palette[regno]>>11) & 31)<<11;
- *red = ((info->pseudo_palette[regno]>>6) & 31)<<11;
- *blue = ((info->pseudo_palette[regno]) & 63)<<10;
-
- return 0;
-}
-
static int q40fb_setcolreg(unsigned regno, unsigned red, unsigned green,
- unsigned blue, unsigned transp,
- const struct fb_info *info)
+ unsigned blue, unsigned transp,
+ struct fb_info *info)
{
/*
* Set a single color register. The values supplied have a 16 bit
@@ -189,118 +76,54 @@
* 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) |
- ((green & 31) << 11) |
- (blue & 63);
+ info->pseudo_palette[regno] = ((red & 31) <<6) |
+ ((green & 31) << 11) |
+ (blue & 63);
}
return 0;
}
-static int q40fb_get_cmap(struct fb_cmap *cmap, int kspc, int con,
- struct fb_info *info)
-{
-#if 1
- if (con == info->currcon) /* current console? */
- return fb_get_cmap(cmap, kspc, q40_getcolreg, info);
- else if (fb_display[con].cmap.len) /* non default colormap? */
- fb_copy_cmap(&fb_display[con].cmap, cmap, kspc ? 0 : 2);
- else
- fb_copy_cmap(fb_default_cmap(1<<fb_display[con].var.bits_per_pixel),
- cmap, kspc ? 0 : 2);
- return 0;
-#else
- printk(KERN_ERR "get cmap not supported\n");
-
- return -EINVAL;
-#endif
-}
-
-static void q40fb_set_disp(int con, struct fb_info *info)
-{
- struct fb_fix_screeninfo fix;
- struct display *display;
-
- q40fb_get_fix(&fix, con, info);
-
- if (con>=0)
- display = &fb_display[con];
- else
- display = &disp[0];
-
- if (con<0) 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->can_soft_blank = 0;
- display->inverse = 0;
- display->line_length = fix.line_length;
-
- display->scrollmode = SCROLL_YREDRAW;
-
-#ifdef FBCON_HAS_CFB16
- display->dispsw = &fbcon_cfb16;
- disp->dispsw_data = info->pseudo_palette;
-#else
- display->dispsw = &fbcon_dummy;
-#endif
-}
-
-int __init q40fb_init(void)
+int q40fb_init(void)
{
-
if ( !MACH_IS_Q40)
return -ENXIO;
-#if 0
- fb_info.screen_base = kernel_map(Q40_PHYS_SCREEN_ADDR, 1024*1024,
- KERNELMAP_NO_COPYBACK, NULL);
-#else
- fb_info.screen_base = Q40_PHYS_SCREEN_ADDR; /* mapped in q40/config.c */
-#endif
-
- fb_info.changevar=NULL;
- strcpy(&fb_info.modename[0],q40fb_name);
- fb_info.fontname[0]=0;
- fb_info.pseudo_palette = pseudo_palette;
- fb_info.disp=disp;
- fb_info.switch_con=&q40con_switch;
- fb_info.updatevar=&q40con_updatevar;
+
+ /* mapped in q40/config.c */
+ q40fb_fix.smem_start = Q40_PHYS_SCREEN_ADDR;
+
+ fb_info.var = q40fb_var;
+ fb_info.fix = q40fb_fix;
fb_info.node = NODEV;
fb_info.fbops = &q40fb_ops;
fb_info.flags = FBINFO_FLAG_DEFAULT; /* not as module for now */
-
- master_outb(3,DISPLAY_CONTROL_REG);
+ fb_info.pseudo_palette = pseudo_palette;
+ fb_info.screen_base = (char *) q40fb_fix.smem_start;
+
+ /* The below feilds will go away !!!! */
+ fb_info.currcon = -1;
+ strcpy(fb_info.modename, fb_info.fix.id);
+ fb_info.disp = &display;
+ fb_info.switch_con = gen_switch;
+ fb_info.updatevar = gen_update_var;
+ fb_alloc_cmap(&fb_info.cmap, 16, 0);
- q40fb_get_var(&disp[0].var, 0, &fb_info);
- q40fb_set_disp(-1, &fb_info);
+ gen_set_var(&fb_info.var, -1, &fb_info);
+
+ master_outb(3, DISPLAY_CONTROL_REG);
if (register_framebuffer(&fb_info) < 0) {
- printk(KERN_ERR "unable to register Q40 frame buffer\n");
+ printk(KERN_ERR "Unable to register Q40 frame buffer\n");
return -EINVAL;
}
printk(KERN_INFO "fb%d: Q40 frame buffer alive and kicking !\n",
GET_FB_IDX(fb_info.node));
return 0;
-}
-
-
-static int q40con_switch(int con, struct fb_info *info)
-{
- info->currcon=con;
- return 0;
-}
-
-static int q40con_updatevar(int con, struct fb_info *info)
-{
- return 0;
}
-MODULE_LICENSE("GPL");
+MODULE_LICENSE("GPL");
|
|
From: James S. <jsi...@tr...> - 2002-02-28 18:28:17
|
Please test this driver so I could included into the dj tree. It is
against 2.5.5-dj1.
. ---
|o_o |
|:_/ | Give Micro$oft the Bird!!!!
// \ \ Use Linux!!!!
(| | )
/'_ _/`\
___)=(___/
--- linux-2.5.5-dj2/drivers/video/fm2fb.c Tue Feb 26 16:04:26 2002
+++ linux/drivers/video/fm2fb.c Thu Feb 28 11:23:44 2002
@@ -4,9 +4,11 @@
*
* Copyright (C) 1998 Steffen A. Mork (mo...@ls...)
* Copyright (C) 1999 Geert Uytterhoeven
+ * Copyright (C) 2001 James Simmons
*
* Written for 2.0.x by Steffen A. Mork
* Ported to 2.1.x by Geert Uytterhoeven
+ * Ported to new api by 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
@@ -18,12 +20,9 @@
#include <linux/fb.h>
#include <linux/init.h>
#include <linux/zorro.h>
-
#include <asm/io.h>
#include <video/fbcon.h>
-#include <video/fbcon-cfb32.h>
-
/*
* Some technical notes:
@@ -117,7 +116,6 @@
*
*/
-
/*
* definitions
*/
@@ -130,29 +128,18 @@
#define FRAMEMASTER_COMPL 4
#define FRAMEMASTER_ROM 8
-
-struct FrameMaster_fb_par
-{
- int xres;
- int yres;
- int bpp;
- int pixclock;
-};
-
-static unsigned long fm2fb_mem_phys;
-static void *fm2fb_mem;
-static unsigned long fm2fb_reg_phys;
static volatile unsigned char *fm2fb_reg;
-static struct display disp;
+#define arraysize(x) (sizeof(x)/sizeof(*(x)))
+
static struct fb_info fb_info;
-static struct { u_char red, green, blue, pad; } palette[16];
-#ifdef FBCON_HAS_CFB32
-static u32 fbcon_cfb32_cmap[16];
-#endif
+static u32 pseudo_palette[17];
+static struct display display;
-static struct fb_fix_screeninfo fb_fix;
-static struct fb_var_screeninfo fb_var;
+static struct fb_fix_screeninfo fb_fix __initdata = {
+ NULL, (unsigned long) NULL, FRAMEMASTER_REG, FB_TYPE_PACKED_PIXELS, 0,
+ FB_VISUAL_TRUECOLOR, 0, 0, 0, 768<<2, (unsigned long)NULL, 8, FB_ACCEL_NONE
+};
static int fm2fb_mode __initdata = -1;
@@ -174,125 +161,55 @@
33333, 10, 102, 10, 5, 80, 34, FB_SYNC_COMP_HIGH_ACT, 0
}
};
-
-
+
/*
* Interface used by the world
*/
+int fm2fb_init(void);
-static int fm2fb_get_fix(struct fb_fix_screeninfo *fix, int con,
- struct fb_info *info);
-static int fm2fb_get_var(struct fb_var_screeninfo *var, int con,
- struct fb_info *info);
-static int fm2fb_set_var(struct fb_var_screeninfo *var, int con,
- struct fb_info *info);
-static int fm2fb_get_cmap(struct fb_cmap *cmap, int kspc, int con,
- struct fb_info *info);
static int fm2fb_setcolreg(u_int regno, u_int red, u_int green, u_int blue,
- u_int transp, struct fb_info *info);
+ u_int transp, struct fb_info *info);
static int fm2fb_blank(int blank, struct fb_info *info);
- /*
- * Interface to the low level console driver
- */
-
-int fm2fb_init(void);
-static int fm2fbcon_switch(int con, struct fb_info *info);
-static int fm2fbcon_updatevar(int con, struct fb_info *info);
-
- /*
- * Internal routines
- */
-
-static int fm2fb_getcolreg(u_int regno, u_int *red, u_int *green, u_int *blue,
- u_int *transp, struct fb_info *info);
-
static struct fb_ops fm2fb_ops = {
owner: THIS_MODULE,
- fb_get_fix: fm2fb_get_fix,
- fb_get_var: fm2fb_get_var,
- fb_set_var: fm2fb_set_var,
- fb_get_cmap: fm2fb_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_setcolreg: fm2fb_setcolreg,
- fb_blank: fm2fb_blank,
+ fb_blank: fm2fb_blank,
};
/*
- * Get the Fixed Part of the Display
+ * Blank the display.
*/
-
-static int fm2fb_get_fix(struct fb_fix_screeninfo *fix, int con,
- struct fb_info *info)
+static int fm2fb_blank(int blank, struct fb_info *info)
{
- memcpy(fix, &fb_fix, sizeof(fb_fix));
- return 0;
-}
+ unsigned char t = FRAMEMASTER_ROM;
-
- /*
- * Get the User Defined Part of the Display
- */
-
-static int fm2fb_get_var(struct fb_var_screeninfo *var, int con,
- struct fb_info *info)
-{
- memcpy(var, &fb_var, sizeof(fb_var));
- return 0;
+ if (!blank)
+ t |= FRAMEMASTER_ENABLE | FRAMEMASTER_NOLACE;
+ fm2fb_reg[0] = t;
}
-
-
+
/*
- * Set the User Defined Part of the Display
+ * Set a single color register. The values supplied are already
+ * rounded down to the hardware's capabilities (according to the
+ * entries in the var structure). Return != 0 for invalid regno.
*/
-
-static int fm2fb_set_var(struct fb_var_screeninfo *var, int con,
- struct fb_info *info)
+static int fm2fb_setcolreg(u_int regno, u_int red, u_int green, u_int blue,
+ u_int transp, struct fb_info *info)
{
- struct display *display;
- int oldbpp = -1, err;
-
- if (con >= 0)
- display = &fb_display[con];
- else
- display = &disp; /* used during initialization */
-
- if (var->xres > fb_var.xres || var->yres > fb_var.yres ||
- var->xres_virtual > fb_var.xres_virtual ||
- var->yres_virtual > fb_var.yres_virtual ||
- var->bits_per_pixel > fb_var.bits_per_pixel ||
- var->nonstd ||
- (var->vmode & FB_VMODE_MASK) != FB_VMODE_NONINTERLACED)
- return -EINVAL;
- memcpy(var, &fb_var, sizeof(fb_var));
-
- if ((var->activate & FB_ACTIVATE_MASK) == FB_ACTIVATE_NOW) {
- oldbpp = display->var.bits_per_pixel;
- display->var = *var;
- }
- if (oldbpp != var->bits_per_pixel) {
- if ((err = fb_alloc_cmap(&display->cmap, 0, 0)))
- return err;
- do_install_cmap(con, info);
- }
- return 0;
-}
-
+ if (regno > 15)
+ return 1;
+ red >>= 8;
+ green >>= 8;
+ blue >>= 8;
- /*
- * Get the Colormap
- */
-
-static int fm2fb_get_cmap(struct fb_cmap *cmap, int kspc, int con,
- struct fb_info *info)
-{
- if (con == info->currcon) /* current console? */
- return fb_get_cmap(cmap, kspc, fm2fb_getcolreg, info);
- else if (fb_display[con].cmap.len) /* non default colormap? */
- fb_copy_cmap(&fb_display[con].cmap, cmap, kspc ? 0 : 2);
- else
- fb_copy_cmap(fb_default_cmap(256), cmap, kspc ? 0 : 2);
- return 0;
+ ((u32*)(info->pseudo_palette))[regno] = (red << 16) | (green << 8) | blue;
+ return 0;
}
/*
@@ -301,193 +218,87 @@
int __init fm2fb_init(void)
{
- int is_fm;
- struct zorro_dev *z = NULL;
- unsigned long *ptr;
- int x, y;
-
- while ((z = zorro_find_device(ZORRO_WILDCARD, z))) {
- if (z->id == ZORRO_PROD_BSC_FRAMEMASTER_II)
- is_fm = 1;
- else if (z->id == ZORRO_PROD_HELFRICH_RAINBOW_II)
- is_fm = 0;
- else
- continue;
- if (!request_mem_region(z->resource.start, FRAMEMASTER_SIZE, "fm2fb"))
- continue;
-
- /* assigning memory to kernel space */
- fm2fb_mem_phys = z->resource.start;
- fm2fb_mem = ioremap(fm2fb_mem_phys, FRAMEMASTER_SIZE);
- fm2fb_reg_phys = fm2fb_mem_phys+FRAMEMASTER_REG;
- fm2fb_reg = (unsigned char *)(fm2fb_mem+FRAMEMASTER_REG);
-
- /* make EBU color bars on display */
- ptr = (unsigned long *)fm2fb_mem;
- for (y = 0; y < 576; y++) {
- for (x = 0; x < 96; x++) *ptr++ = 0xffffff; /* white */
- for (x = 0; x < 96; x++) *ptr++ = 0xffff00; /* yellow */
- for (x = 0; x < 96; x++) *ptr++ = 0x00ffff; /* cyan */
- for (x = 0; x < 96; x++) *ptr++ = 0x00ff00; /* green */
- for (x = 0; x < 96; x++) *ptr++ = 0xff00ff; /* magenta */
- for (x = 0; x < 96; x++) *ptr++ = 0xff0000; /* red */
- for (x = 0; x < 96; x++) *ptr++ = 0x0000ff; /* blue */
- for (x = 0; x < 96; x++) *ptr++ = 0x000000; /* black */
- }
- fm2fb_blank(0, NULL);
+ struct zorro_dev *z = NULL;
+ unsigned long *ptr;
+ int is_fm;
+ int x, y;
+
+ while ((z = zorro_find_device(ZORRO_WILDCARD, z))) {
+ if (z->id == ZORRO_PROD_BSC_FRAMEMASTER_II)
+ is_fm = 1;
+ else if (z->id == ZORRO_PROD_HELFRICH_RAINBOW_II)
+ is_fm = 0;
+ else
+ continue;
+
+ if (!request_mem_region(z->resource.start, FRAMEMASTER_SIZE, "fm2fb"))
+ continue;
+
+ /* assigning memory to kernel space */
+ fb_fix.smem_start = z->resource.start;
+ fb_info.screen_base = ioremap(fb_fix.smem_start, FRAMEMASTER_SIZE);
+ fb_fix.mmio_start = fb_fix.smem_start + FRAMEMASTER_REG;
+ fm2fb_reg = (unsigned char *)(fb_info.screen_base+FRAMEMASTER_REG);
+
+ strcpy(fb_fix.id, is_fm ? "FrameMaster II" : "Rainbow II");
+
+ /* make EBU color bars on display */
+ ptr = (unsigned long *)fb_fix.smem_start;
+ for (y = 0; y < 576; y++) {
+ for (x = 0; x < 96; x++) *ptr++ = 0xffffff;/* white */
+ for (x = 0; x < 96; x++) *ptr++ = 0xffff00;/* yellow */
+ for (x = 0; x < 96; x++) *ptr++ = 0x00ffff;/* cyan */
+ for (x = 0; x < 96; x++) *ptr++ = 0x00ff00;/* green */
+ for (x = 0; x < 96; x++) *ptr++ = 0xff00ff;/* magenta */
+ for (x = 0; x < 96; x++) *ptr++ = 0xff0000;/* red */
+ for (x = 0; x < 96; x++) *ptr++ = 0x0000ff;/* blue */
+ for (x = 0; x < 96; x++) *ptr++ = 0x000000;/* black */
+ }
+ fm2fb_blank(0, NULL);
+
+ 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];
+ fb_info.screen_base = (char *)fb_fix.smem_start;
+ fb_info.pseudo_palette = pseudo_palette;
+ fb_info.fix = fb_fix;
+ fb_info.flags = FBINFO_FLAG_DEFAULT;
+
+ /* The below feilds will go away !!!! */
+ fb_info.currcon = -1;
+ strcpy(fb_info.modename, fb_info.fix.id);
+ fb_info.disp = &display;
+ fb_info.switch_con = gen_switch;
+ fb_info.updatevar = gen_update_var;
+ fb_alloc_cmap(&fb_info.cmap, 16, 0);
- if (fm2fb_mode == -1)
- fm2fb_mode = FM2FB_MODE_PAL;
+ gen_set_var(&fb_info.var, -1, &fb_info);
- fb_var = fb_var_modes[fm2fb_mode];
+ if (register_framebuffer(&fb_info) < 0)
+ return -EINVAL;
- strcpy(fb_fix.id, is_fm ? "FrameMaster II" : "Rainbow II");
- fb_fix.smem_start = fm2fb_mem_phys;
- fb_fix.smem_len = FRAMEMASTER_REG;
- fb_fix.type = FB_TYPE_PACKED_PIXELS;
- fb_fix.type_aux = 0;
- fb_fix.visual = FB_VISUAL_TRUECOLOR;
- fb_fix.line_length = 768<<2;
- fb_fix.mmio_start = fm2fb_reg_phys;
- fb_fix.mmio_len = 8;
- fb_fix.accel = FB_ACCEL_NONE;
-
- disp.var = fb_var;
- disp.cmap.start = 0;
- disp.cmap.len = 0;
- disp.cmap.red = disp.cmap.green = disp.cmap.blue = disp.cmap.transp = NULL;
- disp.screen_base = (char *)fm2fb_mem;
- disp.visual = fb_fix.visual;
- disp.type = fb_fix.type;
- disp.type_aux = fb_fix.type_aux;
- disp.ypanstep = 0;
- disp.ywrapstep = 0;
- disp.line_length = fb_fix.line_length;
- disp.can_soft_blank = 1;
- disp.inverse = 0;
- #ifdef FBCON_HAS_CFB32
- disp.dispsw = &fbcon_cfb32;
- disp.dispsw_data = &fbcon_cfb32_cmap;
- #else
- disp.dispsw = &fbcon_dummy;
- #endif
- disp.scrollmode = SCROLL_YREDRAW;
-
- strcpy(fb_info.modename, fb_fix.id);
- fb_info.node = NODEV;
- fb_info.fbops = &fm2fb_ops;
- fb_info.disp = &disp;
- fb_info.fontname[0] = '\0';
- fb_info.changevar = NULL;
- fb_info.switch_con = &fm2fbcon_switch;
- fb_info.updatevar = &fm2fbcon_updatevar;
- fb_info.flags = FBINFO_FLAG_DEFAULT;
-
- fm2fb_set_var(&fb_var, -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_fix.id);
- return 0;
- }
- return -ENXIO;
+ printk("fb%d: %s frame buffer device\n", GET_FB_IDX(fb_info.node), fb_fix.id);
+ return 0;
+ }
+ return -ENXIO;
}
int __init fm2fb_setup(char *options)
{
- char *this_opt;
-
- if (!options || !*options)
- return 0;
-
- while ((this_opt = strsep(&options, ",")) != NULL) {
- if (!strncmp(this_opt, "pal", 3))
- fm2fb_mode = FM2FB_MODE_PAL;
- else if (!strncmp(this_opt, "ntsc", 4))
- fm2fb_mode = FM2FB_MODE_NTSC;
- }
- return 0;
-}
-
-
-static int fm2fbcon_switch(int con, struct fb_info *info)
-{
- /* Do we have to save the colormap? */
- if (fb_display[info->currcon].cmap.len)
- fb_get_cmap(&fb_display[info->currcon].cmap, 1, fm2fb_getcolreg, info);
-
- info->currcon = con;
- /* Install new colormap */
- do_install_cmap(con, info);
- return 0;
-}
-
- /*
- * Update the `var' structure (called by fbcon.c)
- */
-
-static int fm2fbcon_updatevar(int con, struct fb_info *info)
-{
- /* Nothing */
- return 0;
-}
-
- /*
- * Blank the display.
- */
-
-static int fm2fb_blank(int blank, struct fb_info *info)
-{
- unsigned char t = FRAMEMASTER_ROM;
-
- if (!blank)
- t |= FRAMEMASTER_ENABLE | FRAMEMASTER_NOLACE;
- fm2fb_reg[0] = t;
- return 0;
-}
-
- /*
- * Read a single color register and split it into
- * colors/transparent. Return != 0 for invalid regno.
- */
-
-static int fm2fb_getcolreg(u_int regno, u_int *red, u_int *green, u_int *blue,
- u_int *transp, struct fb_info *info)
-{
- if (regno > 15)
- return 1;
- *red = (palette[regno].red<<8) | palette[regno].red;
- *green = (palette[regno].green<<8) | palette[regno].green;
- *blue = (palette[regno].blue<<8) | palette[regno].blue;
- *transp = 0;
- return 0;
-}
+ char *this_opt;
+ if (!options || !*options)
+ return 0;
- /*
- * Set a single color register. The values supplied are already
- * rounded down to the hardware's capabilities (according to the
- * entries in the var structure). Return != 0 for invalid regno.
- */
-
-static int fm2fb_setcolreg(u_int regno, u_int red, u_int green, u_int blue,
- u_int transp, struct fb_info *info)
-{
- if (regno > 15)
- return 1;
- red >>= 8;
- green >>= 8;
- blue >>= 8;
- palette[regno].red = red;
- palette[regno].green = green;
- palette[regno].blue = blue;
-
-#ifdef FBCON_HAS_CFB32
- fbcon_cfb32_cmap[regno] = (red << 16) | (green << 8) | blue;
-#endif
- return 0;
+ while ((this_opt = strsep(&options, ",")) != NULL) {
+ if (!strncmp(this_opt, "pal", 3))
+ fm2fb_mode = FM2FB_MODE_PAL;
+ else if (!strncmp(this_opt, "ntsc", 4))
+ fm2fb_mode = FM2FB_MODE_NTSC;
+ }
+ return 0;
}
MODULE_LICENSE("GPL");
|
|
From: James S. <jsi...@tr...> - 2002-02-28 18:01:40
|
Hi!
Since I don't have this hardware could someone test this driver. It is
against 2.5.5-dj2
. ---
|o_o |
|:_/ | Give Micro$oft the Bird!!!!
// \ \ Use Linux!!!!
(| | )
/'_ _/`\
___)=(___/
--- linux-2.5.5-dj2/drivers/video/hpfb.c Tue Feb 26 16:04:26 2002
+++ linux/drivers/video/hpfb.c Thu Feb 28 10:55:18 2002
@@ -1,9 +1,6 @@
/*
* HP300 Topcat framebuffer support (derived from macfb of all things)
* Phil Blundell <ph...@gn...> 1998
- *
- * Should this be moved to drivers/dio/video/ ? -- Peter Maydell
- * No! -- Jes
*/
#include <linux/module.h>
@@ -22,16 +19,8 @@
#include <asm/blinken.h>
#include <asm/hwtest.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>
-
-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;
@@ -51,99 +40,41 @@
#define WWIDTH 0x4102
#define WMOVE 0x409c
+static struct fb_fix_screeninfo hpfb_fix __initdata = {
+ "HP300 Topcat", (unsigned long) NULL, 1024*768, FB_TYPE_PACKED_PIXELS, 0,
+ FB_VISUAL_PSEUDOCOLOR, 0, 0, 0, 1024, (unsigned long) NULL, 0, FB_ACCEL_NONE};
+
static struct fb_var_screeninfo hpfb_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,2,0}, /* R */
- {0,2,0}, /* G */
- {0,2,0}, /* B */
- {0,0,0}, /* transparency */
- 0, /* standard pixel format */
+ 1024,768,1024,768, /* W,H, W, H (virtual) load xres,xres_virtual*/
+ 0,0, /* virtual -> visible no offset */
+ 1, /* depth -> load bits_per_pixel */
+ 0, /* greyscale ? */
+ {0,2,0}, /* R */
+ {0,2,0}, /* G */
+ {0,2,0}, /* B */
+ {0,0,0}, /* transparency */
+ 0, /* standard pixel format */
FB_ACTIVATE_NOW,
- 274,195, /* 14" monitor */
+ 274,195, /* 14" monitor */
FB_ACCEL_NONE,
0L,0L,0L,0L,0L,
- 0L,0L,0, /* No sync info */
+ 0L,0L,0, /* No sync info */
FB_VMODE_NONINTERLACED,
{0,0,0,0,0,0}
};
-struct hpfb_par
-{
-};
-
-struct hpfb_par current_par;
-
-static void hpfb_encode_var(struct fb_var_screeninfo *var,
- struct hpfb_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 = 1;
- var->grayscale=0;
- var->transp.offset=0;
- var->transp.length=0;
- var->transp.msb_right=0;
- var->nonstd=0;
- var->activate=0;
- 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<ARRAY_SIZE(var->reserved);i++)
- var->reserved[i]=0;
-}
-
-static void hpfb_get_par(struct hpfb_par *par)
-{
- *par=current_par;
-}
-
-static int fb_update_var(int con, struct fb_info *info)
-{
- return 0;
-}
-
-static int do_fb_set_var(struct fb_var_screeninfo *var, int isactive)
-{
- struct hpfb_par par;
-
- hpfb_get_par(&par);
- hpfb_encode_var(var, &par);
- return 0;
-}
-
-static int hpfb_get_cmap(struct fb_cmap *cmap, int kspc, int con,
- struct fb_info *info)
-{
- return 0;
-}
+static struct display display;
/*
- * Set a palette register. This may not work on all boards but only
- * experimentation will tell.
+ * Set the palette. This may not work on all boards but only experimentation
+ * will tell.
* XXX Doesn't work at all.
*/
-
-static int hpfb_setcolreg(u_int regno, u_int red, u_int green, u_int blue,
- u_int transp, struct fb_info *info)
+static int hpfb_setcolreg(unsigned regno, unsigned red, unsigned green,
+ unsigned blue, unsigned transp,
+ struct fb_info *info)
{
while (readw(fb_regs + 0x6002) & 0x4) udelay(1);
-
writew(0, fb_regs + 0x60f0);
writew(regno, fb_regs + 0x60b8);
writew(red, fb_regs + 0x60b2);
@@ -155,111 +86,28 @@
return 0;
}
-static int hpfb_get_var(struct fb_var_screeninfo *var, int con,
- struct fb_info *info)
-{
- struct hpfb_par par;
- if(con==-1)
- {
- hpfb_get_par(&par);
- hpfb_encode_var(var, &par);
- }
- else
- *var=fb_display[con].var;
- return 0;
-}
-
-static int hpfb_set_var(struct fb_var_screeninfo *var, int con,
- struct fb_info *info)
-{
- int err;
-
- if ((err=do_fb_set_var(var, 1)))
- return err;
- return 0;
-}
-
-static void hpfb_encode_fix(struct fb_fix_screeninfo *fix,
- struct hpfb_par *par)
-{
- memset(fix, 0, sizeof(struct fb_fix_screeninfo));
- strcpy(fix->id, "HP300 Topcat");
-
- /*
- * X works, but screen wraps ...
- */
- fix->smem_start=fb_start;
- 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 hpfb_get_fix(struct fb_fix_screeninfo *fix, int con,
- struct fb_info *info)
-{
- struct hpfb_par par;
- hpfb_get_par(&par);
- hpfb_encode_fix(fix, &par);
- return 0;
-}
-
-static void topcat_blit(int x0, int y0, int x1, int y1, int w, int h)
+void hpfb_copyarea(struct fb_info *info, struct fb_copyarea *area)
{
while (readb(fb_regs + BUSY) & fb_bitmask);
writeb(0x3, fb_regs + WMRR);
- writew(x0, fb_regs + SOURCE_X);
- writew(y0, fb_regs + SOURCE_Y);
- writew(x1, fb_regs + DEST_X);
- writew(y1, fb_regs + DEST_Y);
- writew(h, fb_regs + WHEIGHT);
- writew(w, fb_regs + WWIDTH);
+ writew(area->sx, fb_regs + SOURCE_X);
+ writew(area->sy, fb_regs + SOURCE_Y);
+ writew(area->dx, fb_regs + DEST_X);
+ writew(area->dy, fb_regs + DEST_Y);
+ writew(area->height, fb_regs + WHEIGHT);
+ writew(area->width, fb_regs + WWIDTH);
writeb(fb_bitmask, fb_regs + WMOVE);
}
-static int hpfb_switch(int con, struct fb_info *info)
-{
- do_fb_set_var(&fb_display[con].var,1);
- info->currcon=con;
- return 0;
-}
-
-static void hpfb_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 */
-
- hpfb_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 hpfb_ops = {
owner: THIS_MODULE,
- fb_get_fix: hpfb_get_fix,
- fb_get_var: hpfb_get_var,
- fb_set_var: hpfb_set_var,
- fb_get_cmap: hpfb_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_setcolreg: hpfb_setcolreg,
+ fb_copyarea: hpfb_copyarea,
};
#define TOPCAT_FBOMSB 0x5d
@@ -272,7 +120,7 @@
fboff = (readb(base + TOPCAT_FBOMSB) << 8)
| readb(base + TOPCAT_FBOLSB);
- fb_start = 0xf0000000 | (readb(base + fboff) << 16);
+ hpfb_fix.smem_start = 0xf0000000 | (readb(base + fboff) << 16);
fb_regs = base;
#if 0
@@ -284,17 +132,6 @@
writeb(0, base+0x4516);
writeb(0x90, base+0x4206);
#endif
-
- /*
- * Fill in the available video resolution
- */
-
- hpfb_defined.xres = 1024;
- hpfb_defined.yres = 768;
- hpfb_defined.xres_virtual = 1024;
- hpfb_defined.yres_virtual = 768;
- hpfb_defined.bits_per_pixel = 8;
-
/*
* Give the hardware a bit of a prod and work out how many bits per
* pixel are supported.
@@ -302,8 +139,8 @@
writeb(0xff, base + TC_WEN);
writeb(0xff, base + TC_FBEN);
- writeb(0xff, fb_start);
- fb_bitmask = readb(fb_start);
+ writeb(0xff, hpfb_fix.smem_start);
+ fb_bitmask = readb(hpfb_fix.smem_start);
/*
* Enable reading/writing of all the planes.
@@ -316,23 +153,25 @@
/*
* Let there be consoles..
*/
- strcpy(fb_info.modename, "Topcat");
- fb_info.changevar = NULL;
- fb_info.node = NODEV;
+ fb_info.node = NODEV;
fb_info.fbops = &hpfb_ops;
- fb_info.screen_base = fb_start;
- fb_info.disp = &disp;
- fb_info.switch_con = &hpfb_switch;
- fb_info.updatevar = &fb_update_var;
fb_info.flags = FBINFO_FLAG_DEFAULT;
- do_fb_set_var(&hpfb_defined, 1);
+ fb_info.var = hpfb_defined;
+ fb_info.fix = hpfb_fix;
+ fb_info.screen_base = hpfb_fix.smem_start;
+
+ /* The below feilds will go away !!!! */
+ fb_info.currcon = -1;
+ strcpy(fb_info.modename, fb_info.fix.id);
+ fb_info.disp = &display;
+ fb_info.switch_con = gen_switch;
+ fb_info.updatevar = gen_update_var;
+ fb_alloc_cmap(&fb_info.cmap, 256, 0);
- hpfb_get_var(&disp.var, -1, &fb_info);
- hpfb_set_disp(-1);
+ gen_set_var(&fb_info.var, -1, &fb_info);
if (register_framebuffer(&fb_info) < 0)
return 1;
-
return 0;
}
@@ -362,29 +201,25 @@
*/
#define INTFBADDR 0xf0560000
- if (hwreg_present((void *)INTFBADDR) && (DIO_ID(INTFBADDR) == DIO_ID_FBUFFER)
- && topcat_sid_ok(sid = DIO_SECID(INTFBADDR)))
- {
+ if (hwreg_present((void *)INTFBADDR) &&
+ (DIO_ID(INTFBADDR) == DIO_ID_FBUFFER) &&
+ topcat_sid_ok(sid = DIO_SECID(INTFBADDR))) {
printk("Internal Topcat found (secondary id %02x)\n", sid);
hpfb_init_one(INTFBADDR);
- }
- else
- {
+ } else {
int sc = dio_find(DIO_ID_FBUFFER);
- if (sc)
- {
+
+ if (sc) {
unsigned long addr = (unsigned long)dio_scodetoviraddr(sc);
unsigned int sid = DIO_SECID(addr);
- if (topcat_sid_ok(sid))
- {
+ if (topcat_sid_ok(sid)) {
printk("Topcat found at DIO select code %02x "
- "(secondary id %02x)\n", sc, sid);
+ "(secondary id %02x)\n", sc, sid);
hpfb_init_one(addr);
}
}
}
-
return 0;
}
|
|
From: James S. <jsi...@tr...> - 2002-02-28 16:22:33
|
As you can see I have ported the 3dfx fbdev driver to the new api. It has been tested on my home system and it works. I like others to try it out. The patch is against 2.5.5-dj2 http://www.transvirtual.com/~jsimmons/tdfx.diff Thank you. . --- |o_o | |:_/ | Give Micro$oft the Bird!!!! // \ \ Use Linux!!!! (| | ) /'_ _/`\ ___)=(___/ |
|
From: Petr V. <VAN...@vc...> - 2002-02-28 15:36:32
|
On 28 Feb 02 at 14:49, Petr Janecek wrote:
> Hello,
> in 2.5.6-pre1 (and probably others) matroxfb doesn't
> compile if only CONFIG_FB_MATROX_MYSTIQUE is selected. This #ifdef fixed
> it for me:
I know. 2.4.19-pre2 should contain fixed driver (if Marcello will apply
this driver to 2.4.x). I did not send update to Linus yet, as I received
some patches to provide ioctls to set hue/brightness/... on TV output.
I thought that nobody uses old Mystique anymore.
I preffer change below
> --- drivers/video/matrox/matroxfb_DAC1064.c.orig Thu Feb 28 12:59:43 2002
> +++ drivers/video/matrox/matroxfb_DAC1064.c Thu Feb 28 13:03:21 2002
> @@ -473,9 +473,11 @@
>
> static int m1064_compute(void* outdev, struct my_timming* m) {
> #define minfo ((struct matrox_fb_info*)outdev)
> +#ifdef CONFIG_FB_MATROX_G100
> if (ACCESS_FBINFO(devflags.g450dac)) {
> matroxfb_g450_setclk(PMINFO m->pixclock, M_PIXEL_PLL_C);
- > } else {
- > +#endif
+ } else
+ #endif
+ {
> int i;
> int tmout;
> CRITFLAGS
> @@ -496,7 +498,9 @@
>
> if (!tmout)
> printk(KERN_ERR "matroxfb: Pixel PLL not locked after 5 secs\n");
- > +#ifdef CONFIG_FB_MATROX_G100
> }
- > +#endif
> #undef minfo
> return 0;
> }
... so there is always block around Mystique DAC setting for Mystique own
local variables? I'll send it to Linus today.
Petr Vandrovec
van...@vc...
|
|
From: Petr J. <ja...@uc...> - 2002-02-28 13:49:50
|
Hello,
in 2.5.6-pre1 (and probably others) matroxfb doesn't
compile if only CONFIG_FB_MATROX_MYSTIQUE is selected. This #ifdef fixed
it for me:
--- drivers/video/matrox/matroxfb_DAC1064.c.orig Thu Feb 28 12:59:43 2002
+++ drivers/video/matrox/matroxfb_DAC1064.c Thu Feb 28 13:03:21 2002
@@ -473,9 +473,11 @@
static int m1064_compute(void* outdev, struct my_timming* m) {
#define minfo ((struct matrox_fb_info*)outdev)
+#ifdef CONFIG_FB_MATROX_G100
if (ACCESS_FBINFO(devflags.g450dac)) {
matroxfb_g450_setclk(PMINFO m->pixclock, M_PIXEL_PLL_C);
} else {
+#endif
int i;
int tmout;
CRITFLAGS
@@ -496,7 +498,9 @@
if (!tmout)
printk(KERN_ERR "matroxfb: Pixel PLL not locked after 5 secs\n");
+#ifdef CONFIG_FB_MATROX_G100
}
+#endif
#undef minfo
return 0;
}
|
|
From: Geert U. <ge...@li...> - 2002-02-27 16:02:51
|
Hi Carlos,
> > I just noticed some things I overlooked yesterday:
> >
> > - The `pixclock' parameter is in ps (picoseconds), not Hz, so the
> > test
> >
> > pixelclock > (fb_info->monspecs.hfmax * htotal)
> >
> > is completely wrong! The old code in fbmon.c is correct though,
> > except for being commented out due to long long arithmetic. IMHO
> > it would be better to rewrite it so it doesn't use long long
> > arithmetic.
> >
> > - No frame buffer device calls fbmon_valid_timings(). The few that
> > seem to call it, have the call protected by #if 0/#endif.
>
> after all this talking i did it another way (while i'm trying to get the
> vesa specification to autodetect monitor specifications).
>
> now it checks straight for frequencies...
But it's still not correct: pixelclock is in ps, not Hz.
Please read and understand the old #if 0'd out code...
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- ge...@li...
In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds
|
|
From: Carlos M. D. V. <ca...@em...> - 2002-02-27 16:02:25
|
> > I just noticed some things I overlooked yesterday: > > - The `pixclock' parameter is in ps (picoseconds), not Hz, so the > test > > pixelclock > (fb_info->monspecs.hfmax * htotal) > > is completely wrong! The old code in fbmon.c is correct though, > except for being commented out due to long long arithmetic. IMHO > it would be better to rewrite it so it doesn't use long long > arithmetic. > > - No frame buffer device calls fbmon_valid_timings(). The few that > seem to call it, have the call protected by #if 0/#endif. > Hi, after all this talking i did it another way (while i'm trying to get the vesa specification to autodetect monitor specifications). now it checks straight for frequencies... -- "Solo me arrepiento de unos * de menos y unos ++ de sobra" Carlos Manuel Duclos Vergara |
|
From: Geert U. <ge...@li...> - 2002-02-27 09:43:30
|
On Tue, 26 Feb 2002, Miles Lane wrote:
> Carlos wrote:
> > this patch is to avoid the cooking of monitors from inside the
> > framebuffer subsystem. Normally this would be made by
> > fbmon_valid_timings function, but actually this function does nothing.
> > So i start writing a new implementation that will make some checks, note
> > that is not the full answer because it requires to user use another data
> > structures normally don't used, but for now it checks the basic stuff.
> > (i will continue improving this, i use this on uclinux not on linux so i
> > probably have another things in mind when i create this patches)
>
> Hi Carlos,
>
> I have CCed the fbdev mailing list, since they seem like a much
> better target audience for your patch. Also, there is a much
> greater likelihood of your patch getting into Linus' tree if
> it is sent to him by whoever is the current primary FBDev
> maintainer.
>
> I apologize for attaching the file rather than including the
> text. I don't trust my current mail client to not mangle it.
I just noticed some things I overlooked yesterday:
- The `pixclock' parameter is in ps (picoseconds), not Hz, so the test
pixelclock > (fb_info->monspecs.hfmax * htotal)
is completely wrong! The old code in fbmon.c is correct though, except for
being commented out due to long long arithmetic. IMHO it would be better to
rewrite it so it doesn't use long long arithmetic.
- No frame buffer device calls fbmon_valid_timings(). The few that seem to
call it, have the call protected by #if 0/#endif.
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- ge...@li...
In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds
|
|
From: Miles L. <mi...@me...> - 2002-02-27 05:14:34
|
Carlos wrote: > > Hi, > this patch is to avoid the cooking of monitors from inside the > framebuffer subsystem. Normally this would be made by > fbmon_valid_timings function, but actually this function does nothing. > So i start writing a new implementation that will make some checks, note > that is not the full answer because it requires to user use another data > structures normally don't used, but for now it checks the basic stuff. > (i will continue improving this, i use this on uclinux not on linux so i > probably have another things in mind when i create this patches) Hi Carlos, I have CCed the fbdev mailing list, since they seem like a much better target audience for your patch. Also, there is a much greater likelihood of your patch getting into Linus' tree if it is sent to him by whoever is the current primary FBDev maintainer. I apologize for attaching the file rather than including the text. I don't trust my current mail client to not mangle it. |
|
From: Rudy Z. <ru...@ed...> - 2002-02-26 23:33:36
|
Hi all, I'm not on this list, so please cc me. I'm no (longer) a coder (but still able to read code), so bear with me. While compiling the linux kernel 2.4.18 for a system with a SiS video card, I selected SiS acceleration, but NOT SiS 630/540/730 support and neither SiS 315H/315 support. In that situation the SIS module will *NOT* compile. I think this should at least be mentioned in the help, and preferably the options should be such that a warning is given when none of the two options are selected. I have not yet tested what happens if you select both, but suspect funny results.... Cheers, Rudy |
|
From: Andrey U. <dr...@au...> - 2002-02-26 21:49:54
|
i wrote intel740 frame-buffer driver. i tested it with my hardware with kernels 2.4.8, 2.4.14, 2.4.17 and 2.5.5. you can download the patch http://i740fbdev.sourceforge.net/download/patch-2.5.5-i740fb-020225.diff.gz if anybody tested it, please drop me a report -- With best regards, Andrey Ulanov. mailto: drey<at>au.ru XMMS: Tiamat - So Much For Suicide |
|
From: Geert U. <ge...@li...> - 2002-02-26 16:13:33
|
On Tue, 26 Feb 2002, Carlos Manuel Duclos Vergara wrote:
> reading framebuffer code i discover something potentially dangerous, so
> i fixed.
Yes, monitor validation is not yet implemented.
> the function fbmon_valid_timings(..) don't do a thing..... (read the
> code), so to avoid problems you can use this patch.
> I will send it to main kernel tree.
> NOTE1: this is the beginning of the solution, please read the
> recomendations in the patch itself.
> NOTE2: i will continue improving this, but i will use it on uclinux not
> on linux
> --- uclinux-2.4.x/drivers/video/fbmon.c Wed Mar 8 15:18:25 2000
> +++ ecl-uclinux-2.4.x/drivers/video/fbmon.c Mon Feb 25 14:20:25 2002
> @@ -46,31 +46,54 @@
> int fbmon_valid_timings(u_int pixclock, u_int htotal, u_int vtotal,
> const struct fb_info *fb_info)
> {
> -#if 0
> /*
> - * long long divisions .... $#%%#$
> + * Ohhh, i discover the Secret of Ramses II tomb!
> + * _PLEASE_ note that this is only worth if you _FILL_ _UP_
> + * a fb_monspecs with your monitor specs!
> + * If you don't do that, this will only check for vesa compatible
> + * modes at some "generic" multifrequency monitors! (not done yet)
> + * I will think in how to auto detect monitors, or maybe how you can tell in
> + * runtime what kind of monitor do you have.
> + * If you want to know the progress of that, email me at: ca...@em...
> + * Note 1: I don't assume nothing, so in htotal & vtotal use your values...
> + * if you want a sugestion use: htotal = hres * 1.2 and vtotal = vres * 1.1
> + * Note 2: We only need to calculate one thing to see if your monitor will cook
> + * (please don't blame me if it cooks anyway, you must be aware that this function
> + * do its best to check but is not _the_ final answer!
> */
> - unsigned long long hpicos, vpicos;
> - const unsigned long long _1e12 = 1000000000000ULL;
> - const struct fb_monspecs *monspecs = &fb_info->monspecs;
>
> - hpicos = (unsigned long long)htotal*(unsigned long long)pixclock;
> - vpicos = (unsigned long long)vtotal*(unsigned long long)hpicos;
> - if (!vpicos)
> - return 0;
> -
> - if (monspecs->hfmin == 0)
> + if( !fb_info->monspecs )
> + {
> + /*
> + * Dear God...
> + */
> + printk( KERN_INFO "fb: We could not check your monitor, due lack of monspecs!\n" );
> return 1;
> -
> - if (hpicos*monspecs->hfmin > _1e12 || hpicos*monspecs->hfmax < _1e12 ||
> - vpicos*monspecs->vfmin > _1e12 || vpicos*monspecs->vfmax < _1e12)
> + }
> +
> + if( pixelclock > (fb_info->monspecs.hfmax * htotal) )
> + {
> + /*
> + * We will cook this monitor!
> + */
> + printk( KERN_INFO "fb: To avoid cooking your monitor we won't use this resolution!\n" );
> return 0;
> -#endif
> - return 1;
> + }
> +
> + /*
> + * If we get here, we're safe (almost)
> + */
> +
> + return 1;
> }
I'm afraid this test doesn't help much against frying monitors. For this the
pixel frequency doesn't matter much, but the horizontal and vertical
synchronization frequencies do, and we don't test these.
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- ge...@li...
In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds
|
|
From: Carlos M. D. V. <ca...@em...> - 2002-02-26 15:25:06
|
Hi, reading framebuffer code i discover something potentially dangerous, so i fixed. the function fbmon_valid_timings(..) don't do a thing..... (read the code), so to avoid problems you can use this patch. I will send it to main kernel tree. NOTE1: this is the beginning of the solution, please read the recomendations in the patch itself. NOTE2: i will continue improving this, but i will use it on uclinux not on linux bye -- "Solo me arrepiento de unos * de menos y unos ++ de sobra" Carlos Manuel Duclos Vergara |
|
From: James S. <jsi...@tr...> - 2002-02-25 17:58:53
|
> Hi, > this patch is to avoid the cooking of monitors from inside the > framebuffer subsystem. Normally this would be made by > fbmon_valid_timings function, but actually this function does nothing. > So i start writing a new implementation that will make some checks, note > that is not the full answer because it requires to user use another data > structures normally don't used, but for now it checks the basic stuff. > bye Patch is where? Also please send the patch to me, Geert and the fbdev list. . --- |o_o | |:_/ | Give Micro$oft the Bird!!!! // \ \ Use Linux!!!! (| | ) /'_ _/`\ ___)=(___/ |