Minor cleanup series
Subsystems (2)
cover Minor cleanup series
Just a few things spotted in a readthrough. The DPLL disable one might actually be a bugfix, who knows.
- ajax
PATCH 1/5 drm/i915: Implement plane-disabled assertion for PCH too
--- drivers/gpu/drm/i915/intel_display.c | 8 +++++++- 1 files changed, 7 insertions(+), 1 deletions(-)
drivers/gpu/drm/i915/intel_display.c +7 -1
@@ -939,8 +939,14 @@ static void assert_planes_disabled(struct drm_i915_private *dev_priv,int cur_pipe;/* Planes are fixed to pipes on ILK+ */ -if (HAS_PCH_SPLIT (dev_priv->dev)) +if (HAS_PCH_SPLIT (dev_priv->dev)) { + reg =DSPCNTR (pipe); + val =I915_READ (reg); +WARN ((val &DISPLAY_PLANE_ENABLE ), +"plane %c assertion failure, should be disabled but not\n" , +plane_name (pipe));return ; + }/* Need to check both planes against the pipe */ for (i =0 ; i <2 ; i++) {
Signature · 1 line
1.7.6.4
PATCH 2/5 drm/i915: Fix assert_pch_hdmi_disabled to mention HDMI (not DP)
In reply to Adam Jackson--- drivers/gpu/drm/i915/intel_display.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/gpu/drm/i915/intel_display.c +1 -1
@@ -1065,7 +1065,7 @@ static void assert_pch_hdmi_disabled(struct drm_i915_private *dev_priv, {u32 val =I915_READ (reg);WARN (hdmi_pipe_enabled (dev_priv, val, pipe), -"PCH DP (0x%08x) enabled on transcoder %c, should be disabled\n" , +"PCH HDMI (0x%08x) enabled on transcoder %c, should be disabled\n" , reg,pipe_name (pipe)); }
Signature · 1 line
1.7.6.4
PATCH 3/5 drm/i915/pch: Fix thinko in DPLL disable
In reply to Adam JacksonFor transcoder A, we would never clear the DPLL[AB] select bit. If the firmware had set us up on DPLLB, the effect would be to attempt to use DPLLB for both pipes A and B, which would probably be bad.
--- drivers/gpu/drm/i915/intel_display.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/gpu/drm/i915/intel_display.c +1 -1
@@ -3051,7 +3051,7 @@ static void ironlake_crtc_disable(struct drm_crtc *crtc) temp =I915_READ (PCH_DPLL_SEL );switch (pipe) {case 0 : - temp &= ~(TRANSA_DPLL_ENABLE |TRANSA_DPLLA_SEL ); + temp &= ~(TRANSA_DPLL_ENABLE |TRANSA_DPLLB_SEL );break ;case 1 : temp &= ~(TRANSB_DPLL_ENABLE |TRANSB_DPLLB_SEL );
Signature · 1 line
1.7.6.4
Re: [PATCH 3/5] drm/i915/pch: Fix thinko in DPLL disable
Quoted 14 lines · On Fri, 7 Oct 2011 14:38:44 -0400 Adam Jackson <[email protected]> wrote:
For transcoder A, we would never clear the DPLL[AB] select bit. If the firmware had set us up on DPLLB, the effect would be to attempt to use DPLLB for both pipes A and B, which would probably be bad.
Signed-off-by Adam Jackson <[email protected]>--- drivers/gpu/drm/i915/intel_display.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)drivers/gpu/drm/i915/intel_display.c +0
-0
drivers/gpu/drm/i915/intel_display.c static void ironlake_crtc_disable(struct drm_crtc *crtc) · line 3057
Quoted 8 lines
drivers/gpu/drm/i915/intel_display.c +1
-1@@ -3051,7 +3051,7 @@ static void ironlake_crtc_disable(struct drm_crtc *crtc) temp =I915_READ (PCH_DPLL_SEL );switch (pipe) {case 0 : - temp &= ~(TRANSA_DPLL_ENABLE |TRANSA_DPLLA_SEL ); + temp &= ~(TRANSA_DPLL_ENABLE |TRANSA_DPLLB_SEL );break ;case 1 : temp &= ~(TRANSB_DPLL_ENABLE |TRANSB_DPLLB_SEL );
I think this might be even better (goes with the 3 pipe patches)?
Signature · 16 lines
Jesse Barnes, Intel Open Source Technology Center From 159f6191ed19c0d39f986c1bcbd4652d40525108 Mon Sep 17 00:00:00 2001 From: Jesse Barnes <[email protected]> Date: Wed, 12 Oct 2011 15:01:33 -0700 Subject: [PATCH] drm/i915: fix transcoder PLL select masking Transcoder A will always use PLL A and transcoder B will use PLL B. But transcoder C could use either, so always mask the select bits off before or'ing in a new value. Reported-by: Adam Jackson <[email protected]> Signed-off-by: Jesse Barnes <[email protected]> --- drivers/gpu/drm/i915/intel_display.c | 9 ++++++--- 1 files changed, 6 insertions(+), 3 deletions(-)
drivers/gpu/drm/i915/intel_display.c +6 -3
@@ -2902,8 +2902,10 @@ static void ironlake_pch_enable(struct drm_crtc *crtc) temp |= (TRANSA_DPLL_ENABLE |TRANSA_DPLLA_SEL ); else if (pipe == 1 && (temp & TRANSB_DPLL_ENABLE) == 0) temp |= (TRANSB_DPLL_ENABLE |TRANSB_DPLLB_SEL ); - else if (pipe == 2 && (temp & TRANSC_DPLL_ENABLE) == 0) + else if (pipe == 2 && (temp & TRANSC_DPLL_ENABLE) == 0) { + temp &= ~(TRANSC_DPLLB_SEL ); temp |= (TRANSC_DPLL_ENABLE | transc_sel); + }I915_WRITE (PCH_DPLL_SEL , temp); }
@@ -3069,10 +3071,10 @@ static void ironlake_crtc_disable(struct drm_crtc *crtc) temp =I915_READ (PCH_DPLL_SEL );switch (pipe) {case 0 : - temp &= ~(TRANSA_DPLL_ENABLE |TRANSA_DPLLA_SEL ); + temp &= ~TRANSA_DPLL_ENABLE ;break ;case 1 : - temp &= ~(TRANSB_DPLL_ENABLE |TRANSB_DPLLB_SEL ); + temp &= ~TRANSB_DPLL_ENABLE ;break ;case 2 :/* C shares PLL A or B */
@@ -5540,6 +5542,7 @@ static int ironlake_crtc_mode_set(struct drm_crtc *crtc, temp |=TRANSB_DPLL_ENABLE |TRANSB_DPLLB_SEL ;break ;case 2 : + temp &= ~(TRANSC_DPLLB_SEL ); temp |=TRANSC_DPLL_ENABLE | transc_sel;break ;default :
Signature · 1 line
1.7.4.1
_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [PATCH 3/5] drm/i915/pch: Fix thinko in DPLL disable
Quoted 12 lines · On Wed, 12 Oct 2011 15:03:11 -0700 Jesse Barnes <[email protected]>…
Quoted 9 lines · On Fri, 7 Oct 2011 14:38:44 -0400 Adam Jackson <[email protected]> wrote:
For transcoder A, we would never clear the DPLL[AB] select bit. If the firmware had set us up on DPLLB, the effect would be to attempt to use DPLLB for both pipes A and B, which would probably be bad.
Signed-off-by Adam Jackson <[email protected]>--- drivers/gpu/drm/i915/intel_display.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
Quoted 15 lines
drivers/gpu/drm/i915/intel_display.c static void ironlake_crtc_disable(struct drm_crtc *crtc) · line 3057
Quoted 13 lines
drivers/gpu/drm/i915/intel_display.c +1
-1@@ -3051,7 +3051,7 @@ static void ironlake_crtc_disable(struct drm_crtc *crtc) temp =I915_READ (PCH_DPLL_SEL );switch (pipe) {case 0 : - temp &= ~(TRANSA_DPLL_ENABLE |TRANSA_DPLLA_SEL ); + temp &= ~(TRANSA_DPLL_ENABLE |TRANSA_DPLLB_SEL );break ;case 1 : temp &= ~(TRANSB_DPLL_ENABLE |TRANSB_DPLLB_SEL );I think this might be even better (goes with the 3 pipe patches)?
Ok not really better; we should still mask out the select bits just in case the bios did something screwy.
Signature · 1 line
Jesse Barnes, Intel Open Source Technology Center
_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH 4/5 drm/i915: Simplify HAS_PCH_SPLIT
In reply to Adam JacksonAll gen5+ parts are PCH (so far anyway), so just say so.
--- drivers/gpu/drm/i915/i915_drv.h | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/gpu/drm/i915/i915_drv.h +1 -1
@@ -983,7 +983,7 @@ struct drm_i915_file_private {#define HAS_PIPE_CXSR (dev) (INTEL_INFO(dev)->has_pipe_cxsr)#define I915_HAS_FBC (dev) (INTEL_INFO(dev)->has_fbc) -#define HAS_PCH_SPLIT (dev) (IS_GEN5(dev) || IS_GEN6(dev) || IS_IVYBRIDGE(dev)) +#define HAS_PCH_SPLIT (dev) (INTEL_INFO(dev)->gen >= 5)#define HAS_PIPE_CONTROL (dev) (INTEL_INFO(dev)->gen >= 5)#define INTEL_PCH_TYPE (dev) (((struct drm_i915_private *)(dev)->dev_private)->pch_type)
Signature · 1 line
1.7.6.4
PATCH 5/5 drm/i915: Remove a comment about PCH from the non-PCH path
In reply to Adam Jackson--- drivers/gpu/drm/i915/intel_display.c | 2 -- 1 files changed, 0 insertions(+), 2 deletions(-)
drivers/gpu/drm/i915/intel_display.c +0 -2
@@ -4925,8 +4925,6 @@ static int i9xx_crtc_mode_set(struct drm_crtc *crtc,/* Set up the display plane register */ dspcntr =DISPPLANE_GAMMA_ENABLE ; -/* Ironlake's plane is forced to pipe, bit 24 is to -enable color space conversion */ if (pipe ==0 ) dspcntr &= ~DISPPLANE_SEL_PIPE_MASK ;else
Signature · 1 line
1.7.6.4
Quoted 2 lines · Adam Jackson
Just a few things spotted in a readthrough. The DPLL disable one might actually be a bugfix, who knows.
I've queued patches 1,2&5 for -next. 3 is already fixed and 4 won't be true in the near future due to something I'm not yet allowed to talk about.
-Daniel
Signature · 3 lines
Daniel Vetter Mail: [email protected] Mobile: +41 (0)79 365 57 48