diff options
author | Nirmoy Das <nirmoy.das@amd.com> | 2021-02-18 00:34:30 +0100 |
---|---|---|
committer | Alex Deucher <alexander.deucher@amd.com> | 2021-02-18 22:43:10 +0100 |
commit | 5b54d6797994fe93432970145c93b9747a3c8d6c (patch) | |
tree | 95e7942a8069c62813f9c3d4d9cbdb8e022ec57e /drivers/gpu/drm/radeon/r300.c | |
parent | drm/radeon: add rdev in ring struct (diff) | |
download | linux-5b54d6797994fe93432970145c93b9747a3c8d6c.tar.xz linux-5b54d6797994fe93432970145c93b9747a3c8d6c.zip |
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>
Diffstat (limited to 'drivers/gpu/drm/radeon/r300.c')
-rw-r--r-- | drivers/gpu/drm/radeon/r300.c | 33 |
1 files changed, 12 insertions, 21 deletions
diff --git a/drivers/gpu/drm/radeon/r300.c b/drivers/gpu/drm/radeon/r300.c index 213dc49b6322..92643dfdd8a8 100644 --- a/drivers/gpu/drm/radeon/r300.c +++ b/drivers/gpu/drm/radeon/r300.c @@ -32,7 +32,6 @@ #include <drm/drm.h> #include <drm/drm_crtc_helper.h> -#include <drm/drm_debugfs.h> #include <drm/drm_device.h> #include <drm/drm_file.h> #include <drm/radeon_drm.h> @@ -83,7 +82,7 @@ void rv370_pcie_wreg(struct radeon_device *rdev, uint32_t reg, uint32_t v) /* * rv370,rv380 PCIE GART */ -static int rv370_debugfs_pcie_gart_info_init(struct radeon_device *rdev); +static void rv370_debugfs_pcie_gart_info_init(struct radeon_device *rdev); void rv370_pcie_gart_tlb_flush(struct radeon_device *rdev) { @@ -140,9 +139,8 @@ int rv370_pcie_gart_init(struct radeon_device *rdev) r = radeon_gart_init(rdev); if (r) return r; - r = rv370_debugfs_pcie_gart_info_init(rdev); - if (r) - DRM_ERROR("Failed to register debugfs file for PCIE gart !\n"); + rv370_debugfs_pcie_gart_info_init(rdev); + rdev->gart.table_size = rdev->gart.num_gpu_pages * 4; rdev->asic->gart.tlb_flush = &rv370_pcie_gart_tlb_flush; rdev->asic->gart.get_page_entry = &rv370_pcie_gart_get_page_entry; @@ -590,11 +588,9 @@ int rv370_get_pcie_lanes(struct radeon_device *rdev) } #if defined(CONFIG_DEBUG_FS) -static int rv370_debugfs_pcie_gart_info(struct seq_file *m, void *data) +static int rv370_debugfs_pcie_gart_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; uint32_t tmp; tmp = RREG32_PCIE(RADEON_PCIE_TX_GART_CNTL); @@ -614,17 +610,16 @@ static int rv370_debugfs_pcie_gart_info(struct seq_file *m, void *data) return 0; } -static struct drm_info_list rv370_pcie_gart_info_list[] = { - {"rv370_pcie_gart_info", rv370_debugfs_pcie_gart_info, 0, NULL}, -}; +DEFINE_SHOW_ATTRIBUTE(rv370_debugfs_pcie_gart_info); #endif -static int rv370_debugfs_pcie_gart_info_init(struct radeon_device *rdev) +static void rv370_debugfs_pcie_gart_info_init(struct radeon_device *rdev) { #if defined(CONFIG_DEBUG_FS) - return radeon_debugfs_add_files(rdev, rv370_pcie_gart_info_list, 1); -#else - return 0; + struct dentry *root = rdev->ddev->primary->debugfs_root; + + debugfs_create_file("rv370_pcie_gart_info", 0444, root, rdev, + &rv370_debugfs_pcie_gart_info_fops); #endif } @@ -1331,12 +1326,8 @@ void r300_set_reg_safe(struct radeon_device *rdev) void r300_mc_program(struct radeon_device *rdev) { struct r100_mc_save save; - int r; - r = r100_debugfs_mc_info_init(rdev); - if (r) { - dev_err(rdev->dev, "Failed to create r100_mc debugfs file.\n"); - } + r100_debugfs_mc_info_init(rdev); /* Stops all mc clients */ r100_mc_stop(rdev, &save); |