Skip to contentSkip to conversation

drm/amd/powerplay: delete dpm code for Cz/St.

PATCH In review Rex Zhu 5 participants 12 messages Dec 23, 2016 – Jan 9, 2017 7 messages not in the archive

Subsystems (2)
lore
Share & tools
lore

Rex Zhu

author
#0 lore raw

PATCH 1/4 drm/amd/powerplay: delete dpm code for Cz/St.

Change-Id I6f349037fcd07d2cf5667a535be3946decb80e6f
---
 drivers/gpu/drm/amd/amdgpu/Makefile           |    3 +-
 drivers/gpu/drm/amd/amdgpu/amdgpu_powerplay.c |    8 +-
 drivers/gpu/drm/amd/amdgpu/cz_dpm.c           | 2320 -------------------------
 drivers/gpu/drm/amd/amdgpu/cz_dpm.h           |  239 ---
 drivers/gpu/drm/amd/amdgpu/cz_smc.c           |  995 -----------
 drivers/gpu/drm/amd/amdgpu/cz_smumgr.h        |   94 -
 6 files changed, 2 insertions(+), 3657 deletions(-)
 delete mode 100644 drivers/gpu/drm/amd/amdgpu/cz_dpm.c
 delete mode 100644 drivers/gpu/drm/amd/amdgpu/cz_dpm.h
 delete mode 100644 drivers/gpu/drm/amd/amdgpu/cz_smc.c
 delete mode 100644 drivers/gpu/drm/amd/amdgpu/cz_smumgr.h
drivers/gpu/drm/amd/amdgpu/Makefile +1 -2
index dd0b6db..4185b03 100644
@@ -58,8 +58,7 @@ amdgpu-y += \
 # add SMC block
 amdgpu-y += \
 	amdgpu_dpm.o \
-	amdgpu_powerplay.o \
-	cz_smc.o cz_dpm.o
+	amdgpu_powerplay.o
 
 # add DCE block
 amdgpu-y += \
drivers/gpu/drm/amd/amdgpu/amdgpu_powerplay.c +1 -7
index 95a568d..b1921c7 100644
@@ -78,10 +78,6 @@ static int amdgpu_powerplay_init(struct amdgpu_device *adev)
 			amd_pp->ip_funcs = &kv_dpm_ip_funcs;
 			break;
 #endif
-		case CHIP_CARRIZO:
-		case CHIP_STONEY:
-			amd_pp->ip_funcs = &cz_dpm_ip_funcs;
-			break;
 		default:
 			ret = -EINVAL;
 			break;
@@ -102,11 +98,9 @@ static int amdgpu_pp_early_init(void *handle)
 	case CHIP_TONGA:
 	case CHIP_FIJI:
 	case CHIP_TOPAZ:
-		adev->pp_enabled = true;
-		break;
 	case CHIP_CARRIZO:
 	case CHIP_STONEY:
-		adev->pp_enabled = (amdgpu_powerplay == 0) ? false : true;
+		adev->pp_enabled = true;
 		break;
 	/* These chips don't have powerplay implemenations */
 	case CHIP_BONAIRE:
drivers/gpu/drm/amd/amdgpu/cz_dpm.c deleted +0 -2320

2,320 lines not on this page · raw message

drivers/gpu/drm/amd/amdgpu/cz_dpm.h deleted +0 -239

239 lines not on this page · raw message

drivers/gpu/drm/amd/amdgpu/cz_smc.c deleted +0 -995

410 lines not on this page · raw message

drivers/gpu/drm/amd/amdgpu/cz_smumgr.h deleted +0 -94

94 lines not on this page · raw message

The rest of this diff is not shown. View the raw message.

Signature · 6 lines
1.9.1

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

Part of the diff is not shown here. View the raw message.

A message that is not in the archive (sent off-list or not yet received): 1482482752-31020-1-git-send-email-Rex.Zhu-5C7GfCeVMHo@public.gmane.org

author
#2 lore raw

PATCH 2/4 drm/amd/powerplay: Unify dpm level defines

Change-Id: I209a6732f7956778485b7e55fa9e85e6987c0229

---
 drivers/gpu/drm/amd/amdgpu/amdgpu_dpm.h           | 19 ++++-------
 drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c            | 39 +++++++++--------------
 drivers/gpu/drm/amd/amdgpu/ci_dpm.c               | 12 +++----
 drivers/gpu/drm/amd/amdgpu/kv_dpm.c               | 10 +++---
 drivers/gpu/drm/amd/amdgpu/si_dpm.c               | 10 +++---
 drivers/gpu/drm/amd/include/amd_shared.h          |  7 ++++
 drivers/gpu/drm/amd/powerplay/inc/amd_powerplay.h |  7 ----
 7 files changed, 45 insertions(+), 59 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_dpm.h +7 -12
index e673f08..6c58c7d 100644
@@ -241,13 +241,6 @@ enum amdgpu_pcie_gen {
 	AMDGPU_PCIE_GEN_INVALID = 0xffff
 };
 
