aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/radeon/radeon_ring.c
diff options
context:
space:
mode:
authorChristian König <deathsimple@vodafone.de>2012-02-23 09:18:45 -0500
committerDave Airlie <airlied@redhat.com>2012-02-29 05:11:54 -0500
commit293f9fd53aa1529500ba16d89850100a058b11c1 (patch)
treec3dd3d5091a54d70aa2418f77b47b260440b95c4 /drivers/gpu/drm/radeon/radeon_ring.c
parenteb0c19c539f72d94c33cfd0860f4f8c899c64f4d (diff)
drm/radeon: fix IB debugfs files for multiple cards
Storing pointers to the IBs in a static var just leads to giving the same content back for all cards in the system. Signed-off-by: Christian König <deathsimple@vodafone.de> Reviewed-by: Jerome Glisse <jglisse@redhat.com> Reviewed-by: Alex Deucher <alexander.deucher@amd.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
Diffstat (limited to 'drivers/gpu/drm/radeon/radeon_ring.c')
-rw-r--r--drivers/gpu/drm/radeon/radeon_ring.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/drivers/gpu/drm/radeon/radeon_ring.c b/drivers/gpu/drm/radeon/radeon_ring.c
index 30a4c5014c8b..32c83d8bad34 100644
--- a/drivers/gpu/drm/radeon/radeon_ring.c
+++ b/drivers/gpu/drm/radeon/radeon_ring.c
@@ -478,7 +478,9 @@ static struct drm_info_list radeon_debugfs_ring_info_list[] = {
478static int radeon_debugfs_ib_info(struct seq_file *m, void *data) 478static int radeon_debugfs_ib_info(struct seq_file *m, void *data)
479{ 479{
480 struct drm_info_node *node = (struct drm_info_node *) m->private; 480 struct drm_info_node *node = (struct drm_info_node *) m->private;
481 struct radeon_ib *ib = node->info_ent->data; 481 struct drm_device *dev = node->minor->dev;
482 struct radeon_device *rdev = dev->dev_private;
483 struct radeon_ib *ib = &rdev->ib_pool.ibs[*((unsigned*)node->info_ent->data)];
482 unsigned i; 484 unsigned i;
483 485
484 if (ib == NULL) { 486 if (ib == NULL) {
@@ -495,6 +497,7 @@ static int radeon_debugfs_ib_info(struct seq_file *m, void *data)
495 497
496static struct drm_info_list radeon_debugfs_ib_list[RADEON_IB_POOL_SIZE]; 498static struct drm_info_list radeon_debugfs_ib_list[RADEON_IB_POOL_SIZE];
497static char radeon_debugfs_ib_names[RADEON_IB_POOL_SIZE][32]; 499static char radeon_debugfs_ib_names[RADEON_IB_POOL_SIZE][32];
500static unsigned radeon_debugfs_ib_idx[RADEON_IB_POOL_SIZE];
498#endif 501#endif
499 502
500int radeon_debugfs_ring_init(struct radeon_device *rdev) 503int radeon_debugfs_ring_init(struct radeon_device *rdev)
@@ -514,10 +517,11 @@ int radeon_debugfs_ib_init(struct radeon_device *rdev)
514 517
515 for (i = 0; i < RADEON_IB_POOL_SIZE; i++) { 518 for (i = 0; i < RADEON_IB_POOL_SIZE; i++) {
516 sprintf(radeon_debugfs_ib_names[i], "radeon_ib_%04u", i); 519 sprintf(radeon_debugfs_ib_names[i], "radeon_ib_%04u", i);
520 radeon_debugfs_ib_idx[i] = i;
517 radeon_debugfs_ib_list[i].name = radeon_debugfs_ib_names[i]; 521 radeon_debugfs_ib_list[i].name = radeon_debugfs_ib_names[i];
518 radeon_debugfs_ib_list[i].show = &radeon_debugfs_ib_info; 522 radeon_debugfs_ib_list[i].show = &radeon_debugfs_ib_info;
519 radeon_debugfs_ib_list[i].driver_features = 0; 523 radeon_debugfs_ib_list[i].driver_features = 0;
520 radeon_debugfs_ib_list[i].data = &rdev->ib_pool.ibs[i]; 524 radeon_debugfs_ib_list[i].data = &radeon_debugfs_ib_idx[i];
521 } 525 }
522 return radeon_debugfs_add_files(rdev, radeon_debugfs_ib_list, 526 return radeon_debugfs_add_files(rdev, radeon_debugfs_ib_list,
523 RADEON_IB_POOL_SIZE); 527 RADEON_IB_POOL_SIZE);