linux-fbdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* new logo drawing code
@ 2002-12-29 20:07 Geert Uytterhoeven
  2003-01-03 10:33 ` Antonino Daplas
  2003-01-05 20:46 ` James Simmons
  0 siblings, 2 replies; 3+ messages in thread
From: Geert Uytterhoeven @ 2002-12-29 20:07 UTC (permalink / raw)
  To: James Simmons; +Cc: Linux Frame Buffer Device Development


Did anyone actually test fbcon_set_logo() on monochrome hardware?

I admit I haven't tried it myself yet (still fighting with amifb), but this
looks more reasonable:
  - Use index i*8+j instead of i*2
  - Replace conditionals by straight code without branches (bit 7 of needs_logo
    is either 0 (normal) or 1 (reverse), and perhaps we should kill the default
    case?).

The second part is an indentation fix.

BTW, most of the new fbdev code looks really ugly in vim with `let
c_space_errors=1', due to the exorbitant use of superfluous whitespace
characters.

--- linux-2.5.53/drivers/video/console/fbcon.c	Tue Dec 10 13:41:40 2002
+++ linux-geert-2.5.53/drivers/video/console/fbcon.c	Sun Dec 29 20:54:30 2002
@@ -2631,12 +2632,12 @@
 	case 1:
 	case ~1:
 	default:
-		for (i = 0; i < (LOGO_W * LOGO_H)/8; i++) 
-			for (j = 0; j < 8; j++) 
-				logo[i*2] = (linux_logo_bw[i] &  (7 - j)) ? 
-					((needs_logo == 1) ? 1 : 0) :
-					((needs_logo == 1) ? 0 : 1);
-				
+		for (i = 0; i < (LOGO_W * LOGO_H)/8; i++) {
+			u8 d = linux_logo_bw[i];
+			for (j = 0; j < 8; j++, d <<= 1)
+				logo[i*8+j] = ((d ^ needs_logo) >> 7) & 1;
+		}
+
 		break;
 	} 
 }	
@@ -2668,8 +2669,8 @@
  * be set to 1.
  */
 static int __init fbcon_show_logo(void)
-	{
-		struct display *p = &fb_display[fg_console];	/* draw to vt in foreground */
+{
+	struct display *p = &fb_display[fg_console];	/* draw to vt in foreground */
 	struct fb_info *info = p->fb_info;
 	struct vc_data *vc = info->display_fg;
 	struct fb_image image;

Gr{oetje,eeting}s,

						Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
							    -- Linus Torvalds



-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2003-01-05 20:47 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-12-29 20:07 new logo drawing code Geert Uytterhoeven
2003-01-03 10:33 ` Antonino Daplas
2003-01-05 20:46 ` James Simmons

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).