drm/i915/dp: Introduce is_cpu_edp()
Subsystems (2)
PATCH 1/2 drm/i915/dp: Introduce is_cpu_edp()
The obvious counterpart to is_pch_edp(). Convert existing instances of the idiom to the new routine.
Signed-off-by Adam Jackson <[email protected]>
--- drivers/gpu/drm/i915/intel_dp.c | 15 +++++++++++++-- 1 files changed, 13 insertions(+), 2 deletions(-)
drivers/gpu/drm/i915/intel_dp.c +13 -2
@@ -86,6 +86,17 @@ static bool is_pch_edp(struct intel_dp *intel_dp)return intel_dp->is_pch_edp; } +/** +* is_cpu_edp - is the port on the CPU and attached to an eDP panel? +* @intel_dp: DP struct +* +* Returns true if the given DP struct corresponds to a CPU eDP port. +*/ +static bool is_cpu_edp (struct intel_dp *intel_dp) +{ +return is_edp (intel_dp) && !is_pch_edp (intel_dp); +} +static struct intel_dp *enc_to_intel_dp (struct drm_encoder *encoder) { return container_of(encoder, struct intel_dp, base.base);
@@ -315,7 +326,7 @@ intel_dp_aux_ch(struct intel_dp *intel_dp,* Note that PCH attached eDP panels should use a 125MHz input * clock divider. */ -if (is_edp (intel_dp) && !is_pch_edp (intel_dp)) { +if (is_cpu_edp (intel_dp)) {if (IS_GEN6 (dev)) aux_clock_divider =200 ;/* SNB eDP input clock at 400Mhz */ else
@@ -794,7 +805,7 @@ intel_dp_mode_set(struct drm_encoder *encoder, struct drm_display_mode *mode,if (intel_crtc->pipe ==1 && !HAS_PCH_CPT (dev)) intel_dp->DP |=DP_PIPEB_SELECT ; -if (is_edp (intel_dp) && !is_pch_edp (intel_dp)) { +if (is_cpu_edp (intel_dp)) {/* don't miss out required setting for eDP */ intel_dp->DP |=DP_PLL_ENABLE ;if (adjusted_mode->clock <200000 )
Signature · 1 line
1.7.6.4
PATCH 2/2 drm/i915/dp: Fix eDP on PCH DP on CPT/PPT
According to the gen6 docs, only the DP_A port (on-CPU eDP) still uses the old IBX bit shift for the link training pattern setup bits.
Signed-off-by Adam Jackson <[email protected]>
--- drivers/gpu/drm/i915/intel_dp.c | 12 ++++++------ 1 files changed, 6 insertions(+), 6 deletions(-)
drivers/gpu/drm/i915/intel_dp.c +6 -6
@@ -768,7 +768,7 @@ intel_dp_mode_set(struct drm_encoder *encoder, struct drm_display_mode *mode,if (adjusted_mode->flags &DRM_MODE_FLAG_PVSYNC ) intel_dp->DP |=DP_SYNC_VS_HIGH ; -if (HAS_PCH_CPT (dev) && !is_edp (intel_dp)) +if (HAS_PCH_CPT (dev) && !is_cpu_edp (intel_dp)) intel_dp->DP |=DP_LINK_TRAIN_OFF_CPT ;else intel_dp->DP |=DP_LINK_TRAIN_OFF ;
@@ -1375,7 +1375,7 @@ intel_dp_start_link_train(struct intel_dp *intel_dp) DP_LINK_CONFIGURATION_SIZE);DP |=DP_PORT_EN ; -if (HAS_PCH_CPT (dev) && !is_edp (intel_dp)) +if (HAS_PCH_CPT (dev) && !is_cpu_edp (intel_dp))DP &= ~DP_LINK_TRAIN_MASK_CPT ;else DP &= ~DP_LINK_TRAIN_MASK ;
@@ -1394,7 +1394,7 @@ intel_dp_start_link_train(struct intel_dp *intel_dp)DP = (DP & ~(DP_VOLTAGE_MASK |DP_PRE_EMPHASIS_MASK )) | signal_levels; } -if (HAS_PCH_CPT (dev) && !is_edp (intel_dp)) +if (HAS_PCH_CPT (dev) && !is_cpu_edp (intel_dp)) reg =DP |DP_LINK_TRAIN_PAT_1_CPT ;else reg =DP |DP_LINK_TRAIN_PAT_1 ;
@@ -1469,7 +1469,7 @@ intel_dp_complete_link_train(struct intel_dp *intel_dp)DP = (DP & ~(DP_VOLTAGE_MASK |DP_PRE_EMPHASIS_MASK )) | signal_levels; } -if (HAS_PCH_CPT (dev) && !is_edp (intel_dp)) +if (HAS_PCH_CPT (dev) && !is_cpu_edp (intel_dp)) reg =DP |DP_LINK_TRAIN_PAT_2_CPT ;else reg =DP |DP_LINK_TRAIN_PAT_2 ;
@@ -1510,7 +1510,7 @@ intel_dp_complete_link_train(struct intel_dp *intel_dp) ++tries; } -if (HAS_PCH_CPT (dev) && !is_edp (intel_dp)) +if (HAS_PCH_CPT (dev) && !is_cpu_edp (intel_dp)) reg =DP |DP_LINK_TRAIN_OFF_CPT ;else reg =DP |DP_LINK_TRAIN_OFF ;
@@ -1540,7 +1540,7 @@ intel_dp_link_down(struct intel_dp *intel_dp)udelay (100 ); } -if (HAS_PCH_CPT (dev) && !is_edp (intel_dp)) { +if (HAS_PCH_CPT (dev) && !is_cpu_edp (intel_dp)) {DP &= ~DP_LINK_TRAIN_MASK_CPT ;I915_WRITE (intel_dp->output_reg,DP |DP_LINK_TRAIN_PAT_IDLE_CPT ); }else {
Signature · 1 line
1.7.6.4
Re: [PATCH 2/2] drm/i915/dp: Fix eDP on PCH DP on CPT/PPT
Quoted 5 lines · On Fri, 14 Oct 2011 17:22:26 -0400 Adam Jackson <[email protected]> wrote:
According to the gen6 docs, only the
DP_Aport (on-CPU eDP) still uses the old IBX bit shift for the link training pattern setup bits.Signed-off-by Adam Jackson <[email protected]>---
Looks good. Wish I had a test platform for this...
Reviewed-by Jesse Barnes <[email protected]>
for both patches.
Thanks,
Signature · 1 line
Jesse Barnes, Intel Open Source Technology Center
_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx