diff options
author | Huang Rui <ray.huang@amd.com> | 2017-01-05 06:17:13 -0500 |
---|---|---|
committer | Alex Deucher <alexander.deucher@amd.com> | 2017-01-27 11:13:07 -0500 |
commit | a8503b15ab770967c13bc61ae8a2216165c9760a (patch) | |
tree | 4a23665a714a7ae5c090570155043be41ff0bf68 /drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c | |
parent | 6cb2d4e4f3b1f0857c720ab8c41a764f18995377 (diff) |
drm/amdgpu: add parse clock gating state
Suggested-by: Felix Kuehling <Felix.Kuehling@amd.com>
Signed-off-by: Huang Rui <ray.huang@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Cc: William Lewis <minutemaidpark@hotmail.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c')
-rw-r--r-- | drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c index c63e5d3a902c..f251d0f4ea6a 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c | |||
@@ -34,6 +34,28 @@ | |||
34 | 34 | ||
35 | static int amdgpu_debugfs_pm_init(struct amdgpu_device *adev); | 35 | static int amdgpu_debugfs_pm_init(struct amdgpu_device *adev); |
36 | 36 | ||
37 | static const struct cg_flag_name clocks[] = { | ||
38 | {AMD_CG_SUPPORT_GFX_MGCG, "Graphics Medium Grain Clock Gating"}, | ||
39 | {AMD_CG_SUPPORT_GFX_MGLS, "Graphics Medium Grain memory Light Sleep"}, | ||
40 | {AMD_CG_SUPPORT_GFX_CGCG, "Graphics Coarse Grain Clock Gating"}, | ||
41 | {AMD_CG_SUPPORT_GFX_CGLS, "Graphics Coarse Grain memory Light Sleep"}, | ||
42 | {AMD_CG_SUPPORT_GFX_CGTS, "Graphics Coarse Grain Tree Shader Light Sleep"}, | ||
43 | {AMD_CG_SUPPORT_GFX_CGTS_LS, "Graphics Coarse Grain Tree Shader Light Sleep"}, | ||
44 | {AMD_CG_SUPPORT_GFX_CP_LS, "Graphics Command Processor Light Sleep"}, | ||
45 | {AMD_CG_SUPPORT_GFX_RLC_LS, "Graphics Run List Controller Light Sleep"}, | ||
46 | {AMD_CG_SUPPORT_MC_LS, "Memory Controller Light Sleep"}, | ||
47 | {AMD_CG_SUPPORT_MC_MGCG, "Memory Controller Medium Grain Clock Gating"}, | ||
48 | {AMD_CG_SUPPORT_SDMA_LS, "System Direct Memory Access Light Sleep"}, | ||
49 | {AMD_CG_SUPPORT_SDMA_MGCG, "System Direct Memory Access Medium Grain Clock Gating"}, | ||
50 | {AMD_CG_SUPPORT_BIF_LS, "Bus Interface Light Sleep"}, | ||
51 | {AMD_CG_SUPPORT_UVD_MGCG, "Unified Video Decoder Medium Grain Clock Gating"}, | ||
52 | {AMD_CG_SUPPORT_VCE_MGCG, "Video Compression Engine Medium Grain Clock Gating"}, | ||
53 | {AMD_CG_SUPPORT_HDP_LS, "Host Data Path Light Sleep"}, | ||
54 | {AMD_CG_SUPPORT_HDP_MGCG, "Host Data Path Medium Grain Clock Gating"}, | ||
55 | {AMD_CG_SUPPORT_ROM_MGCG, "Rom Medium Grain Clock Gating"}, | ||
56 | {0, NULL}, | ||
57 | }; | ||
58 | |||
37 | void amdgpu_pm_acpi_event_handler(struct amdgpu_device *adev) | 59 | void amdgpu_pm_acpi_event_handler(struct amdgpu_device *adev) |
38 | { | 60 | { |
39 | if (adev->pp_enabled) | 61 | if (adev->pp_enabled) |
@@ -1359,6 +1381,15 @@ static int amdgpu_debugfs_pm_info_pp(struct seq_file *m, struct amdgpu_device *a | |||
1359 | return 0; | 1381 | return 0; |
1360 | } | 1382 | } |
1361 | 1383 | ||
1384 | static void amdgpu_parse_cg_state(struct seq_file *m, u32 flags) | ||
1385 | { | ||
1386 | int i; | ||
1387 | |||
1388 | for (i = 0; clocks[i].flag; i++) | ||
1389 | seq_printf(m, "\t%s: %s\n", clocks[i].name, | ||
1390 | (flags & clocks[i].flag) ? "On" : "Off"); | ||
1391 | } | ||
1392 | |||
1362 | static int amdgpu_debugfs_pm_info(struct seq_file *m, void *data) | 1393 | static int amdgpu_debugfs_pm_info(struct seq_file *m, void *data) |
1363 | { | 1394 | { |
1364 | struct drm_info_node *node = (struct drm_info_node *) m->private; | 1395 | struct drm_info_node *node = (struct drm_info_node *) m->private; |
@@ -1369,6 +1400,8 @@ static int amdgpu_debugfs_pm_info(struct seq_file *m, void *data) | |||
1369 | 1400 | ||
1370 | amdgpu_get_clockgating_state(adev, &flags); | 1401 | amdgpu_get_clockgating_state(adev, &flags); |
1371 | seq_printf(m, "Clock Gating Flags Mask: 0x%x\n", flags); | 1402 | seq_printf(m, "Clock Gating Flags Mask: 0x%x\n", flags); |
1403 | amdgpu_parse_cg_state(m, flags); | ||
1404 | seq_printf(m, "\n"); | ||
1372 | 1405 | ||
1373 | if (!adev->pm.dpm_enabled) { | 1406 | if (!adev->pm.dpm_enabled) { |
1374 | seq_printf(m, "dpm not enabled\n"); | 1407 | seq_printf(m, "dpm not enabled\n"); |