[PATCH] vga16fb: fix color component length for pseudocolor modes

From: Michal Januszewski
Date: Thu Apr 02 2009 - 08:26:43 EST


vga16fb incorrectly sets the length of the color fields to 6 or 2 bits
for PSEUDOCOLOR modes, for which either 8 or 4 bits are used per pixel.
Fix this by setting the length to 8 or 4, respectively.

Signed-off-by: Michal Januszewski <spock@xxxxxxxxxx>
---
diff --git a/drivers/video/vga16fb.c b/drivers/video/vga16fb.c
index 5b29389..8f1eb7f 100644
--- a/drivers/video/vga16fb.c
+++ b/drivers/video/vga16fb.c
@@ -506,7 +506,7 @@ static int vga16fb_check_var(struct fb_var_screeninfo *var,
var->red.offset = var->green.offset = var->blue.offset =
var->transp.offset = 0;
var->red.length = var->green.length = var->blue.length =
- (par->isVGA) ? 6 : 2;
+ (par->isVGA) ? 8 : 4;
var->transp.length = 0;
var->activate = FB_ACTIVATE_NOW;
var->height = -1;
@@ -1324,7 +1324,7 @@ static int __init vga16fb_probe(struct platform_device *dev)
par->palette_blanked = 0;
par->vesa_blanked = 0;

- i = par->isVGA? 6 : 2;
+ i = par->isVGA? 8 : 4;

vga16fb_defined.red.length = i;
vga16fb_defined.green.length = i;
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/