drm/i915: fix lost FP_CB_TUNE setting for pch plls
Subsystems (2)
PATCH 1/3 drm/i915: fix lost FP_CB_TUNE setting for pch plls
commit de13a2e3f88a4da8e85063b6de37096795079e41
Author: Paulo Zanoni <[email protected]> Date: Thu Sep 20 18:36:05 2012 -0300
drm/i915: extract compute_dpll from ironlake_crtc_mode_set
missed the subtle adjustment of the FP1 register. Fix this up by passing a pointer around instead of the value.
--- drivers/gpu/drm/i915/intel_display.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/gpu/drm/i915/intel_display.c +3 -3
@@ -5374,7 +5374,7 @@ static void ironlake_fdi_set_m_n(struct drm_crtc *crtc) }static uint32_t ironlake_compute_dpll (struct intel_crtc *intel_crtc, -intel_clock_t *clock,u32 fp) +intel_clock_t *clock,u32 *fp) {struct drm_crtc *crtc = &intel_crtc->base;struct drm_device *dev = crtc->dev;
@@ -5414,7 +5414,7 @@ static uint32_t ironlake_compute_dpll(struct intel_crtc *intel_crtc, factor =20 ;if (clock->m < factor * clock->n) - fp |=FP_CB_TUNE ; + *fp |=FP_CB_TUNE ; dpll =0 ;
@@ -5531,7 +5531,7 @@ static int ironlake_crtc_mode_set(struct drm_crtc *crtc, fp2 = reduced_clock.n <<16 | reduced_clock.m1 <<8 | reduced_clock.m2; - dpll =ironlake_compute_dpll (intel_crtc, &clock, fp); + dpll =ironlake_compute_dpll (intel_crtc, &clock, &fp);DRM_DEBUG_KMS ("Mode for pipe %d:\n" , pipe);drm_mode_debug_printmodeline (mode);
Signature · 1 line
1.7.10.4
PATCH 2/3 drm/i915: fix FP CB tuning limits for lvds
Only on IBX should we set the limiting factor to 25 unconditionally for dual-channel mode, on CPT/PPT 25 only applies when the lvds refclock is 100MHz.
--- drivers/gpu/drm/i915/intel_display.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/i915/intel_display.c +1 -1
@@ -5408,7 +5408,7 @@ static uint32_t ironlake_compute_dpll(struct intel_crtc *intel_crtc,if (is_lvds) {if ((intel_panel_use_ssc (dev_priv) && dev_priv->lvds_ssc_freq ==100 ) || -intel_is_dual_link_lvds (dev)) + (HAS_PCH_IBX (dev) &&intel_is_dual_link_lvds (dev))) factor =25 ; }else if (is_sdvo && is_tv) factor =20 ;
Signature · 1 line
1.7.10.4
Re: [PATCH 2/3] drm/i915: fix FP CB tuning limits for lvds
Hi
2013/4/4 Daniel Vetter <[email protected]>:
Quoted 5 lines
Only on IBX should we set the limiting factor to 25 unconditionally for dual-channel mode, on CPT/PPT 25 only applies when the lvds refclock is 100MHz.
Signed-off-by Daniel Vetter <[email protected]>
Quoted 20 lines
--- drivers/gpu/drm/i915/intel_display.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/gpu/drm/i915/intel_display.c +1
-2@@ -5408,7 +5408,7 @@ static uint32_t ironlake_compute_dpll(struct intel_crtc *intel_crtc,if (is_lvds) {if ((intel_panel_use_ssc (dev_priv) && dev_priv->lvds_ssc_freq ==100 ) || -intel_is_dual_link_lvds (dev)) + (HAS_PCH_IBX (dev) &&intel_is_dual_link_lvds (dev))) factor =25 ; }else if (is_sdvo && is_tv) factor =20 ; --1.7.10.4
Quoted 4 lines
_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
--
Paulo Zanoni
PATCH 3/3 drm/i915: set CB tuning also for the reduce clock
In reply to Daniel VetterSince the ratio is different, we also need to pass in the parameters for the reduced clock. Might or might not reduce flicker for the auto-downclocking on lvds/eDP.
--- drivers/gpu/drm/i915/intel_display.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-)
drivers/gpu/drm/i915/intel_display.c +7 -2
@@ -5374,7 +5374,8 @@ static void ironlake_fdi_set_m_n(struct drm_crtc *crtc) }static uint32_t ironlake_compute_dpll (struct intel_crtc *intel_crtc, -intel_clock_t *clock,u32 *fp) +intel_clock_t *clock,u32 *fp, +intel_clock_t *reduced_clock,u32 *fp2) {struct drm_crtc *crtc = &intel_crtc->base;struct drm_device *dev = crtc->dev;
@@ -5416,6 +5417,9 @@ static uint32_t ironlake_compute_dpll(struct intel_crtc *intel_crtc,if (clock->m < factor * clock->n) *fp |=FP_CB_TUNE ; +if (fp2 && (reduced_clock->m < factor * reduced_clock->n)) + *fp2 |=FP_CB_TUNE ; + dpll =0 ;if (is_lvds)
@@ -5531,7 +5535,8 @@ static int ironlake_crtc_mode_set(struct drm_crtc *crtc, fp2 = reduced_clock.n <<16 | reduced_clock.m1 <<8 | reduced_clock.m2; - dpll =ironlake_compute_dpll (intel_crtc, &clock, &fp); + dpll =ironlake_compute_dpll (intel_crtc, &clock, &fp, &reduced_clock, + has_reduced_clock ? &fp2 :NULL );DRM_DEBUG_KMS ("Mode for pipe %d:\n" , pipe);drm_mode_debug_printmodeline (mode);
Signature · 1 line
1.7.10.4
Re: [PATCH 3/3] drm/i915: set CB tuning also for the reduce clock
Hi
2013/4/4 Daniel Vetter <[email protected]>:
Quoted 3 lines
Since the ratio is different, we also need to pass in the parameters for the reduced clock. Might or might not reduce flicker for the auto-downclocking on lvds/eDP.
After this patch, my suggestion to add ironlake_calculate_fp() gets even stronger :)
Quoted 43 lines
Signed-off-by Daniel Vetter <[email protected]>--- drivers/gpu/drm/i915/intel_display.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-)drivers/gpu/drm/i915/intel_display.c +7
-3@@ -5374,7 +5374,8 @@ static void ironlake_fdi_set_m_n(struct drm_crtc *crtc) }static uint32_t ironlake_compute_dpll (struct intel_crtc *intel_crtc, -intel_clock_t *clock,u32 *fp) +intel_clock_t *clock,u32 *fp, +intel_clock_t *reduced_clock,u32 *fp2) {struct drm_crtc *crtc = &intel_crtc->base;struct drm_device *dev = crtc->dev;@@ -5416,6 +5417,9 @@ static uint32_t ironlake_compute_dpll(struct intel_crtc *intel_crtc,if (clock->m < factor * clock->n) *fp |=FP_CB_TUNE ; +if (fp2 && (reduced_clock->m < factor * reduced_clock->n)) + *fp2 |=FP_CB_TUNE ; + dpll =0 ;if (is_lvds)@@ -5531,7 +5535,8 @@ static int ironlake_crtc_mode_set(struct drm_crtc *crtc, fp2 = reduced_clock.n <<16 | reduced_clock.m1 <<8 | reduced_clock.m2; - dpll =ironlake_compute_dpll (intel_crtc, &clock, &fp); + dpll =ironlake_compute_dpll (intel_crtc, &clock, &fp, &reduced_clock, + has_reduced_clock ? &fp2 :NULL );DRM_DEBUG_KMS ("Mode for pipe %d:\n" , pipe);drm_mode_debug_printmodeline (mode); --1.7.10.4
Quoted 4 lines
_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
--
Paulo Zanoni
Hi
2013/4/4 Daniel Vetter <[email protected]>:
Quoted 8 lines
commit
de13a2e3f88a4da8e85063b6de37096795079e41Author: Paulo Zanoni <[email protected]> Date: Thu Sep 20 18:36:05 2012 -0300drm/i915: extract
compute_dpllfromironlake_crtc_mode_setmissed the subtle adjustment of the FP1 register. Fix this up by passing a pointer around instead of the value.
We could also move the whole chunk that sets "factor" and "FP_CB_TUNE" back to ironlake_crtc_mode_set or even to a brand new ironlake_calculate_fp(intel_crtc, clock, has_reduced_clock, reduced_clock, &fp, &fp2). Maybe as a follow-up patch since this version is way much easier for -stable.
Quoted 42 lines
Cc Paulo Zanoni <[email protected]>Cc Rodrigo Vivi <[email protected]>Signed-off-by Daniel Vetter <[email protected]>--- drivers/gpu/drm/i915/intel_display.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)drivers/gpu/drm/i915/intel_display.c +3
-4@@ -5374,7 +5374,7 @@ static void ironlake_fdi_set_m_n(struct drm_crtc *crtc) }static uint32_t ironlake_compute_dpll (struct intel_crtc *intel_crtc, -intel_clock_t *clock,u32 fp) +intel_clock_t *clock,u32 *fp) {struct drm_crtc *crtc = &intel_crtc->base;struct drm_device *dev = crtc->dev;@@ -5414,7 +5414,7 @@ static uint32_t ironlake_compute_dpll(struct intel_crtc *intel_crtc, factor =20 ;if (clock->m < factor * clock->n) - fp |=FP_CB_TUNE ; + *fp |=FP_CB_TUNE ; dpll =0 ;@@ -5531,7 +5531,7 @@ static int ironlake_crtc_mode_set(struct drm_crtc *crtc, fp2 = reduced_clock.n <<16 | reduced_clock.m1 <<8 | reduced_clock.m2; - dpll =ironlake_compute_dpll (intel_crtc, &clock, fp); + dpll =ironlake_compute_dpll (intel_crtc, &clock, &fp);DRM_DEBUG_KMS ("Mode for pipe %d:\n" , pipe);drm_mode_debug_printmodeline (mode); --1.7.10.4
Quoted 4 lines
_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
--
Paulo Zanoni
Quoted 12 lines · Paulo Zanoni
Hi
2013/4/4 Daniel Vetter <[email protected]>:
Quoted 8 lines
commit
de13a2e3f88a4da8e85063b6de37096795079e41Author: Paulo Zanoni <[email protected]> Date: Thu Sep 20 18:36:05 2012 -0300drm/i915: extract
compute_dpllfromironlake_crtc_mode_setmissed the subtle adjustment of the FP1 register. Fix this up by passing a pointer around instead of the value.
Quoted 7 lines
We could also move the whole chunk that sets "factor" and "
FP_CB_TUNE" back toironlake_crtc_mode_setor even to a brand newironlake_calculate_fp(intel_crtc, clock, has_reduced_clock, reduced_clock, &fp, &fp2). Maybe as a follow-up patch since this version is way much easier for -stable.Reviewed-by Paulo Zanoni <[email protected]>
All patches merged, thanks for the review. I didn't add a cc: stable to this one, since no one has reported a regression yet. We can easily backport if that changes.
I agree with your refactor idea, but until all the clock handling has settled a bit (due to the massive pipe config reorganisation) I think we should hold and not waste too much time with beauty-ops ;-)
Cheers, Daniel
Signature · 3 lines
Daniel Vetter Software Engineer, Intel Corporation +41 (0) 79 365 57 48 - http://blog.ffwll.ch