drm/radeon: do not use drm middle layer for debugfs (v2)

Use debugfs API directly instead of drm middle layer.

v2: squash in build fix (Alex)

Signed-off-by: Nirmoy Das <nirmoy.das@amd.com>
Acked-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
This commit is contained in:
Nirmoy Das
2021-02-17 18:34:30 -05:00
committed by Alex Deucher
parent e7fa81bbc3
commit 5b54d67979
18 changed files with 224 additions and 393 deletions

View File

@@ -27,7 +27,6 @@
* Christian König
*/
#include <drm/drm_debugfs.h>
#include <drm/drm_file.h>
#include "radeon.h"
@@ -41,7 +40,7 @@
* produce command buffers which are send to the kernel and
* put in IBs for execution by the requested ring.
*/
static int radeon_debugfs_sa_init(struct radeon_device *rdev);
static void radeon_debugfs_sa_init(struct radeon_device *rdev);
/**
* radeon_ib_get - request an IB (Indirect Buffer)
@@ -225,9 +224,7 @@ int radeon_ib_pool_init(struct radeon_device *rdev)
}
rdev->ib_pool_ready = true;
if (radeon_debugfs_sa_init(rdev)) {
dev_err(rdev->dev, "failed to register debugfs file for SA\n");
}
radeon_debugfs_sa_init(rdev);
return 0;
}
@@ -295,11 +292,9 @@ int radeon_ib_ring_tests(struct radeon_device *rdev)
*/
#if defined(CONFIG_DEBUG_FS)
static int radeon_debugfs_sa_info(struct seq_file *m, void *data)
static int radeon_debugfs_sa_info_show(struct seq_file *m, void *unused)
{
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;
struct radeon_device *rdev = (struct radeon_device *)m->private;
radeon_sa_bo_dump_debug_info(&rdev->ring_tmp_bo, m);
@@ -307,17 +302,16 @@ static int radeon_debugfs_sa_info(struct seq_file *m, void *data)
}
static struct drm_info_list radeon_debugfs_sa_list[] = {
{"radeon_sa_info", &radeon_debugfs_sa_info, 0, NULL},
};
DEFINE_SHOW_ATTRIBUTE(radeon_debugfs_sa_info);
#endif
static int radeon_debugfs_sa_init(struct radeon_device *rdev)
static void radeon_debugfs_sa_init(struct radeon_device *rdev)
{
#if defined(CONFIG_DEBUG_FS)
return radeon_debugfs_add_files(rdev, radeon_debugfs_sa_list, 1);
#else
return 0;
struct dentry *root = rdev->ddev->primary->debugfs_root;
debugfs_create_file("radeon_sa_info", 0444, root, rdev,
&radeon_debugfs_sa_info_fops);
#endif
}