All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Antonino A. Daplas" <adaplas@gmail.com>
To: Richard Purdie <rpurdie@rpsys.net>
Cc: linux-fbdev-devel@lists.sourceforge.net
Subject: Re: Problems with rotated Logos
Date: Thu, 15 Jun 2006 05:27:37 +0800	[thread overview]
Message-ID: <44907F49.7050609@gmail.com> (raw)
In-Reply-To: <1150311401.9240.9.camel@localhost.localdomain>

Richard Purdie wrote:
> Hi,
> 
> On Wed, 2006-06-14 at 21:03 +0800, Antonino A. Daplas wrote:
>> Richard Purdie wrote:
>>> Hi,
>>>
>>> I've been experimenting with logos on the Sharp Zaurus C3000 which has a
>>> 480x640 framebuffer which is rotated clockwise to give 640x480. I'm
>>> using a 2.6.16 based kernel.
>>>
>>> If I use the standard Linux logo (clut224), all is well. I added a
>>> 640x185 logo and this locked the machine up when booting. Space was
>>> cleared at the top of the console for the logo and some boot messages
>>> appeared beneath it. Also, 639x185 gave the same result.
>> Yes, it's a bug. Also present in CCW. Try this patch.
> 
> The patch helps in that the 640x185 image no longer locks the system up
> and it displays something, thanks! The image is corrupted however.
> Rather than trying to describe it:
> 
> http://www.rpsys.net/openzaurus/temp/logo-corrupt.jpg
> 
> (I'm refraining from comment about the logo itself ;-)

:-)

> 
> As well as the wrapping, the blue colour to the left is also corruption,
> and marks the edge of the screen.
> 
> I suspect the rotation function has a bug...
> 

Yes, you're right, the dimensions where reversed. Can you revert the previous
patch, and then apply this one?

Tony

PS: If this still doesn't work, can you send me your logo ppm file?

fbdev: Fix logo rotation if width != height

Logo drawing crashes or produces corrupt display if the logo width and
height are not equal.  The dimensions are transposed prior to the actual
rotation, which produces a corrupt image.  Reverse the sequence to fix.

Signed-off-by: Antonino Daplas <adaplas@pol.net>
---

 drivers/video/fbmem.c |   20 ++++++++++----------
 1 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/drivers/video/fbmem.c b/drivers/video/fbmem.c
index 9527a52..a6b0629 100644
--- a/drivers/video/fbmem.c
+++ b/drivers/video/fbmem.c
@@ -334,11 +334,11 @@ static void fb_rotate_logo_ud(const u8 *
 
 static void fb_rotate_logo_cw(const u8 *in, u8 *out, u32 width, u32 height)
 {
-	int i, j, w = width - 1;
+	int i, j, h = height - 1;
 
 	for (i = 0; i < height; i++)
 		for (j = 0; j < width; j++)
-			out[height * j + w - i] = *in++;
+			out[height * j + h - i] = *in++;
 }
 
 static void fb_rotate_logo_ccw(const u8 *in, u8 *out, u32 width, u32 height)
@@ -356,24 +356,24 @@ static void fb_rotate_logo(struct fb_inf
 	u32 tmp;
 
 	if (rotate == FB_ROTATE_UD) {
-		image->dx = info->var.xres - image->width;
-		image->dy = info->var.yres - image->height;
 		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;
 	} else if (rotate == FB_ROTATE_CW) {
-		tmp = image->width;
-		image->width = image->height;
-		image->height = tmp;
-		image->dx = info->var.xres - image->height;
 		fb_rotate_logo_cw(image->data, dst, image->width,
 				  image->height);
-	} else if (rotate == FB_ROTATE_CCW) {
 		tmp = image->width;
 		image->width = image->height;
 		image->height = tmp;
-		image->dy = info->var.yres - image->width;
+		image->dx = info->var.xres - image->width;
+	} 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;
 	}
 
 	image->data = dst;

  parent reply	other threads:[~2006-06-14 21:29 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-06-14 10:13 Problems with rotated Logos Richard Purdie
2006-06-14 13:03 ` Antonino A. Daplas
2006-06-14 18:56   ` Richard Purdie
2006-06-14 21:24     ` Antonino A. Daplas
2006-06-14 21:27     ` Antonino A. Daplas [this message]
2006-06-14 23:35       ` Richard Purdie

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=44907F49.7050609@gmail.com \
    --to=adaplas@gmail.com \
    --cc=linux-fbdev-devel@lists.sourceforge.net \
    --cc=rpurdie@rpsys.net \
    /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.