* [PATCH] drm/i915: Do not read non-existent DPLL registers on PCH hardware
@ 2012-05-02 11:07 Chris Wilson
2012-05-02 12:35 ` Daniel Vetter
0 siblings, 1 reply; 2+ messages in thread
From: Chris Wilson @ 2012-05-02 11:07 UTC (permalink / raw)
To: intel-gfx
We only execute intel_decrease_pllclock for pre-PCH hardware, typically
gen4 mobiles. However, in the variable declaration we did read from the
non-PCH DPLL register, quite naughty and detected by SandyBridge.
Reported-by: Andrey Rahmatullin <wrar@wrar.name>
References: https://bugs.freedesktop.org/show_bug.cgi?id=49025
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
---
drivers/gpu/drm/i915/intel_display.c | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
index e1716be..10fefdd 100644
--- a/drivers/gpu/drm/i915/intel_display.c
+++ b/drivers/gpu/drm/i915/intel_display.c
@@ -5486,9 +5486,6 @@ static void intel_decrease_pllclock(struct drm_crtc *crtc)
struct drm_device *dev = crtc->dev;
drm_i915_private_t *dev_priv = dev->dev_private;
struct intel_crtc *intel_crtc = to_intel_crtc(crtc);
- int pipe = intel_crtc->pipe;
- int dpll_reg = DPLL(pipe);
- int dpll = I915_READ(dpll_reg);
if (HAS_PCH_SPLIT(dev))
return;
@@ -5501,10 +5498,15 @@ static void intel_decrease_pllclock(struct drm_crtc *crtc)
* the manual case.
*/
if (!HAS_PIPE_CXSR(dev) && intel_crtc->lowfreq_avail) {
+ int pipe = intel_crtc->pipe;
+ int dpll_reg = DPLL(pipe);
+ u32 dpll;
+
DRM_DEBUG_DRIVER("downclocking LVDS\n");
assert_panel_unlocked(dev_priv, pipe);
+ dpll = I915_READ(dpll_reg);
dpll |= DISPLAY_RATE_SELECT_FPA1;
I915_WRITE(dpll_reg, dpll);
intel_wait_for_vblank(dev, pipe);
@@ -5512,7 +5514,6 @@ static void intel_decrease_pllclock(struct drm_crtc *crtc)
if (!(dpll & DISPLAY_RATE_SELECT_FPA1))
DRM_DEBUG_DRIVER("failed to downclock LVDS!\n");
}
-
}
/**
--
1.7.10
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] drm/i915: Do not read non-existent DPLL registers on PCH hardware
2012-05-02 11:07 [PATCH] drm/i915: Do not read non-existent DPLL registers on PCH hardware Chris Wilson
@ 2012-05-02 12:35 ` Daniel Vetter
0 siblings, 0 replies; 2+ messages in thread
From: Daniel Vetter @ 2012-05-02 12:35 UTC (permalink / raw)
To: Chris Wilson; +Cc: intel-gfx
On Wed, May 02, 2012 at 12:07:06PM +0100, Chris Wilson wrote:
> We only execute intel_decrease_pllclock for pre-PCH hardware, typically
> gen4 mobiles. However, in the variable declaration we did read from the
> non-PCH DPLL register, quite naughty and detected by SandyBridge.
>
> Reported-by: Andrey Rahmatullin <wrar@wrar.name>
> References: https://bugs.freedesktop.org/show_bug.cgi?id=49025
> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Picked up for -fixes (with Andrey's tested-by added), thanks for the patch.
-Daniel
--
Daniel Vetter
Mail: daniel@ffwll.ch
Mobile: +41 (0)79 365 57 48
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2012-05-02 12:34 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-05-02 11:07 [PATCH] drm/i915: Do not read non-existent DPLL registers on PCH hardware Chris Wilson
2012-05-02 12:35 ` Daniel Vetter
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox