Update of /cvsroot/linux-vax/kernel-2.4/drivers/video
In directory sc8-pr-cvs1:/tmp/cvs-serv12950
Modified Files:
vmonofb.c
Log Message:
vmonofb changes:
- change line_length from 1280/8 to 1024/8
- add (red,green,blue).length which i guess are used when userspace modifies the palette
- when loading the ramdac, get the intensity value from a weighted r/g/b sum
- when loading cmap data, don't load a 0 into the data reg first (or you'll end up with a mostly empty-colormap)
- fbgen_get_var(&the_fb_info.gen.info.var) instead of &disp.var. this is "wrong" but it seems to work better
- init the_fb_info.gen.fbhw _before_ trying to use it
i'm not sure how correct these changes are.
Index: vmonofb.c
===================================================================
RCS file: /cvsroot/linux-vax/kernel-2.4/drivers/video/vmonofb.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- vmonofb.c 9 Jun 2002 20:47:23 -0000 1.1
+++ vmonofb.c 3 Aug 2003 05:17:30 -0000 1.2
@@ -67,7 +67,7 @@
fix->type = FB_TYPE_PACKED_PIXELS;
fix->type_aux = 0;
fix->visual = FB_VISUAL_PSEUDOCOLOR;
- fix->line_length = 1280 / 8;
+ fix->line_length = 1024 / 8;
if(par->bpp == 2)
fix->line_length *= 2;
fix->smem_start = 0x21000000;
@@ -118,9 +118,12 @@
var->green.offset = 0;
var->blue.offset = 0;
+ var->red.length = 0;
+ var->green.length = 4;
+ var->blue.length = 0;
+
var->bits_per_pixel = par->bpp;
var->grayscale = 1;
- /* uh. do we need to set red.length, green.length, blue.length? */
var->xoffset = 0;
var->yoffset = 0;
@@ -162,8 +165,10 @@
if(regno < 0 || regno > 3)
return 1;
+ if (fbinfo->var.grayscale)
+ red = green = blue = (19595 * red + 38470 * green + 7471 * blue) >> 16;
+
info->regs->bt455_cmap_addr = regno;
- info->regs->bt455_cmap_data = 0;
info->regs->bt455_cmap_data = green >> 12;
return 0;
@@ -289,7 +294,11 @@
info->updatevar = fbgen_update_var;
info->blank = fbgen_blank;
+#if 0
fbgen_get_var(&disp.var, -1, &the_fb_info.gen.info);
+#else
+ fbgen_get_var(&the_fb_info.gen.info.var, -1, &the_fb_info.gen.info);
+#endif
disp.var.activate = FB_ACTIVATE_NOW;
fbgen_do_set_var(&disp.var, 1, &the_fb_info.gen);
fbgen_set_disp(-1, &the_fb_info.gen);
@@ -323,8 +332,8 @@
vmonofb_reset();
- init_fb_info(&the_fb_info.gen.info);
the_fb_info.gen.fbhw = &vmono_hwswitch;
+ init_fb_info(&the_fb_info.gen.info);
if(register_framebuffer(&the_fb_info.gen.info) < 0) {
printk("vmonofb: unable to register framebuffer!\n");
|