diff options
Diffstat (limited to 'drivers/gpu/drm/radeon/r300_cmdbuf.c')
-rw-r--r-- | drivers/gpu/drm/radeon/r300_cmdbuf.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/drivers/gpu/drm/radeon/r300_cmdbuf.c b/drivers/gpu/drm/radeon/r300_cmdbuf.c index cace3964fee..3efa633966e 100644 --- a/drivers/gpu/drm/radeon/r300_cmdbuf.c +++ b/drivers/gpu/drm/radeon/r300_cmdbuf.c | |||
@@ -37,6 +37,8 @@ | |||
37 | #include "radeon_drv.h" | 37 | #include "radeon_drv.h" |
38 | #include "r300_reg.h" | 38 | #include "r300_reg.h" |
39 | 39 | ||
40 | #include <asm/unaligned.h> | ||
41 | |||
40 | #define R300_SIMULTANEOUS_CLIPRECTS 4 | 42 | #define R300_SIMULTANEOUS_CLIPRECTS 4 |
41 | 43 | ||
42 | /* Values for R300_RE_CLIPRECT_CNTL depending on the number of cliprects | 44 | /* Values for R300_RE_CLIPRECT_CNTL depending on the number of cliprects |
@@ -917,6 +919,7 @@ static int r300_scratch(drm_radeon_private_t *dev_priv, | |||
917 | { | 919 | { |
918 | u32 *ref_age_base; | 920 | u32 *ref_age_base; |
919 | u32 i, buf_idx, h_pending; | 921 | u32 i, buf_idx, h_pending; |
922 | u64 ptr_addr; | ||
920 | RING_LOCALS; | 923 | RING_LOCALS; |
921 | 924 | ||
922 | if (cmdbuf->bufsz < | 925 | if (cmdbuf->bufsz < |
@@ -930,7 +933,8 @@ static int r300_scratch(drm_radeon_private_t *dev_priv, | |||
930 | 933 | ||
931 | dev_priv->scratch_ages[header.scratch.reg]++; | 934 | dev_priv->scratch_ages[header.scratch.reg]++; |
932 | 935 | ||
933 | ref_age_base = (u32 *)(unsigned long)*((uint64_t *)cmdbuf->buf); | 936 | ptr_addr = get_unaligned((u64 *)cmdbuf->buf); |
937 | ref_age_base = (u32 *)(unsigned long)ptr_addr; | ||
934 | 938 | ||
935 | cmdbuf->buf += sizeof(u64); | 939 | cmdbuf->buf += sizeof(u64); |
936 | cmdbuf->bufsz -= sizeof(u64); | 940 | cmdbuf->bufsz -= sizeof(u64); |