Skip to contentSkip to conversation

drm/amdgpu: check min clock set by DAL before set ps.

PATCH In review Rex Zhu 2 participants 10 messages Oct 14, 2016 3 messages not in the archive

Subsystems (2)
lore
Share & tools
lore

Rex Zhu

author
#0 lore raw

PATCH 1/7 drm/amdgpu: check min clock set by DAL before set ps.

Change-Id: Id71b9a3329a8a143a189b275926b0a2054bf0bb8

---
 drivers/gpu/drm/amd/amdgpu/ci_dpm.c | 6 ++++++
 1 file changed, 6 insertions(+)
drivers/gpu/drm/amd/amdgpu/ci_dpm.c +6 -0
index 1d8c375..fd2fe85 100644
@@ -960,6 +960,12 @@ static void ci_apply_state_adjust_rules(struct amdgpu_device *adev,
 		sclk = ps->performance_levels[0].sclk;
 	}
 
+	if (adev->pm.pm_display_cfg.min_core_set_clock > sclk)
+		sclk = adev->pm.pm_display_cfg.min_core_set_clock;
+
+	if (adev->pm.pm_display_cfg.min_mem_set_clock > mclk)
+		mclk = adev->pm.pm_display_cfg.min_mem_set_clock;
+
 	if (rps->vce_active) {
 		if (sclk < adev->pm.dpm.vce_states[adev->pm.dpm.vce_level].sclk)
 			sclk = adev->pm.dpm.vce_states[adev->pm.dpm.vce_level].sclk;
Signature · 6 lines
1.9.1

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

PATCH 2/7 drm/amdgpu: add new callback to check power state info

In reply to a message not in the archive
Change-Id I3dcfda30f93f3a7cf94988097f34b7e1a8298968
---
 drivers/gpu/drm/amd/amdgpu/amdgpu.h | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/amdgpu.h +5 -1
index 4cfd55c..366418e 100644
@@ -1235,6 +1235,10 @@ struct amdgpu_dpm_funcs {
 	int (*set_sclk_od)(struct amdgpu_device *adev, uint32_t value);
 	int (*get_mclk_od)(struct amdgpu_device *adev);
 	int (*set_mclk_od)(struct amdgpu_device *adev, uint32_t value);
+	int (*check_state_equal)(struct amdgpu_device *adev,
+				struct amdgpu_ps *cps,
+				struct amdgpu_ps *rps,
+				bool *equal);
 };
 
 struct amdgpu_dpm {
@@ -1990,7 +1994,7 @@ amdgpu_get_sdma_instance(struct amdgpu_ring *ring)
 #define amdgpu_dpm_enable_bapm(adev, e) (adev)->pm.funcs->enable_bapm((adev), (e))
 #define amdgpu_gfx_get_gpu_clock_counter(adev) (adev)->gfx.funcs->get_gpu_clock_counter((adev))
 #define amdgpu_gfx_select_se_sh(adev, se, sh, instance) (adev)->gfx.funcs->select_se_sh((adev), (se), (sh), (instance))
-
+#define amgdpu_dpm_check_state_equal(adev, cps, rps, equal) (adev)->pm.funcs->check_state_equal((adev), (cps),(rps),(equal))
 #define amdgpu_dpm_read_sensor(adev, idx, value) \
 	((adev)->pp_enabled ? \
 		(adev)->powerplay.pp_funcs->read_sensor(adev->powerplay.pp_handle, (idx), (value)) : \
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/7 drm/amdgpu: add an implement for check_power_state equal for CI

In reply to a message not in the archive
Change-Id Ib774eeff0f3f19a5f593668dd3329f5cfd111eaa
---
 drivers/gpu/drm/amd/amdgpu/ci_dpm.c | 51 +++++++++++++++++++++++++++++++++++++
 1 file changed, 51 insertions(+)
drivers/gpu/drm/amd/amdgpu/ci_dpm.c +51 -0
index fd2fe85..a7954eb 100644
@@ -6100,6 +6100,56 @@ static void ci_dpm_print_power_state(struct amdgpu_device *adev,
 	amdgpu_dpm_print_ps_status(adev, rps);
 }
 
+static inline bool ci_are_power_levels_equal(const struct ci_pl *ci_cpl1,
+						const struct ci_pl *ci_cpl2)
+{
+	return ((ci_cpl1->mclk == ci_cpl2->mclk) &&
+		  (ci_cpl1->sclk == ci_cpl2->sclk) &&
+		  (ci_cpl1->pcie_gen == ci_cpl2->pcie_gen) &&
+		  (ci_cpl1->pcie_lane == ci_cpl2->pcie_lane));
+}
+
+static int ci_check_state_equal(struct amdgpu_device *adev,
+				struct amdgpu_ps *cps,
+				struct amdgpu_ps *rps,
+				bool *equal)
+{
+	struct ci_ps *ci_cps;
+	struct ci_ps *ci_rps;
+	int i;
+
+	if (adev == NULL || cps == NULL || rps == NULL || equal == NULL)
+		return -EINVAL;
+
+	ci_cps = ci_get_ps(cps);
+	ci_rps = ci_get_ps(rps);
+
+	if (ci_cps == NULL) {
+		*equal = false;
+		return 0;
+	}
+
+	if (ci_cps->performance_level_count != ci_rps->performance_level_count) {
+
+		*equal = false;
+		return 0;
+	}
+
+	for (i = 0; i < ci_cps->performance_level_count; i++) {
+		if (!ci_are_power_levels_equal(&(ci_cps->performance_levels[i]),
+					&(ci_rps->performance_levels[i]))) {
+			*equal = false;
+			return 0;
+		}
+	}
+
+	/* If all performance levels are the same try to use the UVD clocks to break the tie.*/
+	*equal = ((cps->vclk == rps->vclk) && (cps->dclk == rps->dclk));
+	*equal &= ((cps->evclk == rps->evclk) && (cps->ecclk == rps->ecclk));
+
+	return 0;
+}
+
 static u32 ci_dpm_get_sclk(struct amdgpu_device *adev, bool low)
 {
 	struct ci_power_info *pi = ci_get_pi(adev);
@@ -6650,6 +6700,7 @@ static const struct amdgpu_dpm_funcs ci_dpm_funcs = {
 	.set_sclk_od = ci_dpm_set_sclk_od,
 	.get_mclk_od = ci_dpm_get_mclk_od,
 	.set_mclk_od = ci_dpm_set_mclk_od,
+	.check_state_equal = ci_check_state_equal,
 };
 
 static void ci_dpm_set_dpm_funcs(struct amdgpu_device *adev)
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/7 drm/amdgpu: add an implement for check_power_state equal for Cz.

In reply to a message not in the archive
Change-Id I00186c6d316c22fdf065fd8525e927dd2ee79685
---
 drivers/gpu/drm/amd/amdgpu/cz_dpm.c | 13 +++++++++++++
 1 file changed, 13 insertions(+)
drivers/gpu/drm/amd/amdgpu/cz_dpm.c +13 -0
index f80a083..1ae2b95 100644
@@ -2255,6 +2255,18 @@ static void cz_dpm_powergate_vce(struct amdgpu_device *adev, bool gate)
 	}
 }
 
+static int cz_check_state_equal(struct amdgpu_device *adev,
+				struct amdgpu_ps *cps,
+				struct amdgpu_ps *rps,
+				bool *equal)
+{
+	if (equal == NULL)
+		return -EINVAL;
+
+	*equal = false;
+	return 0;
+}
+
 const struct amd_ip_funcs cz_dpm_ip_funcs = {
 	.name = "cz_dpm",
 	.early_init = cz_dpm_early_init,
@@ -2287,6 +2299,7 @@ static const struct amdgpu_dpm_funcs cz_dpm_funcs = {
 	.vblank_too_short = NULL,
 	.powergate_uvd = cz_dpm_powergate_uvd,
 	.powergate_vce = cz_dpm_powergate_vce,
+	.check_state_equal = cz_check_state_equal,
 };
 
 static void cz_dpm_set_funcs(struct amdgpu_device *adev)
Signature · 6 lines
1.9.1

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

PATCH 5/7 drm/amdgpu: add an implement for check_power_state equal for Si.

In reply to a message not in the archive
Change-Id I6d214800a2bcf4781656905afc1643bca0dd07d5
---
 drivers/gpu/drm/amd/amdgpu/si_dpm.c | 52 +++++++++++++++++++++++++++++++++++++
 1 file changed, 52 insertions(+)
drivers/gpu/drm/amd/amdgpu/si_dpm.c +52 -0
index 3de7bca..492f64f 100644
@@ -7957,6 +7957,57 @@ static int si_dpm_early_init(void *handle)
 	return 0;
 }
 
+static inline bool si_are_power_levels_equal(const struct rv7xx_pl *pl *si_cpl1,
+						const struct rv7xx_pl *pl *si_cpl2)
+{
+	return ((si_cpl1->mclk == si_cpl2->mclk) &&
+		  (si_cpl1->sclk == si_cpl2->sclk) &&
+		  (si_cpl1->pcie_gen == si_cpl2->pcie_gen) &&
+		  (si_cpl1->vddc == si_cpl2->vddc) &&
+		  (si_cpl1->vddci == si_cpl2->vddci));
+}
+
+static int ci_check_state_equal(struct amdgpu_device *adev,
+				struct amdgpu_ps *cps,
+				struct amdgpu_ps *rps,
+				bool *equal)
+{
+	struct si_ps *si_cps;
+	struct si_ps *si_rps;
+	int i;
+
+	if (adev == NULL || cps == NULL || rps == NULL || equal == NULL)
+		return -EINVAL;
+
+	si_cps = si_get_ps(cps);
+	si_rps = si_get_ps(rps);
+
+	if (si_cps == NULL) {
+		printk("si_cps is NULL\n");
+		*equal = false;
+		return 0;
+	}
+
+	if (si_cps->performance_level_count != si_rps->performance_level_count) {
+		*equal = false;
+		return 0;
+	}
+
+	for (i = 0; i < si_cps->performance_level_count; i++) {
+		if (!si_are_power_levels_equal(&(si_cps->performance_levels[i]),
+					&(si_rps->performance_levels[i]))) {
+			*equal = false;
+			return 0;
+		}
+	}
+
+	/* If all performance levels are the same try to use the UVD clocks to break the tie.*/
+	*equal = ((cps->vclk == rps->vclk) && (cps->dclk == rps->dclk));
+	*equal &= ((cps->evclk == rps->evclk) && (cps->ecclk == rps->ecclk));
+
+	return 0;
+}
+
 
 const struct amd_ip_funcs si_dpm_ip_funcs = {
 	.name = "si_dpm",
@@ -7991,6 +8042,7 @@ static const struct amdgpu_dpm_funcs si_dpm_funcs = {
 	.get_fan_control_mode = &si_dpm_get_fan_control_mode,
 	.set_fan_speed_percent = &si_dpm_set_fan_speed_percent,
 	.get_fan_speed_percent = &si_dpm_get_fan_speed_percent,
+	.check_state_equal = &si_check_state_equal,
 };
 
 static void si_dpm_set_dpm_funcs(struct amdgpu_device *adev)
Signature · 6 lines
1.9.1

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

PATCH 6/7 drm/amdgpu: update current ps/requeset ps in adev with real ps.

In reply to a message not in the archive
Change-Id Iaff11c514927fc596cdf9677b2ebde92fcb2d31e
---
 drivers/gpu/drm/amd/amdgpu/ci_dpm.c | 2 ++
 drivers/gpu/drm/amd/amdgpu/cz_dpm.c | 6 ++++--
 drivers/gpu/drm/amd/amdgpu/si_dpm.c | 2 ++
 3 files changed, 8 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/amdgpu/ci_dpm.c +2 -0
index a7954eb..eb65afd 100644
@@ -5225,6 +5225,7 @@ static void ci_update_current_ps(struct amdgpu_device *adev,
 	pi->current_rps = *rps;
 	pi->current_ps = *new_ps;
 	pi->current_rps.ps_priv = &pi->current_ps;
+	adev->pm.dpm.current_ps = &pi->current_rps;
 }
 
 static void ci_update_requested_ps(struct amdgpu_device *adev,
@@ -5236,6 +5237,7 @@ static void ci_update_requested_ps(struct amdgpu_device *adev,
 	pi->requested_rps = *rps;
 	pi->requested_ps = *new_ps;
 	pi->requested_rps.ps_priv = &pi->requested_ps;
+	adev->pm.dpm.requested_ps = &pi->requested_rps;
 }
 
 static int ci_dpm_pre_set_power_state(struct amdgpu_device *adev)
drivers/gpu/drm/amd/amdgpu/cz_dpm.c +4 -2
index 1ae2b95..2e1fbf2 100644
@@ -1250,7 +1250,8 @@ static void cz_update_current_ps(struct amdgpu_device *adev,
 
 	pi->current_ps = *ps;
 	pi->current_rps = *rps;
-	pi->current_rps.ps_priv = ps;
+	pi->current_rps.ps_priv = &pi->current_ps;
+	adev->pm.dpm.current_ps = &pi->current_rps;
 
 }
 
@@ -1262,7 +1263,8 @@ static void cz_update_requested_ps(struct amdgpu_device *adev,
 
 	pi->requested_ps = *ps;
 	pi->requested_rps = *rps;
-	pi->requested_rps.ps_priv = ps;
+	pi->requested_rps.ps_priv = &pi->requested_ps;
+	adev->pm.dpm.requested_ps = &pi->requested_rps;
 
 }
 
drivers/gpu/drm/amd/amdgpu/si_dpm.c +2 -0
index 492f64f..f4d3e98 100644
@@ -3171,6 +3171,7 @@ static void ni_update_current_ps(struct amdgpu_device *adev,
 	eg_pi->current_rps = *rps;
 	ni_pi->current_ps = *new_ps;
 	eg_pi->current_rps.ps_priv = &ni_pi->current_ps;
+	adev->pm.dpm.current_ps = &eg_pi->current_rps;
 }
 
 static void ni_update_requested_ps(struct amdgpu_device *adev,
@@ -3183,6 +3184,7 @@ static void ni_update_requested_ps(struct amdgpu_device *adev,
 	eg_pi->requested_rps = *rps;
 	ni_pi->requested_ps = *new_ps;
 	eg_pi->requested_rps.ps_priv = &ni_pi->requested_ps;
+	adev->pm.dpm.requested_ps = &eg_pi->requested_rps;
 }
 
 static void ni_set_uvd_clock_before_set_eng_clock(struct amdgpu_device *adev,
Signature · 6 lines
1.9.1

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

PATCH 7/7 drm/amdgpu: refine set power state logic for dpm.

In reply to a message not in the archive
Change-Id I74e719454e1c048bb3d31f4ccccdc3e3f39bad0e
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c | 81 +++++++---------------------------
 1 file changed, 16 insertions(+), 65 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c +16 -65
index 5307107..193e3a9 100644
@@ -986,10 +986,10 @@ restart_search:
 
 static void amdgpu_dpm_change_power_state_locked(struct amdgpu_device *adev)
 {
-	int i;
 	struct amdgpu_ps *ps;
 	enum amd_pm_state_type dpm_state;
 	int ret;
+	bool equal;
 
 	/* if dpm init failed */
 	if (!adev->pm.dpm_enabled)
@@ -1009,80 +1009,31 @@ static void amdgpu_dpm_change_power_state_locked(struct amdgpu_device *adev)
 	else
 		return;
 
-	/* no need to reprogram if nothing changed unless we are on BTC+ */
-	if (adev->pm.dpm.current_ps == adev->pm.dpm.requested_ps) {
-		/* vce just modifies an existing state so force a change */
-		if (ps->vce_active != adev->pm.dpm.vce_active)
-			goto force;
-		if (adev->flags & AMD_IS_APU) {
-			/* for APUs if the num crtcs changed but state is the same,
-			 * all we need to do is update the display configuration.
-			 */
-			if (adev->pm.dpm.new_active_crtcs != adev->pm.dpm.current_active_crtcs) {
-				/* update display watermarks based on new power state */
-				amdgpu_display_bandwidth_update(adev);
-				/* update displays */
-				amdgpu_dpm_display_configuration_changed(adev);
-				adev->pm.dpm.current_active_crtcs = adev->pm.dpm.new_active_crtcs;
-				adev->pm.dpm.current_active_crtc_count = adev->pm.dpm.new_active_crtc_count;
-			}
-			return;
-		} else {
-			/* for BTC+ if the num crtcs hasn't changed and state is the same,
-			 * nothing to do, if the num crtcs is > 1 and state is the same,
-			 * update display configuration.
-			 */
-			if (adev->pm.dpm.new_active_crtcs ==
-			    adev->pm.dpm.current_active_crtcs) {
-				return;
-			} else if ((adev->pm.dpm.current_active_crtc_count > 1) &&
-				   (adev->pm.dpm.new_active_crtc_count > 1)) {
-				/* update display watermarks based on new power state */
-				amdgpu_display_bandwidth_update(adev);
-				/* update displays */
-				amdgpu_dpm_display_configuration_changed(adev);
-				adev->pm.dpm.current_active_crtcs = adev->pm.dpm.new_active_crtcs;
-				adev->pm.dpm.current_active_crtc_count = adev->pm.dpm.new_active_crtc_count;
-				return;
-			}
-		}
-	}
-
-force:
 	if (amdgpu_dpm == 1) {
 		printk("switching from power state:\n");
 		amdgpu_dpm_print_power_state(adev, adev->pm.dpm.current_ps);
 		printk("switching to power state:\n");
 		amdgpu_dpm_print_power_state(adev, adev->pm.dpm.requested_ps);
 	}
+
 	/* update whether vce is active */
 	ps->vce_active = adev->pm.dpm.vce_active;
 
+	amdgpu_dpm_display_configuration_changed(adev);
+
 	ret = amdgpu_dpm_pre_set_power_state(adev);
 	if (ret)
 		return;
 
-	/* update display watermarks based on new power state */
-	amdgpu_display_bandwidth_update(adev);
+	if ((0 != amgdpu_dpm_check_state_equal(adev, adev->pm.dpm.current_ps, adev->pm.dpm.requested_ps, &equal)))
+		equal = false;
 
-	/* wait for the rings to drain */
-	for (i = 0; i < AMDGPU_MAX_RINGS; i++) {
-		struct amdgpu_ring *ring = adev->rings[i];
-		if (ring && ring->ready)
-			amdgpu_fence_wait_empty(ring);
-	}
+	if (equal)
+		return;
 
-	/* program the new power state */
 	amdgpu_dpm_set_power_state(adev);
-
-	/* update current power state */
-	adev->pm.dpm.current_ps = adev->pm.dpm.requested_ps;
-
 	amdgpu_dpm_post_set_power_state(adev);
 
-	/* update displays */
-	amdgpu_dpm_display_configuration_changed(adev);
-
 	adev->pm.dpm.current_active_crtcs = adev->pm.dpm.new_active_crtcs;
 	adev->pm.dpm.current_active_crtc_count = adev->pm.dpm.new_active_crtc_count;
 
@@ -1275,20 +1226,20 @@ void amdgpu_pm_compute_clocks(struct amdgpu_device *adev)
 	struct drm_device *ddev = adev->ddev;
 	struct drm_crtc *crtc;
 	struct amdgpu_crtc *amdgpu_crtc;
+	int i = 0;
 
 	if (!adev->pm.dpm_enabled)
 		return;
 
-	if (adev->pp_enabled) {
-		int i = 0;
+	amdgpu_display_bandwidth_update(adev);
 
-		amdgpu_display_bandwidth_update(adev);
-		for (i = 0; i < AMDGPU_MAX_RINGS; i++) {
-			struct amdgpu_ring *ring = adev->rings[i];
-			if (ring && ring->ready)
-				amdgpu_fence_wait_empty(ring);
-		}
+	for (i = 0; i < AMDGPU_MAX_RINGS; i++) {
+		struct amdgpu_ring *ring = adev->rings[i];
+		if (ring && ring->ready)
+			amdgpu_fence_wait_empty(ring);
+	}
 
+	if (adev->pp_enabled) {
 		amdgpu_dpm_dispatch_task(adev, AMD_PP_EVENT_DISPLAY_CONFIG_CHANGE, NULL, NULL);
 	} else {
 		mutex_lock(&adev->pm.mutex);
Signature · 6 lines
1.9.1

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
Reviewed-by Alex Deucher
#8 lore raw
In reply to a message not in the archive
Quoted 9 lines

-----Original Message-----
From: amd-gfx [mailto:[email protected]] On Behalf Of Rex Zhu
Sent: Friday, October 14, 2016 8:07 AM
To: [email protected]
Cc: Zhu, Rex
Subject: [PATCH 1/7] drm/amdgpu: check min clock set by DAL before set ps.

Change-Id: Id71b9a3329a8a143a189b275926b0a2054bf0bb8

Series is:

For CI, I wonder if it would be better to add support for it to the powerplay smu7 module since it's pretty similar to the other smu7 dGPUs.

Alex

Quoted 24 lines
---
 drivers/gpu/drm/amd/amdgpu/ci_dpm.c | 6 ++++++
 1 file changed, 6 insertions(+)
drivers/gpu/drm/amd/amdgpu/ci_dpm.c +6 -0
index 1d8c375..fd2fe85 100644
@@ -960,6 +960,12 @@ static void ci_apply_state_adjust_rules(struct
 amdgpu_device *adev,
 		sclk = ps->performance_levels[0].sclk;
 	}
 
+	if (adev->pm.pm_display_cfg.min_core_set_clock > sclk)
+		sclk = adev->pm.pm_display_cfg.min_core_set_clock;
+
+	if (adev->pm.pm_display_cfg.min_mem_set_clock > mclk)
+		mclk = adev->pm.pm_display_cfg.min_mem_set_clock;
+
 	if (rps->vce_active) {
 		if (sclk < adev->pm.dpm.vce_states[adev-
Quoted 1 line

pm.dpm.vce_level].sclk)

sclk = adev->pm.dpm.vce_states[adev-

Quoted 8 lines
Quoted 1 line

pm.dpm.vce_level].sclk;

--
1.9.1

_______________________________________________
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

author Reviewed-by Alex Deucher
#10 lore raw
In reply to a message not in the archive

Ok. i will add CI support in powerplay next week.

Best Regards

Rex

________________________________
From: Deucher, Alexander
Sent: Friday, October 14, 2016 9:42:42 PM
To: Zhu, Rex; [email protected]
Cc: Zhu, Rex
Subject: RE: [PATCH 1/7] drm/amdgpu: check min clock set by DAL before set ps.

Quoted 9 lines

-----Original Message-----
From: amd-gfx [mailto:amd-gfx-bounces-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org] On Behalf Of Rex Zhu
Sent: Friday, October 14, 2016 8:07 AM
To: [email protected]
Cc: Zhu, Rex
Subject: [PATCH 1/7] drm/amdgpu: check min clock set by DAL before set ps.

Change-Id: Id71b9a3329a8a143a189b275926b0a2054bf0bb8

Series is:

For CI, I wonder if it would be better to add support for it to the powerplay smu7 module since it's pretty similar to the other smu7 dGPUs.

Alex

Quoted 24 lines
---
 drivers/gpu/drm/amd/amdgpu/ci_dpm.c | 6 ++++++
 1 file changed, 6 insertions(+)
drivers/gpu/drm/amd/amdgpu/ci_dpm.c +6 -0
index 1d8c375..fd2fe85 100644
@@ -960,6 +960,12 @@ static void ci_apply_state_adjust_rules(struct
 amdgpu_device *adev,
               sclk = ps->performance_levels[0].sclk;
       }
 
+     if (adev->pm.pm_display_cfg.min_core_set_clock > sclk)
+             sclk = adev->pm.pm_display_cfg.min_core_set_clock;
+
+     if (adev->pm.pm_display_cfg.min_mem_set_clock > mclk)
+             mclk = adev->pm.pm_display_cfg.min_mem_set_clock;
+
       if (rps->vce_active) {
               if (sclk < adev->pm.dpm.vce_states[adev-
Quoted 1 line

pm.dpm.vce_level].sclk)

                       sclk = adev->pm.dpm.vce_states[adev-
Quoted 8 lines
Quoted 1 line

pm.dpm.vce_level].sclk;

--
1.9.1

_______________________________________________
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

Reviewed-by Alex Deucher
#12 lore raw
In reply to a message not in the archive

Up to you; whichever you think is easier.

Alex

From: Zhu, Rex
Sent: Friday, October 14, 2016 11:27 AM
To: Deucher, Alexander; [email protected]
Subject: Re: [PATCH 1/7] drm/amdgpu: check min clock set by DAL before set ps.

Ok. i will add CI support in powerplay next week.

Best Regards

Rex

________________________________
From: Deucher, Alexander
Sent: Friday, October 14, 2016 9:42:42 PM
To: Zhu, Rex; [email protected]<mailto:[email protected]>
Cc: Zhu, Rex
Subject: RE: [PATCH 1/7] drm/amdgpu: check min clock set by DAL before set ps.

Quoted 9 lines

-----Original Message-----
From: amd-gfx [mailto:amd-gfx-bounces-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org] On Behalf
Of Rex Zhu
Sent: Friday, October 14, 2016 8:07 AM
To: [email protected]<mailto:[email protected]>
Cc: Zhu, Rex
Subject: [PATCH 1/7] drm/amdgpu: check min clock set by DAL before set ps.

Change-Id: Id71b9a3329a8a143a189b275926b0a2054bf0bb8

Series is:

For CI, I wonder if it would be better to add support for it to the powerplay smu7 module since it's pretty similar to the other smu7 dGPUs.

Alex

Quoted 24 lines
---
 drivers/gpu/drm/amd/amdgpu/ci_dpm.c | 6 ++++++
 1 file changed, 6 insertions(+)
drivers/gpu/drm/amd/amdgpu/ci_dpm.c +6 -0
index 1d8c375..fd2fe85 100644
@@ -960,6 +960,12 @@ static void ci_apply_state_adjust_rules(struct
 amdgpu_device *adev,
               sclk = ps->performance_levels[0].sclk;
       }
 
+     if (adev->pm.pm_display_cfg.min_core_set_clock > sclk)
+             sclk = adev->pm.pm_display_cfg.min_core_set_clock;
+
+     if (adev->pm.pm_display_cfg.min_mem_set_clock > mclk)
+             mclk = adev->pm.pm_display_cfg.min_mem_set_clock;
+
       if (rps->vce_active) {
               if (sclk < adev->pm.dpm.vce_states[adev-
Quoted 1 line

pm.dpm.vce_level].sclk)

                       sclk = adev->pm.dpm.vce_states[adev-
Quoted 8 lines
Quoted 1 line

pm.dpm.vce_level].sclk;

--
1.9.1

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

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