summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/amd/powerplay/smu_v11_0.c
diff options
context:
space:
mode:
authorHuang Rui2019-03-31 06:49:11 +0200
committerAlex Deucher2019-06-22 01:59:26 +0200
commitcbfba01dde1cb8e805898607544aa8de606a3cfe (patch)
treebea0c73fa248290aa5b37a5719a78e2ff6f75e8a /drivers/gpu/drm/amd/powerplay/smu_v11_0.c
parentdrm/amd/powerplay: modify smu_update_table to use SMU_TABLE_xxx as the input (diff)
downloadkernel-qcow2-linux-cbfba01dde1cb8e805898607544aa8de606a3cfe.tar.gz
kernel-qcow2-linux-cbfba01dde1cb8e805898607544aa8de606a3cfe.tar.xz
kernel-qcow2-linux-cbfba01dde1cb8e805898607544aa8de606a3cfe.zip
drm/amd/powerplay: use the table size member in the structure instead of getting directly
This patch uses the table size member in the structure instead of getting directly, because the table is different in each asic. Signed-off-by: Huang Rui <ray.huang@amd.com> Reviewed-by: Kevin Wang <kevin1.wang@amd.com> Reviewed-by: Alex Deucher <alexander.deucher@amd.com> Reviewed-by: Hawking Zhang <Hawking.Zhang@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu/drm/amd/powerplay/smu_v11_0.c')
-rw-r--r--drivers/gpu/drm/amd/powerplay/smu_v11_0.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/gpu/drm/amd/powerplay/smu_v11_0.c b/drivers/gpu/drm/amd/powerplay/smu_v11_0.c
index 87ec1b147c66..017cf782f336 100644
--- a/drivers/gpu/drm/amd/powerplay/smu_v11_0.c
+++ b/drivers/gpu/drm/amd/powerplay/smu_v11_0.c
@@ -675,11 +675,12 @@ static int smu_v11_0_parse_pptable(struct smu_context *smu)
int ret;
struct smu_table_context *table_context = &smu->smu_table;
+ struct smu_table *table = &table_context->tables[SMU_TABLE_PPTABLE];
if (table_context->driver_pptable)
return -EINVAL;
- table_context->driver_pptable = kzalloc(sizeof(PPTable_t), GFP_KERNEL);
+ table_context->driver_pptable = kzalloc(table->size, GFP_KERNEL);
if (!table_context->driver_pptable)
return -ENOMEM;
@@ -1649,6 +1650,7 @@ static int smu_v11_0_set_od8_default_settings(struct smu_context *smu,
bool initialize)
{
struct smu_table_context *table_context = &smu->smu_table;
+ struct smu_table *table = &table_context->tables[SMU_TABLE_OVERDRIVE];
int ret;
/**
@@ -1662,7 +1664,7 @@ static int smu_v11_0_set_od8_default_settings(struct smu_context *smu,
if (table_context->overdrive_table)
return -EINVAL;
- table_context->overdrive_table = kzalloc(sizeof(OverDriveTable_t), GFP_KERNEL);
+ table_context->overdrive_table = kzalloc(table->size, GFP_KERNEL);
if (!table_context->overdrive_table)
return -ENOMEM;