Commit 711a9729 authored by Christian König's avatar Christian König Committed by Dave Airlie

drm/radeon: add sub allocator debugfs file

Dumping the current allocations.
Signed-off-by: default avatarChristian König <deathsimple@vodafone.de>
Signed-off-by: default avatarDave Airlie <airlied@redhat.com>
parent a651c55a
...@@ -172,5 +172,10 @@ extern int radeon_sa_bo_new(struct radeon_device *rdev, ...@@ -172,5 +172,10 @@ extern int radeon_sa_bo_new(struct radeon_device *rdev,
unsigned size, unsigned align); unsigned size, unsigned align);
extern void radeon_sa_bo_free(struct radeon_device *rdev, extern void radeon_sa_bo_free(struct radeon_device *rdev,
struct radeon_sa_bo *sa_bo); struct radeon_sa_bo *sa_bo);
#if defined(CONFIG_DEBUG_FS)
extern void radeon_sa_bo_dump_debug_info(struct radeon_sa_manager *sa_manager,
struct seq_file *m);
#endif
#endif #endif
...@@ -601,6 +601,23 @@ static int radeon_debugfs_ib_info(struct seq_file *m, void *data) ...@@ -601,6 +601,23 @@ static int radeon_debugfs_ib_info(struct seq_file *m, void *data)
static struct drm_info_list radeon_debugfs_ib_list[RADEON_IB_POOL_SIZE]; static struct drm_info_list radeon_debugfs_ib_list[RADEON_IB_POOL_SIZE];
static char radeon_debugfs_ib_names[RADEON_IB_POOL_SIZE][32]; static char radeon_debugfs_ib_names[RADEON_IB_POOL_SIZE][32];
static unsigned radeon_debugfs_ib_idx[RADEON_IB_POOL_SIZE]; static unsigned radeon_debugfs_ib_idx[RADEON_IB_POOL_SIZE];
static int radeon_debugfs_sa_info(struct seq_file *m, void *data)
{
struct drm_info_node *node = (struct drm_info_node *) m->private;
struct drm_device *dev = node->minor->dev;
struct radeon_device *rdev = dev->dev_private;
radeon_sa_bo_dump_debug_info(&rdev->ib_pool.sa_manager, m);
return 0;
}
static struct drm_info_list radeon_debugfs_sa_list[] = {
{"radeon_sa_info", &radeon_debugfs_sa_info, 0, NULL},
};
#endif #endif
int radeon_debugfs_ring_init(struct radeon_device *rdev, struct radeon_ring *ring) int radeon_debugfs_ring_init(struct radeon_device *rdev, struct radeon_ring *ring)
...@@ -627,6 +644,11 @@ int radeon_debugfs_ib_init(struct radeon_device *rdev) ...@@ -627,6 +644,11 @@ int radeon_debugfs_ib_init(struct radeon_device *rdev)
{ {
#if defined(CONFIG_DEBUG_FS) #if defined(CONFIG_DEBUG_FS)
unsigned i; unsigned i;
int r;
r = radeon_debugfs_add_files(rdev, radeon_debugfs_sa_list, 1);
if (r)
return r;
for (i = 0; i < RADEON_IB_POOL_SIZE; i++) { for (i = 0; i < RADEON_IB_POOL_SIZE; i++) {
sprintf(radeon_debugfs_ib_names[i], "radeon_ib_%04u", i); sprintf(radeon_debugfs_ib_names[i], "radeon_ib_%04u", i);
......
...@@ -193,3 +193,17 @@ void radeon_sa_bo_free(struct radeon_device *rdev, struct radeon_sa_bo *sa_bo) ...@@ -193,3 +193,17 @@ void radeon_sa_bo_free(struct radeon_device *rdev, struct radeon_sa_bo *sa_bo)
list_del_init(&sa_bo->list); list_del_init(&sa_bo->list);
spin_unlock(&sa_bo->manager->lock); spin_unlock(&sa_bo->manager->lock);
} }
#if defined(CONFIG_DEBUG_FS)
void radeon_sa_bo_dump_debug_info(struct radeon_sa_manager *sa_manager,
struct seq_file *m)
{
struct radeon_sa_bo *i;
spin_lock(&sa_manager->lock);
list_for_each_entry(i, &sa_manager->sa_bo, list) {
seq_printf(m, "offset %08d: size %4d\n", i->offset, i->size);
}
spin_unlock(&sa_manager->lock);
}
#endif
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment