aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/radeon/ni.c
diff options
context:
space:
mode:
authorAlex Deucher <alexander.deucher@amd.com>2013-01-24 11:37:19 -0500
committerAlex Deucher <alexander.deucher@amd.com>2013-01-31 16:24:57 -0500
commit123bc1832c33218dfa677a88c2c54bc1a48a9e72 (patch)
tree5ad2423f6e4752d7db0120b8ecb4af6a83a00df2 /drivers/gpu/drm/radeon/ni.c
parentf770d78ac159a96071e3c4e4ab97c262e79506d3 (diff)
drm/radeon: use the reset mask to determine if rings are hung
fetch the reset mask and check if the relevant ring flags are set to determine whether the ring is hung or not. Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu/drm/radeon/ni.c')
-rw-r--r--drivers/gpu/drm/radeon/ni.c36
1 files changed, 31 insertions, 5 deletions
diff --git a/drivers/gpu/drm/radeon/ni.c b/drivers/gpu/drm/radeon/ni.c
index 4784c4e5056f..b6e80550ed90 100644
--- a/drivers/gpu/drm/radeon/ni.c
+++ b/drivers/gpu/drm/radeon/ni.c
@@ -1534,23 +1534,49 @@ int cayman_asic_reset(struct radeon_device *rdev)
1534} 1534}
1535 1535
1536/** 1536/**
1537 * cayman_gfx_is_lockup - Check if the GFX engine is locked up
1538 *
1539 * @rdev: radeon_device pointer
1540 * @ring: radeon_ring structure holding ring information
1541 *
1542 * Check if the GFX engine is locked up.
1543 * Returns true if the engine appears to be locked up, false if not.
1544 */
1545bool cayman_gfx_is_lockup(struct radeon_device *rdev, struct radeon_ring *ring)
1546{
1547 u32 reset_mask = cayman_gpu_check_soft_reset(rdev);
1548
1549 if (!(reset_mask & (RADEON_RESET_GFX |
1550 RADEON_RESET_COMPUTE |
1551 RADEON_RESET_CP))) {
1552 radeon_ring_lockup_update(ring);
1553 return false;
1554 }
1555 /* force CP activities */
1556 radeon_ring_force_activity(rdev, ring);
1557 return radeon_ring_test_lockup(rdev, ring);
1558}
1559
1560/**
1537 * cayman_dma_is_lockup - Check if the DMA engine is locked up 1561 * cayman_dma_is_lockup - Check if the DMA engine is locked up
1538 * 1562 *
1539 * @rdev: radeon_device pointer 1563 * @rdev: radeon_device pointer
1540 * @ring: radeon_ring structure holding ring information 1564 * @ring: radeon_ring structure holding ring information
1541 * 1565 *
1542 * Check if the async DMA engine is locked up (cayman-SI). 1566 * Check if the async DMA engine is locked up.
1543 * Returns true if the engine appears to be locked up, false if not. 1567 * Returns true if the engine appears to be locked up, false if not.
1544 */ 1568 */
1545bool cayman_dma_is_lockup(struct radeon_device *rdev, struct radeon_ring *ring) 1569bool cayman_dma_is_lockup(struct radeon_device *rdev, struct radeon_ring *ring)
1546{ 1570{
1547 u32 dma_status_reg; 1571 u32 reset_mask = cayman_gpu_check_soft_reset(rdev);
1572 u32 mask;
1548 1573
1549 if (ring->idx == R600_RING_TYPE_DMA_INDEX) 1574 if (ring->idx == R600_RING_TYPE_DMA_INDEX)
1550 dma_status_reg = RREG32(DMA_STATUS_REG + DMA0_REGISTER_OFFSET); 1575 mask = RADEON_RESET_DMA;
1551 else 1576 else
1552 dma_status_reg = RREG32(DMA_STATUS_REG + DMA1_REGISTER_OFFSET); 1577 mask = RADEON_RESET_DMA1;
1553 if (dma_status_reg & DMA_IDLE) { 1578
1579 if (!(reset_mask & mask)) {
1554 radeon_ring_lockup_update(ring); 1580 radeon_ring_lockup_update(ring);
1555 return false; 1581 return false;
1556 } 1582 }