Commit af8b3bb2 authored by Jim Hague's avatar Jim Hague Committed by Linus Torvalds

[PATCH] pm2fb: Colour palette fixes

- Hardware CLUT only needs setting on pseudocolor.
- Pseudo palette values need to be 32bit wide for cfb_*().
Signed-off-by: default avatarJim Hague <jim.hague@acm.org>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 745c8560
...@@ -877,7 +877,6 @@ static int pm2fb_setcolreg(unsigned regno, unsigned red, unsigned green, ...@@ -877,7 +877,6 @@ static int pm2fb_setcolreg(unsigned regno, unsigned red, unsigned green,
green = CNVT_TOHW(green, info->var.green.length); green = CNVT_TOHW(green, info->var.green.length);
blue = CNVT_TOHW(blue, info->var.blue.length); blue = CNVT_TOHW(blue, info->var.blue.length);
transp = CNVT_TOHW(transp, info->var.transp.length); transp = CNVT_TOHW(transp, info->var.transp.length);
set_color(par, regno, red, green, blue);
break; break;
case FB_VISUAL_DIRECTCOLOR: case FB_VISUAL_DIRECTCOLOR:
/* example here assumes 8 bit DAC. Might be different /* example here assumes 8 bit DAC. Might be different
...@@ -904,12 +903,8 @@ static int pm2fb_setcolreg(unsigned regno, unsigned red, unsigned green, ...@@ -904,12 +903,8 @@ static int pm2fb_setcolreg(unsigned regno, unsigned red, unsigned green,
switch (info->var.bits_per_pixel) { switch (info->var.bits_per_pixel) {
case 8: case 8:
/* Yes some hand held devices have this. */
((u8*)(info->pseudo_palette))[regno] = v;
break; break;
case 16: case 16:
((u16*)(info->pseudo_palette))[regno] = v;
break;
case 24: case 24:
case 32: case 32:
((u32*)(info->pseudo_palette))[regno] = v; ((u32*)(info->pseudo_palette))[regno] = v;
...@@ -917,7 +912,9 @@ static int pm2fb_setcolreg(unsigned regno, unsigned red, unsigned green, ...@@ -917,7 +912,9 @@ static int pm2fb_setcolreg(unsigned regno, unsigned red, unsigned green,
} }
return 0; return 0;
} }
/* ... */ else if (info->fix.visual == FB_VISUAL_PSEUDOCOLOR)
set_color(par, regno, red, green, blue);
return 0; return 0;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment