return -EINVAL;
kfree(smu_dpm->dpm_context);
+ kfree(smu_dpm->golden_dpm_context);
smu_dpm->dpm_context = NULL;
+ smu_dpm->golden_dpm_context = NULL;
smu_dpm->dpm_context_size = 0;
return 0;
{
struct smu_dpm_context *smu_dpm = &smu->smu_dpm;
+ if (smu_dpm->dpm_context)
+ return -EINVAL;
+
smu_dpm->dpm_context = kzalloc(sizeof(struct vega20_dpm_table),
GFP_KERNEL);
if (!smu_dpm->dpm_context)
return -ENOMEM;
+ if (smu_dpm->golden_dpm_context)
+ return -EINVAL;
+
+ smu_dpm->golden_dpm_context = kzalloc(sizeof(struct vega20_dpm_table),
+ GFP_KERNEL);
+ if (!smu_dpm->golden_dpm_context)
+ return -ENOMEM;
+
smu_dpm->dpm_context_size = sizeof(struct vega20_dpm_table);
return 0;
}
vega20_init_single_dpm_state(&(single_dpm_table->dpm_state));
+ memcpy(smu_dpm->golden_dpm_context, dpm_table,
+ sizeof(struct vega20_dpm_table));
+
return 0;
}