Commit 6a1c1977 authored by Imre Deak's avatar Imre Deak Committed by Tony Lindgren

ARM: OMAP: [PATCH] fb clut fix (Re: console text problems...)

I forgot that the fbconsole code is using a palette even though we
are in true color mode, so we have to handle that case separately.
parent 686455c6
...@@ -260,18 +260,40 @@ static int _setcolreg(struct fb_info *info, u_int regno, u_int red, u_int green, ...@@ -260,18 +260,40 @@ static int _setcolreg(struct fb_info *info, u_int regno, u_int red, u_int green,
u_int blue, u_int transp, int update_hw_pal) u_int blue, u_int transp, int update_hw_pal)
{ {
struct omapfb_device *fbdev = (struct omapfb_device *)info->par; struct omapfb_device *fbdev = (struct omapfb_device *)info->par;
u16 pal;
int r = 0; int r = 0;
switch (fbdev->color_mode) {
case OMAPFB_COLOR_YUV422:
case OMAPFB_COLOR_YUV420:
r = -EINVAL;
break;
case OMAPFB_COLOR_CLUT_8BPP:
case OMAPFB_COLOR_CLUT_4BPP:
case OMAPFB_COLOR_CLUT_2BPP:
case OMAPFB_COLOR_CLUT_1BPP:
if (fbdev->ctrl->setcolreg)
r = fbdev->ctrl->setcolreg(regno, red, green, blue,
transp, update_hw_pal);
/* Fallthrough */
case OMAPFB_COLOR_RGB565:
if (r != 0)
break;
if (regno < 0) {
r = -EINVAL;
break;
}
if (regno < 16) { if (regno < 16) {
pal = ((red >> 11) << 11) | ((green >> 10) << 5) | (blue >> 11); u16 pal;
pal = ((red >> 11) << 11) | ((green >> 10) << 5) |
(blue >> 11);
((u32 *)(info->pseudo_palette))[regno] = pal; ((u32 *)(info->pseudo_palette))[regno] = pal;
} }
break;
if (fbdev->ctrl->setcolreg) default:
r = fbdev->ctrl->setcolreg(regno, red, green, blue, transp, BUG();
update_hw_pal); }
return r; return r;
} }
......
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