linux-fbdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [patch 0/3] Fbdev logo fixes and updates
@ 2007-03-13 14:14 Geert.Uytterhoeven
  2007-03-13 14:14 ` [patch 1/3] fbdev: Avoid vertical overflow when making space for the logo Geert.Uytterhoeven
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Geert.Uytterhoeven @ 2007-03-13 14:14 UTC (permalink / raw)
  To: Linus Torvalds, Andrew Morton
  Cc: linux-fbdev-devel, James Simmons, Antonino A. Daplas

These are a few logo bug fixes and updates:

[PATCH 1/3] fbdev: Avoid vertical overflow when making space for the logo
[PATCH 2/3] fbdev: fb_do_show_logo() updates
[PATCH 3/3] fbdev: correct image offsets when rotating logo

Please apply for 2.6.21. Thx!

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


-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV

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

* [patch 1/3] fbdev: Avoid vertical overflow when making space for the logo
  2007-03-13 14:14 [patch 0/3] Fbdev logo fixes and updates Geert.Uytterhoeven
@ 2007-03-13 14:14 ` Geert.Uytterhoeven
  2007-03-13 14:14 ` [patch 2/3] fbdev: fb_do_show_logo() updates Geert.Uytterhoeven
  2007-03-13 14:14 ` [patch 3/3] fbdev: correct image offsets when rotating logo Geert.Uytterhoeven
  2 siblings, 0 replies; 4+ messages in thread
From: Geert.Uytterhoeven @ 2007-03-13 14:14 UTC (permalink / raw)
  To: Linus Torvalds, Andrew Morton
  Cc: Geert Uytterhoeven, linux-fbdev-devel, James Simmons,
	Geoff Levand, Antonino A. Daplas