-enum amdgpu_dpm_forced_level {
-	AMDGPU_DPM_FORCED_LEVEL_AUTO = 0,
-	AMDGPU_DPM_FORCED_LEVEL_LOW = 1,
-	AMDGPU_DPM_FORCED_LEVEL_HIGH = 2,
-	AMDGPU_DPM_FORCED_LEVEL_MANUAL = 3,
-};
-
 struct amdgpu_dpm_funcs {
 	int (*get_temperature)(struct amdgpu_device *adev);
 	int (*pre_set_power_state)(struct amdgpu_device *adev);
@@ -258,7 +251,7 @@ struct amdgpu_dpm_funcs {
 	u32 (*get_mclk)(struct amdgpu_device *adev, bool low);
 	void (*print_power_state)(struct amdgpu_device *adev, struct amdgpu_ps *ps);
 	void (*debugfs_print_current_performance_level)(struct amdgpu_device *adev, struct seq_file *m);
-	int (*force_performance_level)(struct amdgpu_device *adev, enum amdgpu_dpm_forced_level level);
+	int (*force_performance_level)(struct amdgpu_device *adev, enum amd_dpm_forced_level level);
 	bool (*vblank_too_short)(struct amdgpu_device *adev);
 	void (*powergate_uvd)(struct amdgpu_device *adev, bool gate);
 	void (*powergate_vce)(struct amdgpu_device *adev, bool gate);
@@ -353,9 +346,6 @@ struct amdgpu_dpm_funcs {
 #define amdgpu_dpm_get_current_power_state(adev) \
 	(adev)->powerplay.pp_funcs->get_current_power_state((adev)->powerplay.pp_handle)
 
-#define amdgpu_dpm_get_performance_level(adev) \
-	(adev)->powerplay.pp_funcs->get_performance_level((adev)->powerplay.pp_handle)
-
 #define amdgpu_dpm_get_pp_num_states(adev, data) \
 	(adev)->powerplay.pp_funcs->get_pp_num_states((adev)->powerplay.pp_handle, data)
 
@@ -393,6 +383,11 @@ struct amdgpu_dpm_funcs {
 	 (adev)->powerplay.pp_funcs->get_vce_clock_state((adev)->powerplay.pp_handle, (i)) : \
 	 (adev)->pm.funcs->get_vce_clock_state((adev), (i)))
 
+#define amdgpu_dpm_get_performance_level(adev) \
+	((adev)->pp_enabled ?						\
+	(adev)->powerplay.pp_funcs->get_performance_level((adev)->powerplay.pp_handle) : \
+	(adev)->pm.dpm.forced_level)
+
 struct amdgpu_dpm {
 	struct amdgpu_ps        *ps;
 	/* number of valid power states */
@@ -440,7 +435,7 @@ struct amdgpu_dpm {
 	/* thermal handling */
 	struct amdgpu_dpm_thermal thermal;
 	/* forced levels */
-	enum amdgpu_dpm_forced_level forced_level;
+	enum amd_dpm_forced_level forced_level;
 };
 
 struct amdgpu_pm {
drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c +15 -24
index 0f8c747..2bfede8 100644
@@ -112,28 +112,19 @@ static ssize_t amdgpu_get_dpm_forced_performance_level(struct device *dev,
 {
 	struct drm_device *ddev = dev_get_drvdata(dev);
 	struct amdgpu_device *adev = ddev->dev_private;
+	enum amd_dpm_forced_level level;
 
 	if  ((adev->flags & AMD_IS_PX) &&
 	     (ddev->switch_power_state != DRM_SWITCH_POWER_ON))
 		return snprintf(buf, PAGE_SIZE, "off\n");
 
-	if (adev->pp_enabled) {
-		enum amd_dpm_forced_level level;
-
-		level = amdgpu_dpm_get_performance_level(adev);
-		return snprintf(buf, PAGE_SIZE, "%s\n",
-				(level == AMD_DPM_FORCED_LEVEL_AUTO) ? "auto" :
-				(level == AMD_DPM_FORCED_LEVEL_LOW) ? "low" :
-				(level == AMD_DPM_FORCED_LEVEL_HIGH) ? "high" :
-				(level == AMD_DPM_FORCED_LEVEL_MANUAL) ? "manual" : "unknown");
-	} else {
-		enum amdgpu_dpm_forced_level level;
-
-		level = adev->pm.dpm.forced_level;
-		return snprintf(buf, PAGE_SIZE, "%s\n",
-				(level == AMDGPU_DPM_FORCED_LEVEL_AUTO) ? "auto" :
-				(level == AMDGPU_DPM_FORCED_LEVEL_LOW) ? "low" : "high");
-	}
+	level = amdgpu_dpm_get_performance_level(adev);
+	return snprintf(buf, PAGE_SIZE, "%s\n",
+			(level & (AMD_DPM_FORCED_LEVEL_AUTO) ? "auto" :
+			(level & AMD_DPM_FORCED_LEVEL_LOW) ? "low" :
+			(level & AMD_DPM_FORCED_LEVEL_HIGH) ? "high" :
+			(level & AMD_DPM_FORCED_LEVEL_MANUAL) ? "manual" :
+			"unknown"));
 }
 
 static ssize_t amdgpu_set_dpm_forced_performance_level(struct device *dev,
@@ -143,7 +134,7 @@ static ssize_t amdgpu_set_dpm_forced_performance_level(struct device *dev,
 {
 	struct drm_device *ddev = dev_get_drvdata(dev);
 	struct amdgpu_device *adev = ddev->dev_private;
-	enum amdgpu_dpm_forced_level level;
+	enum amd_dpm_forced_level level;
 	int ret = 0;
 
 	/* Can't force performance level when the card is off */
@@ -152,13 +143,13 @@ static ssize_t amdgpu_set_dpm_forced_performance_level(struct device *dev,
 		return -EINVAL;
 
 	if (strncmp("low", buf, strlen("low")) == 0) {
-		level = AMDGPU_DPM_FORCED_LEVEL_LOW;
+		level = AMD_DPM_FORCED_LEVEL_LOW;
 	} else if (strncmp("high", buf, strlen("high")) == 0) {
-		level = AMDGPU_DPM_FORCED_LEVEL_HIGH;
+		level = AMD_DPM_FORCED_LEVEL_HIGH;
 	} else if (strncmp("auto", buf, strlen("auto")) == 0) {
-		level = AMDGPU_DPM_FORCED_LEVEL_AUTO;
+		level = AMD_DPM_FORCED_LEVEL_AUTO;
 	} else if (strncmp("manual", buf, strlen("manual")) == 0) {
-		level = AMDGPU_DPM_FORCED_LEVEL_MANUAL;
+		level = AMD_DPM_FORCED_LEVEL_MANUAL;
 	} else {
 		count = -EINVAL;
 		goto fail;
@@ -1060,9 +1051,9 @@ static void amdgpu_dpm_change_power_state_locked(struct amdgpu_device *adev)
 
 	if (adev->pm.funcs->force_performance_level) {
 		if (adev->pm.dpm.thermal_active) {
-			enum amdgpu_dpm_forced_level level = adev->pm.dpm.forced_level;
+			enum amd_dpm_forced_level level = adev->pm.dpm.forced_level;
 			/* force low perf level for thermal */
-			amdgpu_dpm_force_performance_level(adev, AMDGPU_DPM_FORCED_LEVEL_LOW);
+			amdgpu_dpm_force_performance_level(adev, AMD_DPM_FORCED_LEVEL_LOW);
 			/* save the user's level */
 			adev->pm.dpm.forced_level = level;
 		} else {
drivers/gpu/drm/amd/amdgpu/ci_dpm.c +6 -6
index bda9e3d..d8de7eb 100644
@@ -4336,13 +4336,13 @@ static u32 ci_get_lowest_enabled_level(struct amdgpu_device *adev,
 
 
 static int ci_dpm_force_performance_level(struct amdgpu_device *adev,
-					  enum amdgpu_dpm_forced_level level)
+					  enum amd_dpm_forced_level level)
 {
 	struct ci_power_info *pi = ci_get_pi(adev);
 	u32 tmp, levels, i;
 	int ret;
 
-	if (level == AMDGPU_DPM_FORCED_LEVEL_HIGH) {
+	if (level == AMD_DPM_FORCED_LEVEL_HIGH) {
 		if ((!pi->pcie_dpm_key_disabled) &&
 		    pi->dpm_level_enable_mask.pcie_dpm_enable_mask) {
 			levels = 0;
@@ -4403,7 +4403,7 @@ static int ci_dpm_force_performance_level(struct amdgpu_device *adev,
 				}
 			}
 		}
-	} else if (level == AMDGPU_DPM_FORCED_LEVEL_LOW) {
+	} else if (level == AMD_DPM_FORCED_LEVEL_LOW) {
 		if ((!pi->sclk_dpm_key_disabled) &&
 		    pi->dpm_level_enable_mask.sclk_dpm_enable_mask) {
 			levels = ci_get_lowest_enabled_level(adev,
@@ -4452,7 +4452,7 @@ static int ci_dpm_force_performance_level(struct amdgpu_device *adev,
 				udelay(1);
 			}
 		}
-	} else if (level == AMDGPU_DPM_FORCED_LEVEL_AUTO) {
+	} else if (level == AMD_DPM_FORCED_LEVEL_AUTO) {
 		if (!pi->pcie_dpm_key_disabled) {
 			PPSMC_Result smc_result;
 
@@ -6262,7 +6262,7 @@ static int ci_dpm_sw_init(void *handle)
 	/* default to balanced state */
 	adev->pm.dpm.state = POWER_STATE_TYPE_BALANCED;
 	adev->pm.dpm.user_state = POWER_STATE_TYPE_BALANCED;
-	adev->pm.dpm.forced_level = AMDGPU_DPM_FORCED_LEVEL_AUTO;
+	adev->pm.dpm.forced_level = AMD_DPM_FORCED_LEVEL_AUTO;
 	adev->pm.default_sclk = adev->clock.default_sclk;
 	adev->pm.default_mclk = adev->clock.default_mclk;
 	adev->pm.current_sclk = adev->clock.default_sclk;
@@ -6572,7 +6572,7 @@ static int ci_dpm_force_clock_level(struct amdgpu_device *adev,
 	struct ci_power_info *pi = ci_get_pi(adev);
 
 	if (adev->pm.dpm.forced_level
-			!= AMDGPU_DPM_FORCED_LEVEL_MANUAL)
+			!= AMD_DPM_FORCED_LEVEL_MANUAL)
 		return -EINVAL;
 
 	switch (type) {
drivers/gpu/drm/amd/amdgpu/kv_dpm.c +5 -5
index 5a1bc35..91f885b 100644
@@ -1904,19 +1904,19 @@ static int kv_enable_nb_dpm(struct amdgpu_device *adev,
 }
 
 static int kv_dpm_force_performance_level(struct amdgpu_device *adev,
-					  enum amdgpu_dpm_forced_level level)
+					  enum amd_dpm_forced_level level)
 {
 	int ret;
 
-	if (level == AMDGPU_DPM_FORCED_LEVEL_HIGH) {
+	if (level == AMD_DPM_FORCED_LEVEL_HIGH) {
 		ret = kv_force_dpm_highest(adev);
 		if (ret)
 			return ret;
-	} else if (level == AMDGPU_DPM_FORCED_LEVEL_LOW) {
+	} else if (level == AMD_DPM_FORCED_LEVEL_LOW) {
 		ret = kv_force_dpm_lowest(adev);
 		if (ret)
 			return ret;
-	} else if (level == AMDGPU_DPM_FORCED_LEVEL_AUTO) {
+	} else if (level == AMD_DPM_FORCED_LEVEL_AUTO) {
 		ret = kv_unforce_levels(adev);
 		if (ret)
 			return ret;
@@ -3029,7 +3029,7 @@ static int kv_dpm_sw_init(void *handle)
 	/* default to balanced state */
 	adev->pm.dpm.state = POWER_STATE_TYPE_BALANCED;
 	adev->pm.dpm.user_state = POWER_STATE_TYPE_BALANCED;
-	adev->pm.dpm.forced_level = AMDGPU_DPM_FORCED_LEVEL_AUTO;
+	adev->pm.dpm.forced_level = AMD_DPM_FORCED_LEVEL_AUTO;
 	adev->pm.default_sclk = adev->clock.default_sclk;
 	adev->pm.default_mclk = adev->clock.default_mclk;
 	adev->pm.current_sclk = adev->clock.default_sclk;
drivers/gpu/drm/amd/amdgpu/si_dpm.c +5 -5
index a3f6331..0859fe7 100644
@@ -3929,25 +3929,25 @@ static int si_restrict_performance_levels_before_switch(struct amdgpu_device *ad
 }
 
 static int si_dpm_force_performance_level(struct amdgpu_device *adev,
-				   enum amdgpu_dpm_forced_level level)
+				   enum amd_dpm_forced_level level)
 {
 	struct amdgpu_ps *rps = adev->pm.dpm.current_ps;
 	struct  si_ps *ps = si_get_ps(rps);
 	u32 levels = ps->performance_level_count;
 
-	if (level == AMDGPU_DPM_FORCED_LEVEL_HIGH) {
+	if (level == AMD_DPM_FORCED_LEVEL_HIGH) {
 		if (si_send_msg_to_smc_with_parameter(adev, PPSMC_MSG_SetEnabledLevels, levels) != PPSMC_Result_OK)
 			return -EINVAL;
 
 		if (si_send_msg_to_smc_with_parameter(adev, PPSMC_MSG_SetForcedLevels, 1) != PPSMC_Result_OK)
 			return -EINVAL;
-	} else if (level == AMDGPU_DPM_FORCED_LEVEL_LOW) {
+	} else if (level == AMD_DPM_FORCED_LEVEL_LOW) {
 		if (si_send_msg_to_smc_with_parameter(adev, PPSMC_MSG_SetForcedLevels, 0) != PPSMC_Result_OK)
 			return -EINVAL;
 
 		if (si_send_msg_to_smc_with_parameter(adev, PPSMC_MSG_SetEnabledLevels, 1) != PPSMC_Result_OK)
 			return -EINVAL;
-	} else if (level == AMDGPU_DPM_FORCED_LEVEL_AUTO) {
+	} else if (level == AMD_DPM_FORCED_LEVEL_AUTO) {
 		if (si_send_msg_to_smc_with_parameter(adev, PPSMC_MSG_SetForcedLevels, 0) != PPSMC_Result_OK)
 			return -EINVAL;
 
@@ -7768,7 +7768,7 @@ static int si_dpm_sw_init(void *handle)
 	/* default to balanced state */
 	adev->pm.dpm.state = POWER_STATE_TYPE_BALANCED;
 	adev->pm.dpm.user_state = POWER_STATE_TYPE_BALANCED;
-	adev->pm.dpm.forced_level = AMDGPU_DPM_FORCED_LEVEL_AUTO;
+	adev->pm.dpm.forced_level = AMD_DPM_FORCED_LEVEL_AUTO;
 	adev->pm.default_sclk = adev->clock.default_sclk;
 	adev->pm.default_mclk = adev->clock.default_mclk;
 	adev->pm.current_sclk = adev->clock.default_sclk;
drivers/gpu/drm/amd/include/amd_shared.h +7 -0
index 5f59117..3f2a6b9 100644
@@ -80,6 +80,13 @@ enum amd_clockgating_state {
 	AMD_CG_STATE_UNGATE,
 };
 
+enum amd_dpm_forced_level {
+	AMD_DPM_FORCED_LEVEL_AUTO = 0x1,
+	AMD_DPM_FORCED_LEVEL_MANUAL = 0x2,
+	AMD_DPM_FORCED_LEVEL_LOW = 0x4,
+	AMD_DPM_FORCED_LEVEL_HIGH = 0x8,
+};
+
 enum amd_powergating_state {
 	AMD_PG_STATE_GATE = 0,
 	AMD_PG_STATE_UNGATE,
drivers/gpu/drm/amd/powerplay/inc/amd_powerplay.h +0 -7
index 3a883e6..6d52a39 100644
@@ -135,13 +135,6 @@ enum amd_pp_event {
 	AMD_PP_EVENT_MAX
 };
 
-enum amd_dpm_forced_level {
-	AMD_DPM_FORCED_LEVEL_AUTO = 0,
-	AMD_DPM_FORCED_LEVEL_LOW = 1,
-	AMD_DPM_FORCED_LEVEL_HIGH = 2,
-	AMD_DPM_FORCED_LEVEL_MANUAL = 3,
-};
-
 struct amd_pp_init {
 	struct cgs_device *device;
 	uint32_t chip_family;
Signature · 6 lines
1.9.1

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
author
#3 lore raw

PATCH 3/4 drm/amd/powerplay: fix bug dpm level set by user was reset to auto.

In reply to a message not in the archive
Change-Id Id68b42dbb2c4e9403e097835a6758c9f930b836e
---
 drivers/gpu/drm/amd/powerplay/eventmgr/eventtasks.c | 5 ++++-
 drivers/gpu/drm/amd/powerplay/hwmgr/hwmgr.c         | 2 +-
 2 files changed, 5 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/powerplay/eventmgr/eventtasks.c +4 -1
index ec36c0e..e04216e 100644
@@ -38,10 +38,13 @@
 int pem_task_update_allowed_performance_levels(struct pp_eventmgr *eventmgr, struct pem_event_data *event_data)
 {
 
+	if (eventmgr == NULL || eventmgr->hwmgr == NULL)
+		return -EINVAL;
+
 	if (pem_is_hw_access_blocked(eventmgr))
 		return 0;
 
-	phm_force_dpm_levels(eventmgr->hwmgr, AMD_DPM_FORCED_LEVEL_AUTO);
+	phm_force_dpm_levels(eventmgr->hwmgr, eventmgr->hwmgr->dpm_level);
 
 	return 0;
 }
drivers/gpu/drm/amd/powerplay/hwmgr/hwmgr.c +1 -1
index b036064..cdd4969 100644
@@ -68,7 +68,7 @@ int hwmgr_init(struct amd_pp_init *pp_init, struct pp_instance *handle)
 	hwmgr->usec_timeout = AMD_MAX_USEC_TIMEOUT;
 	hwmgr->power_source = PP_PowerSource_AC;
 	hwmgr->pp_table_version = PP_TABLE_V1;
-
+	hwmgr->dpm_level = AMD_DPM_FORCED_LEVEL_AUTO;
 	hwmgr_init_default_caps(hwmgr);
 	hwmgr_set_user_specify_caps(hwmgr);
 
Signature · 6 lines
1.9.1

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
author
#4 lore raw

PATCH 4/4 drm/amd/powerplay: add profiling mode in dpm level

In reply to a message not in the archive

Change-Id: I4a46440882cd94fe5e77e3f351aaccc218a2ece5

---
 drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c           | 17 +++++++++++++++++
 drivers/gpu/drm/amd/amdgpu/ci_dpm.c              |  4 ++--
 drivers/gpu/drm/amd/include/amd_shared.h         |  1 +
 drivers/gpu/drm/amd/powerplay/hwmgr/cz_hwmgr.c   |  3 ++-
 drivers/gpu/drm/amd/powerplay/hwmgr/smu7_hwmgr.c |  3 ++-
 5 files changed, 24 insertions(+), 4 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c +17 -0
index 2bfede8..8438642 100644
@@ -124,6 +124,7 @@ static ssize_t amdgpu_get_dpm_forced_performance_level(struct device *dev,
 			(level & AMD_DPM_FORCED_LEVEL_LOW) ? "low" :
 			(level & AMD_DPM_FORCED_LEVEL_HIGH) ? "high" :
 			(level & AMD_DPM_FORCED_LEVEL_MANUAL) ? "manual" :
+			(level & AMD_DPM_FORCED_LEVEL_PROFILING) ? "profiling" :
 			"unknown"));
 }
 
@@ -135,6 +136,7 @@ static ssize_t amdgpu_set_dpm_forced_performance_level(struct device *dev,
 	struct drm_device *ddev = dev_get_drvdata(dev);
 	struct amdgpu_device *adev = ddev->dev_private;
 	enum amd_dpm_forced_level level;
+	enum amd_dpm_forced_level current_level;
 	int ret = 0;
 
 	/* Can't force performance level when the card is off */
@@ -142,6 +144,8 @@ static ssize_t amdgpu_set_dpm_forced_performance_level(struct device *dev,
 	     (ddev->switch_power_state != DRM_SWITCH_POWER_ON))
 		return -EINVAL;
 
+	current_level = amdgpu_dpm_get_performance_level(adev);
+
 	if (strncmp("low", buf, strlen("low")) == 0) {
 		level = AMD_DPM_FORCED_LEVEL_LOW;
 	} else if (strncmp("high", buf, strlen("high")) == 0) {
@@ -150,11 +154,24 @@ static ssize_t amdgpu_set_dpm_forced_performance_level(struct device *dev,
 		level = AMD_DPM_FORCED_LEVEL_AUTO;
 	} else if (strncmp("manual", buf, strlen("manual")) == 0) {
 		level = AMD_DPM_FORCED_LEVEL_MANUAL;
+	} else if (strncmp("profile", buf, strlen("profile")) == 0) {
+		level = AMD_DPM_FORCED_LEVEL_PROFILING;
 	} else {
 		count = -EINVAL;
 		goto fail;
 	}
 
+	if (current_level == level)
+		return 0;
+
+	if (level == AMD_DPM_FORCED_LEVEL_PROFILING)
+		amdgpu_set_clockgating_state(adev, AMD_IP_BLOCK_TYPE_GFX,
+						AMD_CG_STATE_UNGATE);
+	else if (level != AMD_DPM_FORCED_LEVEL_PROFILING &&
+			current_level == AMD_DPM_FORCED_LEVEL_PROFILING)
+		amdgpu_set_clockgating_state(adev, AMD_IP_BLOCK_TYPE_GFX,
+						AMD_CG_STATE_GATE);
+
 	if (adev->pp_enabled)
 		amdgpu_dpm_force_performance_level(adev, level);
 	else {
drivers/gpu/drm/amd/amdgpu/ci_dpm.c +2 -2
index d8de7eb..59be694 100644
@@ -6571,8 +6571,8 @@ static int ci_dpm_force_clock_level(struct amdgpu_device *adev,
 {
 	struct ci_power_info *pi = ci_get_pi(adev);
 
-	if (adev->pm.dpm.forced_level
-			!= AMD_DPM_FORCED_LEVEL_MANUAL)
+	if (!(adev->pm.dpm.forced_level &
+		(AMD_DPM_FORCED_LEVEL_MANUAL | AMD_DPM_FORCED_LEVEL_PROFILING)))
 		return -EINVAL;
 
 	switch (type) {
drivers/gpu/drm/amd/include/amd_shared.h +1 -0
index 3f2a6b9..f3424a1 100644
@@ -85,6 +85,7 @@ enum amd_dpm_forced_level {
 	AMD_DPM_FORCED_LEVEL_MANUAL = 0x2,
 	AMD_DPM_FORCED_LEVEL_LOW = 0x4,
 	AMD_DPM_FORCED_LEVEL_HIGH = 0x8,
+	AMD_DPM_FORCED_LEVEL_PROFILING = 0x10,
 };
 
 enum amd_powergating_state {
drivers/gpu/drm/amd/powerplay/hwmgr/cz_hwmgr.c +2 -1
index 74dbbd1..beaa7e2 100644
@@ -1637,7 +1637,8 @@ static int cz_get_dal_power_level(struct pp_hwmgr *hwmgr,
 static int cz_force_clock_level(struct pp_hwmgr *hwmgr,
 		enum pp_clock_type type, uint32_t mask)
 {
-	if (hwmgr->dpm_level != AMD_DPM_FORCED_LEVEL_MANUAL)
+	if (!(hwmgr->dpm_level &
+		(AMD_DPM_FORCED_LEVEL_MANUAL | AMD_DPM_FORCED_LEVEL_PROFILING)))
 		return -EINVAL;
 
 	switch (type) {
drivers/gpu/drm/amd/powerplay/hwmgr/smu7_hwmgr.c +2 -1
index ae5517a..146d7dd 100644
@@ -4033,7 +4033,8 @@ static int smu7_force_clock_level(struct pp_hwmgr *hwmgr,
 {
 	struct smu7_hwmgr *data = (struct smu7_hwmgr *)(hwmgr->backend);
 
-	if (hwmgr->dpm_level != AMD_DPM_FORCED_LEVEL_MANUAL)
+	if (!(hwmgr->dpm_level &
+		(AMD_DPM_FORCED_LEVEL_MANUAL | AMD_DPM_FORCED_LEVEL_PROFILING)))
 		return -EINVAL;
 
 	switch (type) {
Signature · 6 lines
1.9.1

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

A message that is not in the archive (sent off-list or not yet received): 1482482752-31020-4-git-send-email-Rex.Zhu-5C7GfCeVMHo@public.gmane.org

Reviewed-by
#6 lore raw

Re: [PATCH 4/4] drm/amd/powerplay: add profiling mode in dpm level

Quoted 1 line · Rex Zhu

Change-Id: I4a46440882cd94fe5e77e3f351aaccc218a2ece5

Patches 1-3:

patch 4:
Please add a better patch description and explain what profiling mode is good for, etc.

Alex

Quoted 120 lines
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c           | 17 +++++++++++++++++
 drivers/gpu/drm/amd/amdgpu/ci_dpm.c              |  4 ++--
 drivers/gpu/drm/amd/include/amd_shared.h         |  1 +
 drivers/gpu/drm/amd/powerplay/hwmgr/cz_hwmgr.c   |  3 ++-
 drivers/gpu/drm/amd/powerplay/hwmgr/smu7_hwmgr.c |  3 ++-
 5 files changed, 24 insertions(+), 4 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c +17 -0
index 2bfede8..8438642 100644
@@ -124,6 +124,7 @@ static ssize_t amdgpu_get_dpm_forced_performance_level(struct device *dev,
                        (level & AMD_DPM_FORCED_LEVEL_LOW) ? "low" :
                        (level & AMD_DPM_FORCED_LEVEL_HIGH) ? "high" :
                        (level & AMD_DPM_FORCED_LEVEL_MANUAL) ? "manual" :
+                       (level & AMD_DPM_FORCED_LEVEL_PROFILING) ? "profiling" :
                        "unknown"));
 }
 
@@ -135,6 +136,7 @@ static ssize_t amdgpu_set_dpm_forced_performance_level(struct device *dev,
        struct drm_device *ddev = dev_get_drvdata(dev);
        struct amdgpu_device *adev = ddev->dev_private;
        enum amd_dpm_forced_level level;
+       enum amd_dpm_forced_level current_level;
        int ret = 0;
 
        /* Can't force performance level when the card is off */
@@ -142,6 +144,8 @@ static ssize_t amdgpu_set_dpm_forced_performance_level(struct device *dev,
             (ddev->switch_power_state != DRM_SWITCH_POWER_ON))
                return -EINVAL;
 
+       current_level = amdgpu_dpm_get_performance_level(adev);
+
        if (strncmp("low", buf, strlen("low")) == 0) {
                level = AMD_DPM_FORCED_LEVEL_LOW;
        } else if (strncmp("high", buf, strlen("high")) == 0) {
@@ -150,11 +154,24 @@ static ssize_t amdgpu_set_dpm_forced_performance_level(struct device *dev,
                level = AMD_DPM_FORCED_LEVEL_AUTO;
        } else if (strncmp("manual", buf, strlen("manual")) == 0) {
                level = AMD_DPM_FORCED_LEVEL_MANUAL;
+       } else if (strncmp("profile", buf, strlen("profile")) == 0) {
+               level = AMD_DPM_FORCED_LEVEL_PROFILING;
        } else {
                count = -EINVAL;
                goto fail;
        }
 
+       if (current_level == level)
+               return 0;
+
+       if (level == AMD_DPM_FORCED_LEVEL_PROFILING)
+               amdgpu_set_clockgating_state(adev, AMD_IP_BLOCK_TYPE_GFX,
+                                               AMD_CG_STATE_UNGATE);
+       else if (level != AMD_DPM_FORCED_LEVEL_PROFILING &&
+                       current_level == AMD_DPM_FORCED_LEVEL_PROFILING)
+               amdgpu_set_clockgating_state(adev, AMD_IP_BLOCK_TYPE_GFX,
+                                               AMD_CG_STATE_GATE);
+
        if (adev->pp_enabled)
                amdgpu_dpm_force_performance_level(adev, level);
        else {
drivers/gpu/drm/amd/amdgpu/ci_dpm.c +2 -2
index d8de7eb..59be694 100644
@@ -6571,8 +6571,8 @@ static int ci_dpm_force_clock_level(struct amdgpu_device *adev,
 {
        struct ci_power_info *pi = ci_get_pi(adev);
 
-       if (adev->pm.dpm.forced_level
-                       != AMD_DPM_FORCED_LEVEL_MANUAL)
+       if (!(adev->pm.dpm.forced_level &
+               (AMD_DPM_FORCED_LEVEL_MANUAL | AMD_DPM_FORCED_LEVEL_PROFILING)))
                return -EINVAL;
 
        switch (type) {
drivers/gpu/drm/amd/include/amd_shared.h +1 -0
index 3f2a6b9..f3424a1 100644
@@ -85,6 +85,7 @@ enum amd_dpm_forced_level {
        AMD_DPM_FORCED_LEVEL_MANUAL = 0x2,
        AMD_DPM_FORCED_LEVEL_LOW = 0x4,
        AMD_DPM_FORCED_LEVEL_HIGH = 0x8,
+       AMD_DPM_FORCED_LEVEL_PROFILING = 0x10,
 };
 
 enum amd_powergating_state {
drivers/gpu/drm/amd/powerplay/hwmgr/cz_hwmgr.c +2 -1
index 74dbbd1..beaa7e2 100644
@@ -1637,7 +1637,8 @@ static int cz_get_dal_power_level(struct pp_hwmgr *hwmgr,
 static int cz_force_clock_level(struct pp_hwmgr *hwmgr,
                enum pp_clock_type type, uint32_t mask)
 {
-       if (hwmgr->dpm_level != AMD_DPM_FORCED_LEVEL_MANUAL)
+       if (!(hwmgr->dpm_level &
+               (AMD_DPM_FORCED_LEVEL_MANUAL | AMD_DPM_FORCED_LEVEL_PROFILING)))
                return -EINVAL;
 
        switch (type) {
drivers/gpu/drm/amd/powerplay/hwmgr/smu7_hwmgr.c +2 -2
index ae5517a..146d7dd 100644
@@ -4033,7 +4033,8 @@ static int smu7_force_clock_level(struct pp_hwmgr *hwmgr,
 {
        struct smu7_hwmgr *data = (struct smu7_hwmgr *)(hwmgr->backend);
 
-       if (hwmgr->dpm_level != AMD_DPM_FORCED_LEVEL_MANUAL)
+       if (!(hwmgr->dpm_level &
+               (AMD_DPM_FORCED_LEVEL_MANUAL | AMD_DPM_FORCED_LEVEL_PROFILING)))
                return -EINVAL;
 
        switch (type) {
--

1.9.1

Quoted 4 lines

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

A message that is not in the archive (sent off-list or not yet received): CADnq5_P2GiXmoWnUiHipKQj-2VYT0sD72LoOScmmRua+_kQCXA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org

#8 lore raw

Re: [PATCH 4/4] drm/amd/powerplay: add profiling mode in dpm level

Quoted 9 lines · Alex Deucher
Quoted 1 line · Rex Zhu

Change-Id: I4a46440882cd94fe5e77e3f351aaccc218a2ece5

Patches 1-3:

patch 4:
Please add a better patch description and explain what profiling mode is good for, etc.

This on drm-next-4.10-wip regresses setting profile a bit on R9285.

It works eg. if in auto then doing

echo high > /sys/class/drm/card0/device/power_dpm_force_performance_level

is OK and echo auto > ... is also OK.

The issue if I am in auto and echo auto > .... then I don't get my prompt back.

echo high from elsewhere will make it return - but it doesn't set high.

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

A message that is not in the archive (sent off-list or not yet received): [email protected]

author
#10 lore raw

RE: [PATCH 4/4] drm/amd/powerplay: add profiling mode in dpm level

Thanks Andy,

The attached patch can fix this bug.
Please review.

Best Regards
Rex

-----Original Message-----
From: Andy Furniss [mailto:[email protected]]
Sent: Monday, January 09, 2017 4:18 AM
To: Alex Deucher; Zhu, Rex
Cc: amd-gfx list
Subject: Re: [PATCH 4/4] drm/amd/powerplay: add profiling mode in dpm level

Quoted 9 lines · Alex Deucher
Quoted 1 line · Rex Zhu

Change-Id: I4a46440882cd94fe5e77e3f351aaccc218a2ece5

Patches 1-3:

patch 4:
Please add a better patch description and explain what profiling mode is good for, etc.

This on drm-next-4.10-wip regresses setting profile a bit on R9285.

It works eg. if in auto then doing

echo high > /sys/class/drm/card0/device/power_dpm_force_performance_level

is OK and echo auto > ... is also OK.

The issue if I am in auto and echo auto > .... then I don't get my prompt back.

echo high from elsewhere will make it return - but it doesn't set high.

From 87b02c21a7ebc0b6eb33af8133cecead0de3c1ff Mon Sep 17 00:00:00 2001
From: Rex Zhu <[email protected]>
Date: Mon, 9 Jan 2017 15:18:01 +0800
Subject: [PATCH] drm/amdgpu: fix bug return invaild value to sysfs.

Change-Id Ib9e1f60ad816eaaedd247c224684686d764a72fc
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c +1 -1
index a6a4d36..6662c06 100644
@@ -173,7 +173,7 @@ static ssize_t amdgpu_set_dpm_forced_performance_level(struct device *dev,
 	}
 
 	if (current_level == level)
-		return 0;
+		return count;
 
 	if (adev->pp_enabled)
 		amdgpu_dpm_force_performance_level(adev, level);
Signature · 1 line
1.9.1

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

A message that is not in the archive (sent off-list or not yet received): CY4PR12MB1687780C20D2155C8D92F994FB640-rpdhrqHFk06Y0SjTqZDccQdYzm3356FpvxpqHgZTriW3zl9H0oFU5g@public.gmane.org

#12 lore raw

Re: [PATCH 4/4] drm/amd/powerplay: add profiling mode in dpm level

Hi, that change does fix it for me.

The patch doesn't apply directly to drm-next-4.10-wip, here's what I tested -

drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c +1 -1
index 0345fbb..ac2e5f4 100644
@@ -162,7 +162,7 @@ static ssize_t amdgpu_set_dpm_forced_performance_level(struct device *dev,
        }
 
        if (current_level == level)
-               return 0;
+               return count;
 
        if (level == AMD_DPM_FORCED_LEVEL_PROFILING)
                amdgpu_set_clockgating_state(adev, AMD_IP_BLOCK_TYPE_GFX,
Quoted 30 lines · Rex

Thanks Andy,

The attached patch can fix this bug.
Please review.

Best Regards
Rex

-----Original Message-----
From: Andy Furniss [mailto:[email protected]]
Sent: Monday, January 09, 2017 4:18 AM
To: Alex Deucher; Zhu, Rex
Cc: amd-gfx list
Subject: Re: [PATCH 4/4] drm/amd/powerplay: add profiling mode in dpm level

Quoted 9 lines · Alex Deucher
Quoted 1 line · Rex Zhu

Change-Id: I4a46440882cd94fe5e77e3f351aaccc218a2ece5

Patches 1-3:

patch 4:
Please add a better patch description and explain what profiling mode is good for, etc.

This on drm-next-4.10-wip regresses setting profile a bit on R9285.

It works eg. if in auto then doing

Quoted 8 lines

echo high > /sys/class/drm/card0/device/power_dpm_force_performance_level

is OK and echo auto > ... is also OK.

The issue if I am in auto and echo auto > .... then I don't get my prompt back.

echo high from elsewhere will make it return - but it doesn't set high.

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

A message that is not in the archive (sent off-list or not yet received): [email protected]

author
#14 lore raw

RE: [PATCH 4/4] drm/amd/powerplay: add profiling mode in dpm level

Thanks for quick response.

Quoted 1 line
Quoted 1 line
Quoted 1 line

The patch doesn't apply directly to drm-next-4.10-wip, here's what I tested -

Sorry, it is because code base has been changed in my local.

Please review the attached patch.

Best Regards
Rex

-----Original Message-----
From: Andy Furniss [mailto:[email protected]]
Sent: Monday, January 09, 2017 6:29 PM
To: Zhu, Rex; Alex Deucher
Cc: amd-gfx list
Subject: Re: [PATCH 4/4] drm/amd/powerplay: add profiling mode in dpm level

Hi, that change does fix it for me.

The patch doesn't apply directly to drm-next-4.10-wip, here's what I tested -

(quoted diff) +0 -0

b/drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c
index 0345fbb..ac2e5f4 100644

drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c +0 -0
@@ -162,7 +162,7 @@ static ssize_t

amdgpu_set_dpm_forced_performance_level(struct device *dev,

         }

         if (current_level == level)

- return 0;
+ return count;

         if (level == AMD_DPM_FORCED_LEVEL_PROFILING)
                 amdgpu_set_clockgating_state(adev, AMD_IP_BLOCK_TYPE_GFX,
Quoted 31 lines · Rex

Thanks Andy,

The attached patch can fix this bug.
Please review.

Best Regards
Rex

-----Original Message-----
From: Andy Furniss [mailto:[email protected]]
Sent: Monday, January 09, 2017 4:18 AM
To: Alex Deucher; Zhu, Rex
Cc: amd-gfx list
Subject: Re: [PATCH 4/4] drm/amd/powerplay: add profiling mode in dpm level

Quoted 9 lines · Alex Deucher
Quoted 1 line · Rex Zhu

Change-Id: I4a46440882cd94fe5e77e3f351aaccc218a2ece5

Patches 1-3:

patch 4:
Please add a better patch description and explain what profiling mode is good for, etc.

This on drm-next-4.10-wip regresses setting profile a bit on R9285.

It works eg. if in auto then doing

Quoted 9 lines

echo high > /sys/class/drm/card0/device/power_dpm_force_performance_level

is OK and echo auto > ... is also OK.

The issue if I am in auto and echo auto > .... then I don't get my prompt back.

echo high from elsewhere will make it return - but it doesn't set high.

From d020dae854fb0cf50a663ec8e932b85694f75f98 Mon Sep 17 00:00:00 2001
From: Rex Zhu <[email protected]>
Date: Mon, 9 Jan 2017 15:18:01 +0800
Subject: [PATCH 1/6] drm/amdgpu: fix bug return invaild value to sysfs.

Change-Id Ib9e1f60ad816eaaedd247c224684686d764a72fc
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c +1 -1
index 8438642..02aa7ce 100644
@@ -162,7 +162,7 @@ static ssize_t amdgpu_set_dpm_forced_performance_level(struct device *dev,
 	}
 
 	if (current_level == level)
-		return 0;
+		return count;
 
 	if (level == AMD_DPM_FORCED_LEVEL_PROFILING)
 		amdgpu_set_clockgating_state(adev, AMD_IP_BLOCK_TYPE_GFX,
Signature · 1 line
1.9.1

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

A message that is not in the archive (sent off-list or not yet received): CY4PR12MB1687BA955CA0340AB65272F8FB640-rpdhrqHFk06Y0SjTqZDccQdYzm3356FpvxpqHgZTriW3zl9H0oFU5g@public.gmane.org

#16 lore raw

Re: [PATCH 4/4] drm/amd/powerplay: add profiling mode in dpm level

Quoted 7 lines · Rex

Thanks for quick response.

Quoted 1 line
Quoted 1 line
Quoted 1 line

The patch doesn't apply directly to drm-next-4.10-wip, here's what I tested -

Sorry, it is because code base has been changed in my local.

Please review the attached patch.

The patch applies OK and produces an identical diff to the one I tested.

Quoted 34 lines

Best Regards
Rex

-----Original Message-----
From: Andy Furniss [mailto:[email protected]]
Sent: Monday, January 09, 2017 6:29 PM
To: Zhu, Rex; Alex Deucher
Cc: amd-gfx list
Subject: Re: [PATCH 4/4] drm/amd/powerplay: add profiling mode in dpm level

Hi, that change does fix it for me.

The patch doesn't apply directly to drm-next-4.10-wip, here's what I tested -

drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c +1 -1
index 0345fbb..ac2e5f4 100644
@@ -162,7 +162,7 @@ static ssize_t
 amdgpu_set_dpm_forced_performance_level(struct device *dev,
          }
 
          if (current_level == level)
-               return 0;
+               return count;
 
          if (level == AMD_DPM_FORCED_LEVEL_PROFILING)

amdgpu_set_clockgating_state(adev, AMD_IP_BLOCK_TYPE_GFX,

Quoted 42 lines
Quoted 40 lines · Rex

Thanks Andy,

The attached patch can fix this bug.
Please review.

Best Regards
Rex

-----Original Message-----
From: Andy Furniss [mailto:[email protected]]
Sent: Monday, January 09, 2017 4:18 AM
To: Alex Deucher; Zhu, Rex
Cc: amd-gfx list
Subject: Re: [PATCH 4/4] drm/amd/powerplay: add profiling mode in dpm level

Quoted 9 lines · Alex Deucher
Quoted 1 line · Rex Zhu

Change-Id: I4a46440882cd94fe5e77e3f351aaccc218a2ece5

Patches 1-3:

patch 4:
Please add a better patch description and explain what profiling mode is good for, etc.

This on drm-next-4.10-wip regresses setting profile a bit on R9285.

It works eg. if in auto then doing

echo high > /sys/class/drm/card0/device/power_dpm_force_performance_level

is OK and echo auto > ... is also OK.

The issue if I am in auto and echo auto > .... then I don't get my prompt back.

echo high from elsewhere will make it return - but it doesn't set high.

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

Reviewed-by Alex Deucher
#17 lore raw

RE: [PATCH 4/4] drm/amd/powerplay: add profiling mode in dpm level

In reply to a message not in the archive
Quoted 9 lines

-----Original Message-----
From: amd-gfx [mailto:[email protected]] On Behalf Of Zhu, Rex
Sent: Monday, January 09, 2017 2:46 AM
To: Andy Furniss; Alex Deucher
Cc: amd-gfx list
Subject: RE: [PATCH 4/4] drm/amd/powerplay: add profiling mode in dpm level

Quoted 4 lines

Thanks Andy,

The attached patch can fix this bug. Please review.

Quoted 27 lines

Best Regards
Rex

-----Original Message-----
From: Andy Furniss [mailto:[email protected]]
Sent: Monday, January 09, 2017 4:18 AM
To: Alex Deucher; Zhu, Rex
Cc: amd-gfx list
Subject: Re: [PATCH 4/4] drm/amd/powerplay: add profiling mode in dpm level

Quoted 9 lines · Alex Deucher
Quoted 1 line · Rex Zhu

Change-Id: I4a46440882cd94fe5e77e3f351aaccc218a2ece5

Patches 1-3:

patch 4:
Please add a better patch description and explain what profiling mode is good for, etc.

This on drm-next-4.10-wip regresses setting profile a bit on R9285.

It works eg. if in auto then doing

Quoted 8 lines

echo high > /sys/class/drm/card0/device/power_dpm_force_performance_level

is OK and echo auto > ... is also OK.

The issue if I am in auto and echo auto > .... then I don't get my prompt back.

echo high from elsewhere will make it return - but it doesn't set high.

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

Reviewed-by
#18 lore raw

Re: [PATCH 4/4] drm/amd/powerplay: add profiling mode in dpm level

In reply to a message not in the archive

On Fri, Dec 23, 2016 at 04:45:52PM +0800, Rex Zhu wrote:

You need add signed-by-off and descriptions here.

Quoted 22 lines

Change-Id: I4a46440882cd94fe5e77e3f351aaccc218a2ece5

---
 drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c           | 17 +++++++++++++++++
 drivers/gpu/drm/amd/amdgpu/ci_dpm.c              |  4 ++--
 drivers/gpu/drm/amd/include/amd_shared.h         |  1 +
 drivers/gpu/drm/amd/powerplay/hwmgr/cz_hwmgr.c   |  3 ++-
 drivers/gpu/drm/amd/powerplay/hwmgr/smu7_hwmgr.c |  3 ++-
 5 files changed, 24 insertions(+), 4 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c +1 -0
index 2bfede8..8438642 100644
@@ -124,6 +124,7 @@ static ssize_t amdgpu_get_dpm_forced_performance_level(struct device *dev,
 			(level & AMD_DPM_FORCED_LEVEL_LOW) ? "low" :
 			(level & AMD_DPM_FORCED_LEVEL_HIGH) ? "high" :
 			(level & AMD_DPM_FORCED_LEVEL_MANUAL) ? "manual" :
+			(level & AMD_DPM_FORCED_LEVEL_PROFILING) ? "profiling" :
 			"unknown"));
 
 

drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c static ssize_t amdgpu_set_dpm_forced_performance_level(struct device *dev, · line 158

Quoted 5 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c +2 -0
@@ -150,11 +154,24 @@ static ssize_t amdgpu_set_dpm_forced_performance_level(struct device *dev,
 		level = AMD_DPM_FORCED_LEVEL_AUTO;
 	} else if (strncmp("manual", buf, strlen("manual")) == 0) {
 		level = AMD_DPM_FORCED_LEVEL_MANUAL;
+	} else if (strncmp("profile", buf, strlen("profile")) == 0) {
+		level = AMD_DPM_FORCED_LEVEL_PROFILING;

We would better algin get/set (input/output) word with profiling or profile. With that fixed, patch is

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx