Skip to contentSkip to conversation

pm2fb: Colour palette fixes

PATCH In review Jim Hague 1 participant 1 message Oct 22, 2004 Framebuffer layer

lore
Share & tools
lore

Jim Hague

author
#0 lore raw

PATCH 2/2 pm2fb: Colour palette fixes

- Hardware CLUT only needs setting on pseudocolor.
- Pseudo palette values need to be 32bit wide for cfb_*().

video/pm2fb.c +3 -6
diff -u -p -r1.24 pm2fb.c
@@ -877,7 +877,6 @@ static int pm2fb_setcolreg(unsigned regn
 		green = CNVT_TOHW(green, info->var.green.length);
 		blue = CNVT_TOHW(blue, info->var.blue.length);
 		transp = CNVT_TOHW(transp, info->var.transp.length);
-		set_color(par, regno, red, green, blue);
 		break;
 	case FB_VISUAL_DIRECTCOLOR:
 		/* example here assumes 8 bit DAC. Might be different 
@@ -904,12 +903,8 @@ static int pm2fb_setcolreg(unsigned regn
 
 		switch (info->var.bits_per_pixel) {
 		case 8:
-			/* Yes some hand held devices have this. */ 
-           		((u8*)(info->pseudo_palette))[regno] = v;
 			break;	
    		case 16:
-           		((u16*)(info->pseudo_palette))[regno] = v;
-			break;
 		case 24:
 		case 32:	
            		((u32*)(info->pseudo_palette))[regno] = v;
@@ -917,7 +912,9 @@ static int pm2fb_setcolreg(unsigned regn
 		}
 		return 0;
 	}
-	/* ... */
+	else if (info->fix.visual == FB_VISUAL_PSEUDOCOLOR)
+		set_color(par, regno, red, green, blue);
+
 	return 0;
 }
 

-------------------------------------------------------
This SF.net email is sponsored by: IT Product Guide on ITManagersJournal Use IT products in your business? Tell us what you think of them. Give us Your Opinions, Get Free ThinkGeek Gift Certificates! Click to find out more
http://productguide.itmanagersjournal.com/guidepromo.tmpl