drm/amd/amdgpu: Add name field to amd_ip_funcs (v2)
authorTom St Denis <tom.stdenis@amd.com>
Wed, 4 May 2016 18:28:35 +0000 (14:28 -0400)
committerAlex Deucher <alexander.deucher@amd.com>
Wed, 11 May 2016 16:31:26 +0000 (12:31 -0400)
Add name that we can print out in kernel messages
to aid in debugging.

v2: drop DAL changes for upstream

Signed-off-by: Tom St Denis <tom.stdenis@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
32 files changed:
drivers/gpu/drm/amd/amdgpu/amdgpu_acp.c
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
drivers/gpu/drm/amd/amdgpu/amdgpu_powerplay.c
drivers/gpu/drm/amd/amdgpu/ci_dpm.c
drivers/gpu/drm/amd/amdgpu/cik.c
drivers/gpu/drm/amd/amdgpu/cik_ih.c
drivers/gpu/drm/amd/amdgpu/cik_sdma.c
drivers/gpu/drm/amd/amdgpu/cz_dpm.c
drivers/gpu/drm/amd/amdgpu/cz_ih.c
drivers/gpu/drm/amd/amdgpu/dce_v10_0.c
drivers/gpu/drm/amd/amdgpu/dce_v11_0.c
drivers/gpu/drm/amd/amdgpu/dce_v8_0.c
drivers/gpu/drm/amd/amdgpu/fiji_dpm.c
drivers/gpu/drm/amd/amdgpu/gfx_v7_0.c
drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c
drivers/gpu/drm/amd/amdgpu/gmc_v7_0.c
drivers/gpu/drm/amd/amdgpu/gmc_v8_0.c
drivers/gpu/drm/amd/amdgpu/iceland_dpm.c
drivers/gpu/drm/amd/amdgpu/iceland_ih.c
drivers/gpu/drm/amd/amdgpu/kv_dpm.c
drivers/gpu/drm/amd/amdgpu/sdma_v2_4.c
drivers/gpu/drm/amd/amdgpu/sdma_v3_0.c
drivers/gpu/drm/amd/amdgpu/tonga_dpm.c
drivers/gpu/drm/amd/amdgpu/tonga_ih.c
drivers/gpu/drm/amd/amdgpu/uvd_v4_2.c
drivers/gpu/drm/amd/amdgpu/uvd_v5_0.c
drivers/gpu/drm/amd/amdgpu/uvd_v6_0.c
drivers/gpu/drm/amd/amdgpu/vce_v2_0.c
drivers/gpu/drm/amd/amdgpu/vce_v3_0.c
drivers/gpu/drm/amd/amdgpu/vi.c
drivers/gpu/drm/amd/include/amd_shared.h
drivers/gpu/drm/amd/powerplay/amd_powerplay.c

