LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: Geert Uytterhoeven <Geert.Uytterhoeven@sonycom.com>
To: James Simmons <jsimmons@infradead.org>
Cc: Linux Frame Buffer Device Development 
	<linux-fbdev-devel@lists.sourceforge.net>,
	Cell Broadband Engine OSS Development  <cbe-oss-dev@ozlabs.org>,
	Linux Kernel Development <linux-kernel@vger.kernel.org>
Subject: [PATCH 3/7] fbdev: extract fb_show_logo_line()
Date: Wed, 31 Jan 2007 13:44:03 +0100 (CET)	[thread overview]
Message-ID: <Pine.LNX.4.62.0701311338480.15066@pademelon.sonytel.be> (raw)
In-Reply-To: <Pine.LNX.4.62.0701311325480.14996@pademelon.sonytel.be>

Extract the code to draw one line of logos into fb_show_logo_line()

Signed-off-by: Geert Uytterhoeven <Geert.Uytterhoeven@sonycom.com>
Signed-off-by: Geoff Levand <geoffrey.levand@am.sony.com>
---
 drivers/video/fbmem.c |   39 +++++++++++++++++++++++----------------
 1 files changed, 23 insertions(+), 16 deletions(-)

--- ps3-linux-2.6.20-rc7.orig/drivers/video/fbmem.c
+++ ps3-linux-2.6.20-rc7/drivers/video/fbmem.c
@@ -473,21 +473,23 @@ int fb_prepare_logo(struct fb_info *info
 	return fb_logo.logo->height;
 }
 
