diff options
Diffstat (limited to 'drivers/gpu/drm/radeon/r300_cmdbuf.c')
-rw-r--r-- | drivers/gpu/drm/radeon/r300_cmdbuf.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/drivers/gpu/drm/radeon/r300_cmdbuf.c b/drivers/gpu/drm/radeon/r300_cmdbuf.c index cace3964feeb..cb2e470f97d4 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 |
@@ -205,6 +207,10 @@ void r300_init_reg_flags(struct drm_device *dev) | |||
205 | ADD_RANGE(0x42C0, 2); | 207 | ADD_RANGE(0x42C0, 2); |
206 | ADD_RANGE(R300_RS_CNTL_0, 2); | 208 | ADD_RANGE(R300_RS_CNTL_0, 2); |
207 | 209 | ||
210 | ADD_RANGE(R300_SU_REG_DEST, 1); | ||
211 | if ((dev_priv->flags & RADEON_FAMILY_MASK) == CHIP_RV530) | ||
212 | ADD_RANGE(RV530_FG_ZBREG_DEST, 1); | ||
213 | |||
208 | ADD_RANGE(R300_SC_HYPERZ, 2); | 214 | ADD_RANGE(R300_SC_HYPERZ, 2); |
209 | ADD_RANGE(0x43E8, 1); | 215 | ADD_RANGE(0x43E8, 1); |
210 | 216 | ||
@@ -230,6 +236,7 @@ void r300_init_reg_flags(struct drm_device *dev) | |||
230 | ADD_RANGE(R300_ZB_DEPTHPITCH, 1); | 236 | ADD_RANGE(R300_ZB_DEPTHPITCH, 1); |
231 | ADD_RANGE(R300_ZB_DEPTHCLEARVALUE, 1); | 237 | ADD_RANGE(R300_ZB_DEPTHCLEARVALUE, 1); |
232 | ADD_RANGE(R300_ZB_ZMASK_OFFSET, 13); | 238 | ADD_RANGE(R300_ZB_ZMASK_OFFSET, 13); |
239 | ADD_RANGE(R300_ZB_ZPASS_DATA, 2); /* ZB_ZPASS_DATA, ZB_ZPASS_ADDR */ | ||
233 | 240 | ||
234 | ADD_RANGE(R300_TX_FILTER_0, 16); | 241 | ADD_RANGE(R300_TX_FILTER_0, 16); |
235 | ADD_RANGE(R300_TX_FILTER1_0, 16); | 242 | ADD_RANGE(R300_TX_FILTER1_0, 16); |
@@ -917,6 +924,7 @@ static int r300_scratch(drm_radeon_private_t *dev_priv, | |||
917 | { | 924 | { |
918 | u32 *ref_age_base; | 925 | u32 *ref_age_base; |
919 | u32 i, buf_idx, h_pending; | 926 | u32 i, buf_idx, h_pending; |
927 | u64 ptr_addr; | ||
920 | RING_LOCALS; | 928 | RING_LOCALS; |
921 | 929 | ||
922 | if (cmdbuf->bufsz < | 930 | if (cmdbuf->bufsz < |
@@ -930,7 +938,8 @@ static int r300_scratch(drm_radeon_private_t *dev_priv, | |||
930 | 938 | ||
931 | dev_priv->scratch_ages[header.scratch.reg]++; | 939 | dev_priv->scratch_ages[header.scratch.reg]++; |
932 | 940 | ||
933 | ref_age_base = (u32 *)(unsigned long)*((uint64_t *)cmdbuf->buf); | 941 | ptr_addr = get_unaligned((u64 *)cmdbuf->buf); |
942 | ref_age_base = (u32 *)(unsigned long)ptr_addr; | ||
934 | 943 | ||
935 | cmdbuf->buf += sizeof(u64); | 944 | cmdbuf->buf += sizeof(u64); |
936 | cmdbuf->bufsz -= sizeof(u64); | 945 | cmdbuf->bufsz -= sizeof(u64); |