* [PATCH 1/2] drm/i915: only get clock for active pipes
@ 2013-09-19 20:26 Jesse Barnes
2013-09-19 20:26 ` [PATCH 2/2] drm/i915/vlv: add VLV specific clock_get function Jesse Barnes
2013-09-20 7:50 ` [PATCH 1/2] drm/i915: only get clock for active pipes Daniel Vetter
0 siblings, 2 replies; 3+ messages in thread
From: Jesse Barnes @ 2013-09-19 20:26 UTC (permalink / raw)
To: intel-gfx
Otherwise the pixel_multiplier may not be set, and who knows what else
in the future.
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
---
drivers/gpu/drm/i915/intel_display.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
index 1d14ad3..8d7b5f0 100644
--- a/drivers/gpu/drm/i915/intel_display.c
+++ b/drivers/gpu/drm/i915/intel_display.c
@@ -8790,7 +8790,7 @@ check_crtc_state(struct drm_device *dev)
encoder->get_config(encoder, &pipe_config);
}
- if (dev_priv->display.get_clock)
+ if (active && dev_priv->display.get_clock)
dev_priv->display.get_clock(crtc, &pipe_config);
WARN(crtc->active != active,
--
1.7.9.5
^ permalink raw reply related [flat|nested] 3+ messages in thread
* [PATCH 2/2] drm/i915/vlv: add VLV specific clock_get function
2013-09-19 20:26 [PATCH 1/2] drm/i915: only get clock for active pipes Jesse Barnes
@ 2013-09-19 20:26 ` Jesse Barnes
2013-09-20 7:50 ` [PATCH 1/2] drm/i915: only get clock for active pipes Daniel Vetter
1 sibling, 0 replies; 3+ messages in thread
From: Jesse Barnes @ 2013-09-19 20:26 UTC (permalink / raw)
To: intel-gfx
Calculation is a little different than other platforms.
References: https://bugs.freedesktop.org/show_bug.cgi?id=67345
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
---
drivers/gpu/drm/i915/intel_display.c | 30 +++++++++++++++++++++++++++++-
1 file changed, 29 insertions(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
index 8d7b5f0..8261822 100644
--- a/drivers/gpu/drm/i915/intel_display.c
+++ b/drivers/gpu/drm/i915/intel_display.c
@@ -7257,6 +7257,34 @@ void intel_release_load_detect_pipe(struct drm_connector *connector,
mutex_unlock(&crtc->mutex);
}
+static void vlv_crtc_clock_get(struct intel_crtc *crtc,
+ struct intel_crtc_config *pipe_config)
+{
+ struct drm_device *dev = crtc->base.dev;
+ struct drm_i915_private *dev_priv = dev->dev_private;
+ int pipe = pipe_config->cpu_transcoder;
+ intel_clock_t clock;
+ u32 mdiv;
+ int refclk = vlv_get_refclk(&crtc->base), fastclk, update_rate;
+
+ mutex_lock(&dev_priv->dpio_lock);
+ mdiv = vlv_dpio_read(dev_priv, pipe, DPIO_DIV(pipe));
+ mutex_unlock(&dev_priv->dpio_lock);
+
+ clock.m1 = (mdiv >> DPIO_M1DIV_SHIFT) & 7;
+ clock.m2 = mdiv & DPIO_M2DIV_MASK;
+ clock.n = (mdiv >> DPIO_N_SHIFT) & 0xf;
+ clock.p1 = (mdiv >> DPIO_P1_SHIFT) & 7;
+ clock.p2 = (mdiv >> DPIO_P2_SHIFT) & 0x1f;
+
+ update_rate = refclk / clock.n;
+ clock.vco = update_rate * clock.m1 * clock.m2;
+ fastclk = clock.vco / clock.p1 / clock.p2;
+ clock.dot = (2 * fastclk) / pipe_config->pixel_multiplier;
+
+ pipe_config->adjusted_mode.clock = clock.dot / 10;
+}
+
/* Returns the clock of the currently programmed mode of the given pipe. */
static void i9xx_crtc_clock_get(struct intel_crtc *crtc,
struct intel_crtc_config *pipe_config)
@@ -9826,7 +9854,7 @@ static void intel_init_display(struct drm_device *dev)
dev_priv->display.update_plane = ironlake_update_plane;
} else if (IS_VALLEYVIEW(dev)) {
dev_priv->display.get_pipe_config = i9xx_get_pipe_config;
- dev_priv->display.get_clock = i9xx_crtc_clock_get;
+ dev_priv->display.get_clock = vlv_crtc_clock_get;
dev_priv->display.crtc_mode_set = i9xx_crtc_mode_set;
dev_priv->display.crtc_enable = valleyview_crtc_enable;
dev_priv->display.crtc_disable = i9xx_crtc_disable;
--
1.7.9.5
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH 1/2] drm/i915: only get clock for active pipes
2013-09-19 20:26 [PATCH 1/2] drm/i915: only get clock for active pipes Jesse Barnes
2013-09-19 20:26 ` [PATCH 2/2] drm/i915/vlv: add VLV specific clock_get function Jesse Barnes
@ 2013-09-20 7:50 ` Daniel Vetter
1 sibling, 0 replies; 3+ messages in thread
From: Daniel Vetter @ 2013-09-20 7:50 UTC (permalink / raw)
To: Jesse Barnes; +Cc: intel-gfx
On Thu, Sep 19, 2013 at 01:26:40PM -0700, Jesse Barnes wrote:
> Otherwise the pixel_multiplier may not be set, and who knows what else
> in the future.
>
> Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
> ---
> drivers/gpu/drm/i915/intel_display.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
> index 1d14ad3..8d7b5f0 100644
> --- a/drivers/gpu/drm/i915/intel_display.c
> +++ b/drivers/gpu/drm/i915/intel_display.c
> @@ -8790,7 +8790,7 @@ check_crtc_state(struct drm_device *dev)
> encoder->get_config(encoder, &pipe_config);
> }
>
> - if (dev_priv->display.get_clock)
> + if (active && dev_priv->display.get_clock)
> dev_priv->display.get_clock(crtc, &pipe_config);
You're -nightly is a bit old, this stuff is gone now. Ville moved it all
into the get_crtc_config callback.
-Daniel
>
> WARN(crtc->active != active,
> --
> 1.7.9.5
>
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/intel-gfx
--
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2013-09-20 7:49 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-09-19 20:26 [PATCH 1/2] drm/i915: only get clock for active pipes Jesse Barnes
2013-09-19 20:26 ` [PATCH 2/2] drm/i915/vlv: add VLV specific clock_get function Jesse Barnes
2013-09-20 7:50 ` [PATCH 1/2] drm/i915: only get clock for active pipes Daniel Vetter
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox