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 49838df..252edba 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 0d44e6a..5889c89 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 be56595..6bd961f 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 31b38bd..ea407db 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 68e5698..07bc795 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 7e750a4..845c21b 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 8d69c65..df824f8 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 bf1847b..fa4449e 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 874b928..863cb16 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 5783288..be1cf38 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 60bfeb1..b722aa0 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 c739934..c087f93 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 6d13345..245cabf 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 0014a9c..92d8061 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 7525f99..7886228 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 48e4800..1feb643 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 53c3339..9945d5b 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 57a9613..460bc8a 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 5c4001e..39bfc52 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 bc7997b..b45f547 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 27ca46d..6be2c0f 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 278b1fe..b3dab09 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 552f0f4..b7615ce 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 55cdab8..f036af9 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 abd37a7..46a3976 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 1c1a0e2..b96486c 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 d015cb0..892bdac 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 95f6e57..45d92ac 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 55b35da..30e8099 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 b7da094..2c88d0b 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 ea9ee46..6080951 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 aba587c..9f2d406 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,