diff options
author | Kevin Wang | 2018-12-14 10:43:57 +0100 |
---|---|---|
committer | Alex Deucher | 2019-03-19 21:03:55 +0100 |
commit | 813ce279448e7d5af183571b99d8ca7f605188b8 (patch) | |
tree | 667e24490bbda270ad2b6a47ae52bf4d2283df0e /drivers/gpu/drm/amd/powerplay/inc/amdgpu_smu.h | |
parent | drm/amd/powerplay: implement read_pptable_from_vbios function for smu11 (diff) | |
download | kernel-qcow2-linux-813ce279448e7d5af183571b99d8ca7f605188b8.tar.gz kernel-qcow2-linux-813ce279448e7d5af183571b99d8ca7f605188b8.tar.xz kernel-qcow2-linux-813ce279448e7d5af183571b99d8ca7f605188b8.zip |
drm/amd/powerplay: implement smu_init[fini]_smc_tables for smu11
Each SMU IP may have a different number of SMU tables, so these tables
are allocated using dynamic memory
Signed-off-by: Kevin Wang <Kevin1.Wang@amd.com>
Reviewed-by: Huang Rui <ray.huang@amd.com>
Acked-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu/drm/amd/powerplay/inc/amdgpu_smu.h')
-rw-r--r-- | drivers/gpu/drm/amd/powerplay/inc/amdgpu_smu.h | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/drivers/gpu/drm/amd/powerplay/inc/amdgpu_smu.h b/drivers/gpu/drm/amd/powerplay/inc/amdgpu_smu.h index 88eee63364f1..16f11a41eac6 100644 --- a/drivers/gpu/drm/amd/powerplay/inc/amdgpu_smu.h +++ b/drivers/gpu/drm/amd/powerplay/inc/amdgpu_smu.h @@ -24,10 +24,29 @@ #include "amdgpu.h" +#define SMU_TABLE_INIT(tables, table_id, s, a, d) \ + do { \ + tables[table_id].size = s; \ + tables[table_id].align = a; \ + tables[table_id].domain = d; \ + } while (0) + +struct smu_table { + uint64_t size; + uint32_t align; + uint8_t domain; + uint64_t mc_address; + void *cpu_addr; + struct amdgpu_bo *bo; + +}; + struct smu_table_context { void *power_play_table; uint32_t power_play_table_size; + struct smu_table *tables; + uint32_t table_count; }; struct smu_context @@ -44,6 +63,7 @@ struct smu_funcs { int (*init_microcode)(struct smu_context *smu); int (*init_smc_tables)(struct smu_context *smu); + int (*fini_smc_tables)(struct smu_context *smu); int (*init_power)(struct smu_context *smu); int (*load_microcode)(struct smu_context *smu); int (*check_fw_status)(struct smu_context *smu); @@ -69,6 +89,8 @@ struct smu_funcs ((smu)->funcs->init_microcode ? (smu)->funcs->init_microcode((smu)) : 0) #define smu_init_smc_tables(smu) \ ((smu)->funcs->init_smc_tables ? (smu)->funcs->init_smc_tables((smu)) : 0) +#define smu_fini_smc_tables(smu) \ + ((smu)->funcs->fini_smc_tables ? (smu)->funcs->fini_smc_tables((smu)) : 0) #define smu_init_power(smu) \ ((smu)->funcs->init_power ? (smu)->funcs->init_power((smu)) : 0) #define smu_load_microcode(smu) \ |