Commit 8b3ee85f authored by Jim Hague's avatar Jim Hague Committed by Linus Torvalds

[PATCH] pm2fb: fix fbi image display on 24 bit depth big endian

Handle 24bit on big-endian by leaving the hardware in RGB and using the
colour offset to reverse red/blue.  Leaving the hardware in RGB means that
fbi displays images correctly (abeit fortuitously) and the console is
correct, thanks to a recent patch to the console code correcting an endian
bug in fbcon_putc().
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 e9776274
......@@ -646,12 +646,22 @@ static int pm2fb_check_var(struct fb_var_screeninfo *var, struct fb_info *info)
case 32:
var->transp.offset = 24;
var->transp.length = 8;
case 24:
var->red.offset = 16;
var->green.offset = 8;
var->blue.offset = 0;
var->red.length = var->green.length = var->blue.length = 8;
break;
case 24:
#ifdef __BIG_ENDIAN
var->red.offset = 0;
var->blue.offset = 16;
#else
var->red.offset = 16;
var->blue.offset = 0;
#endif
var->green.offset = 8;
var->red.length = var->green.length = var->blue.length = 8;
break;
}
var->height = var->width = -1;
......@@ -789,10 +799,6 @@ static int pm2fb_set_par(struct fb_info *info)
case 24:
pm2_WR(par, PM2R_FB_READ_PIXEL, 4);
clrmode |= PM2F_RD_TRUECOLOR | PM2F_RD_PIXELFORMAT_RGB888;
#ifdef __BIG_ENDIAN
/* Use BGR not RGB */
clrmode &= ~PM2F_RD_COLOR_MODE_RGB;
#endif
txtmap = PM2F_TEXTEL_SIZE_24;
pixsize = 4;
clrformat = 0x20;
......
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