All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Antonino A. Daplas" <adaplas@gmail.com>
To: Geert Uytterhoeven <Geert.Uytterhoeven@sonycom.com>
Cc: linux-fbdev-devel@lists.sourceforge.net,
	Geoff Levand <geoffrey.levand@am.sony.com>,
	Arnd Bergmann <arnd@arndb.de>,
	linux-kernel@vger.kernel.org,
	James Simmons <jsimmons@infradead.org>,
	Andrew Morton <akpm@linux-foundation.org>,
	cbe-oss-dev@ozlabs.org
Subject: Re: [patch 2/4] fbdev: Add fb_append_extra_logo()
Date: Fri, 13 Jul 2007 08:15:57 +0800	[thread overview]
Message-ID: <1184285757.4566.11.camel@daplas> (raw)
In-Reply-To: <20070710123540.678435000@pademelon.sonytel.be>

On Tue, 2007-07-10 at 14:27 +0200, Geert Uytterhoeven wrote:
> plain text document attachment (spe-logo)
> 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>
> Acked-By: James Simmons <jsimmons@infradead.org>
> ---
>  drivers/video/fbmem.c      |   50 +++++++++++++++++++++++++++++++++++++++++----
>  include/linux/linux_logo.h |    8 +++++++
>  2 files changed, 54 insertions(+), 4 deletions(-)
> 
> --- a/drivers/video/fbmem.c
> +++ b/drivers/video/fbmem.c
> @@ -318,6 +318,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;
> +
>  static void fb_rotate_logo_ud(const u8 *in, u8 *out, u32 width, u32 height)
>  {
>  	u32 size = width * height, i;
> @@ -411,10 +418,22 @@ static void fb_do_show_logo(struct fb_in
>  	}
>  }
>  
> +#ifdef CONFIG_FB

The #ifdef is redundant.

> +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++;
> +}
> +#endif
> +
>  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));
>  
> @@ -474,7 +493,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,
> @@ -547,8 +580,17 @@ 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
>  int fb_prepare_logo(struct fb_info *info, int rotate) { return 0; }
> --- a/include/linux/linux_logo.h
> +++ b/include/linux/linux_logo.h
> @@ -33,5 +33,13 @@ struct linux_logo {
>  };
>  
>  extern const struct linux_logo *fb_find_logo(int depth);
> +#if defined(CONFIG_LOGO) && defined(CONFIG_FB)

The CONFIG_LOGO is also probably redundant, but that's arguable.

Tony



-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/

WARNING: multiple messages have this Message-ID (diff)
From: "Antonino A. Daplas" <adaplas@gmail.com>
To: Geert Uytterhoeven <Geert.Uytterhoeven@sonycom.com>
Cc: Andrew Morton <akpm@linux-foundation.org>,
	Arnd Bergmann <arnd@arndb.de>,
	James Simmons <jsimmons@infradead.org>,
	linux-fbdev-devel@lists.sourceforge.net, cbe-oss-dev@ozlabs.org,
	linux-kernel@vger.kernel.org,
	Geoff Levand <geoffrey.levand@am.sony.com>
Subject: Re: [patch 2/4] fbdev: Add fb_append_extra_logo()
Date: Fri, 13 Jul 2007 08:15:57 +0800	[thread overview]
Message-ID: <1184285757.4566.11.camel@daplas> (raw)
In-Reply-To: <20070710123540.678435000@pademelon.sonytel.be>

On Tue, 2007-07-10 at 14:27 +0200, Geert Uytterhoeven wrote:
> plain text document attachment (spe-logo)
> 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>
> Acked-By: James Simmons <jsimmons@infradead.org>
> ---
>  drivers/video/fbmem.c      |   50 +++++++++++++++++++++++++++++++++++++++++----
>  include/linux/linux_logo.h |    8 +++++++
>  2 files changed, 54 insertions(+), 4 deletions(-)
> 
> --- a/drivers/video/fbmem.c
> +++ b/drivers/video/fbmem.c
> @@ -318,6 +318,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;
> +
>  static void fb_rotate_logo_ud(const u8 *in, u8 *out, u32 width, u32 height)
>  {
>  	u32 size = width * height, i;
> @@ -411,10 +418,22 @@ static void fb_do_show_logo(struct fb_in
>  	}
>  }
>  
> +#ifdef CONFIG_FB

