fbdev: correct image offsets when rotating logo
authorGeert Uytterhoeven <Geert.Uytterhoeven@sonycom.com>
Tue, 8 May 2007 07:37:57 +0000 (00:37 -0700)
committerLinus Torvalds <torvalds@woody.linux-foundation.org>
Tue, 8 May 2007 18:15:27 +0000 (11:15 -0700)
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>
Cc: "Antonino A. Daplas" <adaplas@pol.net>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
drivers/video/fbmem.c

index 8ce98a2f6f37d4139bdb8f696bd12cfcc0429190..45f38390605b1894a2a66f7a1fcf911868a7fd58 100644 (file)
@@ -354,22 +354,26 @@ static void fb_rotate_logo(struct fb_info *info, u8 *dst,
        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;