diff options
author | Rafał Miłecki <zajec5@gmail.com> | 2009-11-10 16:26:21 -0500 |
---|---|---|
committer | Dave Airlie <airlied@redhat.com> | 2009-12-03 19:21:22 -0500 |
commit | d684076627a4561ea698bf7652a1a1baabdcdbdc (patch) | |
tree | 292441425fdee338979b940cf55018dfa0698bef /drivers/gpu/drm/radeon/r600.c | |
parent | 93e7de7b37cb6c75032007e5b84e1305f1705485 (diff) |
drm/radeon/kms: fix ring info in debugfs on r600+
Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
Acked-by: Jerome Glisse <jglisse@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Diffstat (limited to 'drivers/gpu/drm/radeon/r600.c')
-rw-r--r-- | drivers/gpu/drm/radeon/r600.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/drivers/gpu/drm/radeon/r600.c b/drivers/gpu/drm/radeon/r600.c index 26947e8dadcb..94e7fd2f59e9 100644 --- a/drivers/gpu/drm/radeon/r600.c +++ b/drivers/gpu/drm/radeon/r600.c | |||
@@ -2361,21 +2361,21 @@ static int r600_debugfs_cp_ring_info(struct seq_file *m, void *data) | |||
2361 | struct drm_info_node *node = (struct drm_info_node *) m->private; | 2361 | struct drm_info_node *node = (struct drm_info_node *) m->private; |
2362 | struct drm_device *dev = node->minor->dev; | 2362 | struct drm_device *dev = node->minor->dev; |
2363 | struct radeon_device *rdev = dev->dev_private; | 2363 | struct radeon_device *rdev = dev->dev_private; |
2364 | uint32_t rdp, wdp; | ||
2365 | unsigned count, i, j; | 2364 | unsigned count, i, j; |
2366 | 2365 | ||
2367 | radeon_ring_free_size(rdev); | 2366 | radeon_ring_free_size(rdev); |
2368 | rdp = RREG32(CP_RB_RPTR); | 2367 | count = (rdev->cp.ring_size / 4) - rdev->cp.ring_free_dw; |
2369 | wdp = RREG32(CP_RB_WPTR); | ||
2370 | count = (rdp + rdev->cp.ring_size - wdp) & rdev->cp.ptr_mask; | ||
2371 | seq_printf(m, "CP_STAT 0x%08x\n", RREG32(CP_STAT)); | 2368 | seq_printf(m, "CP_STAT 0x%08x\n", RREG32(CP_STAT)); |
2372 | seq_printf(m, "CP_RB_WPTR 0x%08x\n", wdp); | 2369 | seq_printf(m, "CP_RB_WPTR 0x%08x\n", RREG32(CP_RB_WPTR)); |
2373 | seq_printf(m, "CP_RB_RPTR 0x%08x\n", rdp); | 2370 | seq_printf(m, "CP_RB_RPTR 0x%08x\n", RREG32(CP_RB_RPTR)); |
2371 | seq_printf(m, "driver's copy of the CP_RB_WPTR 0x%08x\n", rdev->cp.wptr); | ||
2372 | seq_printf(m, "driver's copy of the CP_RB_RPTR 0x%08x\n", rdev->cp.rptr); | ||
2374 | seq_printf(m, "%u free dwords in ring\n", rdev->cp.ring_free_dw); | 2373 | seq_printf(m, "%u free dwords in ring\n", rdev->cp.ring_free_dw); |
2375 | seq_printf(m, "%u dwords in ring\n", count); | 2374 | seq_printf(m, "%u dwords in ring\n", count); |
2375 | i = rdev->cp.rptr; | ||
2376 | for (j = 0; j <= count; j++) { | 2376 | for (j = 0; j <= count; j++) { |
2377 | i = (rdp + j) & rdev->cp.ptr_mask; | ||
2378 | seq_printf(m, "r[%04d]=0x%08x\n", i, rdev->cp.ring[i]); | 2377 | seq_printf(m, "r[%04d]=0x%08x\n", i, rdev->cp.ring[i]); |
2378 | i = (i + 1) & rdev->cp.ptr_mask; | ||
2379 | } | 2379 | } |
2380 | return 0; | 2380 | return 0; |
2381 | } | 2381 | } |