index 49838dfe9bda99f51425a1863fcb12149bfb3dfc..252edba16e367d9e92212f8b0e3b60fedb8aa1a2 100644 (file)
@@ -480,6 +480,7 @@ static int acp_set_powergating_state(void *handle,
 }
 
 const struct amd_ip_funcs acp_ip_funcs = {
+       .name = "acp_ip",
        .early_init = acp_early_init,
        .late_init = NULL,
        .sw_init = acp_sw_init,
index 0d44e6a41edae2d8f3237909e20774ff21ab1a9c..5889c897b6ab24da522e4e3142ef45d0bfb3aa62 100644 (file)
@@ -1196,7 +1196,7 @@ static int amdgpu_early_init(struct amdgpu_device *adev)
                                if (r == -ENOENT) {
                                        adev->ip_block_status[i].valid = false;
                                } else if (r) {
-                                       DRM_ERROR("early_init %d failed %d\n", i, r);
+                                       DRM_ERROR("early_init of IP block <%s> failed %d\n", adev->ip_blocks[i].funcs->name, r);
                                        return r;
                                } else {
                                        adev->ip_block_status[i].valid = true;
index be565955bcc77a3381d4d949c6bab11620aaeab6..6bd961fb43dcc7c7e3562d994e5fc0e79515ed01 100644 (file)
@@ -304,6 +304,7 @@ static int amdgpu_pp_soft_reset(void *handle)
 }
 
 const struct amd_ip_funcs amdgpu_pp_ip_funcs = {
+       .name = "amdgpu_powerplay",
        .early_init = amdgpu_pp_early_init,
        .late_init = amdgpu_pp_late_init,
        .sw_init = amdgpu_pp_sw_init,
index 31b38bd6721502d4112166c5e939fc6a9a1013fd..ea407db1fbcfaaa54c844e7f41e06eb3a04bb1a2 100644 (file)
@@ -6402,6 +6402,7 @@ static int ci_dpm_set_powergating_state(void *handle,
 }
 
 const struct amd_ip_funcs ci_dpm_ip_funcs = {
+       .name = "ci_dpm",
        .early_init = ci_dpm_early_init,
        .late_init = ci_dpm_late_init,
        .sw_init = ci_dpm_sw_init,
index 68e569853c95a7cd6b4e34d241c4489b0660c4a8..07bc795a4ca9f87662bdaaa6ebd34f6846bb932b 100644 (file)
@@ -2232,6 +2232,7 @@ static int cik_common_set_powergating_state(void *handle,
 }
 
 const struct amd_ip_funcs cik_common_ip_funcs = {
+       .name = "cik_common",
        .early_init = cik_common_early_init,
        .late_init = NULL,
        .sw_init = cik_common_sw_init,
index 7e750a459499b66e80ab4b70d33851c567080ae1..845c21b1b2ee04587bd2ab57749f3f76045a38dd 100644 (file)
@@ -415,6 +415,7 @@ static int cik_ih_set_powergating_state(void *handle,
 }
 
 const struct amd_ip_funcs cik_ih_ip_funcs = {
+       .name = "cik_ih",
        .early_init = cik_ih_early_init,
        .late_init = NULL,
        .sw_init = cik_ih_sw_init,
index 8d69c6555e02ec846acff1e7a367b604b1e23a2e..df824f80ac07d795bc92087e6c407e81aaa47803 100644 (file)
@@ -1223,6 +1223,7 @@ static int cik_sdma_set_powergating_state(void *handle,
 }
 
 const struct amd_ip_funcs cik_sdma_ip_funcs = {
+       .name = "cik_sdma",
        .early_init = cik_sdma_early_init,
        .late_init = NULL,
        .sw_init = cik_sdma_sw_init,
index bf1847b28d9c2133678754e29fb935ade8e3ca9d..fa4449e126e6c811111026a13d0bac343931f7f5 100644 (file)
@@ -2230,6 +2230,7 @@ static void cz_dpm_powergate_vce(struct amdgpu_device *adev, bool gate)
 }
 
 const struct amd_ip_funcs cz_dpm_ip_funcs = {
+       .name = "cz_dpm",
        .early_init = cz_dpm_early_init,
        .late_init = cz_dpm_late_init,
        .sw_init = cz_dpm_sw_init,
index 874b928997975c344b18e6b2e9491a61e509ec46..863cb16f6126dccd54075144ab0ff0d80016498e 100644 (file)
@@ -396,6 +396,7 @@ static int cz_ih_set_powergating_state(void *handle,
 }
 
 const struct amd_ip_funcs cz_ih_ip_funcs = {
+       .name = "cz_ih",
        .early_init = cz_ih_early_init,
        .late_init = NULL,
        .sw_init = cz_ih_sw_init,
index 578328860396f65244c54e631af2a98541be909e..be1cf388c2ec9536ad084e0f2428396ec84e7363 100644 (file)
@@ -3499,6 +3499,7 @@ static int dce_v10_0_set_powergating_state(void *handle,
 }
 
 const struct amd_ip_funcs dce_v10_0_ip_funcs = {
+       .name = "dce_v10_0",
        .early_init = dce_v10_0_early_init,
        .late_init = NULL,
        .sw_init = dce_v10_0_sw_init,
index 60bfeb1b956e01f181a7f9129ecd3f4634a0a2b1..b722aa0554926a724fcc2cbf9ea9394ad6e7cea3 100644 (file)
@@ -3559,6 +3559,7 @@ static int dce_v11_0_set_powergating_state(void *handle,
 }
 
 const struct amd_ip_funcs dce_v11_0_ip_funcs = {
+       .name = "dce_v11_0",
        .early_init = dce_v11_0_early_init,
        .late_init = NULL,
        .sw_init = dce_v11_0_sw_init,
index c73993472059a6fc3280984426cebb18f6f304eb..c087f930d67e439c651625e121bb052d3308812e 100644 (file)
@@ -3424,6 +3424,7 @@ static int dce_v8_0_set_powergating_state(void *handle,
 }
 
 const struct amd_ip_funcs dce_v8_0_ip_funcs = {
+       .name = "dce_v8_0",
        .early_init = dce_v8_0_early_init,
        .late_init = NULL,
        .sw_init = dce_v8_0_sw_init,
index 6d133450d3cce9d61fcb4443df551885722655ba..245cabf06575c73e1e9427011d878237e2e96fdf 100644 (file)
@@ -143,6 +143,7 @@ static int fiji_dpm_set_powergating_state(void *handle,
 }
 
 const struct amd_ip_funcs fiji_dpm_ip_funcs = {
+       .name = "fiji_dpm",
        .early_init = fiji_dpm_early_init,
        .late_init = NULL,
        .sw_init = fiji_dpm_sw_init,
index 0014a9ceaf291868267b308d57fe647005f82a9c..92d8061efaf44534daacf28d450fdac69d686730 100644 (file)
@@ -4894,6 +4894,7 @@ static int gfx_v7_0_set_powergating_state(void *handle,
 }
 
 const struct amd_ip_funcs gfx_v7_0_ip_funcs = {
+       .name = "gfx_v7_0",
        .early_init = gfx_v7_0_early_init,
        .late_init = gfx_v7_0_late_init,
        .sw_init = gfx_v7_0_sw_init,
index 7525f99858f13f0e7ecb3e8a4e2ecc76fdaf81eb..7886228b8318f98b2cfebfe0c617c8625495fd89 100644 (file)
@@ -6066,6 +6066,7 @@ static int gfx_v8_0_priv_inst_irq(struct amdgpu_device *adev,
 }
 
 const struct amd_ip_funcs gfx_v8_0_ip_funcs = {
+       .name = "gfx_v8_0",
        .early_init = gfx_v8_0_early_init,
        .late_init = gfx_v8_0_late_init,
        .sw_init = gfx_v8_0_sw_init,
index 48e4800eafcc4cb133ec244dd49c7337d6d8ea5e..1feb6439cb0b7fd4768a232f5ad7520df0716c2a 100644 (file)
@@ -1261,6 +1261,7 @@ static int gmc_v7_0_set_powergating_state(void *handle,
 }
 
 const struct amd_ip_funcs gmc_v7_0_ip_funcs = {
+       .name = "gmc_v7_0",
        .early_init = gmc_v7_0_early_init,
        .late_init = gmc_v7_0_late_init,
        .sw_init = gmc_v7_0_sw_init,
index 53c3339e2cfdb438a06d148ce67f6fe4f395afde..9945d5bbf1fe06244bf950167f09589b266b2a23 100644 (file)
@@ -1423,6 +1423,7 @@ static int gmc_v8_0_set_powergating_state(void *handle,
 }
 
 const struct amd_ip_funcs gmc_v8_0_ip_funcs = {
+       .name = "gmc_v8_0",
        .early_init = gmc_v8_0_early_init,
        .late_init = gmc_v8_0_late_init,
        .sw_init = gmc_v8_0_sw_init,
index 57a96132a8a24399d2952699fff3fc72a0ef85e9..460bc8ad37e6252a910c068e5114bcc687350faf 100644 (file)
@@ -157,6 +157,7 @@ static int iceland_dpm_set_powergating_state(void *handle,
 }
 
 const struct amd_ip_funcs iceland_dpm_ip_funcs = {
+       .name = "iceland_dpm",
        .early_init = iceland_dpm_early_init,
        .late_init = NULL,
        .sw_init = iceland_dpm_sw_init,
index 5c4001e2538ec7f57426953277c16ca6f412e8e9..39bfc52d0b42150fa085b0073bf8e7088ef3d00d 100644 (file)
@@ -394,6 +394,7 @@ static int iceland_ih_set_powergating_state(void *handle,
 }
 
 const struct amd_ip_funcs iceland_ih_ip_funcs = {
+       .name = "iceland_ih",
        .early_init = iceland_ih_early_init,
        .late_init = NULL,
        .sw_init = iceland_ih_sw_init,
index bc7997b649c08defc3e77d27c5c6eb915cdb4b77..b45f54714574431f925712c73c11e4e40aa24004 100644 (file)
@@ -3238,6 +3238,7 @@ static int kv_dpm_set_powergating_state(void *handle,
 }
 
 const struct amd_ip_funcs kv_dpm_ip_funcs = {
+       .name = "kv_dpm",
        .early_init = kv_dpm_early_init,
        .late_init = kv_dpm_late_init,
        .sw_init = kv_dpm_sw_init,
index 27ca46d16bc4a92f23699d56137a2190fa0ecd4c..6be2c0faa1bcb6c71b0ea90406079415dd696535 100644 (file)
@@ -1230,6 +1230,7 @@ static int sdma_v2_4_set_powergating_state(void *handle,
 }
 
 const struct amd_ip_funcs sdma_v2_4_ip_funcs = {
+       .name = "sdma_v2_4",
        .early_init = sdma_v2_4_early_init,
        .late_init = NULL,
        .sw_init = sdma_v2_4_sw_init,
index 278b1fe353857ede5465e4272d3b09c32ae5d52b..b3dab09205af5df0ff8b2c6caded816e469a570f 100644 (file)
@@ -1542,6 +1542,7 @@ static int sdma_v3_0_set_powergating_state(void *handle,
 }
 
 const struct amd_ip_funcs sdma_v3_0_ip_funcs = {
+       .name = "sdma_v3_0",
        .early_init = sdma_v3_0_early_init,
        .late_init = NULL,
        .sw_init = sdma_v3_0_sw_init,
index 552f0f42a39f70ca93cf5bf72a4b488f9bc25b73..b7615cefcac40b5d2607a194b5184ed2fe3a9bcf 100644 (file)
@@ -143,6 +143,7 @@ static int tonga_dpm_set_powergating_state(void *handle,
 }
 
 const struct amd_ip_funcs tonga_dpm_ip_funcs = {
+       .name = "tonga_dpm",
        .early_init = tonga_dpm_early_init,
        .late_init = NULL,
        .sw_init = tonga_dpm_sw_init,
index 55cdab849089006576b8a1864aa6620a5ca0566b..f036af937fbc950216418e3e62d3ec9787bd70d3 100644 (file)
@@ -417,6 +417,7 @@ static int tonga_ih_set_powergating_state(void *handle,
 }
 
 const struct amd_ip_funcs tonga_ih_ip_funcs = {
+       .name = "tonga_ih",
        .early_init = tonga_ih_early_init,
        .late_init = NULL,
        .sw_init = tonga_ih_sw_init,
index abd37a7eb4c6e81d9632be1c18aac9acfb31b463..46a397654837c286cdad22afb95ea6aa361f7fee 100644 (file)
@@ -739,6 +739,7 @@ static int uvd_v4_2_set_powergating_state(void *handle,
 }
 
 const struct amd_ip_funcs uvd_v4_2_ip_funcs = {
+       .name = "uvd_v4_2",
        .early_init = uvd_v4_2_early_init,
        .late_init = NULL,
        .sw_init = uvd_v4_2_sw_init,
index 1c1a0e2c7e0f60cc9fd724b19df32409752e15d8..b96486c09250b244d8e049787e022b9536f628c8 100644 (file)
@@ -791,6 +791,7 @@ static int uvd_v5_0_set_powergating_state(void *handle,
 }
 
 const struct amd_ip_funcs uvd_v5_0_ip_funcs = {
+       .name = "uvd_v5_0",
        .early_init = uvd_v5_0_early_init,
        .late_init = NULL,
        .sw_init = uvd_v5_0_sw_init,
index d015cb0c9eb5082d31f388d912ec4771a0f2bf9b..892bdac4bb213a401e6240d6420b8b0c255fe127 100644 (file)
@@ -895,6 +895,7 @@ static int uvd_v6_0_set_powergating_state(void *handle,
 }
 
 const struct amd_ip_funcs uvd_v6_0_ip_funcs = {
+       .name = "uvd_v6_0",
        .early_init = uvd_v6_0_early_init,
        .late_init = NULL,
        .sw_init = uvd_v6_0_sw_init,
index 95f6e579427dbadf77d4cd00fbcb042cd09a8244..45d92aceb485f7477ec80c4d31aca52228c2c20a 100644 (file)
@@ -567,6 +567,7 @@ static int vce_v2_0_set_powergating_state(void *handle,
 }
 
 const struct amd_ip_funcs vce_v2_0_ip_funcs = {
+       .name = "vce_v2_0",
        .early_init = vce_v2_0_early_init,
        .late_init = NULL,
        .sw_init = vce_v2_0_sw_init,
index 55b35daa1ac9168313b57eea9b8886e548e9f7b6..30e8099e94c5629ca6d7703526b20bf0a715267c 100644 (file)
@@ -674,6 +674,7 @@ static int vce_v3_0_set_powergating_state(void *handle,
 }
 
 const struct amd_ip_funcs vce_v3_0_ip_funcs = {
+       .name = "vce_v3_0",
        .early_init = vce_v3_0_early_init,
        .late_init = NULL,
        .sw_init = vce_v3_0_sw_init,
index b7da094f8bf9421e6c8b6715b50aa35cebc4c020..2c88d0b66cf396b35016b169c04091feaa2cc6e5 100644 (file)
@@ -1408,6 +1408,7 @@ static int vi_common_set_powergating_state(void *handle,
 }
 
 const struct amd_ip_funcs vi_common_ip_funcs = {
+       .name = "vi_common",
        .early_init = vi_common_early_init,
        .late_init = NULL,
        .sw_init = vi_common_sw_init,
index ea9ee46441395c1e093b3d08281b70bea04081f2..6080951d539d0d3fd4c85390a0afa18ce2df8cd7 100644 (file)
@@ -143,6 +143,8 @@ enum amd_pm_state_type {
 };
 
 struct amd_ip_funcs {
+       /* Name of IP block */
+       char *name;
        /* sets up early driver state (pre sw_init), does not configure hw - Optional */
        int (*early_init)(void *handle);
        /* sets up late driver/hw state (post hw_init) - Optional */
index aba587cfce81c9755c8859c95d65f172e58ce22c..9f2d4069a5f33f2f333607fb8c0e89e265bac5a4 100644 (file)
@@ -340,6 +340,7 @@ static int pp_resume(void *handle)
 }
 
 const struct amd_ip_funcs pp_ip_funcs = {
+       .name = "powerplay",
        .early_init = pp_early_init,
        .late_init = NULL,
        .sw_init = pp_sw_init,