aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorAntonino A. Daplas <adaplas@gmail.com>2006-06-26 03:26:56 -0400
committerLinus Torvalds <torvalds@g5.osdl.org>2006-06-26 12:58:31 -0400
commitf837e6f73fe3f04594dad9829df6c7baa5b64a85 (patch)
treeef08bf98f116c50189a5659137e7f6b6b1795b60 /drivers
parent4efefd1d8ea4eaf71bacc4f71fa017c202fa67ec (diff)
[PATCH] fbdev: Fix logo rotation if width != height
Logo drawing crashes or produces a corrupt display if the logo width and height are not equal. The dimensions are transposed prior to the actual rotation and the width is used instead of the height in the actual rotation code. These produce a corrupt image. Signed-off-by: Antonino Daplas <adaplas@pol.net> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/video/fbmem.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/drivers/video/fbmem.c b/drivers/video/fbmem.c
index 2279d14fe556..e9af5e61018d 100644
--- a/drivers/video/fbmem.c
+++ b/drivers/video/fbmem.c
@@ -334,11 +334,11 @@ static void fb_rotate_logo_ud(const u8 *in, u8 *out, u32 width, u32 height)
334 334
335static void fb_rotate_logo_cw(const u8 *in, u8 *out, u32 width, u32 height) 335static void fb_rotate_logo_cw(const u8 *in, u8 *out, u32 width, u32 height)
336{ 336{
337 int i, j, w = width - 1; 337 int i, j, h = height - 1;
338 338
339 for (i = 0; i < height; i++) 339 for (i = 0; i < height; i++)
340 for (j = 0; j < width; j++) 340 for (j = 0; j < width; j++)
341 out[height * j + w - i] = *in++; 341 out[height * j + h - i] = *in++;
342} 342}
343 343
344static void fb_rotate_logo_ccw(const u8 *in, u8 *out, u32 width, u32 height) 344static 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_info *info, u8 *dst,
356 u32 tmp; 356 u32 tmp;
357 357
358 if (rotate == FB_ROTATE_UD) { 358 if (rotate == FB_ROTATE_UD) {
359 image->dx = info->var.xres - image->width;
360 image->dy = info->var.yres - image->height;
361 fb_rotate_logo_ud(image->data, dst, image->width, 359 fb_rotate_logo_ud(image->data, dst, image->width,
362 image->height); 360 image->height);
361 image->dx = info->var.xres - image->width;
362 image->dy = info->var.yres - image->height;
363 } else if (rotate == FB_ROTATE_CW) { 363 } else if (rotate == FB_ROTATE_CW) {
364 tmp = image->width;
365 image->width = image->height;
366 image->height = tmp;
367 image->dx = info->var.xres - image->height;
368 fb_rotate_logo_cw(image->data, dst, image->width, 364 fb_rotate_logo_cw(image->data, dst, image->width,
369 image->height); 365 image->height);
370 } else if (rotate == FB_ROTATE_CCW) {
371 tmp = image->width; 366 tmp = image->width;
372 image->width = image->height; 367 image->width = image->height;
373 image->height = tmp; 368 image->height = tmp;
374 image->dy = info->var.yres - image->width; 369 image->dx = info->var.xres - image->width;
370 } else if (rotate == FB_ROTATE_CCW) {
375 fb_rotate_logo_ccw(image->data, dst, image->width, 371 fb_rotate_logo_ccw(image->data, dst, image->width,
376 image->height); 372 image->height);
373 tmp = image->width;
374 image->width = image->height;
375 image->height = tmp;
376 image->dy = info->var.yres - image->height;
377 } 377 }
378 378
379 image->data = dst; 379 image->data = dst;