RE: [PATCH 2/4] drm/amd/pp: Implement load_firmware interface

2018-09-29 Thread Quan, Evan
Reviewed-by: Evan Quan 

> -Original Message-
> From: amd-gfx  On Behalf Of Rex
> Zhu
> Sent: 2018年9月30日 0:19
> To: amd-gfx@lists.freedesktop.org
> Cc: Zhu, Rex 
> Subject: [PATCH 2/4] drm/amd/pp: Implement load_firmware interface
> 
> with this interface, gfx/sdma can be initialized before smu.
> 
> Signed-off-by: Rex Zhu 
> ---
>  drivers/gpu/drm/amd/powerplay/amd_powerplay.c | 15
> +++
>  1 file changed, 15 insertions(+)
> 
> diff --git a/drivers/gpu/drm/amd/powerplay/amd_powerplay.c
> b/drivers/gpu/drm/amd/powerplay/amd_powerplay.c
> index a267f9e..ace88e2 100644
> --- a/drivers/gpu/drm/amd/powerplay/amd_powerplay.c
> +++ b/drivers/gpu/drm/amd/powerplay/amd_powerplay.c
> @@ -270,8 +270,23 @@ static int pp_set_clockgating_state(void *handle,
>   .funcs = _ip_funcs,
>  };
> 
> +/* This interface only be supported On Vi,
> + * because only smu7/8 can help to load gfx/sdma fw,
> + * smu need to be enabled before load other ip's fw.
> + * so call start smu to load smu7 fw and other ip's fw  */
>  static int pp_dpm_load_fw(void *handle)  {
> + struct pp_hwmgr *hwmgr = handle;
> +
> + if (!hwmgr || !hwmgr->smumgr_funcs || !hwmgr->smumgr_funcs-
> >start_smu)
> + return -EINVAL;
> +
> + if (hwmgr->smumgr_funcs->start_smu(hwmgr)) {
> + pr_err("fw load failed\n");
> + return -EINVAL;
> + }
> +
>   return 0;
>  }
> 
> --
> 1.9.1
> 
> ___
> amd-gfx mailing list
> amd-gfx@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/amd-gfx
___
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx


[PATCH 2/4] drm/amd/pp: Implement load_firmware interface

2018-09-29 Thread Rex Zhu
with this interface, gfx/sdma can be initialized
before smu.

Signed-off-by: Rex Zhu 
---
 drivers/gpu/drm/amd/powerplay/amd_powerplay.c | 15 +++
 1 file changed, 15 insertions(+)

diff --git a/drivers/gpu/drm/amd/powerplay/amd_powerplay.c 
b/drivers/gpu/drm/amd/powerplay/amd_powerplay.c
index a267f9e..ace88e2 100644
--- a/drivers/gpu/drm/amd/powerplay/amd_powerplay.c
+++ b/drivers/gpu/drm/amd/powerplay/amd_powerplay.c
@@ -270,8 +270,23 @@ static int pp_set_clockgating_state(void *handle,
.funcs = _ip_funcs,
 };
 
+/* This interface only be supported On Vi,
+ * because only smu7/8 can help to load gfx/sdma fw,
+ * smu need to be enabled before load other ip's fw.
+ * so call start smu to load smu7 fw and other ip's fw
+ */
 static int pp_dpm_load_fw(void *handle)
 {
+   struct pp_hwmgr *hwmgr = handle;
+
+   if (!hwmgr || !hwmgr->smumgr_funcs || !hwmgr->smumgr_funcs->start_smu)
+   return -EINVAL;
+
+   if (hwmgr->smumgr_funcs->start_smu(hwmgr)) {
+   pr_err("fw load failed\n");
+   return -EINVAL;
+   }
+
return 0;
 }
 
-- 
1.9.1

___
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx