Commit 88a907d6 authored by Tom St Denis's avatar Tom St Denis Committed by Alex Deucher

drm/amd/amdgpu: Add name field to amd_ip_funcs (v2)

Add name that we can print out in kernel messages
to aid in debugging.

v2: drop DAL changes for upstream
Signed-off-by: default avatarTom St Denis <tom.stdenis@amd.com>
Reviewed-by: default avatarAlex Deucher <alexander.deucher@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent cb9e59d7
...@@ -480,6 +480,7 @@ static int acp_set_powergating_state(void *handle, ...@@ -480,6 +480,7 @@ static int acp_set_powergating_state(void *handle,
} }
const struct amd_ip_funcs acp_ip_funcs = { const struct amd_ip_funcs acp_ip_funcs = {
.name = "acp_ip",
.early_init = acp_early_init, .early_init = acp_early_init,
.late_init = NULL, .late_init = NULL,
.sw_init = acp_sw_init, .sw_init = acp_sw_init,
......
...@@ -1196,7 +1196,7 @@ static int amdgpu_early_init(struct amdgpu_device *adev) ...@@ -1196,7 +1196,7 @@ static int amdgpu_early_init(struct amdgpu_device *adev)
if (r == -ENOENT) { if (r == -ENOENT) {
adev->ip_block_status[i].valid = false; adev->ip_block_status[i].valid = false;
} else if (r) { } 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; return r;
} else { } else {
adev->ip_block_status[i].valid = true; adev->ip_block_status[i].valid = true;
......
...@@ -304,6 +304,7 @@ static int amdgpu_pp_soft_reset(void *handle) ...@@ -304,6 +304,7 @@ static int amdgpu_pp_soft_reset(void *handle)
} }
const struct amd_ip_funcs amdgpu_pp_ip_funcs = { const struct amd_ip_funcs amdgpu_pp_ip_funcs = {
.name = "amdgpu_powerplay",
.early_init = amdgpu_pp_early_init, .early_init = amdgpu_pp_early_init,
.late_init = amdgpu_pp_late_init, .late_init = amdgpu_pp_late_init,
.sw_init = amdgpu_pp_sw_init, .sw_init = amdgpu_pp_sw_init,
......
...@@ -6402,6 +6402,7 @@ static int ci_dpm_set_powergating_state(void *handle, ...@@ -6402,6 +6402,7 @@ static int ci_dpm_set_powergating_state(void *handle,
} }
const struct amd_ip_funcs ci_dpm_ip_funcs = { const struct amd_ip_funcs ci_dpm_ip_funcs = {
.name = "ci_dpm",
.early_init = ci_dpm_early_init, .early_init = ci_dpm_early_init,
.late_init = ci_dpm_late_init, .late_init = ci_dpm_late_init,
.sw_init = ci_dpm_sw_init, .sw_init = ci_dpm_sw_init,
......
...@@ -2232,6 +2232,7 @@ static int cik_common_set_powergating_state(void *handle, ...@@ -2232,6 +2232,7 @@ static int cik_common_set_powergating_state(void *handle,
} }
const struct amd_ip_funcs cik_common_ip_funcs = { const struct amd_ip_funcs cik_common_ip_funcs = {
.name = "cik_common",
.early_init = cik_common_early_init, .early_init = cik_common_early_init,
.late_init = NULL, .late_init = NULL,
.sw_init = cik_common_sw_init, .sw_init = cik_common_sw_init,
......
...@@ -415,6 +415,7 @@ static int cik_ih_set_powergating_state(void *handle, ...@@ -415,6 +415,7 @@ static int cik_ih_set_powergating_state(void *handle,
} }
const struct amd_ip_funcs cik_ih_ip_funcs = { const struct amd_ip_funcs cik_ih_ip_funcs = {
.name = "cik_ih",
.early_init = cik_ih_early_init, .early_init = cik_ih_early_init,
.late_init = NULL, .late_init = NULL,
.sw_init = cik_ih_sw_init, .sw_init = cik_ih_sw_init,
......
...@@ -1223,6 +1223,7 @@ static int cik_sdma_set_powergating_state(void *handle, ...@@ -1223,6 +1223,7 @@ static int cik_sdma_set_powergating_state(void *handle,
} }
const struct amd_ip_funcs cik_sdma_ip_funcs = { const struct amd_ip_funcs cik_sdma_ip_funcs = {
.name = "cik_sdma",
.early_init = cik_sdma_early_init, .early_init = cik_sdma_early_init,
.late_init = NULL, .late_init = NULL,
.sw_init = cik_sdma_sw_init, .sw_init = cik_sdma_sw_init,
......
...@@ -2230,6 +2230,7 @@ static void cz_dpm_powergate_vce(struct amdgpu_device *adev, bool gate) ...@@ -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 = { const struct amd_ip_funcs cz_dpm_ip_funcs = {
.name = "cz_dpm",
.early_init = cz_dpm_early_init, .early_init = cz_dpm_early_init,
.late_init = cz_dpm_late_init, .late_init = cz_dpm_late_init,
.sw_init = cz_dpm_sw_init, .sw_init = cz_dpm_sw_init,
......
...@@ -396,6 +396,7 @@ static int cz_ih_set_powergating_state(void *handle, ...@@ -396,6 +396,7 @@ static int cz_ih_set_powergating_state(void *handle,
} }
const struct amd_ip_funcs cz_ih_ip_funcs = { const struct amd_ip_funcs cz_ih_ip_funcs = {
.name = "cz_ih",
.early_init = cz_ih_early_init, .early_init = cz_ih_early_init,
.late_init = NULL, .late_init = NULL,
.sw_init = cz_ih_sw_init, .sw_init = cz_ih_sw_init,
......
...@@ -3499,6 +3499,7 @@ static int dce_v10_0_set_powergating_state(void *handle, ...@@ -3499,6 +3499,7 @@ static int dce_v10_0_set_powergating_state(void *handle,
} }
const struct amd_ip_funcs dce_v10_0_ip_funcs = { const struct amd_ip_funcs dce_v10_0_ip_funcs = {
.name = "dce_v10_0",
.early_init = dce_v10_0_early_init, .early_init = dce_v10_0_early_init,
.late_init = NULL, .late_init = NULL,
.sw_init = dce_v10_0_sw_init, .sw_init = dce_v10_0_sw_init,
......
...@@ -3559,6 +3559,7 @@ static int dce_v11_0_set_powergating_state(void *handle, ...@@ -3559,6 +3559,7 @@ static int dce_v11_0_set_powergating_state(void *handle,
} }
const struct amd_ip_funcs dce_v11_0_ip_funcs = { const struct amd_ip_funcs dce_v11_0_ip_funcs = {
.name = "dce_v11_0",
.early_init = dce_v11_0_early_init, .early_init = dce_v11_0_early_init,
.late_init = NULL, .late_init = NULL,
.sw_init = dce_v11_0_sw_init, .sw_init = dce_v11_0_sw_init,
......
...@@ -3424,6 +3424,7 @@ static int dce_v8_0_set_powergating_state(void *handle, ...@@ -3424,6 +3424,7 @@ static int dce_v8_0_set_powergating_state(void *handle,
} }
const struct amd_ip_funcs dce_v8_0_ip_funcs = { const struct amd_ip_funcs dce_v8_0_ip_funcs = {
.name = "dce_v8_0",
.early_init = dce_v8_0_early_init, .early_init = dce_v8_0_early_init,
.late_init = NULL, .late_init = NULL,
.sw_init = dce_v8_0_sw_init, .sw_init = dce_v8_0_sw_init,
......
...@@ -143,6 +143,7 @@ static int fiji_dpm_set_powergating_state(void *handle, ...@@ -143,6 +143,7 @@ static int fiji_dpm_set_powergating_state(void *handle,
} }
const struct amd_ip_funcs fiji_dpm_ip_funcs = { const struct amd_ip_funcs fiji_dpm_ip_funcs = {
.name = "fiji_dpm",
.early_init = fiji_dpm_early_init, .early_init = fiji_dpm_early_init,
.late_init = NULL, .late_init = NULL,
.sw_init = fiji_dpm_sw_init, .sw_init = fiji_dpm_sw_init,
......
...@@ -4894,6 +4894,7 @@ static int gfx_v7_0_set_powergating_state(void *handle, ...@@ -4894,6 +4894,7 @@ static int gfx_v7_0_set_powergating_state(void *handle,
} }
const struct amd_ip_funcs gfx_v7_0_ip_funcs = { const struct amd_ip_funcs gfx_v7_0_ip_funcs = {
.name = "gfx_v7_0",
.early_init = gfx_v7_0_early_init, .early_init = gfx_v7_0_early_init,
.late_init = gfx_v7_0_late_init, .late_init = gfx_v7_0_late_init,
.sw_init = gfx_v7_0_sw_init, .sw_init = gfx_v7_0_sw_init,
......
...@@ -6066,6 +6066,7 @@ static int gfx_v8_0_priv_inst_irq(struct amdgpu_device *adev, ...@@ -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 = { const struct amd_ip_funcs gfx_v8_0_ip_funcs = {
.name = "gfx_v8_0",
.early_init = gfx_v8_0_early_init, .early_init = gfx_v8_0_early_init,
.late_init = gfx_v8_0_late_init, .late_init = gfx_v8_0_late_init,
.sw_init = gfx_v8_0_sw_init, .sw_init = gfx_v8_0_sw_init,
......
...@@ -1261,6 +1261,7 @@ static int gmc_v7_0_set_powergating_state(void *handle, ...@@ -1261,6 +1261,7 @@ static int gmc_v7_0_set_powergating_state(void *handle,
} }
const struct amd_ip_funcs gmc_v7_0_ip_funcs = { const struct amd_ip_funcs gmc_v7_0_ip_funcs = {
.name = "gmc_v7_0",
.early_init = gmc_v7_0_early_init, .early_init = gmc_v7_0_early_init,
.late_init = gmc_v7_0_late_init, .late_init = gmc_v7_0_late_init,
.sw_init = gmc_v7_0_sw_init, .sw_init = gmc_v7_0_sw_init,
......
...@@ -1423,6 +1423,7 @@ static int gmc_v8_0_set_powergating_state(void *handle, ...@@ -1423,6 +1423,7 @@ static int gmc_v8_0_set_powergating_state(void *handle,
} }
const struct amd_ip_funcs gmc_v8_0_ip_funcs = { const struct amd_ip_funcs gmc_v8_0_ip_funcs = {
.name = "gmc_v8_0",
.early_init = gmc_v8_0_early_init, .early_init = gmc_v8_0_early_init,
.late_init = gmc_v8_0_late_init, .late_init = gmc_v8_0_late_init,
.sw_init = gmc_v8_0_sw_init, .sw_init = gmc_v8_0_sw_init,
......
...@@ -157,6 +157,7 @@ static int iceland_dpm_set_powergating_state(void *handle, ...@@ -157,6 +157,7 @@ static int iceland_dpm_set_powergating_state(void *handle,
} }
const struct amd_ip_funcs iceland_dpm_ip_funcs = { const struct amd_ip_funcs iceland_dpm_ip_funcs = {
.name = "iceland_dpm",
.early_init = iceland_dpm_early_init, .early_init = iceland_dpm_early_init,
.late_init = NULL, .late_init = NULL,
.sw_init = iceland_dpm_sw_init, .sw_init = iceland_dpm_sw_init,
......
...@@ -394,6 +394,7 @@ static int iceland_ih_set_powergating_state(void *handle, ...@@ -394,6 +394,7 @@ static int iceland_ih_set_powergating_state(void *handle,
} }
const struct amd_ip_funcs iceland_ih_ip_funcs = { const struct amd_ip_funcs iceland_ih_ip_funcs = {
.name = "iceland_ih",
.early_init = iceland_ih_early_init, .early_init = iceland_ih_early_init,
.late_init = NULL, .late_init = NULL,
.sw_init = iceland_ih_sw_init, .sw_init = iceland_ih_sw_init,
......
...@@ -3238,6 +3238,7 @@ static int kv_dpm_set_powergating_state(void *handle, ...@@ -3238,6 +3238,7 @@ static int kv_dpm_set_powergating_state(void *handle,
} }
const struct amd_ip_funcs kv_dpm_ip_funcs = { const struct amd_ip_funcs kv_dpm_ip_funcs = {
.name = "kv_dpm",
.early_init = kv_dpm_early_init, .early_init = kv_dpm_early_init,
.late_init = kv_dpm_late_init, .late_init = kv_dpm_late_init,
.sw_init = kv_dpm_sw_init, .sw_init = kv_dpm_sw_init,
......
...@@ -1230,6 +1230,7 @@ static int sdma_v2_4_set_powergating_state(void *handle, ...@@ -1230,6 +1230,7 @@ static int sdma_v2_4_set_powergating_state(void *handle,
} }
const struct amd_ip_funcs sdma_v2_4_ip_funcs = { const struct amd_ip_funcs sdma_v2_4_ip_funcs = {
.name = "sdma_v2_4",
.early_init = sdma_v2_4_early_init, .early_init = sdma_v2_4_early_init,
.late_init = NULL, .late_init = NULL,
.sw_init = sdma_v2_4_sw_init, .sw_init = sdma_v2_4_sw_init,
......
...@@ -1542,6 +1542,7 @@ static int sdma_v3_0_set_powergating_state(void *handle, ...@@ -1542,6 +1542,7 @@ static int sdma_v3_0_set_powergating_state(void *handle,
} }
const struct amd_ip_funcs sdma_v3_0_ip_funcs = { const struct amd_ip_funcs sdma_v3_0_ip_funcs = {
.name = "sdma_v3_0",
.early_init = sdma_v3_0_early_init, .early_init = sdma_v3_0_early_init,
.late_init = NULL, .late_init = NULL,
.sw_init = sdma_v3_0_sw_init, .sw_init = sdma_v3_0_sw_init,
......
...@@ -143,6 +143,7 @@ static int tonga_dpm_set_powergating_state(void *handle, ...@@ -143,6 +143,7 @@ static int tonga_dpm_set_powergating_state(void *handle,
} }
const struct amd_ip_funcs tonga_dpm_ip_funcs = { const struct amd_ip_funcs tonga_dpm_ip_funcs = {
.name = "tonga_dpm",
.early_init = tonga_dpm_early_init, .early_init = tonga_dpm_early_init,
.late_init = NULL, .late_init = NULL,
.sw_init = tonga_dpm_sw_init, .sw_init = tonga_dpm_sw_init,
......
...@@ -417,6 +417,7 @@ static int tonga_ih_set_powergating_state(void *handle, ...@@ -417,6 +417,7 @@ static int tonga_ih_set_powergating_state(void *handle,
} }
const struct amd_ip_funcs tonga_ih_ip_funcs = { const struct amd_ip_funcs tonga_ih_ip_funcs = {
.name = "tonga_ih",
.early_init = tonga_ih_early_init, .early_init = tonga_ih_early_init,
.late_init = NULL, .late_init = NULL,
.sw_init = tonga_ih_sw_init, .sw_init = tonga_ih_sw_init,
......
...@@ -739,6 +739,7 @@ static int uvd_v4_2_set_powergating_state(void *handle, ...@@ -739,6 +739,7 @@ static int uvd_v4_2_set_powergating_state(void *handle,
} }
const struct amd_ip_funcs uvd_v4_2_ip_funcs = { const struct amd_ip_funcs uvd_v4_2_ip_funcs = {
.name = "uvd_v4_2",
.early_init = uvd_v4_2_early_init, .early_init = uvd_v4_2_early_init,
.late_init = NULL, .late_init = NULL,
.sw_init = uvd_v4_2_sw_init, .sw_init = uvd_v4_2_sw_init,
......
...@@ -791,6 +791,7 @@ static int uvd_v5_0_set_powergating_state(void *handle, ...@@ -791,6 +791,7 @@ static int uvd_v5_0_set_powergating_state(void *handle,
} }
const struct amd_ip_funcs uvd_v5_0_ip_funcs = { const struct amd_ip_funcs uvd_v5_0_ip_funcs = {
.name = "uvd_v5_0",
.early_init = uvd_v5_0_early_init, .early_init = uvd_v5_0_early_init,
.late_init = NULL, .late_init = NULL,
.sw_init = uvd_v5_0_sw_init, .sw_init = uvd_v5_0_sw_init,
......
...@@ -895,6 +895,7 @@ static int uvd_v6_0_set_powergating_state(void *handle, ...@@ -895,6 +895,7 @@ static int uvd_v6_0_set_powergating_state(void *handle,
} }
const struct amd_ip_funcs uvd_v6_0_ip_funcs = { const struct amd_ip_funcs uvd_v6_0_ip_funcs = {
.name = "uvd_v6_0",
.early_init = uvd_v6_0_early_init, .early_init = uvd_v6_0_early_init,
.late_init = NULL, .late_init = NULL,
.sw_init = uvd_v6_0_sw_init, .sw_init = uvd_v6_0_sw_init,
......
...@@ -567,6 +567,7 @@ static int vce_v2_0_set_powergating_state(void *handle, ...@@ -567,6 +567,7 @@ static int vce_v2_0_set_powergating_state(void *handle,
} }
const struct amd_ip_funcs vce_v2_0_ip_funcs = { const struct amd_ip_funcs vce_v2_0_ip_funcs = {
.name = "vce_v2_0",
.early_init = vce_v2_0_early_init, .early_init = vce_v2_0_early_init,
.late_init = NULL, .late_init = NULL,
.sw_init = vce_v2_0_sw_init, .sw_init = vce_v2_0_sw_init,
......
...@@ -674,6 +674,7 @@ static int vce_v3_0_set_powergating_state(void *handle, ...@@ -674,6 +674,7 @@ static int vce_v3_0_set_powergating_state(void *handle,
} }
const struct amd_ip_funcs vce_v3_0_ip_funcs = { const struct amd_ip_funcs vce_v3_0_ip_funcs = {
.name = "vce_v3_0",
.early_init = vce_v3_0_early_init, .early_init = vce_v3_0_early_init,
.late_init = NULL, .late_init = NULL,
.sw_init = vce_v3_0_sw_init, .sw_init = vce_v3_0_sw_init,
......
...@@ -1408,6 +1408,7 @@ static int vi_common_set_powergating_state(void *handle, ...@@ -1408,6 +1408,7 @@ static int vi_common_set_powergating_state(void *handle,
} }
const struct amd_ip_funcs vi_common_ip_funcs = { const struct amd_ip_funcs vi_common_ip_funcs = {
.name = "vi_common",
.early_init = vi_common_early_init, .early_init = vi_common_early_init,
.late_init = NULL, .late_init = NULL,
.sw_init = vi_common_sw_init, .sw_init = vi_common_sw_init,
......
...@@ -143,6 +143,8 @@ enum amd_pm_state_type { ...@@ -143,6 +143,8 @@ enum amd_pm_state_type {
}; };
struct amd_ip_funcs { struct amd_ip_funcs {
/* Name of IP block */
char *name;
/* sets up early driver state (pre sw_init), does not configure hw - Optional */ /* sets up early driver state (pre sw_init), does not configure hw - Optional */
int (*early_init)(void *handle); int (*early_init)(void *handle);
/* sets up late driver/hw state (post hw_init) - Optional */ /* sets up late driver/hw state (post hw_init) - Optional */
......
...@@ -340,6 +340,7 @@ static int pp_resume(void *handle) ...@@ -340,6 +340,7 @@ static int pp_resume(void *handle)
} }
const struct amd_ip_funcs pp_ip_funcs = { const struct amd_ip_funcs pp_ip_funcs = {
.name = "powerplay",
.early_init = pp_early_init, .early_init = pp_early_init,
.late_init = NULL, .late_init = NULL,
.sw_init = pp_sw_init, .sw_init = pp_sw_init,
......
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