Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 36f71405 authored by Maciej W. Rozycki's avatar Maciej W. Rozycki Committed by Linus Torvalds
Browse files

[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: default avatarMaciej W. Rozycki <macro@linux-mips.org>
Cc: James Simmons <jsimmons@infradead.org>
Cc: "Antonino A. Daplas" <adaplas@pol.net>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent ee9a25e5
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -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;