From: Maciej W. Rozycki Date: Mon, 12 Feb 2007 08:54:53 +0000 (-0800) Subject: [PATCH] tgafb: fix copying overlapping areas X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=36f71405e63f3d1e4c2a8dd98523820bbca8e078;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git [PATCH] tgafb: fix copying overlapping areas The direction of copying in the copyarea functions is selected incorrectly, resulting in corruption. This is a fix. Signed-off-by: Maciej W. Rozycki Cc: James Simmons Cc: "Antonino A. Daplas" Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/drivers/video/tgafb.c b/drivers/video/tgafb.c index 0a00a6cc7c2b..9c23a783e713 100644 --- a/drivers/video/tgafb.c +++ b/drivers/video/tgafb.c @@ -885,7 +885,7 @@ copyarea_line_8bpp(struct fb_info *info, u32 dy, u32 sy, n64 = (height * width) / 64; - if (dy < sy) { + if (sy < dy) { spos = (sy + height) * width; dpos = (dy + height) * width; @@ -933,7 +933,7 @@ copyarea_line_32bpp(struct fb_info *info, u32 dy, u32 sy, n16 = (height * width) / 16; - if (dy < sy) { + if (sy < dy) { src = tga_fb + (sy + height) * width * 4; dst = tga_fb + (dy + height) * width * 4;