amd/powerplay: Fix get dal power level
Simplify data struct for get dal power level
Signed-off-by: Vitaly Prosyak <vitaly.prosyak@amd.com>
diff --git a/drivers/gpu/drm/amd/powerplay/amd_powerplay.c b/drivers/gpu/drm/amd/powerplay/amd_powerplay.c
index 0b9876d..db0370b 100644
--- a/drivers/gpu/drm/amd/powerplay/amd_powerplay.c
+++ b/drivers/gpu/drm/amd/powerplay/amd_powerplay.c
@@ -620,7 +620,8 @@
return 0;
}
-int amd_powerplay_get_display_power_level(void *handle, void *output)
+int amd_powerplay_get_display_power_level(void *handle,
+ struct amd_pp_dal_clock_info *output)
{
struct pp_hwmgr *hwmgr;
@@ -629,6 +630,5 @@
hwmgr = ((struct pp_instance *)handle)->hwmgr;
- return phm_get_dal_power_level(hwmgr,
- (struct pp_dal_clock_info *)output);
+ return phm_get_dal_power_level(hwmgr, output);
}
diff --git a/drivers/gpu/drm/amd/powerplay/hwmgr/cz_hwmgr.c b/drivers/gpu/drm/amd/powerplay/hwmgr/cz_hwmgr.c
index a745acf..bd30b56 100644
--- a/drivers/gpu/drm/amd/powerplay/hwmgr/cz_hwmgr.c
+++ b/drivers/gpu/drm/amd/powerplay/hwmgr/cz_hwmgr.c
@@ -1597,7 +1597,7 @@
}
static int cz_get_dal_power_level(struct pp_hwmgr *hwmgr,
- struct pp_dal_clock_info*info)
+ struct amd_pp_dal_clock_info*info)
{
uint32_t i;
const struct phm_clock_voltage_dependency_table * table =
diff --git a/drivers/gpu/drm/amd/powerplay/hwmgr/hardwaremanager.c b/drivers/gpu/drm/amd/powerplay/hwmgr/hardwaremanager.c
index d24a419..881feb8 100644
--- a/drivers/gpu/drm/amd/powerplay/hwmgr/hardwaremanager.c
+++ b/drivers/gpu/drm/amd/powerplay/hwmgr/hardwaremanager.c
@@ -262,12 +262,13 @@
}
int phm_get_dal_power_level(struct pp_hwmgr *hwmgr,
- struct pp_dal_clock_info*info)
+ struct amd_pp_dal_clock_info*info)
{
- if (hwmgr == NULL || hwmgr->hwmgr_func->get_dal_power_level == NULL)
+ if (info == NULL || hwmgr == NULL ||
+ hwmgr->hwmgr_func->get_dal_power_level == NULL)
return -EINVAL;
- return hwmgr->hwmgr_func->get_dal_power_level(hwmgr,info);
+ return hwmgr->hwmgr_func->get_dal_power_level(hwmgr, info);
}
int phm_set_cpu_power_state(struct pp_hwmgr *hwmgr)
diff --git a/drivers/gpu/drm/amd/powerplay/inc/amd_powerplay.h b/drivers/gpu/drm/amd/powerplay/inc/amd_powerplay.h
index 2ec8c22..3d0058c 100644
--- a/drivers/gpu/drm/amd/powerplay/inc/amd_powerplay.h
+++ b/drivers/gpu/drm/amd/powerplay/inc/amd_powerplay.h
@@ -218,7 +218,8 @@
int amd_powerplay_display_configuration_change(void *handle, const void *input);
-int amd_powerplay_get_display_power_level(void *handle, void *output);
+int amd_powerplay_get_display_power_level(void *handle,
+ struct amd_pp_dal_clock_info *output);
#endif /* _AMD_POWERPLAY_H_ */
diff --git a/drivers/gpu/drm/amd/powerplay/inc/hardwaremanager.h b/drivers/gpu/drm/amd/powerplay/inc/hardwaremanager.h
index a3b93cd..a503306 100644
--- a/drivers/gpu/drm/amd/powerplay/inc/hardwaremanager.h
+++ b/drivers/gpu/drm/amd/powerplay/inc/hardwaremanager.h
@@ -340,11 +340,6 @@
PP_DAL_POWERLEVEL_7 = PP_DAL_POWERLEVEL_6+1,
};
-struct pp_dal_clock_info {
- uint32_t engine_max_clock;/*dal validation clock on AC*/
- uint32_t memory_max_clock;/*dal validation clock on AC*/
- enum PP_DAL_POWERLEVEL level; /*number of levels for the given clocks*/
-};
extern int phm_enable_clock_power_gatings(struct pp_hwmgr *hwmgr);
extern int phm_powergate_uvd(struct pp_hwmgr *hwmgr, bool gate);
@@ -380,7 +375,7 @@
const struct amd_pp_display_configuration *display_config);
extern int phm_get_dal_power_level(struct pp_hwmgr *hwmgr,
- struct pp_dal_clock_info*info);
+ struct amd_pp_dal_clock_info*info);
extern int phm_set_cpu_power_state(struct pp_hwmgr *hwmgr);
diff --git a/drivers/gpu/drm/amd/powerplay/inc/hwmgr.h b/drivers/gpu/drm/amd/powerplay/inc/hwmgr.h
index c9fcc0c..0c58969 100644
--- a/drivers/gpu/drm/amd/powerplay/inc/hwmgr.h
+++ b/drivers/gpu/drm/amd/powerplay/inc/hwmgr.h
@@ -325,7 +325,7 @@
bool cc6_disable, bool pstate_disable,
bool pstate_switch_disable);
int (*get_dal_power_level)(struct pp_hwmgr *hwmgr,
- struct pp_dal_clock_info*info);
+ struct amd_pp_dal_clock_info*info);
};
struct pp_table_func {