mach64: fix display corruption on big endian machines
authorMikulas Patocka <mpatocka@redhat.com>
Mon, 8 Oct 2018 10:57:34 +0000 (12:57 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 22 Nov 2018 06:32:46 +0000 (07:32 +0100)
commitd913c88a41fdbacf92727a24e480c591b4c20a73
treeb45ad1388a73e8443cbcfe1f2628b72403b714de
parent5a6726d7695d09d1935ccb18b46c870ac23192df
mach64: fix display corruption on big endian machines

commit 3c6c6a7878d00a3ac997a779c5b9861ff25dfcc8 upstream.

The code for manual bit triple is not endian-clean. It builds the variable
"hostdword" using byte accesses, therefore we must read the variable with
"le32_to_cpu".

The patch also enables (hardware or software) bit triple only if the image
is monochrome (image->depth). If we want to blit full-color image, we
shouldn't use the triple code.

Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
Reviewed-by: Ville Syrjälä <syrjala@sci.fi>
Cc: stable@vger.kernel.org
Signed-off-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/video/fbdev/aty/mach64_accel.c