All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/4] drm/radeon/dpm/rs780: use drm_mode_vrefresh()
@ 2013-09-13 15:08 Alex Deucher
  2013-09-13 15:08 ` [PATCH 2/4] drm/radeon/dpm/rs780: add some sanity checking to sclk scaling Alex Deucher
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Alex Deucher @ 2013-09-13 15:08 UTC (permalink / raw)
  To: dri-devel; +Cc: Alex Deucher

Rather than open coding it.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
---
 drivers/gpu/drm/radeon/rs780_dpm.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/gpu/drm/radeon/rs780_dpm.c b/drivers/gpu/drm/radeon/rs780_dpm.c
index 828a776..afb7584 100644
--- a/drivers/gpu/drm/radeon/rs780_dpm.c
+++ b/drivers/gpu/drm/radeon/rs780_dpm.c
@@ -62,9 +62,7 @@ static void rs780_get_pm_mode_parameters(struct radeon_device *rdev)
 			radeon_crtc = to_radeon_crtc(crtc);
 			pi->crtc_id = radeon_crtc->crtc_id;
 			if (crtc->mode.htotal && crtc->mode.vtotal)
-				pi->refresh_rate =
-					(crtc->mode.clock * 1000) /
-					(crtc->mode.htotal * crtc->mode.vtotal);
+				pi->refresh_rate = drm_mode_vrefresh(&crtc->mode);
 			break;
 		}
 	}
-- 
1.8.3.1

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH 2/4] drm/radeon/dpm/rs780: add some sanity checking to sclk scaling
  2013-09-13 15:08 [PATCH 1/4] drm/radeon/dpm/rs780: use drm_mode_vrefresh() Alex Deucher
@ 2013-09-13 15:08 ` Alex Deucher
  2013-09-13 15:08 ` [PATCH 3/4] drm/radeon/dpm/rs780: don't enable sclk scaling if not required Alex Deucher
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: Alex Deucher @ 2013-09-13 15:08 UTC (permalink / raw)
  To: dri-devel; +Cc: Alex Deucher

Since the clock scaling is based on fb divider adjustments,
make sure the other pll parameters are the same.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
---
 drivers/gpu/drm/radeon/rs780_dpm.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/drivers/gpu/drm/radeon/rs780_dpm.c b/drivers/gpu/drm/radeon/rs780_dpm.c
index afb7584..31487ce 100644
--- a/drivers/gpu/drm/radeon/rs780_dpm.c
+++ b/drivers/gpu/drm/radeon/rs780_dpm.c
@@ -449,6 +449,12 @@ static int rs780_set_engine_clock_scaling(struct radeon_device *rdev,
 	if (ret)
 		return ret;
 
+	if ((min_dividers.ref_div != max_dividers.ref_div) ||
+	    (min_dividers.post_div != max_dividers.post_div) ||
+	    (max_dividers.ref_div != current_max_dividers.ref_div) ||
+	    (max_dividers.post_div != current_max_dividers.post_div))
+		return -EINVAL;
+
 	rs780_force_fbdiv(rdev, max_dividers.fb_div);
 
 	if (max_dividers.fb_div > min_dividers.fb_div) {
-- 
1.8.3.1

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH 3/4] drm/radeon/dpm/rs780: don't enable sclk scaling if not required
  2013-09-13 15:08 [PATCH 1/4] drm/radeon/dpm/rs780: use drm_mode_vrefresh() Alex Deucher
  2013-09-13 15:08 ` [PATCH 2/4] drm/radeon/dpm/rs780: add some sanity checking to sclk scaling Alex Deucher
