Skip to contentSkip to conversation

SiMotion VoyagerGX framebuffer: blue stripped background

PATCH In review Sergei Shtylylov 2 participants 3 messages Dec 9, 2005 – Dec 11, 2005

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 SiMotion VoyagerGX framebuffer: blue stripped background

Hello.

This driver was using an incorrect typecast when setting pseudopalette,
hence were the blue strips on the black char background. As this driver happens to be maintaned by Linux/MIPS, here's the patch (I've also noticed a typo in the head comment, hence comes another hunk)...

WBR, Sergei

drivers/video/smivgxfb.c +2 -2
index d5755c5..c521069 100644
@@ -1,5 +1,5 @@
 /***************************************************************************
- *  Silicon Motion VoyaagerGX framebuffer driver
+ *  Silicon Motion VoyagerGX framebuffer driver
  *
  * 	ported to 2.6 by Embedded Alley Solutions, Inc
  * 	Copyright (C) 2005 Embedded Alley Solutions, Inc
@@ -162,7 +162,7 @@ smi_setcolreg(unsigned regno, unsigned r
 	if (regno > 255)
 		return 1;
 
-	((u16 *)(info->pseudo_palette))[regno] =
+	((u32 *)(info->pseudo_palette))[regno] =
 		    ((red & 0xf800) >> 0) |
 		    ((green & 0xfc00) >> 5) |
 		    ((blue & 0xf800) >> 11);
#1 lore raw

Hello.

Quoted 4 lines · Sergei Shtylylov

This driver was using an incorrect typecast when setting pseudopalette,
hence were the blue strips on the black char background. As this driver happens to be maintaned by Linux/MIPS, here's the patch (I've also noticed a typo in the head comment, hence comes another hunk)...

Have noticed that regno check in smi_setcolreg() is too relaxed as
pseudo-palette has only 16 entries. So, had to update the patch.

WBR, Sergei

drivers/video/smivgxfb.c +5 -5
index d5755c5..944ff4a 100644
@@ -1,5 +1,5 @@
 /***************************************************************************
- *  Silicon Motion VoyaagerGX framebuffer driver
+ *  Silicon Motion VoyagerGX framebuffer driver
  *
  * 	ported to 2.6 by Embedded Alley Solutions, Inc
  * 	Copyright (C) 2005 Embedded Alley Solutions, Inc
@@ -159,10 +159,10 @@ smi_setcolreg(unsigned regno, unsigned r
 	unsigned blue, unsigned transp,
 	struct fb_info *info)
 {
-	if (regno > 255)
+	if (regno > 15)
 		return 1;
 
-	((u16 *)(info->pseudo_palette))[regno] =
+	((u32 *)(info->pseudo_palette))[regno] =
 		    ((red & 0xf800) >> 0) |
 		    ((green & 0xfc00) >> 5) |
 		    ((blue & 0xf800) >> 11);
@@ -318,9 +318,9 @@ static int __devinit vgx_pci_probe(struc
 	if (!info.pseudo_palette) {
 		return -ENOMEM;
 	}
-	memset(info.pseudo_palette, 0, sizeof(u32) *16);
+	memset(info.pseudo_palette, 0, sizeof(u32) * 16);
 
-	fb_alloc_cmap(&info.cmap,256,0);
+	fb_alloc_cmap(&info.cmap, 256, 0);
 
 	smi_setmode();
 
#2 lore raw
In reply to Sergei Shtylylov
Quoted 3 lines · Sergei Shtylylov

This driver was using an incorrect typecast when setting pseudopalette,
hence were the blue strips on the black char background. As this driver happens to be maintaned by Linux/MIPS, here's the patch (I've also noticed a

Framebuffer stuff to it's maintainer "Antonino A. Daplas" <[email protected]> and [email protected], please.

Ralf