Skip to contentSkip to conversation

vga16fb: fix color component length for pseudocolor modes

PATCH In review Michal Januszewski 2 participants 4 messages Mar 30, 2009 – Apr 4, 2009 Framebuffer layer

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 vga16fb: fix color component length for pseudocolor modes

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.

---

drivers/video/vga16fb.c +1 -1
index 5b29389..50033b9 100644
@@ -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;
#1 lore raw
Quoted 12 lines · On Tue, 31 Mar 2009 00:05:24 +0200 Michal Januszewski <[email protected]> wrote:

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.

---

drivers/video/vga16fb.c +0 -0
index 5b29389..50033b9 100644

drivers/video/vga16fb.c static int vga16fb_check_var(struct fb_var_screeninfo *var, · line 512

Quoted 8 lines
drivers/video/vga16fb.c +1 -1
@@ -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;

There is the second place to change in the vga16fb_probe().

Regards,
Krzysztof

----------------------------------------------------------------------
Internetowe dowcipy na 1 kwietnia! Sprawdz! ;)
http://link.interia.pl/f20f4

#2 lore raw

PATCH 1/1 vga16fb: fix color component length for pseudocolor modes

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.

---

drivers/video/vga16fb.c +2 -2
index 5b29389..8f1eb7f 100644
@@ -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;
Acked-by on v1 1/1
#3 lore raw
Quoted 6 lines · On Thu, 2 Apr 2009 14:26:13 +0200 Michal Januszewski <[email protected]> wrote:

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.

---

Quoted 15 lines
drivers/video/vga16fb.c +1 -1
index 5b29389..8f1eb7f 100644
@@ -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;

drivers/video/vga16fb.c static int __init vga16fb_probe(struct platform_device *dev) · line 1330

Quoted 8 lines
drivers/video/vga16fb.c +1 -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;

----------------------------------------------------------------------
Kredyt z doplata, nawet 200 000 zl. Sprawdz!
http://link.interia.pl/f20fc