aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorAntonino Daplas <adaplas@hotpop.com>2004-08-22 22:51:00 -0700
committerLinus Torvalds <torvalds@ppc970.osdl.org>2004-08-22 22:51:00 -0700
commitbced0c6c5c956bc17dc3cbb2a24b91c9ddf92063 (patch)
treef581dac77e72c72499d0a8f0fe628b3c88571d52 /drivers
parent82f912ea8ab9c77437900b2dcbeb313986d461ae (diff)
downloadhistory-bced0c6c5c956bc17dc3cbb2a24b91c9ddf92063.tar.gz
[PATCH] fbdev: find correct logo for directcolor < 24bpp
Current algorithm does not choose correct logo type for directcolor < 24 bpp. It chooses logo_224, but this is too deep for bpp < 24. This should fix the problem. Signed-off-by: Antonino Daplas <adaplas@pol.net> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/video/fbmem.c31
1 files changed, 20 insertions, 11 deletions
diff --git a/drivers/video/fbmem.c b/drivers/video/fbmem.c
index 9a2b2be38b260d..0f38e03c1b1f8f 100644
--- a/drivers/video/fbmem.c
+++ b/drivers/video/fbmem.c
@@ -738,26 +738,35 @@ static struct logo_data {
int fb_prepare_logo(struct fb_info *info)
{
+ int depth = fb_get_color_depth(info);
+
memset(&fb_logo, 0, sizeof(struct logo_data));
- switch (info->fix.visual) {
- case FB_VISUAL_TRUECOLOR:
- if (info->var.bits_per_pixel >= 8)
+ if (info->fix.visual == FB_VISUAL_DIRECTCOLOR) {
+ depth = info->var.blue.length;
+ if (info->var.red.length < depth)
+ depth = info->var.red.length;
+ if (info->var.green.length < depth)
+ depth = info->var.green.length;
+ }
+
+ if (depth >= 8) {
+ switch (info->fix.visual) {
+ case FB_VISUAL_TRUECOLOR:
fb_logo.needs_truepalette = 1;
- break;
- case FB_VISUAL_DIRECTCOLOR:
- if (info->var.bits_per_pixel >= 24) {
+ break;
+ case FB_VISUAL_DIRECTCOLOR:
fb_logo.needs_directpalette = 1;
fb_logo.needs_cmapreset = 1;
+ break;
+ case FB_VISUAL_PSEUDOCOLOR:
+ fb_logo.needs_cmapreset = 1;
+ break;
}
- break;
- case FB_VISUAL_PSEUDOCOLOR:
- fb_logo.needs_cmapreset = 1;
- break;
}
/* Return if no suitable logo was found */
- fb_logo.logo = fb_find_logo(fb_get_color_depth(info));
+ fb_logo.logo = fb_find_logo(depth);
if (!fb_logo.logo || fb_logo.logo->height > info->var.yres) {
fb_logo.logo = NULL;