diff options
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); |