Problems with rotated Logos
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.
To assist debugging, I changed to a 480x185 logo and tested this without console rotation where it displays fine. If I rotate the console clockwise, the logo doesn't appear but there is space left for it and the system boots.
I've tried to get further with this but I couldn't quite understand how fb_rotate_logo_cw was working. Could this be broken in the case where you have a logo with width > height? (height > width in the case of that function). I made a test program to look at the numbers outputted by that function and they didn't seem right for my logo size. I've not checked with the tux logo sizes as I ran out of time but will do in due course.
I'll continue to look into this but I wondered if anyone had any thoughts where the problem might be offhand? The lockup worries me but could be some separate issue and I'll work on getting the 480x185 logo working initially.
Regards,
Richard
Quoted 10 lines · Richard Purdie
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.
Tony
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.
---
drivers/video/fbmem.c | 16 ++++++++-------- 1 files changed, 8 insertions(+), 8 deletions(-)
drivers/video/fbmem.c +8 -8
@@ -356,24 +356,24 @@ static void fb_rotate_logo(struct fb_infu32 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;
Hi,
Quoted 7 lines · Antonino A. Daplas
Quoted 6 lines · Richard Purdie
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.
Quoted 6 lines
Quoted 4 lines
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...
Cheers,
Richard
Quoted 16 lines · Richard Purdie
Hi,
Quoted 7 lines · Antonino A. Daplas
Quoted 6 lines · Richard Purdie
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.
Quoted 5 lines
Quoted 4 lines
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.
Quoted 7 lines
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 ;-)
:-)
Quoted 6 lines
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?
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.
---
drivers/video/fbmem.c | 20 ++++++++++---------- 1 files changed, 10 insertions(+), 10 deletions(-)
drivers/video/fbmem.c +10 -10
@@ -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_infu32 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;
Quoted 16 lines · Richard Purdie
Hi,
Quoted 7 lines · Antonino A. Daplas
Quoted 6 lines · Richard Purdie
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.
Quoted 5 lines
Quoted 4 lines
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.
Quoted 7 lines
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 ;-)
:-)
Quoted 6 lines
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.
---
drivers/video/fbmem.c | 20 ++++++++++---------- 1 files changed, 10 insertions(+), 10 deletions(-)
drivers/video/fbmem.c +10 -10
@@ -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_infu32 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;
Quoted 2 lines · Antonino A. Daplas
Yes, you're right, the dimensions where reversed. Can you revert the previous patch, and then apply this one?
I've applied this and it displays perfectly, thanks! :)
Quoted 1 line
PS: If this still doesn't work, can you send me your logo ppm file?
In case you still want it, I have a few logos available at:
http://www.rpsys.net/openzaurus/patches/archive/logo_oz-r0.patch.bz2
http://www.rpsys.net/openzaurus/patches/archive/logo_oh-r0.patch.bz2
(the oz640 one is the one I was testing with)
Cheers,
Richard