提交 cdb0c632 编写于 作者: H Huang Rui 提交者: Alex Deucher

drm/amd/powerplay: init table_count for smu tables on asic level

TABLE_COUNT should be inited in asic level. Because the value may be different
on each asic even on the same ip.
Signed-off-by: NHuang Rui <ray.huang@amd.com>
Reviewed-by: NKevin Wang <kevin1.wang@amd.com>
Reviewed-by: NAlex Deucher <alexander.deucher@amd.com>
Reviewed-by: NHawking Zhang <Hawking.Zhang@amd.com>
Signed-off-by: NAlex Deucher <alexander.deucher@amd.com>
上级 2436911b
...@@ -447,6 +447,9 @@ static const struct pptable_funcs navi10_ppt_funcs = { ...@@ -447,6 +447,9 @@ static const struct pptable_funcs navi10_ppt_funcs = {
void navi10_set_ppt_funcs(struct smu_context *smu) void navi10_set_ppt_funcs(struct smu_context *smu)
{ {
struct smu_table_context *smu_table = &smu->smu_table;
smu->ppt_funcs = &navi10_ppt_funcs; smu->ppt_funcs = &navi10_ppt_funcs;
smu->smc_if_version = SMU11_DRIVER_IF_VERSION; smu->smc_if_version = SMU11_DRIVER_IF_VERSION;
smu_table->table_count = TABLE_COUNT;
} }
...@@ -400,15 +400,15 @@ static int smu_v11_0_init_smc_tables(struct smu_context *smu) ...@@ -400,15 +400,15 @@ static int smu_v11_0_init_smc_tables(struct smu_context *smu)
struct smu_table *tables = NULL; struct smu_table *tables = NULL;
int ret = 0; int ret = 0;
if (smu_table->tables || smu_table->table_count != 0) if (smu_table->tables || smu_table->table_count == 0)
return -EINVAL; return -EINVAL;
tables = kcalloc(TABLE_COUNT, sizeof(struct smu_table), GFP_KERNEL); tables = kcalloc(SMU_TABLE_COUNT, sizeof(struct smu_table),
GFP_KERNEL);
if (!tables) if (!tables)
return -ENOMEM; return -ENOMEM;
smu_table->tables = tables; smu_table->tables = tables;
smu_table->table_count = TABLE_COUNT;
SMU_TABLE_INIT(tables, TABLE_PPTABLE, sizeof(PPTable_t), SMU_TABLE_INIT(tables, TABLE_PPTABLE, sizeof(PPTable_t),
PAGE_SIZE, AMDGPU_GEM_DOMAIN_VRAM); PAGE_SIZE, AMDGPU_GEM_DOMAIN_VRAM);
......
...@@ -2989,6 +2989,9 @@ static const struct pptable_funcs vega20_ppt_funcs = { ...@@ -2989,6 +2989,9 @@ static const struct pptable_funcs vega20_ppt_funcs = {
void vega20_set_ppt_funcs(struct smu_context *smu) void vega20_set_ppt_funcs(struct smu_context *smu)
{ {
struct smu_table_context *smu_table = &smu->smu_table;
smu->ppt_funcs = &vega20_ppt_funcs; smu->ppt_funcs = &vega20_ppt_funcs;
smu->smc_if_version = SMU11_DRIVER_IF_VERSION; smu->smc_if_version = SMU11_DRIVER_IF_VERSION;
smu_table->table_count = TABLE_COUNT;
} }
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册