* [PATCH] drm/amd/powerplay: move the smc_if_version to asic file
@ 2019-03-11 3:06 Wang, Kevin(Yang)
[not found] ` <1552273553-28570-1-git-send-email-kevin1.wang-5C7GfCeVMHo@public.gmane.org>
0 siblings, 1 reply; 2+ messages in thread
From: Wang, Kevin(Yang) @ 2019-03-11 3:06 UTC (permalink / raw)
To: amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW; +Cc: Huang, Ray, Wang, Kevin(Yang)
each asic may be has different smc if version,
so move its to asic file to implement.
Signed-off-by: Kevin Wang <kevin1.wang@amd.com>
---
drivers/gpu/drm/amd/powerplay/inc/amdgpu_smu.h | 2 ++
drivers/gpu/drm/amd/powerplay/smu_v11_0.c | 4 ++--
drivers/gpu/drm/amd/powerplay/vega20_ppt.c | 1 +
3 files changed, 5 insertions(+), 2 deletions(-)
diff --git a/drivers/gpu/drm/amd/powerplay/inc/amdgpu_smu.h b/drivers/gpu/drm/amd/powerplay/inc/amdgpu_smu.h
index 851234e..b0dc5a5 100644
--- a/drivers/gpu/drm/amd/powerplay/inc/amdgpu_smu.h
+++ b/drivers/gpu/drm/amd/powerplay/inc/amdgpu_smu.h
@@ -401,6 +401,8 @@ struct smu_context
uint32_t workload_setting[WORKLOAD_POLICY_MAX];
uint32_t power_profile_mode;
uint32_t default_power_profile_mode;
+
+ uint32_t smc_if_version;
};
struct pptable_funcs {
diff --git a/drivers/gpu/drm/amd/powerplay/smu_v11_0.c b/drivers/gpu/drm/amd/powerplay/smu_v11_0.c
index 4d1bdaa..e92da41 100644
--- a/drivers/gpu/drm/amd/powerplay/smu_v11_0.c
+++ b/drivers/gpu/drm/amd/powerplay/smu_v11_0.c
@@ -224,8 +224,8 @@ static int smu_v11_0_check_fw_version(struct smu_context *smu)
if (ret)
goto err;
- if (smu_version == SMU11_DRIVER_IF_VERSION)
- return 0;
+ if (smu_version != smu->smc_if_version)
+ ret = -EINVAL;
err:
return ret;
}
diff --git a/drivers/gpu/drm/amd/powerplay/vega20_ppt.c b/drivers/gpu/drm/amd/powerplay/vega20_ppt.c
index 1996f2c..214142c 100644
--- a/drivers/gpu/drm/amd/powerplay/vega20_ppt.c
+++ b/drivers/gpu/drm/amd/powerplay/vega20_ppt.c
@@ -2704,4 +2704,5 @@ static const struct pptable_funcs vega20_ppt_funcs = {
void vega20_set_ppt_funcs(struct smu_context *smu)
{
smu->ppt_funcs = &vega20_ppt_funcs;
+ smu->smc_if_version = SMU11_DRIVER_IF_VERSION;
}
--
2.7.4
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
^ permalink raw reply related [flat|nested] 2+ messages in thread
* RE: [PATCH] drm/amd/powerplay: move the smc_if_version to asic file
[not found] ` <1552273553-28570-1-git-send-email-kevin1.wang-5C7GfCeVMHo@public.gmane.org>
@ 2019-03-11 3:16 ` Huang, Ray
0 siblings, 0 replies; 2+ messages in thread
From: Huang, Ray @ 2019-03-11 3:16 UTC (permalink / raw)
To: Wang, Kevin(Yang), amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW
> -----Original Message-----
> From: Wang, Kevin(Yang)
> Sent: Monday, March 11, 2019 11:06 AM
> To: amd-gfx@lists.freedesktop.org
> Cc: Huang, Ray <Ray.Huang@amd.com>; Wang, Kevin(Yang)
> <Kevin1.Wang@amd.com>
> Subject: [PATCH] drm/amd/powerplay: move the smc_if_version to asic file
>
> each asic may be has different smc if version, so move its to asic file to
> implement.
>
> Signed-off-by: Kevin Wang <kevin1.wang@amd.com>
Reviewed-by: Huang Rui <ray.huang@amd.com>
> ---
> drivers/gpu/drm/amd/powerplay/inc/amdgpu_smu.h | 2 ++
> drivers/gpu/drm/amd/powerplay/smu_v11_0.c | 4 ++--
> drivers/gpu/drm/amd/powerplay/vega20_ppt.c | 1 +
> 3 files changed, 5 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/powerplay/inc/amdgpu_smu.h
> b/drivers/gpu/drm/amd/powerplay/inc/amdgpu_smu.h
> index 851234e..b0dc5a5 100644
> --- a/drivers/gpu/drm/amd/powerplay/inc/amdgpu_smu.h
> +++ b/drivers/gpu/drm/amd/powerplay/inc/amdgpu_smu.h
> @@ -401,6 +401,8 @@ struct smu_context
> uint32_t workload_setting[WORKLOAD_POLICY_MAX];
> uint32_t power_profile_mode;
> uint32_t default_power_profile_mode;
> +
> + uint32_t smc_if_version;
> };
>
> struct pptable_funcs {
> diff --git a/drivers/gpu/drm/amd/powerplay/smu_v11_0.c
> b/drivers/gpu/drm/amd/powerplay/smu_v11_0.c
> index 4d1bdaa..e92da41 100644
> --- a/drivers/gpu/drm/amd/powerplay/smu_v11_0.c
> +++ b/drivers/gpu/drm/amd/powerplay/smu_v11_0.c
> @@ -224,8 +224,8 @@ static int smu_v11_0_check_fw_version(struct
> smu_context *smu)
> if (ret)
> goto err;
>
> - if (smu_version == SMU11_DRIVER_IF_VERSION)
> - return 0;
> + if (smu_version != smu->smc_if_version)
> + ret = -EINVAL;
> err:
> return ret;
> }
> diff --git a/drivers/gpu/drm/amd/powerplay/vega20_ppt.c
> b/drivers/gpu/drm/amd/powerplay/vega20_ppt.c
> index 1996f2c..214142c 100644
> --- a/drivers/gpu/drm/amd/powerplay/vega20_ppt.c
> +++ b/drivers/gpu/drm/amd/powerplay/vega20_ppt.c
> @@ -2704,4 +2704,5 @@ static const struct pptable_funcs vega20_ppt_funcs
> = { void vega20_set_ppt_funcs(struct smu_context *smu) {
> smu->ppt_funcs = &vega20_ppt_funcs;
> + smu->smc_if_version = SMU11_DRIVER_IF_VERSION;
> }
> --
> 2.7.4
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2019-03-11 3:16 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-03-11 3:06 [PATCH] drm/amd/powerplay: move the smc_if_version to asic file Wang, Kevin(Yang)
[not found] ` <1552273553-28570-1-git-send-email-kevin1.wang-5C7GfCeVMHo@public.gmane.org>
2019-03-11 3:16 ` Huang, Ray
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.