diff options
author | Benjamin Herrenschmidt <benh@kernel.crashing.org> | 2008-10-16 01:03:44 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2008-10-16 14:21:44 -0400 |
commit | a6c0c37db654444dfce91cd75ad8a56bb15a0d25 (patch) | |
tree | a204a42fa6441253f51bd186f6978a4f25492a44 /drivers/video/aty/radeon_accel.c | |
parent | 7c08c9ae0c145807c0dae4a55f240fa3d4fd5262 (diff) |
radeonfb: misc cleanup of engine and dst cache handling
Fix a couple of incomplete tests of the chip families in the engine
init/reset code and proper initialization of the destination cache mode.
The result should better match what the latest X radeon driver does.
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Acked-by: David S. Miller <davem@davemloft.net>
Cc: Krzysztof Halasa <khc@pm.waw.pl>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/video/aty/radeon_accel.c')
-rw-r--r-- | drivers/video/aty/radeon_accel.c | 22 |
1 files changed, 13 insertions, 9 deletions
diff --git a/drivers/video/aty/radeon_accel.c b/drivers/video/aty/radeon_accel.c index aa95f8350242..a469a3d6edcb 100644 --- a/drivers/video/aty/radeon_accel.c +++ b/drivers/video/aty/radeon_accel.c | |||
@@ -211,9 +211,7 @@ void radeonfb_engine_reset(struct radeonfb_info *rinfo) | |||
211 | host_path_cntl = INREG(HOST_PATH_CNTL); | 211 | host_path_cntl = INREG(HOST_PATH_CNTL); |
212 | rbbm_soft_reset = INREG(RBBM_SOFT_RESET); | 212 | rbbm_soft_reset = INREG(RBBM_SOFT_RESET); |
213 | 213 | ||
214 | if (rinfo->family == CHIP_FAMILY_R300 || | 214 | if (IS_R300_VARIANT(rinfo)) { |
215 | rinfo->family == CHIP_FAMILY_R350 || | ||
216 | rinfo->family == CHIP_FAMILY_RV350) { | ||
217 | u32 tmp; | 215 | u32 tmp; |
218 | 216 | ||
219 | OUTREG(RBBM_SOFT_RESET, (rbbm_soft_reset | | 217 | OUTREG(RBBM_SOFT_RESET, (rbbm_soft_reset | |
@@ -249,9 +247,7 @@ void radeonfb_engine_reset(struct radeonfb_info *rinfo) | |||
249 | INREG(HOST_PATH_CNTL); | 247 | INREG(HOST_PATH_CNTL); |
250 | OUTREG(HOST_PATH_CNTL, host_path_cntl); | 248 | OUTREG(HOST_PATH_CNTL, host_path_cntl); |
251 | 249 | ||
252 | if (rinfo->family != CHIP_FAMILY_R300 && | 250 | if (!IS_R300_VARIANT(rinfo)) |
253 | rinfo->family != CHIP_FAMILY_R350 && | ||
254 | rinfo->family != CHIP_FAMILY_RV350) | ||
255 | OUTREG(RBBM_SOFT_RESET, rbbm_soft_reset); | 251 | OUTREG(RBBM_SOFT_RESET, rbbm_soft_reset); |
256 | 252 | ||
257 | OUTREG(CLOCK_CNTL_INDEX, clock_cntl_index); | 253 | OUTREG(CLOCK_CNTL_INDEX, clock_cntl_index); |
@@ -268,10 +264,18 @@ void radeonfb_engine_init (struct radeonfb_info *rinfo) | |||
268 | radeonfb_engine_reset(rinfo); | 264 | radeonfb_engine_reset(rinfo); |
269 | 265 | ||
270 | radeon_fifo_wait (1); | 266 | radeon_fifo_wait (1); |
271 | if ((rinfo->family != CHIP_FAMILY_R300) && | 267 | if (IS_R300_VARIANT(rinfo)) { |
272 | (rinfo->family != CHIP_FAMILY_R350) && | 268 | OUTREG(RB2D_DSTCACHE_MODE, INREG(RB2D_DSTCACHE_MODE) | |
273 | (rinfo->family != CHIP_FAMILY_RV350)) | 269 | RB2D_DC_AUTOFLUSH_ENABLE | |
270 | RB2D_DC_DC_DISABLE_IGNORE_PE); | ||
271 | } else { | ||
272 | /* This needs to be double checked with ATI. Latest X driver | ||
273 | * completely "forgets" to set this register on < r3xx, and | ||
274 | * we used to just write 0 there... I'll keep the 0 and update | ||
275 | * that when we have sorted things out on X side. | ||
276 | */ | ||
274 | OUTREG(RB2D_DSTCACHE_MODE, 0); | 277 | OUTREG(RB2D_DSTCACHE_MODE, 0); |
278 | } | ||
275 | 279 | ||
276 | radeon_fifo_wait (3); | 280 | radeon_fifo_wait (3); |
277 | /* We re-read MC_FB_LOCATION from card as it can have been | 281 | /* We re-read MC_FB_LOCATION from card as it can have been |