linux-fbdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Franck Bui-Huu <vagabon.xyz@gmail.com>
To: Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	linux-fbdev-devel@lists.sourceforge.net
Subject: fbmem: is bootup logo broken for monochrome LCD ?
Date: Thu, 09 Nov 2006 17:49:12 +0100	[thread overview]
Message-ID: <45535C08.5020607@innova-card.com> (raw)

I'm trying to display the bootup logo on a monochrome LCD (1 bit per
pixel). I had to hack fbmem.c in a couple of place to make it
works. I'm wondering now if these changes are correct since I'm not
familiar with this code. Could anybody take a look and tell me ?

Thanks
		Franck

-- >8 --

diff --git a/drivers/video/fbmem.c b/drivers/video/fbmem.c
index 17961e3..8c9d51f 100644
--- a/drivers/video/fbmem.c
+++ b/drivers/video/fbmem.c
@@ -247,6 +247,7 @@ static void fb_set_logo(struct fb_info *
 			       const struct linux_logo *logo, u8 *dst,
 			       int depth)
 {
+	u32 bpp = info->var.bits_per_pixel;
 	int i, j, k;
 	const u8 *src = logo->data;
 	u8 xor = (info->fix.visual == FB_VISUAL_MONO01) ? 0xff : 0;
@@ -275,9 +276,14 @@ static void fb_set_logo(struct fb_info *
 		for (i = 0; i < logo->height; i++) {
 			for (j = 0; j < logo->width; src++) {
 				d = *src ^ xor;
-				for (k = 7; k >= 0; k--) {
-					*dst++ = ((d >> k) & 1) ? fg : 0;
+				if (bpp == 1) {
+					*dst++ = d;
 					j++;
+				} else {
+					for (k = 7; k >= 0; k--) {
+						*dst++ = ((d >> k) & 1) ? fg : 0;
+						j++;
+					}
 				}
 			}
 		}
@@ -487,7 +493,6 @@ int fb_show_logo(struct fb_info *info, i
 	if (fb_logo.logo == NULL || info->state != FBINFO_STATE_RUNNING)
 		return 0;
 
-	image.depth = 8;
 	image.data = fb_logo.logo->data;
 
 	if (fb_logo.needs_cmapreset)
@@ -506,6 +511,9 @@ int fb_show_logo(struct fb_info *info, i
 
 		saved_pseudo_palette = info->pseudo_palette;
 		info->pseudo_palette = palette;
+	} else {
+		image.fg_color = 1;
+		image.bg_color = 0;
 	}
 
 	if (fb_logo.depth <= 4) {
@@ -525,6 +533,7 @@ int fb_show_logo(struct fb_info *info, i
 	image.dy = 0;
 	image.width = fb_logo.logo->width;
 	image.height = fb_logo.logo->height;
+	image.depth = fb_logo.depth;
 
 	if (rotate) {
 		logo_rotate = kmalloc(fb_logo.logo->width *

             reply	other threads:[~2006-11-09 16:49 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-11-09 16:49 Franck Bui-Huu [this message]
2006-11-12 22:04 ` fbmem: is bootup logo broken for monochrome LCD ? James Simmons
2006-11-13  9:53   ` Franck Bui-Huu
2006-11-13 14:17     ` James Simmons
2006-11-13 14:31       ` Franck Bui-Huu
2006-11-13 18:55         ` James Simmons
2006-11-13 18:27       ` Franck Bui-Huu
2006-11-13 18:51         ` James Simmons
2006-11-14  9:44           ` Franck Bui-Huu
2006-11-17 18:40             ` James Simmons
2006-11-17 20:42               ` [Linux-fbdev-devel] " Franck Bui-Huu
2006-11-20 16:42                 ` James Simmons
2006-11-21  9:45                   ` Franck Bui-Huu
2006-11-21 18:02                     ` James Simmons
2006-11-22  8:48                       ` Franck Bui-Huu
2006-11-22 19:43                         ` James Simmons
2006-11-22 21:04                         ` James Simmons
2006-11-23 14:53                           ` Franck Bui-Huu
2006-11-27 16:01                             ` James Simmons

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=45535C08.5020607@innova-card.com \
    --to=vagabon.xyz@gmail.com \
    --cc=linux-fbdev-devel@lists.sourceforge.net \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).