[-- Attachment #1: spe-logo/logo-avoid-vertical-overflow.diff --]
[-- Type: text/plain, Size: 1517 bytes --]

fbcon_prepare_logo(): Avoid vertical overflow when making space for the 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/console/fbcon.c |    9 +++++++--
 1 files changed, 7 insertions(+), 2 deletions(-)

--- ps3-linux-2.6.21-rc3.orig/drivers/video/console/fbcon.c
+++ ps3-linux-2.6.21-rc3/drivers/video/console/fbcon.c
@@ -618,8 +618,13 @@ static void fbcon_prepare_logo(struct vc
 			r -= cols;
 		}
 		if (!save) {
-			vc->vc_y += logo_lines;
-			vc->vc_pos += logo_lines * vc->vc_size_row;
+			int lines;
+			if (vc->vc_y + logo_lines >= rows)
+				lines = rows - vc->vc_y - 1;
+			else
+				lines = logo_lines;
+			vc->vc_y += lines;
+			vc->vc_pos += lines * vc->vc_size_row;
 		}
 	}
 	scr_memsetw((unsigned short *) vc->vc_origin,

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


-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV

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

* [patch 2/3] fbdev: fb_do_show_logo() updates
  2007-03-13 14:14 [patch 0/3] Fbdev logo fixes and updates Geert.Uytterhoeven
  2007-03-13 14:14 ` [patch 1/3] fbdev: Avoid vertical overflow when making space for the logo Geert.Uytterhoeven
@ 2007-03-13 14:14 ` Geert.Uytterhoeven
  2007-03-13 14:14 ` [patch 3/3] fbdev: correct image offsets when rotating logo Geert.Uytterhoeven
  2 siblings, 0 replies; 4+ messages in thread
From: Geert.Uytterhoeven @ 2007-03-13 14:14 UTC (permalink / raw)
  To: Linus Torvalds, Andrew Morton
  Cc: Geert Uytterhoeven, linux-fbdev-devel, James Simmons,
	Geoff Levand, Antonino A. Daplas

[-- Attachment #1: spe-logo/fb_do_show_logo.diff --]
[-- Type: text/plain, Size: 3191 bytes --]

fb_do_show_logo() updates:
  - Use width and height of the passed image instead of the global variable
    fb_logo
  - Explicitly pass the number of logos to draw

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 |   34 +++++++++++++++-------------------
 1 files changed, 15 insertions(+), 19 deletions(-)

--- ps3-linux-2.6.21-rc3.orig/drivers/video/fbmem.c
+++ ps3-linux-2.6.21-rc3/drivers/video/fbmem.c
@@ -376,37 +376,33 @@ static void fb_rotate_logo(struct fb_inf
 }
 
 static void fb_do_show_logo(struct fb_info *info, struct fb_image *image,
-			    int rotate)
+			    int rotate, unsigned int num)
 {
-	int x;
+	unsigned int x;
 
 	if (rotate == FB_ROTATE_UR) {
-		for (x = 0; x < num_online_cpus() &&
-			     x * (fb_logo.logo->width + 8) <=
-			     info->var.xres - fb_logo.logo->width; x++) {
+		for (x = 0;
+		     x < num && image->dx + image->width <= info->var.xres;
+		     x++) {
 			info->fbops->fb_imageblit(info, image);
-			image->dx += fb_logo.logo->width + 8;
+			image->dx += image->width + 8;
 		}
 	} else if (rotate == FB_ROTATE_UD) {
-		for (x = 0; x < num_online_cpus() &&
-			     x * (fb_logo.logo->width + 8) <=
-			     info->var.xres - fb_logo.logo->width; x++) {
+		for (x = 0; x < num && image->dx >= 0; x++) {
 			info->fbops->fb_imageblit(info, image);
-			image->dx -= fb_logo.logo->width + 8;
+			image->dx -= image->width + 8;
 		}
 	} else if (rotate == FB_ROTATE_CW) {
-		for (x = 0; x < num_online_cpus() &&
-			     x * (fb_logo.logo->width + 8) <=
-			     info->var.yres - fb_logo.logo->width; x++) {
+		for (x = 0;
+		     x < num && image->dy + image->height <= info->var.yres;
+		     x++) {
 			info->fbops->fb_imageblit(info, image);
-			image->dy += fb_logo.logo->width + 8;
+			image->dy += image->height + 8;
 		}
 	} else if (rotate == FB_ROTATE_CCW) {
-		for (x = 0; x < num_online_cpus() &&
-			     x * (fb_logo.logo->width + 8) <=
-			     info->var.yres - fb_logo.logo->width; x++) {
+		for (x = 0; x < num && image->dy >= 0; x++) {
 			info->fbops->fb_imageblit(info, image);
-			image->dy -= fb_logo.logo->width + 8;
+			image->dy -= image->height + 8;
 		}
 	}
 }
@@ -532,7 +528,7 @@ int fb_show_logo(struct fb_info *info, i
 			fb_rotate_logo(info, logo_rotate, &image, rotate);
 	}
 
-	fb_do_show_logo(info, &image, rotate);
+	fb_do_show_logo(info, &image, rotate, num_online_cpus());
 
 	kfree(palette);
 	if (saved_pseudo_palette != NULL)

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


-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV

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

* [patch 3/3] fbdev: correct image offsets when rotating logo
  2007-03-13 14:14 [patch 0/3] Fbdev logo fixes and updates Geert.Uytterhoeven
  2007-03-13 14:14 ` [patch 1/3] fbdev: Avoid vertical overflow when making space for the logo Geert.Uytterhoeven
  2007-03-13 14:14 ` [patch 2/3] fbdev: fb_do_show_logo() updates Geert.Uytterhoeven
@ 2007-03-13 14:14 ` Geert.Uytterhoeven
  2 siblings, 0 replies; 4+ messages in thread
From: Geert.Uytterhoeven @ 2007-03-13 14:14 UTC (permalink / raw)
  To: Linus Torvalds, Andrew Morton
  Cc: Geert Uytterhoeven, linux-fbdev-devel, James Simmons,
	Antonino A. Daplas

[-- Attachment #1: spe-logo/fb_rotate_logo-fix-offsets.diff --]
[-- Type: text/plain, Size: 2156 bytes --]

Correct the image offsets when rotating the logo. Before image->dx and
image->dy were always zero, so nobody ever noticed.

Signed-off-by: Geert Uytterhoeven <Geert.Uytterhoeven@sonycom.com>
Acked-By: James Simmons <jsimmons@infradead.org>
---
 drivers/video/fbmem.c |   12 ++++++++----
 1 files changed, 8 insertions(+), 4 deletions(-)

--- ps3-linux-2.6.21-rc3.orig/drivers/video/fbmem.c
+++ ps3-linux-2.6.21-rc3/drivers/video/fbmem.c
@@ -354,22 +354,26 @@ static void fb_rotate_logo(struct fb_inf
 	if (rotate == FB_ROTATE_UD) {
 		fb_rotate_logo_ud(image->data, dst, image->width,
 				  image->height);
-		image->dx = info->var.xres - image->width;
-		image->dy = info->var.yres - image->height;
+		image->dx = info->var.xres - image->width - image->dx;
+		image->dy = info->var.yres - image->height - image->dy;
 	} else if (rotate == FB_ROTATE_CW) {
 		fb_rotate_logo_cw(image->data, dst, image->width,
 				  image->height);
 		tmp = image->width;
 		image->width = image->height;
 		image->height = tmp;
-		image->dx = info->var.xres - image->width;
+		tmp = image->dy;
+		image->dy = image->dx;
+		image->dx = info->var.xres - image->width - tmp;
 	} else if (rotate == FB_ROTATE_CCW) {
 		fb_rotate_logo_ccw(image->data, dst, image->width,
 				   image->height);
 		tmp = image->width;
 		image->width = image->height;
 		image->height = tmp;
-		image->dy = info->var.yres - image->height;
+		tmp = image->dx;
+		image->dx = image->dy;
+		image->dy = info->var.yres - image->height - tmp;
 	}
 
 	image->data = dst;

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


-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV

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

end of thread, other threads:[~2007-03-13 14:16 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-03-13 14:14 [patch 0/3] Fbdev logo fixes and updates Geert.Uytterhoeven
2007-03-13 14:14 ` [patch 1/3] fbdev: Avoid vertical overflow when making space for the logo Geert.Uytterhoeven
2007-03-13 14:14 ` [patch 2/3] fbdev: fb_do_show_logo() updates Geert.Uytterhoeven
2007-03-13 14:14 ` [patch 3/3] fbdev: correct image offsets when rotating logo Geert.Uytterhoeven

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