-int fb_show_logo(struct fb_info *info, int rotate)
+static int fb_show_logo_line(struct fb_info *info, int rotate,
+			     const struct linux_logo *logo, int y,
+			     unsigned int n)
 {
 	u32 *palette = NULL, *saved_pseudo_palette = NULL;
 	unsigned char *logo_new = NULL, *logo_rotate = NULL;
 	struct fb_image image;
 
 	/* Return if the frame buffer is not mapped or suspended */
-	if (fb_logo.logo == NULL || info->state != FBINFO_STATE_RUNNING)
+	if (logo == NULL || info->state != FBINFO_STATE_RUNNING)
 		return 0;
 
 	image.depth = 8;
-	image.data = fb_logo.logo->data;
+	image.data = logo->data;
 
 	if (fb_logo.needs_cmapreset)
-		fb_set_logocmap(info, fb_logo.logo);
+		fb_set_logocmap(info, logo);
 
 	if (fb_logo.needs_truepalette || 
 	    fb_logo.needs_directpalette) {
@@ -496,17 +498,16 @@ int fb_show_logo(struct fb_info *info, i
 			return 0;
 
 		if (fb_logo.needs_truepalette)
-			fb_set_logo_truepalette(info, fb_logo.logo, palette);
+			fb_set_logo_truepalette(info, logo, palette);
 		else
-			fb_set_logo_directpalette(info, fb_logo.logo, palette);
+			fb_set_logo_directpalette(info, logo, palette);
 
 		saved_pseudo_palette = info->pseudo_palette;
 		info->pseudo_palette = palette;
 	}
 
 	if (fb_logo.depth <= 4) {
-		logo_new = kmalloc(fb_logo.logo->width * fb_logo.logo->height, 
-				   GFP_KERNEL);
+		logo_new = kmalloc(logo->width * logo->height, GFP_KERNEL);
 		if (logo_new == NULL) {
 			kfree(palette);
 			if (saved_pseudo_palette)
@@ -514,29 +515,35 @@ int fb_show_logo(struct fb_info *info, i
 			return 0;
 		}
 		image.data = logo_new;
-		fb_set_logo(info, fb_logo.logo, logo_new, fb_logo.depth);
+		fb_set_logo(info, logo, logo_new, fb_logo.depth);
 	}
 
 	image.dx = 0;
-	image.dy = 0;
-	image.width = fb_logo.logo->width;
-	image.height = fb_logo.logo->height;
+	image.dy = y;
+	image.width = logo->width;
+	image.height = logo->height;
 
 	if (rotate) {
-		logo_rotate = kmalloc(fb_logo.logo->width *
-				      fb_logo.logo->height, GFP_KERNEL);
+		logo_rotate = kmalloc(logo->width *
+				      logo->height, GFP_KERNEL);
 		if (logo_rotate)
 			fb_rotate_logo(info, logo_rotate, &image, rotate);
 	}
 
-	fb_do_show_logo(info, &image, rotate, num_online_cpus());
+	fb_do_show_logo(info, &image, rotate, n);
 
 	kfree(palette);
 	if (saved_pseudo_palette != NULL)
 		info->pseudo_palette = saved_pseudo_palette;
 	kfree(logo_new);
 	kfree(logo_rotate);
-	return fb_logo.logo->height;
+	return logo->height;
+}
+
+int fb_show_logo(struct fb_info *info, int rotate)
+{
+	return fb_show_logo_line(info, rotate, fb_logo.logo, 0,
+				 num_online_cpus());
 }
 #else
 int fb_prepare_logo(struct fb_info *info, int rotate) { return 0; }

Gr{oetje,eeting}s,

						Geert

--
Geert Uytterhoeven -- Sony Network and Software Technology Center Europe (NSCE)
Geert.Uytterhoeven@sonycom.com ------- The Corporate Village, Da Vincilaan 7-D1
Voice +32-2-7008453 Fax +32-2-7008622 ---------------- B-1935 Zaventem, Belgium

  parent reply	other threads:[~2007-01-31 12:44 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-01-31 12:27 [PATCH 0/7] RFC: Cell SPE logos Geert Uytterhoeven
2007-01-31 12:40 ` Geert Uytterhoeven
2007-01-31 12:43 ` [PATCH 1/7] fbdev: Avoid vertical overflow when making space for the logo Geert Uytterhoeven
2007-01-31 12:43 ` [PATCH 2/7] fbdev: fb_do_show_logo() updates Geert Uytterhoeven
2007-01-31 12:44 ` Geert Uytterhoeven [this message]
2007-01-31 12:44 ` [PATCH 4/7] fbdev: move logo externs to header file Geert Uytterhoeven
2007-03-13 14:00   ` const and __initdata (was: Re: [Linux-fbdev-devel] [PATCH 4/7] fbdev: move logo externs to header file) Geert Uytterhoeven
2007-01-31 12:44 ` [PATCH 5/7] fbdev: Add fb_append_extra_logo() Geert Uytterhoeven
2007-01-31 12:44 ` [PATCH 6/7] fbdev: SPE helper penguin logo Geert Uytterhoeven
2007-01-31 12:44 ` [PATCH 7/7] Cell: Draw SPE helper penguin logos Geert Uytterhoeven
2007-02-01 16:51 ` [Cbe-oss-dev] [PATCH 0/7] RFC: Cell SPE logos Geoff Levand
2007-02-04 13:32 ` Pavel Machek
2007-02-04 17:44   ` [Linux-fbdev-devel] " Geert Uytterhoeven
2007-02-05  2:14   ` [Cbe-oss-dev] " Benjamin Herrenschmidt
2007-02-06 21:42     ` [Linux-fbdev-devel] " James Simmons
2007-02-07 12:44     ` Pavel Machek
2007-02-06 22:06 ` James Simmons
2007-02-12 13:54 ` Geert Uytterhoeven
2007-02-13 20:51   ` James Simmons
2007-02-14 17:33     ` Geert Uytterhoeven

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=Pine.LNX.4.62.0701311338480.15066@pademelon.sonytel.be \
    --to=geert.uytterhoeven@sonycom.com \
    --cc=cbe-oss-dev@ozlabs.org \
    --cc=jsimmons@infradead.org \
    --cc=linux-fbdev-devel@lists.sourceforge.net \
    --cc=linux-kernel@vger.kernel.org \
    --subject='Re: [PATCH 3/7] fbdev: extract fb_show_logo_line()' \
    /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

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