diff options
Diffstat (limited to 'drivers/gpu/drm/amd/powerplay/hwmgr/hwmgr.c')
-rw-r--r-- | drivers/gpu/drm/amd/powerplay/hwmgr/hwmgr.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/drivers/gpu/drm/amd/powerplay/hwmgr/hwmgr.c b/drivers/gpu/drm/amd/powerplay/hwmgr/hwmgr.c index 20f20e075588..27e07624ac28 100644 --- a/drivers/gpu/drm/amd/powerplay/hwmgr/hwmgr.c +++ b/drivers/gpu/drm/amd/powerplay/hwmgr/hwmgr.c | |||
@@ -24,6 +24,7 @@ | |||
24 | #include <linux/types.h> | 24 | #include <linux/types.h> |
25 | #include <linux/kernel.h> | 25 | #include <linux/kernel.h> |
26 | #include <linux/slab.h> | 26 | #include <linux/slab.h> |
27 | #include <drm/amdgpu_drm.h> | ||
27 | #include "cgs_common.h" | 28 | #include "cgs_common.h" |
28 | #include "power_state.h" | 29 | #include "power_state.h" |
29 | #include "hwmgr.h" | 30 | #include "hwmgr.h" |
@@ -58,12 +59,13 @@ int hwmgr_init(struct amd_pp_init *pp_init, struct pp_instance *handle) | |||
58 | hwmgr->hw_revision = pp_init->rev_id; | 59 | hwmgr->hw_revision = pp_init->rev_id; |
59 | hwmgr->usec_timeout = AMD_MAX_USEC_TIMEOUT; | 60 | hwmgr->usec_timeout = AMD_MAX_USEC_TIMEOUT; |
60 | hwmgr->power_source = PP_PowerSource_AC; | 61 | hwmgr->power_source = PP_PowerSource_AC; |
62 | hwmgr->powercontainment_enabled = pp_init->powercontainment_enabled; | ||
61 | 63 | ||
62 | switch (hwmgr->chip_family) { | 64 | switch (hwmgr->chip_family) { |
63 | case AMD_FAMILY_CZ: | 65 | case AMDGPU_FAMILY_CZ: |
64 | cz_hwmgr_init(hwmgr); | 66 | cz_hwmgr_init(hwmgr); |
65 | break; | 67 | break; |
66 | case AMD_FAMILY_VI: | 68 | case AMDGPU_FAMILY_VI: |
67 | switch (hwmgr->chip_id) { | 69 | switch (hwmgr->chip_id) { |
68 | case CHIP_TONGA: | 70 | case CHIP_TONGA: |
69 | tonga_hwmgr_init(hwmgr); | 71 | tonga_hwmgr_init(hwmgr); |
@@ -94,6 +96,8 @@ int hwmgr_fini(struct pp_hwmgr *hwmgr) | |||
94 | return -EINVAL; | 96 | return -EINVAL; |
95 | 97 | ||
96 | /* do hwmgr finish*/ | 98 | /* do hwmgr finish*/ |
99 | kfree(hwmgr->hardcode_pp_table); | ||
100 | |||
97 | kfree(hwmgr->backend); | 101 | kfree(hwmgr->backend); |
98 | 102 | ||
99 | kfree(hwmgr->start_thermal_controller.function_list); | 103 | kfree(hwmgr->start_thermal_controller.function_list); |
@@ -530,7 +534,7 @@ int phm_initializa_dynamic_state_adjustment_rule_settings(struct pp_hwmgr *hwmgr | |||
530 | 534 | ||
531 | /* initialize vddc_dep_on_dal_pwrl table */ | 535 | /* initialize vddc_dep_on_dal_pwrl table */ |
532 | table_size = sizeof(uint32_t) + 4 * sizeof(struct phm_clock_voltage_dependency_record); | 536 | table_size = sizeof(uint32_t) + 4 * sizeof(struct phm_clock_voltage_dependency_record); |
533 | table_clk_vlt = (struct phm_clock_voltage_dependency_table *)kzalloc(table_size, GFP_KERNEL); | 537 | table_clk_vlt = kzalloc(table_size, GFP_KERNEL); |
534 | 538 | ||
535 | if (NULL == table_clk_vlt) { | 539 | if (NULL == table_clk_vlt) { |
536 | printk(KERN_ERR "[ powerplay ] Can not allocate space for vddc_dep_on_dal_pwrl! \n"); | 540 | printk(KERN_ERR "[ powerplay ] Can not allocate space for vddc_dep_on_dal_pwrl! \n"); |