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 5/7] fbdev: Add fb_append_extra_logo()
Date: Wed, 31 Jan 2007 13:44:11 +0100 (CET) [thread overview]
Message-ID: <Pine.LNX.4.62.0701311340310.15066@pademelon.sonytel.be> (raw)
In-Reply-To: <Pine.LNX.4.62.0701311325480.14996@pademelon.sonytel.be>
Add fb_append_extra_logo(), to append extra lines of logos below the standard
Linux logo.
Signed-off-by: Geert Uytterhoeven <Geert.Uytterhoeven@sonycom.com>
Signed-off-by: Geoff Levand <geoffrey.levand@am.sony.com>
---
drivers/video/fbmem.c | 50 +++++++++++++++++++++++++++++++++++++++++----
include/linux/linux_logo.h | 8 +++++++
2 files changed, 54 insertions(+), 4 deletions(-)
--- ps3-linux-2.6.20-rc7.orig/drivers/video/fbmem.c
+++ ps3-linux-2.6.20-rc7/drivers/video/fbmem.c
@@ -319,6 +319,13 @@ static struct logo_data {
const struct linux_logo *logo;
} fb_logo __read_mostly;
+#define FB_LOGO_EX_NUM_MAX 10
+static struct logo_data_extra {
+ const struct linux_logo *logo;
+ unsigned int n;
+} fb_logo_ex[FB_LOGO_EX_NUM_MAX];
+static unsigned int fb_logo_ex_num = 0;
+
static void fb_rotate_logo_ud(const u8 *in, u8 *out, u32 width, u32 height)
{
u32 size = width * height, i;
@@ -408,10 +415,20 @@ static void fb_do_show_logo(struct fb_in
}
}
+void fb_append_extra_logo(const struct linux_logo *logo, unsigned int n)
+{
+ if (!n || fb_logo_ex_num == FB_LOGO_EX_NUM_MAX)
+ return;
+
+ fb_logo_ex[fb_logo_ex_num].logo = logo;
+ fb_logo_ex[fb_logo_ex_num].n = n;
+ fb_logo_ex_num++;
+}
+
int fb_prepare_logo(struct fb_info *info, int rotate)
{
int depth = fb_get_color_depth(&info->var, &info->fix);
- int yres;
+ unsigned int yres, height, i;
memset(&fb_logo, 0, sizeof(struct logo_data));
@@ -470,7 +487,21 @@ int fb_prepare_logo(struct fb_info *info
fb_logo.depth = 4;
else
fb_logo.depth = 1;
- return fb_logo.logo->height;
+
+ /* FIXME: logo_ex supports only truecolor fb. */
+ if (info->fix.visual != FB_VISUAL_TRUECOLOR)
+ fb_logo_ex_num = 0;
+
+ height = fb_logo.logo->height;
+ for (i = 0; i < fb_logo_ex_num; i++) {
+ height += fb_logo_ex[i].logo->height;
+ if (height > yres) {
+ height -= fb_logo_ex[i].logo->height;
+ fb_logo_ex_num = i;
+ break;
+ }
+ }
+ return height;
}
static int fb_show_logo_line(struct fb_info *info, int rotate,
@@ -542,10 +573,20 @@ static int fb_show_logo_line(struct fb_i
int fb_show_logo(struct fb_info *info, int rotate)
{
- return fb_show_logo_line(info, rotate, fb_logo.logo, 0,
- num_online_cpus());
+ int y, i;
+
+ y = fb_show_logo_line(info, rotate, fb_logo.logo, 0,
+ num_online_cpus());
+
+ for (i = 0; i < fb_logo_ex_num; i++) {
+ y += fb_show_logo_line(info, rotate,
+ fb_logo_ex[i].logo, y, fb_logo_ex[i].n);
+ }
+
+ return y;
}
#else
+void fb_append_extra_logo(const struct linux_logo *logo, int n) {}
int fb_prepare_logo(struct fb_info *info, int rotate) { return 0; }
int fb_show_logo(struct fb_info *info, int rotate) { return 0; }
#endif /* CONFIG_LOGO */
@@ -1561,6 +1602,7 @@ EXPORT_SYMBOL(register_framebuffer);
EXPORT_SYMBOL(unregister_framebuffer);
EXPORT_SYMBOL(num_registered_fb);
EXPORT_SYMBOL(registered_fb);
+EXPORT_SYMBOL(fb_append_extra_logo);
EXPORT_SYMBOL(fb_prepare_logo);
EXPORT_SYMBOL(fb_show_logo);
EXPORT_SYMBOL(fb_set_var);
--- ps3-linux-2.6.20-rc7.orig/include/linux/linux_logo.h
+++ ps3-linux-2.6.20-rc7/include/linux/linux_logo.h
@@ -46,5 +46,13 @@ extern struct linux_logo logo_superh_clu
extern struct linux_logo logo_m32r_clut224;
extern const struct linux_logo *fb_find_logo(int depth);
+#ifdef CONFIG_LOGO
+extern void fb_append_extra_logo(const struct linux_logo *logo,
+ unsigned int n);
+#else
+static inline void fb_append_extra_logo(const struct linux_logo *logo,
+ unsigned int n)
+{}
+#endif
#endif /* _LINUX_LINUX_LOGO_H */
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
next prev parent reply other threads:[~2007-01-31 12:46 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 ` [PATCH 3/7] fbdev: extract fb_show_logo_line() Geert Uytterhoeven
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 ` Geert Uytterhoeven [this message]
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.0701311340310.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 5/7] fbdev: Add fb_append_extra_logo()' \
/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).