aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/video/aty/mach64_accel.c
diff options
context:
space:
mode:
authorMikulas Patocka <mpatocka@redhat.com>2014-01-23 14:41:09 -0500
committerTomi Valkeinen <tomi.valkeinen@ti.com>2014-02-11 08:01:04 -0500
commitc29dd8696dc5dbd50b3ac441b8a26751277ba520 (patch)
tree36e7c97bda98cff02557b602572b076b89931994 /drivers/video/aty/mach64_accel.c
parentbf26e6d2fed45da619ae0ef675a09b794db6e449 (diff)
mach64: use unaligned access
This patch fixes mach64 to use unaligned access to the font bitmap. This fixes unaligned access warning on sparc64 when 14x8 font is loaded. On x86(64), unaligned access is handled in hardware, so both functions le32_to_cpup and get_unaligned_le32 perform the same operation. On RISC machines, unaligned access is not handled in hardware, so we better use get_unaligned_le32 to avoid the unaligned trap and warning. Signed-off-by: Mikulas Patocka <mpatocka@redhat.com> Cc: stable@vger.kernel.org Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Diffstat (limited to 'drivers/video/aty/mach64_accel.c')
-rw-r--r--drivers/video/aty/mach64_accel.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/video/aty/mach64_accel.c b/drivers/video/aty/mach64_accel.c
index e45833ce975b..182bd680141f 100644
--- a/drivers/video/aty/mach64_accel.c
+++ b/drivers/video/aty/mach64_accel.c
@@ -4,6 +4,7 @@
4 */ 4 */
5 5
6#include <linux/delay.h> 6#include <linux/delay.h>
7#include <asm/unaligned.h>
7#include <linux/fb.h> 8#include <linux/fb.h>
8#include <video/mach64.h> 9#include <video/mach64.h>
9#include "atyfb.h" 10#include "atyfb.h"
@@ -419,7 +420,7 @@ void atyfb_imageblit(struct fb_info *info, const struct fb_image *image)
419 u32 *pbitmap, dwords = (src_bytes + 3) / 4; 420 u32 *pbitmap, dwords = (src_bytes + 3) / 4;
420 for (pbitmap = (u32*)(image->data); dwords; dwords--, pbitmap++) { 421 for (pbitmap = (u32*)(image->data); dwords; dwords--, pbitmap++) {
421 wait_for_fifo(1, par); 422 wait_for_fifo(1, par);
422 aty_st_le32(HOST_DATA0, le32_to_cpup(pbitmap), par); 423 aty_st_le32(HOST_DATA0, get_unaligned_le32(pbitmap), par);
423 } 424 }
424 } 425 }
425 426