@ 2013-09-13 15:08 ` Alex Deucher
  2013-09-13 15:08 ` [PATCH 4/4] drm/radeon/dpm/rs780: fix force_performance state for same sclks Alex Deucher
  2013-09-13 15:37 ` [PATCH 1/4] drm/radeon/dpm/rs780: use drm_mode_vrefresh() Christian König
  3 siblings, 0 replies; 5+ messages in thread
From: Alex Deucher @ 2013-09-13 15:08 UTC (permalink / raw)
  To: dri-devel; +Cc: Alex Deucher, stable

If the low and high sclks are the same, there is no need to
enable sclk scaling.  This causes display stability issues on
certain boards.

Fixes:
https://bugzilla.kernel.org/show_bug.cgi?id=60857

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Cc: stable@vger.kernel.org
---
 drivers/gpu/drm/radeon/rs780_dpm.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/gpu/drm/radeon/rs780_dpm.c b/drivers/gpu/drm/radeon/rs780_dpm.c
index 31487ce..eb336bf 100644
--- a/drivers/gpu/drm/radeon/rs780_dpm.c
+++ b/drivers/gpu/drm/radeon/rs780_dpm.c
@@ -499,6 +499,9 @@ static void rs780_activate_engine_clk_scaling(struct radeon_device *rdev,
 	    (new_state->sclk_low == old_state->sclk_low))
 		return;
 
+	if (new_state->sclk_high == new_state->sclk_low)
+		return;
+
 	rs780_clk_scaling_enable(rdev, true);
 }
 
-- 
1.8.3.1

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH 4/4] drm/radeon/dpm/rs780: fix force_performance state for same sclks
  2013-09-13 15:08 [PATCH 1/4] drm/radeon/dpm/rs780: use drm_mode_vrefresh() Alex Deucher
  2013-09-13 15:08 ` [PATCH 2/4] drm/radeon/dpm/rs780: add some sanity checking to sclk scaling Alex Deucher
  2013-09-13 15:08 ` [PATCH 3/4] drm/radeon/dpm/rs780: don't enable sclk scaling if not required Alex Deucher
@ 2013-09-13 15:08 ` Alex Deucher
  2013-09-13 15:37 ` [PATCH 1/4] drm/radeon/dpm/rs780: use drm_mode_vrefresh() Christian König
  3 siblings, 0 replies; 5+ messages in thread
From: Alex Deucher @ 2013-09-13 15:08 UTC (permalink / raw)
  To: dri-devel; +Cc: Alex Deucher

If the low and high sclks within a power state are the same,
there no need to enable sclk scaling.  Enabling sclk scaling
can cause display stability issues on some boards.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
---
 drivers/gpu/drm/radeon/rs780_dpm.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/radeon/rs780_dpm.c b/drivers/gpu/drm/radeon/rs780_dpm.c
index eb336bf..6af8505 100644
--- a/drivers/gpu/drm/radeon/rs780_dpm.c
+++ b/drivers/gpu/drm/radeon/rs780_dpm.c
@@ -1043,8 +1043,10 @@ int rs780_dpm_force_performance_level(struct radeon_device *rdev,
 		if (pi->voltage_control)
 			rs780_force_voltage(rdev, pi->max_voltage);
 
-		WREG32_P(FVTHROT_FBDIV_REG1, 0, ~FORCE_FEEDBACK_DIV);
-		rs780_clk_scaling_enable(rdev, true);
+		if (ps->sclk_high != ps->sclk_low) {
+			WREG32_P(FVTHROT_FBDIV_REG1, 0, ~FORCE_FEEDBACK_DIV);
+			rs780_clk_scaling_enable(rdev, true);
+		}
 
 		if (pi->voltage_control) {
 			rs780_voltage_scaling_enable(rdev, true);
-- 
1.8.3.1

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH 1/4] drm/radeon/dpm/rs780: use drm_mode_vrefresh()
  2013-09-13 15:08 [PATCH 1/4] drm/radeon/dpm/rs780: use drm_mode_vrefresh() Alex Deucher
                   ` (2 preceding siblings ...)
  2013-09-13 15:08 ` [PATCH 4/4] drm/radeon/dpm/rs780: fix force_performance state for same sclks Alex Deucher
@ 2013-09-13 15:37 ` Christian König
  3 siblings, 0 replies; 5+ messages in thread
From: Christian König @ 2013-09-13 15:37 UTC (permalink / raw)
  To: Alex Deucher; +Cc: Alex Deucher, dri-devel

Am 13.09.2013 17:08, schrieb Alex Deucher:
> Rather than open coding it.
>
> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>

For this series: Reviewed-by: Christian König <christian.koenig@amd.com>

> ---
>   drivers/gpu/drm/radeon/rs780_dpm.c | 4 +---
>   1 file changed, 1 insertion(+), 3 deletions(-)
>
> diff --git a/drivers/gpu/drm/radeon/rs780_dpm.c b/drivers/gpu/drm/radeon/rs780_dpm.c
> index 828a776..afb7584 100644
> --- a/drivers/gpu/drm/radeon/rs780_dpm.c
> +++ b/drivers/gpu/drm/radeon/rs780_dpm.c
> @@ -62,9 +62,7 @@ static void rs780_get_pm_mode_parameters(struct radeon_device *rdev)
>   			radeon_crtc = to_radeon_crtc(crtc);
>   			pi->crtc_id = radeon_crtc->crtc_id;
>   			if (crtc->mode.htotal && crtc->mode.vtotal)
> -				pi->refresh_rate =
> -					(crtc->mode.clock * 1000) /
> -					(crtc->mode.htotal * crtc->mode.vtotal);
> +				pi->refresh_rate = drm_mode_vrefresh(&crtc->mode);
>   			break;
>   		}
>   	}

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2013-09-13 15:37 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-09-13 15:08 [PATCH 1/4] drm/radeon/dpm/rs780: use drm_mode_vrefresh() Alex Deucher
2013-09-13 15:08 ` [PATCH 2/4] drm/radeon/dpm/rs780: add some sanity checking to sclk scaling Alex Deucher
2013-09-13 15:08 ` [PATCH 3/4] drm/radeon/dpm/rs780: don't enable sclk scaling if not required Alex Deucher
2013-09-13 15:08 ` [PATCH 4/4] drm/radeon/dpm/rs780: fix force_performance state for same sclks Alex Deucher
2013-09-13 15:37 ` [PATCH 1/4] drm/radeon/dpm/rs780: use drm_mode_vrefresh() Christian König

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.