diff options
Diffstat (limited to 'drivers/gpu/drm/radeon/radeon_cp.c')
-rw-r--r-- | drivers/gpu/drm/radeon/radeon_cp.c | 38 |
1 files changed, 18 insertions, 20 deletions
diff --git a/drivers/gpu/drm/radeon/radeon_cp.c b/drivers/gpu/drm/radeon/radeon_cp.c index f0de81a5689d..3331f88dcfb6 100644 --- a/drivers/gpu/drm/radeon/radeon_cp.c +++ b/drivers/gpu/drm/radeon/radeon_cp.c | |||
@@ -40,6 +40,7 @@ | |||
40 | #define RADEON_FIFO_DEBUG 0 | 40 | #define RADEON_FIFO_DEBUG 0 |
41 | 41 | ||
42 | static int radeon_do_cleanup_cp(struct drm_device * dev); | 42 | static int radeon_do_cleanup_cp(struct drm_device * dev); |
43 | static void radeon_do_cp_start(drm_radeon_private_t * dev_priv); | ||
43 | 44 | ||
44 | static u32 R500_READ_MCIND(drm_radeon_private_t *dev_priv, int addr) | 45 | static u32 R500_READ_MCIND(drm_radeon_private_t *dev_priv, int addr) |
45 | { | 46 | { |
@@ -198,23 +199,8 @@ static int radeon_do_pixcache_flush(drm_radeon_private_t * dev_priv) | |||
198 | DRM_UDELAY(1); | 199 | DRM_UDELAY(1); |
199 | } | 200 | } |
200 | } else { | 201 | } else { |
201 | /* 3D */ | 202 | /* don't flush or purge cache here or lockup */ |
202 | tmp = RADEON_READ(R300_RB3D_DSTCACHE_CTLSTAT); | 203 | return 0; |
203 | tmp |= RADEON_RB3D_DC_FLUSH_ALL; | ||
204 | RADEON_WRITE(R300_RB3D_DSTCACHE_CTLSTAT, tmp); | ||
205 | |||
206 | /* 2D */ | ||
207 | tmp = RADEON_READ(R300_DSTCACHE_CTLSTAT); | ||
208 | tmp |= RADEON_RB3D_DC_FLUSH_ALL; | ||
209 | RADEON_WRITE(R300_DSTCACHE_CTLSTAT, tmp); | ||
210 | |||
211 | for (i = 0; i < dev_priv->usec_timeout; i++) { | ||
212 | if (!(RADEON_READ(R300_DSTCACHE_CTLSTAT) | ||
213 | & RADEON_RB3D_DC_BUSY)) { | ||
214 | return 0; | ||
215 | } | ||
216 | DRM_UDELAY(1); | ||
217 | } | ||
218 | } | 204 | } |
219 | 205 | ||
220 | #if RADEON_FIFO_DEBUG | 206 | #if RADEON_FIFO_DEBUG |
@@ -237,6 +223,9 @@ static int radeon_do_wait_for_fifo(drm_radeon_private_t * dev_priv, int entries) | |||
237 | return 0; | 223 | return 0; |
238 | DRM_UDELAY(1); | 224 | DRM_UDELAY(1); |
239 | } | 225 | } |
226 | DRM_INFO("wait for fifo failed status : 0x%08X 0x%08X\n", | ||
227 | RADEON_READ(RADEON_RBBM_STATUS), | ||
228 | RADEON_READ(R300_VAP_CNTL_STATUS)); | ||
240 | 229 | ||
241 | #if RADEON_FIFO_DEBUG | 230 | #if RADEON_FIFO_DEBUG |
242 | DRM_ERROR("failed!\n"); | 231 | DRM_ERROR("failed!\n"); |
@@ -263,6 +252,9 @@ static int radeon_do_wait_for_idle(drm_radeon_private_t * dev_priv) | |||
263 | } | 252 | } |
264 | DRM_UDELAY(1); | 253 | DRM_UDELAY(1); |
265 | } | 254 | } |
255 | DRM_INFO("wait idle failed status : 0x%08X 0x%08X\n", | ||
256 | RADEON_READ(RADEON_RBBM_STATUS), | ||
257 | RADEON_READ(R300_VAP_CNTL_STATUS)); | ||
266 | 258 | ||
267 | #if RADEON_FIFO_DEBUG | 259 | #if RADEON_FIFO_DEBUG |
268 | DRM_ERROR("failed!\n"); | 260 | DRM_ERROR("failed!\n"); |
@@ -443,14 +435,20 @@ static void radeon_do_cp_start(drm_radeon_private_t * dev_priv) | |||
443 | 435 | ||
444 | dev_priv->cp_running = 1; | 436 | dev_priv->cp_running = 1; |
445 | 437 | ||
446 | BEGIN_RING(6); | 438 | BEGIN_RING(8); |
447 | 439 | /* isync can only be written through cp on r5xx write it here */ | |
440 | OUT_RING(CP_PACKET0(RADEON_ISYNC_CNTL, 0)); | ||
441 | OUT_RING(RADEON_ISYNC_ANY2D_IDLE3D | | ||
442 | RADEON_ISYNC_ANY3D_IDLE2D | | ||
443 | RADEON_ISYNC_WAIT_IDLEGUI | | ||
444 | RADEON_ISYNC_CPSCRATCH_IDLEGUI); | ||
448 | RADEON_PURGE_CACHE(); | 445 | RADEON_PURGE_CACHE(); |
449 | RADEON_PURGE_ZCACHE(); | 446 | RADEON_PURGE_ZCACHE(); |
450 | RADEON_WAIT_UNTIL_IDLE(); | 447 | RADEON_WAIT_UNTIL_IDLE(); |
451 | |||
452 | ADVANCE_RING(); | 448 | ADVANCE_RING(); |
453 | COMMIT_RING(); | 449 | COMMIT_RING(); |
450 | |||
451 | dev_priv->track_flush |= RADEON_FLUSH_EMITED | RADEON_PURGE_EMITED; | ||
454 | } | 452 | } |
455 | 453 | ||
456 | /* Reset the Command Processor. This will not flush any pending | 454 | /* Reset the Command Processor. This will not flush any pending |