[PATCH 1/2] drm/powerplay: Add smu set xgmi pstate interface
Liu, Shaoyun
Shaoyun.Liu at amd.com
Mon Apr 8 14:45:06 UTC 2019
ping
On 2019-04-05 12:01 p.m., Liu, Shaoyun wrote:
> XGMI pstate is controlled by SMU, driver need this interface to communicate
> with SMU
>
> Change-Id: I3a30797332557725d48d392bea0c9d59e2d0e427
> Signed-off-by: shaoyunl <shaoyun.liu at amd.com>
> ---
> drivers/gpu/drm/amd/powerplay/inc/amdgpu_smu.h | 4 ++++
> drivers/gpu/drm/amd/powerplay/smu_v11_0.c | 8 ++++++++
> 2 files changed, 12 insertions(+)
>
> diff --git a/drivers/gpu/drm/amd/powerplay/inc/amdgpu_smu.h b/drivers/gpu/drm/amd/powerplay/inc/amdgpu_smu.h
> index 2083139..0e52d1b 100644
> --- a/drivers/gpu/drm/amd/powerplay/inc/amdgpu_smu.h
> +++ b/drivers/gpu/drm/amd/powerplay/inc/amdgpu_smu.h
> @@ -546,6 +546,8 @@ struct smu_funcs
> int (*get_fan_speed_percent)(struct smu_context *smu, uint32_t *speed);
> int (*set_fan_speed_percent)(struct smu_context *smu, uint32_t speed);
> int (*set_fan_speed_rpm)(struct smu_context *smu, uint32_t speed);
> + int (*set_xgmi_pstate)(struct smu_context *smu, uint32_t pstate);
> +
> };
>
> #define smu_init_microcode(smu) \
> @@ -729,6 +731,8 @@ struct smu_funcs
> ((smu)->funcs->get_sclk ? (smu)->funcs->get_sclk((smu), (low)) : 0)
> #define smu_get_mclk(smu, low) \
> ((smu)->funcs->get_mclk ? (smu)->funcs->get_mclk((smu), (low)) : 0)
> +#define smu_set_xgmi_pstate(smu, pstate) \
> + ((smu)->funcs->set_xgmi_pstate ? (smu)->funcs->set_xgmi_pstate((smu), (pstate)) : 0)
>
>
> extern int smu_get_atom_data_table(struct smu_context *smu, uint32_t table,
> diff --git a/drivers/gpu/drm/amd/powerplay/smu_v11_0.c b/drivers/gpu/drm/amd/powerplay/smu_v11_0.c
> index 9d75911..2e2ce71 100644
> --- a/drivers/gpu/drm/amd/powerplay/smu_v11_0.c
> +++ b/drivers/gpu/drm/amd/powerplay/smu_v11_0.c
> @@ -1952,6 +1952,13 @@ static int smu_v11_0_set_fan_speed_rpm(struct smu_context *smu,
> return ret;
> }
>
> +static int smu_v11_0_set_xgmi_pstate(struct smu_context *smu,
> + uint32_t pstate)
> +{
> + /* send msg to SMU to set pstate */
> + return 0;
> +}
> +
> static const struct smu_funcs smu_v11_0_funcs = {
> .init_microcode = smu_v11_0_init_microcode,
> .load_microcode = smu_v11_0_load_microcode,
> @@ -2008,6 +2015,7 @@ static const struct smu_funcs smu_v11_0_funcs = {
> .get_fan_speed_percent = smu_v11_0_get_fan_speed_percent,
> .set_fan_speed_percent = smu_v11_0_set_fan_speed_percent,
> .set_fan_speed_rpm = smu_v11_0_set_fan_speed_rpm,
> + .set_xgmi_pstate = smu_v11_0_set_xgmi_pstate,
> };
>
> void smu_v11_0_set_smu_funcs(struct smu_context *smu)
More information about the amd-gfx
mailing list