The #ifdef is redundant.

> +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++;
> +}
> +#endif
> +
>  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));
>  
> @@ -474,7 +493,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,
> @@ -547,8 +580,17 @@ 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
>  int fb_prepare_logo(struct fb_info *info, int rotate) { return 0; }
> --- a/include/linux/linux_logo.h
> +++ b/include/linux/linux_logo.h
> @@ -33,5 +33,13 @@ struct linux_logo {
>  };
>  
>  extern const struct linux_logo *fb_find_logo(int depth);
> +#if defined(CONFIG_LOGO) && defined(CONFIG_FB)

The CONFIG_LOGO is also probably redundant, but that's arguable.

Tony



  reply	other threads:[~2007-07-13  0:16 UTC|newest]

Thread overview: 35+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-07-10 12:27 [patch 0/4] Cell SPE logos Geert Uytterhoeven
2007-07-10 12:27 ` [patch 1/4] fbdev: extract fb_show_logo_line() Geert Uytterhoeven
2007-07-10 12:27   ` Geert Uytterhoeven
2007-07-10 12:27 ` [patch 2/4] fbdev: Add fb_append_extra_logo() Geert Uytterhoeven
2007-07-10 12:27   ` Geert Uytterhoeven
2007-07-13  0:15   ` Antonino A. Daplas [this message]
2007-07-13  0:15     ` Antonino A. Daplas
2007-07-13  6:56     ` Geert Uytterhoeven
2007-07-13  6:56       ` Geert Uytterhoeven
2007-07-13 11:45       ` Antonino A. Daplas
2007-07-13 11:45         ` Antonino A. Daplas
2007-07-13 12:02         ` Geert Uytterhoeven
2007-07-13 12:02           ` Geert Uytterhoeven
2007-07-13  6:58     ` Geert Uytterhoeven
2007-07-13  6:58       ` Geert Uytterhoeven
2007-07-13 11:53       ` Antonino A. Daplas
2007-07-13 11:53         ` Antonino A. Daplas
2007-07-10 12:27 ` [patch 3/4] fbdev: SPE helper penguin logo Geert Uytterhoeven
2007-07-10 12:27   ` Geert Uytterhoeven
2007-07-10 12:27 ` [patch 4/4] Cell: Draw SPE helper penguin logos Geert Uytterhoeven
2007-07-10 12:27   ` Geert Uytterhoeven
2007-07-10 16:54   ` [Cbe-oss-dev] " Arnd Bergmann
2007-07-10 16:54     ` Arnd Bergmann
2007-07-12 23:06 ` [patch 0/4] Cell SPE logos Andrew Morton
2007-07-13  8:52   ` Geert Uytterhoeven
2007-07-13  8:52     ` Geert Uytterhoeven
2007-07-13  9:06     ` Andrew Morton
2007-07-13  9:09       ` Geert Uytterhoeven
2007-07-13  9:09         ` Geert Uytterhoeven
2007-07-13 12:30         ` Benjamin Herrenschmidt
2007-07-13 12:30           ` [Linux-fbdev-devel] " Benjamin Herrenschmidt
2007-07-13 10:05     ` [Cbe-oss-dev] " Arnd Bergmann
2007-07-13 10:05       ` Arnd Bergmann
  -- strict thread matches above, loose matches on Subject: below --
2007-07-16 13:55 Geert Uytterhoeven
2007-07-16 13:55 ` [patch 2/4] fbdev: Add fb_append_extra_logo() Geert Uytterhoeven
2007-07-16 13:55   ` 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=1184285757.4566.11.camel@daplas \
    --to=adaplas@gmail.com \
    --cc=Geert.Uytterhoeven@sonycom.com \
    --cc=akpm@linux-foundation.org \
    --cc=arnd@arndb.de \
    --cc=cbe-oss-dev@ozlabs.org \
    --cc=geoffrey.levand@am.sony.com \
    --cc=jsimmons@infradead.org \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.