Skip to content

Commit

Permalink
drm/radeon/kms/atom: use get_unaligned_le32() for ctx->ps
Browse files Browse the repository at this point in the history
Noticed on a DEC Alpha.

Start up into console mode caused 15 unaligned accesses, and starting X
caused another 48.

Signed-off-by: Matt Turner <mattst88@gmail.com>
CC: Jerome Glisse <jglisse@redhat.com>
CC: Alex Deucher <alexdeucher@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
  • Loading branch information
Matt Turner authored and Dave Airlie committed Feb 15, 2010
1 parent e22238e commit ce36f00
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion drivers/gpu/drm/radeon/atom.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@

#include <linux/module.h>
#include <linux/sched.h>
#include <asm/unaligned.h>

#define ATOM_DEBUG

Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit ce36f00

Please sign in to comment.