Commit a4c5b1bb authored by Alex Deucher's avatar Alex Deucher

drm/amdgpu/pm: move debugfs init into core amdgpu debugfs

In order to remove the load and unload drm callbacks,
we need to reorder the init sequence to move all the drm
debugfs file handling.  Do this for pm.
Tested-by: default avatarThomas Zimmermann <tzimmermann@suse.de>
Acked-by: default avatarChristian König <christian.koenig@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent c5820361
...@@ -31,6 +31,7 @@ ...@@ -31,6 +31,7 @@
#include <drm/drm_debugfs.h> #include <drm/drm_debugfs.h>
#include "amdgpu.h" #include "amdgpu.h"
#include "amdgpu_pm.h"
/** /**
* amdgpu_debugfs_add_files - Add simple debugfs entries * amdgpu_debugfs_add_files - Add simple debugfs entries
...@@ -1290,6 +1291,12 @@ int amdgpu_debugfs_init(struct amdgpu_device *adev) ...@@ -1290,6 +1291,12 @@ int amdgpu_debugfs_init(struct amdgpu_device *adev)
return r; return r;
} }
r = amdgpu_debugfs_pm_init(adev);
if (r) {
DRM_ERROR("Failed to register debugfs file for dpm!\n");
return r;
}
return amdgpu_debugfs_add_files(adev, amdgpu_debugfs_list, return amdgpu_debugfs_add_files(adev, amdgpu_debugfs_list,
ARRAY_SIZE(amdgpu_debugfs_list)); ARRAY_SIZE(amdgpu_debugfs_list));
} }
......
...@@ -41,8 +41,6 @@ ...@@ -41,8 +41,6 @@
#include "hwmgr.h" #include "hwmgr.h"
#define WIDTH_4K 3840 #define WIDTH_4K 3840
static int amdgpu_debugfs_pm_init(struct amdgpu_device *adev);
static const struct cg_flag_name clocks[] = { static const struct cg_flag_name clocks[] = {
{AMD_CG_SUPPORT_GFX_MGCG, "Graphics Medium Grain Clock Gating"}, {AMD_CG_SUPPORT_GFX_MGCG, "Graphics Medium Grain Clock Gating"},
{AMD_CG_SUPPORT_GFX_MGLS, "Graphics Medium Grain memory Light Sleep"}, {AMD_CG_SUPPORT_GFX_MGLS, "Graphics Medium Grain memory Light Sleep"},
...@@ -3398,11 +3396,6 @@ int amdgpu_pm_sysfs_init(struct amdgpu_device *adev) ...@@ -3398,11 +3396,6 @@ int amdgpu_pm_sysfs_init(struct amdgpu_device *adev)
DRM_ERROR("failed to create device file unique_id\n"); DRM_ERROR("failed to create device file unique_id\n");
return ret; return ret;
} }
ret = amdgpu_debugfs_pm_init(adev);
if (ret) {
DRM_ERROR("Failed to register debugfs file for dpm!\n");
return ret;
}
if ((adev->asic_type >= CHIP_VEGA10) && if ((adev->asic_type >= CHIP_VEGA10) &&
!(adev->flags & AMD_IS_APU)) { !(adev->flags & AMD_IS_APU)) {
...@@ -3669,7 +3662,7 @@ static const struct drm_info_list amdgpu_pm_info_list[] = { ...@@ -3669,7 +3662,7 @@ static const struct drm_info_list amdgpu_pm_info_list[] = {
}; };
#endif #endif
static int amdgpu_debugfs_pm_init(struct amdgpu_device *adev) int amdgpu_debugfs_pm_init(struct amdgpu_device *adev)
{ {
#if defined(CONFIG_DEBUG_FS) #if defined(CONFIG_DEBUG_FS)
return amdgpu_debugfs_add_files(adev, amdgpu_pm_info_list, ARRAY_SIZE(amdgpu_pm_info_list)); return amdgpu_debugfs_add_files(adev, amdgpu_pm_info_list, ARRAY_SIZE(amdgpu_pm_info_list));
......
...@@ -43,4 +43,6 @@ void amdgpu_dpm_enable_uvd(struct amdgpu_device *adev, bool enable); ...@@ -43,4 +43,6 @@ void amdgpu_dpm_enable_uvd(struct amdgpu_device *adev, bool enable);
void amdgpu_dpm_enable_vce(struct amdgpu_device *adev, bool enable); void amdgpu_dpm_enable_vce(struct amdgpu_device *adev, bool enable);
void amdgpu_dpm_enable_jpeg(struct amdgpu_device *adev, bool enable); void amdgpu_dpm_enable_jpeg(struct amdgpu_device *adev, bool enable);
int amdgpu_debugfs_pm_init(struct amdgpu_device *adev);
#endif #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