]> git.karo-electronics.de Git - mv-sheeva.git/blobdiff - drivers/gpu/drm/radeon/atom.c
drm/radeon/kms/atom: use get_unaligned_le32() for ctx->ps
[mv-sheeva.git] / drivers / gpu / drm / radeon / atom.c
index e3b44562d2654f7ab2c29da917d50a864db736ef..2a3df5599ab48b0056fc2a4ad4b2d37bac29b4a1 100644 (file)
@@ -24,6 +24,7 @@
 
 #include <linux/module.h>
 #include <linux/sched.h>
+#include <asm/unaligned.h>
 
 #define ATOM_DEBUG
 
@@ -212,7 +213,9 @@ static uint32_t atom_get_src_int(atom_exec_context *ctx, uint8_t attr,
        case ATOM_ARG_PS:
                idx = U8(*ptr);
                (*ptr)++;
-               val = le32_to_cpu(ctx->ps[idx]);
+               /* get_unaligned_le32 avoids unaligned accesses from atombios
+                * tables, noticed on a DEC Alpha. */
+               val = get_unaligned_le32((u32 *)&ctx->ps[idx]);
                if (print)
                        DEBUG("PS[0x%02X,0x%04X]", idx, val);
                break;