drm/amd/powerplay: run acg btc for Vega12

Submitted by Kenneth Feng on Jan. 11, 2019, 4:45 a.m.

Details

Message ID 1547181954-30619-1-git-send-email-kenneth.feng@amd.com
State Accepted
Series "drm/amd/powerplay: run acg btc for Vega12"
Commit a29b01a1313d20a6d45c0f25858f31701cee625d
Headers show

Commit Message

Kenneth Feng Jan. 11, 2019, 4:45 a.m.
acg btc was added to Vega12

Signed-off-by: Kenneth Feng <kenneth.feng@amd.com>
---
 drivers/gpu/drm/amd/powerplay/hwmgr/vega12_hwmgr.c | 21 +++++++++++++++++++++
 1 file changed, 21 insertions(+)

Patch hide | download patch | download mbox

diff --git a/drivers/gpu/drm/amd/powerplay/hwmgr/vega12_hwmgr.c b/drivers/gpu/drm/amd/powerplay/hwmgr/vega12_hwmgr.c
index 5436444..0c82129 100644
--- a/drivers/gpu/drm/amd/powerplay/hwmgr/vega12_hwmgr.c
+++ b/drivers/gpu/drm/amd/powerplay/hwmgr/vega12_hwmgr.c
@@ -753,6 +753,22 @@  static int vega12_init_smc_table(struct pp_hwmgr *hwmgr)
 	return 0;
 }
 
+static int vega12_run_acg_btc(struct pp_hwmgr *hwmgr)
+{
+	uint32_t result;
+
+	PP_ASSERT_WITH_CODE(
+		smum_send_msg_to_smc(hwmgr, PPSMC_MSG_RunAcgBtc) == 0,
+		"[Run_ACG_BTC] Attempt to run ACG BTC failed!",
+		return -EINVAL);
+
+	result = smum_get_argument(hwmgr);
+	PP_ASSERT_WITH_CODE(result == 1,
+			"Failed to run ACG BTC!", return -EINVAL);
+
+	return 0;
+}
+
 static int vega12_set_allowed_featuresmask(struct pp_hwmgr *hwmgr)
 {
 	struct vega12_hwmgr *data =
@@ -931,6 +947,11 @@  static int vega12_enable_dpm_tasks(struct pp_hwmgr *hwmgr)
 			"Failed to initialize SMC table!",
 			result = tmp_result);
 
+	tmp_result = vega12_run_acg_btc(hwmgr);
+	PP_ASSERT_WITH_CODE(!tmp_result,
+			"Failed to run ACG BTC!",
+			result = tmp_result);
+
 	result = vega12_enable_all_smu_features(hwmgr);
 	PP_ASSERT_WITH_CODE(!result,
 			"Failed to enable all smu features!",

Comments

Quan, Evan Jan. 11, 2019, 6:07 a.m.
Reviewed-by: Evan Quan <evan.quan@amd.com>


> -----Original Message-----

> From: amd-gfx <amd-gfx-bounces@lists.freedesktop.org> On Behalf Of

> Kenneth Feng

> Sent: 2019年1月11日 12:46

> To: amd-gfx@lists.freedesktop.org

> Cc: Feng, Kenneth <Kenneth.Feng@amd.com>

> Subject: [PATCH] drm/amd/powerplay: run acg btc for Vega12

> 

> acg btc was added to Vega12

> 

> Signed-off-by: Kenneth Feng <kenneth.feng@amd.com>

> ---

>  drivers/gpu/drm/amd/powerplay/hwmgr/vega12_hwmgr.c | 21

> +++++++++++++++++++++

>  1 file changed, 21 insertions(+)

> 

> diff --git a/drivers/gpu/drm/amd/powerplay/hwmgr/vega12_hwmgr.c

> b/drivers/gpu/drm/amd/powerplay/hwmgr/vega12_hwmgr.c

> index 5436444..0c82129 100644

> --- a/drivers/gpu/drm/amd/powerplay/hwmgr/vega12_hwmgr.c

> +++ b/drivers/gpu/drm/amd/powerplay/hwmgr/vega12_hwmgr.c

> @@ -753,6 +753,22 @@ static int vega12_init_smc_table(struct pp_hwmgr

> *hwmgr)

>  	return 0;

>  }

> 

> +static int vega12_run_acg_btc(struct pp_hwmgr *hwmgr) {

> +	uint32_t result;

> +

> +	PP_ASSERT_WITH_CODE(

> +		smum_send_msg_to_smc(hwmgr, PPSMC_MSG_RunAcgBtc)

> == 0,

> +		"[Run_ACG_BTC] Attempt to run ACG BTC failed!",

> +		return -EINVAL);

> +

> +	result = smum_get_argument(hwmgr);

> +	PP_ASSERT_WITH_CODE(result == 1,

> +			"Failed to run ACG BTC!", return -EINVAL);

> +

> +	return 0;

> +}

> +

>  static int vega12_set_allowed_featuresmask(struct pp_hwmgr *hwmgr)  {

>  	struct vega12_hwmgr *data =

> @@ -931,6 +947,11 @@ static int vega12_enable_dpm_tasks(struct

> pp_hwmgr *hwmgr)

>  			"Failed to initialize SMC table!",

>  			result = tmp_result);

> 

> +	tmp_result = vega12_run_acg_btc(hwmgr);

> +	PP_ASSERT_WITH_CODE(!tmp_result,

> +			"Failed to run ACG BTC!",

> +			result = tmp_result);

> +

>  	result = vega12_enable_all_smu_features(hwmgr);

>  	PP_ASSERT_WITH_CODE(!result,

>  			"Failed to enable all smu features!",

> --

> 2.7.4

> 

> _______________________________________________

> amd-gfx mailing list

> amd-gfx@lists.freedesktop.org

> https://lists.freedesktop.org/mailman/listinfo/amd-gfx