drm/i915/chv: fix HW readout of the port PLL fractional divider
Subsystems (2)
PATCH 1/1 drm/i915/chv: fix HW readout of the port PLL fractional divider
Ville noticed that the PLL HW readout code parsed the fractional divider value as if the fractional divider was always enabled. This may result in a port clock state check mismatch if the preceeding modeset disabled the fractional divider, but left a non-zero divider value in the register.
--- drivers/gpu/drm/i915/intel_display.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-)
drivers/gpu/drm/i915/intel_display.c +5 -2
@@ -8021,7 +8021,7 @@ static void chv_crtc_clock_get(struct intel_crtc *crtc,int pipe = pipe_config->cpu_transcoder;enum dpio_channel port =vlv_pipe_to_channel (pipe);intel_clock_t clock; -u32 cmn_dw13, pll_dw0, pll_dw1, pll_dw2; +u32 cmn_dw13, pll_dw0, pll_dw1, pll_dw2, pll_dw3;int refclk =100000 ;mutex_lock (&dev_priv->sb_lock);
@@ -8029,10 +8029,13 @@ static void chv_crtc_clock_get(struct intel_crtc *crtc, pll_dw0 =vlv_dpio_read (dev_priv, pipe,CHV_PLL_DW0 (port)); pll_dw1 =vlv_dpio_read (dev_priv, pipe,CHV_PLL_DW1 (port)); pll_dw2 =vlv_dpio_read (dev_priv, pipe,CHV_PLL_DW2 (port)); + pll_dw3 =vlv_dpio_read (dev_priv, pipe,CHV_PLL_DW3 (port));mutex_unlock (&dev_priv->sb_lock); clock.m1 = (pll_dw1 &0x7 ) ==DPIO_CHV_M1_DIV_BY_2 ?2 :0 ; - clock.m2 = ((pll_dw0 &0xff ) <<22 ) | (pll_dw2 &0x3fffff ); + clock.m2 = (pll_dw0 &0xff ) <<22 ; +if (pll_dw3 &DPIO_CHV_FRAC_DIV_EN ) + clock.m2 |= pll_dw2 &0x3fffff ; clock.n = (pll_dw1 >>DPIO_CHV_N_DIV_SHIFT ) &0xf ; clock.p1 = (cmn_dw13 >>DPIO_CHV_P1_DIV_SHIFT ) &0x7 ; clock.p2 = (cmn_dw13 >>DPIO_CHV_P2_DIV_SHIFT ) &0x1f ;
Signature · 6 lines
2.1.4 _______________________________________________ Intel-gfx mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Quoted 7 lines · Imre Deak
Ville noticed that the PLL HW readout code parsed the fractional divider value as if the fractional divider was always enabled. This may result in a port clock state check mismatch if the preceeding modeset disabled the fractional divider, but left a non-zero divider value in the register.
Signed-off-by Imre Deak <[email protected]>
Quoted 34 lines
--- drivers/gpu/drm/i915/intel_display.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-)drivers/gpu/drm/i915/intel_display.c +5
-2@@ -8021,7 +8021,7 @@ static void chv_crtc_clock_get(struct intel_crtc *crtc,int pipe = pipe_config->cpu_transcoder;enum dpio_channel port =vlv_pipe_to_channel (pipe);intel_clock_t clock; -u32 cmn_dw13, pll_dw0, pll_dw1, pll_dw2; +u32 cmn_dw13, pll_dw0, pll_dw1, pll_dw2, pll_dw3;int refclk =100000 ;mutex_lock (&dev_priv->sb_lock);@@ -8029,10 +8029,13 @@ static void chv_crtc_clock_get(struct intel_crtc *crtc, pll_dw0 =vlv_dpio_read (dev_priv, pipe,CHV_PLL_DW0 (port)); pll_dw1 =vlv_dpio_read (dev_priv, pipe,CHV_PLL_DW1 (port)); pll_dw2 =vlv_dpio_read (dev_priv, pipe,CHV_PLL_DW2 (port)); + pll_dw3 =vlv_dpio_read (dev_priv, pipe,CHV_PLL_DW3 (port));mutex_unlock (&dev_priv->sb_lock); clock.m1 = (pll_dw1 &0x7 ) ==DPIO_CHV_M1_DIV_BY_2 ?2 :0 ; - clock.m2 = ((pll_dw0 &0xff ) <<22 ) | (pll_dw2 &0x3fffff ); + clock.m2 = (pll_dw0 &0xff ) <<22 ; +if (pll_dw3 &DPIO_CHV_FRAC_DIV_EN ) + clock.m2 |= pll_dw2 &0x3fffff ; clock.n = (pll_dw1 >>DPIO_CHV_N_DIV_SHIFT ) &0xf ; clock.p1 = (cmn_dw13 >>DPIO_CHV_P1_DIV_SHIFT ) &0x7 ; clock.p2 = (cmn_dw13 >>DPIO_CHV_P2_DIV_SHIFT ) &0x1f ;Signature · 1 line
2.1.4
Signature · 6 lines
Ville Syrjälä Intel OTC _______________________________________________ Intel-gfx mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Daniel Vetter
AppliedQuoted 10 lines · Ville Syrjälä
Quoted 7 lines · Imre Deak
Ville noticed that the PLL HW readout code parsed the fractional divider value as if the fractional divider was always enabled. This may result in a port clock state check mismatch if the preceeding modeset disabled the fractional divider, but left a non-zero divider value in the register.
Signed-off-by Imre Deak <[email protected]>Reviewed-by Ville Syrjälä <[email protected]>
Queued for -fixes (with cc: stable), thanks for the patch. -Daniel
Quoted 43 lines
Quoted 35 lines
--- drivers/gpu/drm/i915/intel_display.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-)drivers/gpu/drm/i915/intel_display.c +5
-2@@ -8021,7 +8021,7 @@ static void chv_crtc_clock_get(struct intel_crtc *crtc,int pipe = pipe_config->cpu_transcoder;enum dpio_channel port =vlv_pipe_to_channel (pipe);intel_clock_t clock; -u32 cmn_dw13, pll_dw0, pll_dw1, pll_dw2; +u32 cmn_dw13, pll_dw0, pll_dw1, pll_dw2, pll_dw3;int refclk =100000 ;mutex_lock (&dev_priv->sb_lock);@@ -8029,10 +8029,13 @@ static void chv_crtc_clock_get(struct intel_crtc *crtc, pll_dw0 =vlv_dpio_read (dev_priv, pipe,CHV_PLL_DW0 (port)); pll_dw1 =vlv_dpio_read (dev_priv, pipe,CHV_PLL_DW1 (port)); pll_dw2 =vlv_dpio_read (dev_priv, pipe,CHV_PLL_DW2 (port)); + pll_dw3 =vlv_dpio_read (dev_priv, pipe,CHV_PLL_DW3 (port));mutex_unlock (&dev_priv->sb_lock); clock.m1 = (pll_dw1 &0x7 ) ==DPIO_CHV_M1_DIV_BY_2 ?2 :0 ; - clock.m2 = ((pll_dw0 &0xff ) <<22 ) | (pll_dw2 &0x3fffff ); + clock.m2 = (pll_dw0 &0xff ) <<22 ; +if (pll_dw3 &DPIO_CHV_FRAC_DIV_EN ) + clock.m2 |= pll_dw2 &0x3fffff ; clock.n = (pll_dw1 >>DPIO_CHV_N_DIV_SHIFT ) &0xf ; clock.p1 = (cmn_dw13 >>DPIO_CHV_P1_DIV_SHIFT ) &0x7 ; clock.p2 = (cmn_dw13 >>DPIO_CHV_P2_DIV_SHIFT ) &0x1f ;Signature · 1 line
2.1.4Signature · 6 lines
Ville Syrjälä Intel OTC _______________________________________________ Intel-gfx mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Signature · 7 lines
Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch _______________________________________________ Intel-gfx mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Quoted 8 lines · Daniel Vetter
Quoted 7 lines · Ville Syrjälä
Quoted 6 lines · Imre Deak
Ville noticed that the PLL HW readout code parsed the fractional divider value as if the fractional divider was always enabled. This may result in a port clock state check mismatch if the preceeding modeset disabled the fractional divider, but left a non-zero divider value in the register.
Quoted 5 lines
Quoted 3 lines
Quoted 1 line
Signed-off-by Imre Deak <[email protected]>Reviewed-by Ville Syrjälä <[email protected]>Queued for -fixes (with cc: stable), thanks for the patch.
Maybe doesn't justify stable, so dropped that again. -Daniel
Signature · 7 lines
Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch _______________________________________________ Intel-gfx mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Task id: 6707 -------------------------------------Summary-------------------------------------
Platform Delta drm-intel-nightly Series Applied
ILK 302/302 302/302 SNB 312/316 312/316 IVB 343/343 343/343
BYT -1 287/287 286/287
HSW 380/380 380/380
-------------------------------------Detailed-------------------------------------
Platform Test drm-intel-nightly Series Applied
*BYT igt@gem_tiled_partial_pwrite_pread@reads PASS(1) FAIL(1)
Note: You need to pay more attention to line start with '*'
_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx