IVB fixes and 3 pipe support
Subsystems (2)
Latest patches; Eugeni can you reply with your tested-by? I think they're all ready for upstream.
Thanks,
Jesse
PATCH 1/14 drm/i915: PLL macro cleanup and pipe assertion check
Add a macro for accessing the two pipe PLLs and add a check to make sure we don't access a non-existent one in the enable/disable functions.
--- drivers/gpu/drm/i915/i915_reg.h | 6 +++--- drivers/gpu/drm/i915/intel_display.c | 6 ++++++ 2 files changed, 9 insertions(+), 3 deletions(-)
drivers/gpu/drm/i915/i915_reg.h +3 -3
@@ -2958,15 +2958,15 @@#define _PCH_DPLL_A 0xc6014#define _PCH_DPLL_B 0xc6018 -#define PCH_DPLL (pipe) _PIPE(pipe, _PCH_DPLL_A, _PCH_DPLL_B) +#define PCH_DPLL (pipe) (pipe == 0 ? _PCH_DPLL_A : _PCH_DPLL_B)#define _PCH_FPA0 0xc6040#define FP_CB_TUNE (0x3<<22)#define _PCH_FPA1 0xc6044#define _PCH_FPB0 0xc6048#define _PCH_FPB1 0xc604c -#define PCH_FP0 (pipe) _PIPE(pipe, _PCH_FPA0, _PCH_FPB0) -#define PCH_FP1 (pipe) _PIPE(pipe, _PCH_FPA1, _PCH_FPB1) +#define PCH_FP0 (pipe) (pipe == 0 ? _PCH_FPA0 : _PCH_FPB0) +#define PCH_FP1 (pipe) (pipe == 0 ? _PCH_FPA1 : _PCH_FPB1)#define PCH_DPLL_TEST 0xc606c
drivers/gpu/drm/i915/intel_display.c +6 -0
@@ -1172,6 +1172,9 @@ static void intel_enable_pch_pll(struct drm_i915_private *dev_priv,int reg;u32 val; +if (pipe >1 ) +return ; +/* PCH only available on ILK+ */ BUG_ON (dev_priv->info->gen <5 );
@@ -1192,6 +1195,9 @@ static void intel_disable_pch_pll(struct drm_i915_private *dev_priv,int reg;u32 val; +if (pipe >1 ) +return ; +/* PCH only available on ILK+ */ BUG_ON (dev_priv->info->gen <5 );
Signature · 1 line
1.7.4.1
PATCH 2/14 drm/i915: support 3 pipes on IVB+
In reply to Jesse BarnesWell almost anyway. IVB has 3 planes, pipes, transcoders, and FDI interfaces, but only 2 pipe PLLs. So two of the pipes must use the same pipe timings (e.g. 2 DP plus one other, or two HDMI with the same mode and one other, etc.).
--- drivers/gpu/drm/i915/i915_dma.c | 4 +++- drivers/gpu/drm/i915/i915_drv.h | 4 ++-- drivers/gpu/drm/i915/intel_display.c | 7 +++++++ drivers/gpu/drm/i915/intel_dp.c | 2 +- drivers/gpu/drm/i915/intel_hdmi.c | 2 +- drivers/gpu/drm/i915/intel_lvds.c | 8 +++++--- drivers/gpu/drm/i915/intel_sdvo.c | 2 +- 7 files changed, 20 insertions(+), 9 deletions(-)
drivers/gpu/drm/i915/i915_dma.c +3 -1
@@ -2035,7 +2035,9 @@ int i915_driver_load(struct drm_device *dev, unsigned long flags)spin_lock_init (&dev_priv->error_lock);spin_lock_init (&dev_priv->rps_lock); -if (IS_MOBILE (dev) || !IS_GEN2 (dev)) +if (IS_IVYBRIDGE (dev)) + dev_priv->num_pipe =3 ; +else if (IS_MOBILE (dev) || !IS_GEN2 (dev)) dev_priv->num_pipe =2 ;else dev_priv->num_pipe =1 ;
drivers/gpu/drm/i915/i915_drv.h +2 -2
@@ -676,8 +676,8 @@ typedef struct drm_i915_private {u32 pch_pf_pos, pch_pf_size;int panel_t3, panel_t12; -struct drm_crtc *plane_to_crtc_mapping[2 ]; -struct drm_crtc *pipe_to_crtc_mapping[2 ]; +struct drm_crtc *plane_to_crtc_mapping[3 ]; +struct drm_crtc *pipe_to_crtc_mapping[3 ];wait_queue_head_t pending_flip_queue;bool flip_pending_is_done;
drivers/gpu/drm/i915/intel_display.c +7 -0
@@ -2084,6 +2084,7 @@ static int ironlake_update_plane(struct drm_crtc *crtc,switch (plane) {case 0 :case 1 : +case 2 :break ;default :DRM_ERROR ("Can't update plane %d in SAREA\n" , plane);
@@ -2183,6 +2184,10 @@ intel_pipe_set_base(struct drm_crtc *crtc, int x, int y,case 0 :case 1 :break ; +case 2 : +if (IS_IVYBRIDGE (dev)) +break ; +/* fall through otherwise */ default :DRM_ERROR ("no plane for crtc\n" );return -EINVAL ;
@@ -2879,6 +2884,8 @@ 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) + temp |= (TRANSC_DPLL_ENABLE |TRANSC_DPLLB_SEL );I915_WRITE (PCH_DPLL_SEL , temp); }
drivers/gpu/drm/i915/intel_dp.c +1 -1
@@ -2000,7 +2000,7 @@ intel_dp_init(struct drm_device *dev, int output_reg)if (is_edp (intel_dp)) intel_encoder->clone_mask = (1 <<INTEL_EDP_CLONE_BIT ); - intel_encoder->crtc_mask = (1 <<0 ) | (1 <<1 ); + intel_encoder->crtc_mask = (1 <<0 ) | (1 <<1 ) | (1 <<2 ); connector->interlace_allowed = true; connector->doublescan_allowed =0 ;
drivers/gpu/drm/i915/intel_hdmi.c +1 -1
@@ -514,7 +514,7 @@ void intel_hdmi_init(struct drm_device *dev, int sdvox_reg) connector->polled =DRM_CONNECTOR_POLL_HPD ; connector->interlace_allowed =0 ; connector->doublescan_allowed =0 ; - intel_encoder->crtc_mask = (1 <<0 ) | (1 <<1 ); + intel_encoder->crtc_mask = (1 <<0 ) | (1 <<1 ) | (1 <<2 );/* Set up the DDC bus. */ if (sdvox_reg ==SDVOB ) {
drivers/gpu/drm/i915/intel_lvds.c +5 -3
@@ -888,9 +888,11 @@ bool intel_lvds_init(struct drm_device *dev) intel_encoder->type =INTEL_OUTPUT_LVDS ; intel_encoder->clone_mask = (1 <<INTEL_LVDS_CLONE_BIT ); - intel_encoder->crtc_mask = (1 <<1 ); -if (INTEL_INFO (dev)->gen >=5 ) - intel_encoder->crtc_mask |= (1 <<0 ); +if (HAS_PCH_SPLIT (dev)) + intel_encoder->crtc_mask = (1 <<0 ) | (1 <<1 ) | (1 <<2 ); +else + intel_encoder->crtc_mask = (1 <<1 ); +drm_encoder_helper_add (encoder, &intel_lvds_helper_funcs);drm_connector_helper_add (connector, &intel_lvds_connector_helper_funcs); connector->display_info.subpixel_order = SubPixelHorizontalRGB;
drivers/gpu/drm/i915/intel_sdvo.c +1 -1
@@ -2244,7 +2244,7 @@ intel_sdvo_output_setup(struct intel_sdvo *intel_sdvo, uint16_t flags) bytes[0], bytes[1]);return false; } - intel_sdvo->base.crtc_mask = (1 <<0 ) | (1 <<1 ); + intel_sdvo->base.crtc_mask = (1 <<0 ) | (1 <<1 ) | (1 <<2 );return true; }
Signature · 1 line
1.7.4.1
PATCH 3/14 drm/i915: split refclk code out of ironlake_crtc_mode_set
In reply to Jesse BarnesJust a cleanup to make the mode_set function more manageable.
--- drivers/gpu/drm/i915/intel_display.c | 45 ++++++++++++++++++++++++++------- 1 files changed, 35 insertions(+), 10 deletions(-)
drivers/gpu/drm/i915/intel_display.c +35 -10
@@ -5188,6 +5188,40 @@ static void ironlake_update_pch_refclk(struct drm_device *dev) } } +static int ironlake_get_refclk (struct drm_crtc *crtc) +{ +struct drm_device *dev = crtc->dev; +struct drm_i915_private *dev_priv = dev->dev_private; +struct intel_encoder *encoder; +struct drm_mode_config *mode_config = &dev->mode_config; +struct intel_encoder *edp_encoder =NULL ; +int num_connectors =0 ; +bool is_lvds = false; + +list_for_each_entry (encoder, &mode_config->encoder_list, base.head) { +if (encoder->base.crtc != crtc) +continue ; + +switch (encoder->type) { +case INTEL_OUTPUT_LVDS : + is_lvds = true; +break ; +case INTEL_OUTPUT_EDP : + edp_encoder = encoder; +break ; + } + num_connectors++; + } + +if (is_lvds &&intel_panel_use_ssc (dev_priv) && num_connectors <2 ) { +DRM_DEBUG_KMS ("using SSC reference clock of %d MHz\n" , + dev_priv->lvds_ssc_freq); +return dev_priv->lvds_ssc_freq *1000 ; + } + +return 120000 ; +} + static int ironlake_crtc_mode_set(struct drm_crtc *crtc, struct drm_display_mode *mode, struct drm_display_mode *adjusted_mode,
@@ -5247,16 +5281,7 @@ static int ironlake_crtc_mode_set(struct drm_crtc *crtc, num_connectors++; } -if (is_lvds &&intel_panel_use_ssc (dev_priv) && num_connectors <2 ) { - refclk = dev_priv->lvds_ssc_freq *1000 ; -DRM_DEBUG_KMS ("using SSC reference clock of %d MHz\n" , - refclk /1000 ); - }else { - refclk =96000 ; -if (!has_edp_encoder || -intel_encoder_is_pch_edp (&has_edp_encoder->base)) - refclk =120000 ;/* 120Mhz refclk */ - } + refclk =ironlake_get_refclk (crtc);/* * Returns a set of divisors for the desired target clock with the given
Signature · 1 line
1.7.4.1
PATCH 4/14 drm/i915: use transcoder select bits on VGA and HDMI on CPT
In reply to Jesse BarnesRequired for 3 pipe functionality.
--- drivers/gpu/drm/i915/intel_crt.c | 18 +++++++----------- drivers/gpu/drm/i915/intel_hdmi.c | 10 ++++------ 2 files changed, 11 insertions(+), 17 deletions(-)
drivers/gpu/drm/i915/intel_crt.c +7 -11
@@ -152,17 +152,13 @@ static void intel_crt_mode_set(struct drm_encoder *encoder,if (adjusted_mode->flags &DRM_MODE_FLAG_PVSYNC ) adpa |=ADPA_VSYNC_ACTIVE_HIGH ; -if (intel_crtc->pipe ==0 ) { -if (HAS_PCH_CPT (dev)) - adpa |=PORT_TRANS_A_SEL_CPT ; -else - adpa |=ADPA_PIPE_A_SELECT ; - }else { -if (HAS_PCH_CPT (dev)) - adpa |=PORT_TRANS_B_SEL_CPT ; -else - adpa |=ADPA_PIPE_B_SELECT ; - } +/* For CPT allow 3 pipe config, for others just use A or B */ +if (HAS_PCH_CPT (dev)) + adpa |=PORT_TRANS_SEL_CPT (intel_crtc->pipe); +else if (intel_crtc->pipe ==0 ) + adpa |=ADPA_PIPE_A_SELECT ; +else + adpa |=ADPA_PIPE_B_SELECT ;if (!HAS_PCH_SPLIT (dev))I915_WRITE (BCLRPAT (intel_crtc->pipe),0 );
drivers/gpu/drm/i915/intel_hdmi.c +4 -6
@@ -252,12 +252,10 @@ static void intel_hdmi_mode_set(struct drm_encoder *encoder,intel_write_eld (encoder, adjusted_mode); } -if (intel_crtc->pipe ==1 ) { -if (HAS_PCH_CPT (dev)) - sdvox |=PORT_TRANS_B_SEL_CPT ; -else - sdvox |=SDVO_PIPE_B_SELECT ; - } +if (HAS_PCH_CPT (dev)) + sdvox |=PORT_TRANS_SEL_CPT (intel_crtc->pipe); +else if (intel_crtc->pipe ==1 ) + sdvox |=SDVO_PIPE_B_SELECT ;I915_WRITE (intel_hdmi->sdvox_reg, sdvox);POSTING_READ (intel_hdmi->sdvox_reg);
Signature · 1 line
1.7.4.1
PATCH 5/14 drm/i915: fix PCH PLL assertion check for 3 pipes
In reply to Jesse BarnesAdd a couple of checks now that we're using the 3rd transcoder:
1) make sure the transcoder PLL enable bit is set for the transcoder in question
2) when checking actual PLL enable, use the selected PLL number rather than the transcoder number (they could be different now)
--- drivers/gpu/drm/i915/intel_display.c | 13 +++++++++++++ 1 files changed, 13 insertions(+), 0 deletions(-)
drivers/gpu/drm/i915/intel_display.c +13 -0
@@ -803,6 +803,19 @@ static void assert_pch_pll(struct drm_i915_private *dev_priv,u32 val;bool cur_state; +if (HAS_PCH_CPT (dev_priv->dev)) { +u32 pch_dpll; + + pch_dpll =I915_READ (PCH_DPLL_SEL ); + +/* Make sure the selected PLL is enabled to the transcoder */ +WARN (!((pch_dpll >> (4 * pipe)) &8 ), +"transcoder %d PLL not enabled\n" , pipe); + +/* Convert the transcoder pipe number to a pll pipe number */ + pipe = (pch_dpll >> (4 * pipe)) &1 ; + } + reg =PCH_DPLL (pipe); val =I915_READ (reg); cur_state = !!(val &DPLL_VCO_ENABLE );
Signature · 1 line
1.7.4.1
PATCH 6/14 drm/i915: always set FDI composite sync bit
In reply to Jesse BarnesOn IVB with CPT or PPT PCH chips, FDI sync can be done with one or two wires depending on the board configuration. For 3 pipe configurations, since FDI B and C share lanes, composite sync must be used. The board design specs require that composite sync always work in general too, so just use it by default, since we don't currently have a way of knowing if frame/line sync are supported on a given board.
--- drivers/gpu/drm/i915/i915_reg.h | 1 + drivers/gpu/drm/i915/intel_display.c | 2 ++ 2 files changed, 3 insertions(+), 0 deletions(-)
drivers/gpu/drm/i915/i915_reg.h +1 -0
@@ -3180,6 +3180,7 @@#define FDI_LINK_TRAIN_NONE_IVB (3<<8)/* both Tx and Rx */ +#define FDI_COMPOSITE_SYNC (1<<11)#define FDI_LINK_TRAIN_AUTO (1<<10)#define FDI_SCRAMBLING_ENABLE (0<<7)#define FDI_SCRAMBLING_DISABLE (1<<7)
drivers/gpu/drm/i915/intel_display.c +2 -0
@@ -2617,6 +2617,7 @@ static void ivb_manual_fdi_link_train(struct drm_crtc *crtc) temp |=FDI_LINK_TRAIN_PATTERN_1_IVB ; temp &= ~FDI_LINK_TRAIN_VOL_EMP_MASK ; temp |=FDI_LINK_TRAIN_400MV_0DB_SNB_B ; + temp |=FDI_COMPOSITE_SYNC ;I915_WRITE (reg, temp |FDI_TX_ENABLE ); reg =FDI_RX_CTL (pipe);
@@ -2624,6 +2625,7 @@ static void ivb_manual_fdi_link_train(struct drm_crtc *crtc) temp &= ~FDI_LINK_TRAIN_AUTO ; temp &= ~FDI_LINK_TRAIN_PATTERN_MASK_CPT ; temp |=FDI_LINK_TRAIN_PATTERN_1_CPT ; + temp |=FDI_COMPOSITE_SYNC ;I915_WRITE (reg, temp |FDI_RX_ENABLE );POSTING_READ (reg);
Signature · 1 line
1.7.4.1
PATCH 7/14 drm/i915: add PLL sharing support to handle 3 pipes
In reply to Jesse BarnesAdd two new fields to the intel_crtc struct for 3 pipe support: no_pll and use_pll_a. The no_pll field is only set on the 3rd pipe to indicate that it doesn't have a PLL of its own and so shouldn't try to write the main PLL regs. The use_pll_a field controls which PLL pipe 3 will share, A or B. The core code will try to share PLLs with whichever pipe has the same timings, rejecting the mode set if none is found. This means that pipe 3 must always be set after one of the other pipes has been configured with real PLL settings.
--- drivers/gpu/drm/i915/intel_display.c | 87 +++++++++++++++++++++------------- drivers/gpu/drm/i915/intel_drv.h | 3 + 2 files changed, 57 insertions(+), 33 deletions(-)
drivers/gpu/drm/i915/intel_display.c +54 -33
@@ -2885,7 +2885,7 @@ static void ironlake_pch_enable(struct drm_crtc *crtc)struct drm_i915_private *dev_priv = dev->dev_private;struct intel_crtc *intel_crtc =to_intel_crtc (crtc);int pipe = intel_crtc->pipe; -u32 reg, temp; +u32 reg, temp, transc_sel;/* For PCH output, training FDI link */ dev_priv->display.fdi_link_train (crtc);
@@ -2893,6 +2893,9 @@ static void ironlake_pch_enable(struct drm_crtc *crtc)intel_enable_pch_pll (dev_priv, pipe);if (HAS_PCH_CPT (dev)) { + transc_sel = intel_crtc->use_pll_a ?TRANSC_DPLLA_SEL : +TRANSC_DPLLB_SEL ; +/* Be sure PCH DPLL SEL is set */ temp =I915_READ (PCH_DPLL_SEL );if (pipe ==0 && (temp &TRANSA_DPLL_ENABLE ) ==0 )
@@ -2900,7 +2903,7 @@ static void ironlake_pch_enable(struct drm_crtc *crtc)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 ) - temp |= (TRANSC_DPLL_ENABLE |TRANSC_DPLLB_SEL ); + temp |= (TRANSC_DPLL_ENABLE | transc_sel);I915_WRITE (PCH_DPLL_SEL , temp); }
@@ -3072,8 +3075,8 @@ static void ironlake_crtc_disable(struct drm_crtc *crtc) temp &= ~(TRANSB_DPLL_ENABLE |TRANSB_DPLLB_SEL );break ;case 2 : -/* FIXME: manage transcoder PLLs? */ - temp &= ~(TRANSC_DPLL_ENABLE |TRANSC_DPLLB_SEL ); +/* C shares PLL A or B */ + temp &= ~(TRANSC_DPLL_ENABLE |TRANSB_DPLLB_SEL );break ;default :BUG ();/* wtf */
@@ -3082,7 +3085,8 @@ static void ironlake_crtc_disable(struct drm_crtc *crtc) }/* disable PCH DPLL */ -intel_disable_pch_pll (dev_priv, pipe); +if (!intel_crtc->no_pll) +intel_disable_pch_pll (dev_priv, pipe);/* Switch from PCDclk to Rawclk */ reg =FDI_RX_CTL (pipe);
@@ -5500,16 +5504,33 @@ static int ironlake_crtc_mode_set(struct drm_crtc *crtc,drm_mode_debug_printmodeline (mode);/* PCH eDP needs FDI, but CPU eDP does not */ -if (!has_edp_encoder ||intel_encoder_is_pch_edp (&has_edp_encoder->base)) { +if (!intel_crtc->no_pll && + (!has_edp_encoder || +intel_encoder_is_pch_edp (&has_edp_encoder->base))) {I915_WRITE (PCH_FP0 (pipe), fp);I915_WRITE (PCH_DPLL (pipe), dpll & ~DPLL_VCO_ENABLE );POSTING_READ (PCH_DPLL (pipe));udelay (150 ); + }else { +if (dpll == (I915_READ (PCH_DPLL (0 )) &0x7fffffff ) && + fp ==I915_READ (PCH_FP0 (0 ))) { + intel_crtc->use_pll_a = true; +DRM_DEBUG_KMS ("using pipe a dpll\n" ); + }else if (dpll == (I915_READ (PCH_DPLL (1 )) &0x7fffffff ) && + fp ==I915_READ (PCH_FP0 (1 ))) { + intel_crtc->use_pll_a = false; +DRM_DEBUG_KMS ("using pipe b dpll\n" ); + }else { +DRM_DEBUG_KMS ("no matching PLL configuration for pipe 2\n" ); +return -EINVAL ; + } }/* enable transcoder DPLL */ if (HAS_PCH_CPT (dev)) { +u32 transc_sel = intel_crtc->use_pll_a ?TRANSC_DPLLA_SEL : +TRANSC_DPLLB_SEL ; temp =I915_READ (PCH_DPLL_SEL );switch (pipe) {case 0 :
@@ -5519,8 +5540,7 @@ static int ironlake_crtc_mode_set(struct drm_crtc *crtc, temp |=TRANSB_DPLL_ENABLE |TRANSB_DPLLB_SEL ;break ;case 2 : -/* FIXME: manage transcoder PLLs? */ - temp |=TRANSC_DPLL_ENABLE |TRANSC_DPLLB_SEL ; + temp |=TRANSC_DPLL_ENABLE | transc_sel;break ;default :BUG ();
@@ -5538,17 +5558,13 @@ static int ironlake_crtc_mode_set(struct drm_crtc *crtc,if (is_lvds) { temp =I915_READ (PCH_LVDS ); temp |=LVDS_PORT_EN |LVDS_A0A2_CLKA_POWER_UP ; -if (pipe ==1 ) { -if (HAS_PCH_CPT (dev)) - temp |=PORT_TRANS_B_SEL_CPT ; -else - temp |=LVDS_PIPEB_SELECT ; - }else { -if (HAS_PCH_CPT (dev)) - temp &= ~PORT_TRANS_SEL_MASK ; -else - temp &= ~LVDS_PIPEB_SELECT ; - } +if (HAS_PCH_CPT (dev)) + temp |=PORT_TRANS_SEL_CPT (pipe); +else if (pipe ==1 ) + temp |=LVDS_PIPEB_SELECT ; +else + temp &= ~LVDS_PIPEB_SELECT ; +/* set the corresponsding LVDS_BORDER bit */ temp |= dev_priv->lvds_border_bits;/* Set the B0-B3 data pairs corresponding to whether we're going to
@@ -5598,8 +5614,9 @@ static int ironlake_crtc_mode_set(struct drm_crtc *crtc,I915_WRITE (TRANSDPLINK_N1 (pipe),0 ); } -if (!has_edp_encoder || -intel_encoder_is_pch_edp (&has_edp_encoder->base)) { +if (!intel_crtc->no_pll && + (!has_edp_encoder || +intel_encoder_is_pch_edp (&has_edp_encoder->base))) {I915_WRITE (PCH_DPLL (pipe), dpll);/* Wait for the clocks to stabilize. */
@@ -5615,18 +5632,20 @@ static int ironlake_crtc_mode_set(struct drm_crtc *crtc, } intel_crtc->lowfreq_avail = false; -if (is_lvds && has_reduced_clock && i915_powersave) { -I915_WRITE (PCH_FP1 (pipe), fp2); - intel_crtc->lowfreq_avail = true; -if (HAS_PIPE_CXSR (dev)) { -DRM_DEBUG_KMS ("enabling CxSR downclocking\n" ); - pipeconf |=PIPECONF_CXSR_DOWNCLOCK ; - } - }else { -I915_WRITE (PCH_FP1 (pipe), fp); -if (HAS_PIPE_CXSR (dev)) { -DRM_DEBUG_KMS ("disabling CxSR downclocking\n" ); - pipeconf &= ~PIPECONF_CXSR_DOWNCLOCK ; +if (!intel_crtc->no_pll) { +if (is_lvds && has_reduced_clock && i915_powersave) { +I915_WRITE (PCH_FP1 (pipe), fp2); + intel_crtc->lowfreq_avail = true; +if (HAS_PIPE_CXSR (dev)) { +DRM_DEBUG_KMS ("enabling CxSR downclocking\n" ); + pipeconf |=PIPECONF_CXSR_DOWNCLOCK ; + } + }else { +I915_WRITE (PCH_FP1 (pipe), fp); +if (HAS_PIPE_CXSR (dev)) { +DRM_DEBUG_KMS ("disabling CxSR downclocking\n" ); + pipeconf &= ~PIPECONF_CXSR_DOWNCLOCK ; + } } }
@@ -7242,6 +7261,8 @@ static void intel_crtc_init(struct drm_device *dev, int pipe) intel_crtc->bpp =24 ;/* default for pre-Ironlake */ if (HAS_PCH_SPLIT (dev)) { +if (pipe ==2 &&IS_IVYBRIDGE (dev)) + intel_crtc->no_pll = true; intel_helper_funcs.prepare = ironlake_crtc_prepare; intel_helper_funcs.commit = ironlake_crtc_commit; }else {
drivers/gpu/drm/i915/intel_drv.h +3 -0
@@ -171,6 +171,9 @@ struct intel_crtc {int16_t cursor_width, cursor_height;bool cursor_visible;unsigned int bpp; + +bool no_pll;/* tertiary pipe for IVB */ +bool use_pll_a; };#define to_intel_crtc (x) container_of(x, struct intel_crtc, base)
Signature · 1 line
1.7.4.1
Re: [PATCH 07/14] drm/i915: add PLL sharing support to handle 3 pipes
Quoted 13 lines · Jesse Barnes
drivers/gpu/drm/i915/intel_display.c +6
-1/* PCH eDP needs FDI, but CPU eDP does not */ -if (!has_edp_encoder ||intel_encoder_is_pch_edp (&has_edp_encoder->base)) { +if (!intel_crtc->no_pll && + (!has_edp_encoder || +intel_encoder_is_pch_edp (&has_edp_encoder->base))) {I915_WRITE (PCH_FP0 (pipe), fp);I915_WRITE (PCH_DPLL (pipe), dpll & ~DPLL_VCO_ENABLE );POSTING_READ (PCH_DPLL (pipe));udelay (150 ); + }else { +if (dpll == (I915_READ (PCH_DPLL (0 )) &0x7fffffff ) && + fp ==I915_READ (PCH_FP0 (0 ))) {
drivers/gpu/drm/i915/intel_display.c static int ironlake_crtc_mode_set(struct drm_crtc *crtc, · line 5527
Quoted 10 lines
drivers/gpu/drm/i915/intel_display.c +10
-0+ intel_crtc->use_pll_a = true; +DRM_DEBUG_KMS ("using pipe a dpll\n" ); + }else if (dpll == (I915_READ (PCH_DPLL (1 )) &0x7fffffff ) && + fp ==I915_READ (PCH_FP0 (1 ))) { + intel_crtc->use_pll_a = false; +DRM_DEBUG_KMS ("using pipe b dpll\n" ); + }else { +DRM_DEBUG_KMS ("no matching PLL configuration for pipe 2\n" ); +return -EINVAL ; + }
This hunk breaks eDP nicely -- you end up in the 'else' clause still looking for a DPLL to use.
Here's my suggested replacement:
/* PCH eDP needs FDI, but CPU eDP does not */
- if (!has_edp_encoder || intel_encoder_is_pch_edp(&has_edp_encoder->base)) {
- I915_WRITE(PCH_FP0(pipe), fp);
- I915_WRITE(PCH_DPLL(pipe), dpll & ~DPLL_VCO_ENABLE);
-
- POSTING_READ(PCH_DPLL(pipe));
- udelay(150);
+ if (!intel_crtc->no_pll) {
+ if (!has_edp_encoder ||
+ intel_encoder_is_pch_edp(&has_edp_encoder->base)) {
+ I915_WRITE(PCH_FP0(pipe), fp);
+ I915_WRITE(PCH_DPLL(pipe), dpll & ~DPLL_VCO_ENABLE);
+
+ POSTING_READ(PCH_DPLL(pipe));
+ udelay(150);
+ }
+ } else {
+ if (dpll == (I915_READ(PCH_DPLL(0)) & 0x7fffffff) &&
+ fp == I915_READ(PCH_FP0(0))) {
+ intel_crtc->use_pll_a = true;
+ DRM_DEBUG_KMS("using pipe a dpll\n");
+ } else if (dpll == (I915_READ(PCH_DPLL(1)) & 0x7fffffff) &&
+ fp == I915_READ(PCH_FP0(1))) {
+ intel_crtc->use_pll_a = false;
+ DRM_DEBUG_KMS("using pipe b dpll\n");
+ } else {
+ DRM_DEBUG_KMS("no matching PLL configuration for pipe 2\n");
+ return -EINVAL;
+ }
}
Signature · 1 line
[email protected]
_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [PATCH 07/14] drm/i915: add PLL sharing support to handle 3 pipes
Quoted 51 lines · On Thu, 20 Oct 2011 23:18:06 -0700 Keith Packard <[email protected]> wrote:
Quoted 13 lines · Jesse Barnes
drivers/gpu/drm/i915/intel_display.c +6
-1/* PCH eDP needs FDI, but CPU eDP does not */ -if (!has_edp_encoder ||intel_encoder_is_pch_edp (&has_edp_encoder->base)) { +if (!intel_crtc->no_pll && + (!has_edp_encoder || +intel_encoder_is_pch_edp (&has_edp_encoder->base))) {I915_WRITE (PCH_FP0 (pipe), fp);I915_WRITE (PCH_DPLL (pipe), dpll & ~DPLL_VCO_ENABLE );POSTING_READ (PCH_DPLL (pipe));udelay (150 ); + }else { +if (dpll == (I915_READ (PCH_DPLL (0 )) &0x7fffffff ) && + fp ==I915_READ (PCH_FP0 (0 ))) {drivers/gpu/drm/i915/intel_display.c static int ironlake_crtc_mode_set(struct drm_crtc *crtc, · line 5527
Quoted 10 lines
drivers/gpu/drm/i915/intel_display.c +10
-0+ intel_crtc->use_pll_a = true; +DRM_DEBUG_KMS ("using pipe a dpll\n" ); + }else if (dpll == (I915_READ (PCH_DPLL (1 )) &0x7fffffff ) && + fp ==I915_READ (PCH_FP0 (1 ))) { + intel_crtc->use_pll_a = false; +DRM_DEBUG_KMS ("using pipe b dpll\n" ); + }else { +DRM_DEBUG_KMS ("no matching PLL configuration for pipe 2\n" ); +return -EINVAL ; + }This hunk breaks eDP nicely -- you end up in the 'else' clause still looking for a DPLL to use.
Here's my suggested replacement:
drivers/gpu/drm/i915/intel_display.c +13
-6/* PCH eDP needs FDI, but CPU eDP does not */ -if (!has_edp_encoder ||intel_encoder_is_pch_edp (&has_edp_encoder->base)) { -I915_WRITE (PCH_FP0 (pipe), fp); -I915_WRITE (PCH_DPLL (pipe), dpll & ~DPLL_VCO_ENABLE ); - -POSTING_READ (PCH_DPLL (pipe)); -udelay (150 ); +if (!intel_crtc->no_pll) { +if (!has_edp_encoder || +intel_encoder_is_pch_edp (&has_edp_encoder->base)) { +I915_WRITE (PCH_FP0 (pipe), fp); +I915_WRITE (PCH_DPLL (pipe), dpll & ~DPLL_VCO_ENABLE ); + +POSTING_READ (PCH_DPLL (pipe)); +udelay (150 ); + } + }else { +if (dpll == (I915_READ (PCH_DPLL (0 )) &0x7fffffff ) && + fp ==I915_READ (PCH_FP0 (0 ))) { + intel_crtc->use_pll_a = true;
drivers/gpu/drm/i915/intel_display.c static int ironlake_crtc_mode_set(struct drm_crtc *crtc, · line 5528
Quoted 10 lines
drivers/gpu/drm/i915/intel_display.c +9
-0+DRM_DEBUG_KMS ("using pipe a dpll\n" ); + }else if (dpll == (I915_READ (PCH_DPLL (1 )) &0x7fffffff ) && + fp ==I915_READ (PCH_FP0 (1 ))) { + intel_crtc->use_pll_a = false; +DRM_DEBUG_KMS ("using pipe b dpll\n" ); + }else { +DRM_DEBUG_KMS ("no matching PLL configuration for pipe 2\n" ); +return -EINVAL ; + } }
Ah of course. Looks like your patch should work; I'll test on my CPU eDP system to confirm.
Signature · 1 line
Jesse Barnes, Intel Open Source Technology Center
Re: [PATCH 07/14] drm/i915: add PLL sharing support to handle 3 pipes
In reply to Keith PackardQuoted 52 lines · On Thu, 20 Oct 2011 23:18:06 -0700 Keith Packard <[email protected]> wrote:
Quoted 13 lines · Jesse Barnes
drivers/gpu/drm/i915/intel_display.c +6
-1/* PCH eDP needs FDI, but CPU eDP does not */ -if (!has_edp_encoder ||intel_encoder_is_pch_edp (&has_edp_encoder->base)) { +if (!intel_crtc->no_pll && + (!has_edp_encoder || +intel_encoder_is_pch_edp (&has_edp_encoder->base))) {I915_WRITE (PCH_FP0 (pipe), fp);I915_WRITE (PCH_DPLL (pipe), dpll & ~DPLL_VCO_ENABLE );POSTING_READ (PCH_DPLL (pipe));udelay (150 ); + }else { +if (dpll == (I915_READ (PCH_DPLL (0 )) &0x7fffffff ) && + fp ==I915_READ (PCH_FP0 (0 ))) {drivers/gpu/drm/i915/intel_display.c static int ironlake_crtc_mode_set(struct drm_crtc *crtc, · line 5527
Quoted 10 lines
drivers/gpu/drm/i915/intel_display.c +10
-0+ intel_crtc->use_pll_a = true; +DRM_DEBUG_KMS ("using pipe a dpll\n" ); + }else if (dpll == (I915_READ (PCH_DPLL (1 )) &0x7fffffff ) && + fp ==I915_READ (PCH_FP0 (1 ))) { + intel_crtc->use_pll_a = false; +DRM_DEBUG_KMS ("using pipe b dpll\n" ); + }else { +DRM_DEBUG_KMS ("no matching PLL configuration for pipe 2\n" ); +return -EINVAL ; + }This hunk breaks eDP nicely -- you end up in the 'else' clause still looking for a DPLL to use.
Here's my suggested replacement:
drivers/gpu/drm/i915/intel_display.c +13
-6/* PCH eDP needs FDI, but CPU eDP does not */ -if (!has_edp_encoder ||intel_encoder_is_pch_edp (&has_edp_encoder->base)) { -I915_WRITE (PCH_FP0 (pipe), fp); -I915_WRITE (PCH_DPLL (pipe), dpll & ~DPLL_VCO_ENABLE ); - -POSTING_READ (PCH_DPLL (pipe)); -udelay (150 ); +if (!intel_crtc->no_pll) { +if (!has_edp_encoder || +intel_encoder_is_pch_edp (&has_edp_encoder->base)) { +I915_WRITE (PCH_FP0 (pipe), fp); +I915_WRITE (PCH_DPLL (pipe), dpll & ~DPLL_VCO_ENABLE ); + +POSTING_READ (PCH_DPLL (pipe)); +udelay (150 ); + } + }else { +if (dpll == (I915_READ (PCH_DPLL (0 )) &0x7fffffff ) && + fp ==I915_READ (PCH_FP0 (0 ))) { + intel_crtc->use_pll_a = true;
drivers/gpu/drm/i915/intel_display.c static int ironlake_crtc_mode_set(struct drm_crtc *crtc, · line 5528
Quoted 10 lines
drivers/gpu/drm/i915/intel_display.c +9
-0+DRM_DEBUG_KMS ("using pipe a dpll\n" ); + }else if (dpll == (I915_READ (PCH_DPLL (1 )) &0x7fffffff ) && + fp ==I915_READ (PCH_FP0 (1 ))) { + intel_crtc->use_pll_a = false; +DRM_DEBUG_KMS ("using pipe b dpll\n" ); + }else { +DRM_DEBUG_KMS ("no matching PLL configuration for pipe 2\n" ); +return -EINVAL ; + } }
Yeah works much better with this applied. Makes me want to change the PLL sharing code a bit though; this should be factored out into a separate function and I should probably just add a tiny PLL allocator for the pipes. That would make some of the code a little cleaner I think, though add a bit more configuration complexity...
Signature · 1 line
Jesse Barnes, Intel Open Source Technology Center
Re: [PATCH 07/14] drm/i915: add PLL sharing support to handle 3 pipes
Quoted 4 lines · Jesse Barnes
Yeah works much better with this applied. Makes me want to change the PLL sharing code a bit though; this should be factored out into a separate function and I should probably just add a tiny PLL allocator for the pipes.
That would allow sharing of PLLs between any two pipes? Seems like a nicer plan.
Quoted 2 lines
Tested-by Jesse Barnes <[email protected]>Acked-by Jesse Barnes <[email protected]>
I just smashed your original patch so that bisect would work across it.
Signature · 1 line
[email protected]
_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH 8/14 drm/i915: fix debug output for 3 pipe configs
In reply to Jesse BarnesWe can have more than just A and B these days.
--- drivers/gpu/drm/i915/intel_display.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/gpu/drm/i915/intel_display.c +1 -1
@@ -5500,7 +5500,7 @@ static int ironlake_crtc_mode_set(struct drm_crtc *crtc,/* Set up the display plane register */ dspcntr =DISPPLANE_GAMMA_ENABLE ; -DRM_DEBUG_KMS ("Mode for pipe %c:\n" , pipe ==0 ?'A' :'B' ); +DRM_DEBUG_KMS ("Mode for pipe %d:\n" , pipe);drm_mode_debug_printmodeline (mode);/* PCH eDP needs FDI, but CPU eDP does not */
Signature · 1 line
1.7.4.1
PATCH 9/14 drm/i915: fix IVB cursor support
In reply to Jesse BarnesThe cursor regs have moved around, add the offsets and new macros for getting at them.
--- drivers/gpu/drm/i915/i915_reg.h | 8 ++++++ drivers/gpu/drm/i915/intel_display.c | 40 +++++++++++++++++++++++++++++---- 2 files changed, 43 insertions(+), 5 deletions(-)
drivers/gpu/drm/i915/i915_reg.h +8 -0
@@ -2567,10 +2567,18 @@#define _CURBBASE 0x700c4#define _CURBPOS 0x700c8 +#define _CURBCNTR_IVB 0x71080 +#define _CURBBASE_IVB 0x71084 +#define _CURBPOS_IVB 0x71088 +#define CURCNTR (pipe) _PIPE(pipe, _CURACNTR, _CURBCNTR)#define CURBASE (pipe) _PIPE(pipe, _CURABASE, _CURBBASE)#define CURPOS (pipe) _PIPE(pipe, _CURAPOS, _CURBPOS) +#define CURCNTR_IVB (pipe) _PIPE(pipe, _CURACNTR, _CURBCNTR_IVB) +#define CURBASE_IVB (pipe) _PIPE(pipe, _CURABASE, _CURBBASE_IVB) +#define CURPOS_IVB (pipe) _PIPE(pipe, _CURAPOS, _CURBPOS_IVB) +/* Display A control */ #define _DSPACNTR 0x70180#define DISPLAY_PLANE_ENABLE (1<<31)
drivers/gpu/drm/i915/intel_display.c +35 -5
@@ -5948,6 +5948,31 @@ static void i9xx_update_cursor(struct drm_crtc *crtc, u32 base)I915_WRITE (CURBASE (pipe), base); } +static void ivb_update_cursor (struct drm_crtc *crtc,u32 base) +{ +struct drm_device *dev = crtc->dev; +struct drm_i915_private *dev_priv = dev->dev_private; +struct intel_crtc *intel_crtc =to_intel_crtc (crtc); +int pipe = intel_crtc->pipe; +bool visible = base !=0 ; + +if (intel_crtc->cursor_visible != visible) { +uint32_t cntl =I915_READ (CURCNTR_IVB (pipe)); +if (base) { + cntl &= ~CURSOR_MODE ; + cntl |=CURSOR_MODE_64_ARGB_AX |MCURSOR_GAMMA_ENABLE ; + }else { + cntl &= ~(CURSOR_MODE |MCURSOR_GAMMA_ENABLE ); + cntl |=CURSOR_MODE_DISABLE ; + } +I915_WRITE (CURCNTR_IVB (pipe), cntl); + + intel_crtc->cursor_visible = visible; + } +/* and commit changes on next vblank */ +I915_WRITE (CURBASE_IVB (pipe), base); +} +/* If no-part of the cursor is visible on the framebuffer, then the GPU may hang... */ static void intel_crtc_update_cursor (struct drm_crtc *crtc,bool on)
@@ -5995,11 +6020,16 @@ static void intel_crtc_update_cursor(struct drm_crtc *crtc,if (!visible && !intel_crtc->cursor_visible)return ; -I915_WRITE (CURPOS (pipe), pos); -if (IS_845G (dev) ||IS_I865G (dev)) -i845_update_cursor (crtc, base); -else -i9xx_update_cursor (crtc, base); +if (IS_IVYBRIDGE (dev)) { +I915_WRITE (CURPOS_IVB (pipe), pos); +ivb_update_cursor (crtc, base); + }else { +I915_WRITE (CURPOS (pipe), pos); +if (IS_845G (dev) ||IS_I865G (dev)) +i845_update_cursor (crtc, base); +else +i9xx_update_cursor (crtc, base); + }if (visible)intel_mark_busy (dev,to_intel_framebuffer (crtc->fb)->obj);
Signature · 1 line
1.7.4.1
PATCH 10/14 drm/i915: fix transcoder PLL select masking
In reply to Jesse BarnesTranscoder 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.
--- drivers/gpu/drm/i915/intel_display.c | 15 ++++++++++----- 1 files changed, 10 insertions(+), 5 deletions(-)
drivers/gpu/drm/i915/intel_display.c +10 -5
@@ -2898,12 +2898,16 @@ static void ironlake_pch_enable(struct drm_crtc *crtc)/* Be sure PCH DPLL SEL is set */ temp =I915_READ (PCH_DPLL_SEL ); -if (pipe ==0 && (temp &TRANSA_DPLL_ENABLE ) ==0 ) +if (pipe ==0 ) { + temp &= ~(TRANSA_DPLLB_SEL ); temp |= (TRANSA_DPLL_ENABLE |TRANSA_DPLLA_SEL ); -else if (pipe ==1 && (temp &TRANSB_DPLL_ENABLE ) ==0 ) + }else if (pipe ==1 ) { + temp &= ~(TRANSB_DPLLB_SEL ); temp |= (TRANSB_DPLL_ENABLE |TRANSB_DPLLB_SEL ); -else if (pipe ==2 && (temp &TRANSC_DPLL_ENABLE ) ==0 ) + }else if (pipe ==2 ) { + temp &= ~(TRANSC_DPLLB_SEL ); temp |= (TRANSC_DPLL_ENABLE | transc_sel); + }I915_WRITE (PCH_DPLL_SEL , temp); }
@@ -3069,14 +3073,14 @@ 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 );break ;case 2 :/* C shares PLL A or B */ - temp &= ~(TRANSC_DPLL_ENABLE |TRANSB_DPLLB_SEL ); + temp &= ~(TRANSC_DPLL_ENABLE |TRANSC_DPLLB_SEL );break ;default :BUG ();/* wtf */
@@ -5540,6 +5544,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
PATCH 11/14 drm/i915: export a CPT mode set verification function
In reply to Jesse BarnesAt the point where we check, we can't do much about the failure, but it can aid debugging. Note that the auto-train override bit will be reset as part of normal mode setting with this patch if a pipe ever does get stuck, but that's consistent with the workaround for CPT provided by the hardware team. This patch helped catch the fact that the pipe wasn't running in the !composite sync FDI case on my IVB SDV, so has already shown to be useful.
--- drivers/gpu/drm/i915/intel_display.c | 25 +++++++++++++++++++++++++ drivers/gpu/drm/i915/intel_dp.c | 4 ++++ drivers/gpu/drm/i915/intel_drv.h | 2 ++ 3 files changed, 31 insertions(+), 0 deletions(-)
drivers/gpu/drm/i915/intel_display.c +25 -0
@@ -2963,6 +2963,24 @@ static void ironlake_pch_enable(struct drm_crtc *crtc)intel_enable_transcoder (dev_priv, pipe); } +void intel_cpt_verify_modeset (struct drm_device *dev,int pipe) +{ +struct drm_i915_private *dev_priv = dev->dev_private; +int dslreg =PIPEDSL (pipe), tc2reg =TRANS_CHICKEN2 (pipe); +u32 temp; + + temp =I915_READ (dslreg); +udelay (500 ); +if (wait_for (I915_READ (dslreg) != temp,5 )) { +/* Without this, mode sets may fail silently on FDI */ +I915_WRITE (tc2reg,TRANS_AUTOTRAIN_GEN_STALL_DIS ); +udelay (250 ); +I915_WRITE (tc2reg,0 ); +if (wait_for (I915_READ (dslreg) != temp,5 )) +DRM_ERROR ("mode set failed: pipe %d stuck\n" , pipe); + } +} +static void ironlake_crtc_enable (struct drm_crtc *crtc) {struct drm_device *dev = crtc->dev;
@@ -3332,8 +3350,15 @@ void intel_encoder_prepare(struct drm_encoder *encoder)void intel_encoder_commit (struct drm_encoder *encoder) {struct drm_encoder_helper_funcs *encoder_funcs = encoder->helper_private; +struct drm_device *dev = encoder->dev; +struct intel_encoder *intel_encoder =to_intel_encoder (encoder); +struct intel_crtc *intel_crtc =to_intel_crtc (intel_encoder->base.crtc); +/* lvds has its own version of commit see intel_lvds_commit */ encoder_funcs->dpms (encoder,DRM_MODE_DPMS_ON ); + +if (HAS_PCH_CPT (dev)) +intel_cpt_verify_modeset (dev, intel_crtc->pipe); }void intel_encoder_destroy (struct drm_encoder *encoder)
drivers/gpu/drm/i915/intel_dp.c +4 -0
@@ -1010,6 +1010,7 @@ static void intel_dp_commit(struct drm_encoder *encoder) {struct intel_dp *intel_dp =enc_to_intel_dp (encoder);struct drm_device *dev = encoder->dev; +struct intel_crtc *intel_crtc =to_intel_crtc (intel_dp->base.base.crtc);if (is_edp (intel_dp))ironlake_edp_panel_vdd_on (intel_dp);
@@ -1027,6 +1028,9 @@ static void intel_dp_commit(struct drm_encoder *encoder)ironlake_edp_backlight_on (dev); intel_dp->dpms_mode =DRM_MODE_DPMS_ON ; + +if (HAS_PCH_CPT (dev)) +intel_cpt_verify_modeset (dev, intel_crtc->pipe); } static void
drivers/gpu/drm/i915/intel_drv.h +2 -0
@@ -385,4 +385,6 @@ extern void intel_fb_restore_mode(struct drm_device *dev);extern void intel_init_clock_gating (struct drm_device *dev);extern void intel_write_eld (struct drm_encoder *encoder,struct drm_display_mode *mode); +extern void intel_cpt_verify_modeset (struct drm_device *dev,int pipe); +#endif /* __INTEL_DRV_H__ */
Signature · 1 line
1.7.4.1
PATCH 12/14 drm/i915: set watermarks for third pipe on IVB
In reply to Jesse BarnesThe watermark reg for the third pipe is in an unusual offset; add support for it and set watermarks for 3 pipe configs.
--- drivers/gpu/drm/i915/i915_reg.h | 1 + drivers/gpu/drm/i915/intel_display.c | 14 ++++++++++++++ 2 files changed, 15 insertions(+), 0 deletions(-)
drivers/gpu/drm/i915/i915_reg.h +1 -0
@@ -2429,6 +2429,7 @@#define WM0_PIPE_CURSOR_MASK (0x1f)#define WM0_PIPEB_ILK 0x45104 +#define WM0_PIPEC_IVB 0x45200#define WM1_LP_ILK 0x45108#define WM1_LP_SR_EN (1<<31)#define WM1_LP_LATENCY_SHIFT 24
drivers/gpu/drm/i915/intel_display.c +14 -0
@@ -4532,6 +4532,20 @@ static void sandybridge_update_wm(struct drm_device *dev) enabled |=2 ; } +/* IVB has 3 pipes */ +if (IS_IVYBRIDGE (dev) && +g4x_compute_wm0 (dev,2 , + &sandybridge_display_wm_info, latency, + &sandybridge_cursor_wm_info, latency, + &plane_wm, &cursor_wm)) { +I915_WRITE (WM0_PIPEC_IVB , + (plane_wm <<WM0_PIPE_PLANE_SHIFT ) | cursor_wm); +DRM_DEBUG_KMS ("FIFO watermarks For pipe C -" +" plane %d, cursor: %d\n" , + plane_wm, cursor_wm); + enabled |=3 ; + } +/* * Calculate and update the self-refresh watermark only when one * display plane is used.
Signature · 1 line
1.7.4.1
PATCH 13/14 drm/i915: if transcoder disable fails, say which
In reply to Jesse BarnesJust some extra debug output.
--- drivers/gpu/drm/i915/intel_display.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/gpu/drm/i915/intel_display.c +1 -1
@@ -1276,7 +1276,7 @@ static void intel_disable_transcoder(struct drm_i915_private *dev_priv,I915_WRITE (reg, val);/* wait for PCH transcoder off, transcoder state */ if (wait_for ((I915_READ (reg) &TRANS_STATE_ENABLE ) ==0 ,50 )) -DRM_ERROR ("failed to disable transcoder\n" ); +DRM_ERROR ("failed to disable transcoder %d\n" , pipe); }/**
Signature · 1 line
1.7.4.1
PATCH 14/14 drm/i915: remove transcoder PLL mashing from mode_set per specs
In reply to Jesse BarnesBelongs in PCH enable instead. The duplication is worrying and the specs explicitly list transcoder select *after* actual PLL enable, which doesn't occur until later.
--- drivers/gpu/drm/i915/intel_display.c | 25 ------------------------- 1 files changed, 0 insertions(+), 25 deletions(-)
drivers/gpu/drm/i915/intel_display.c +0 -25
@@ -5570,31 +5570,6 @@ static int ironlake_crtc_mode_set(struct drm_crtc *crtc, } } -/* enable transcoder DPLL */ -if (HAS_PCH_CPT (dev)) { -u32 transc_sel = intel_crtc->use_pll_a ?TRANSC_DPLLA_SEL : -TRANSC_DPLLB_SEL ; - temp =I915_READ (PCH_DPLL_SEL ); -switch (pipe) { -case 0 : - temp |=TRANSA_DPLL_ENABLE |TRANSA_DPLLA_SEL ; -break ; -case 1 : - temp |=TRANSB_DPLL_ENABLE |TRANSB_DPLLB_SEL ; -break ; -case 2 : - temp &= ~(TRANSC_DPLLB_SEL ); - temp |=TRANSC_DPLL_ENABLE | transc_sel; -break ; -default : -BUG (); - } -I915_WRITE (PCH_DPLL_SEL , temp); - -POSTING_READ (PCH_DPLL_SEL ); -udelay (150 ); - } -/* The LVDS pin pair needs to be on before the DPLLs are enabled. * This is an exception to the general rule that mode_set doesn't turn * things on.
Signature · 1 line
1.7.4.1
Quoted 3 lines · Jesse Barnes
Latest patches; Eugeni can you reply with your tested-by? I think they're all ready for upstream.
For the series:
There three reproducible issues I found out, but they were present with previous patch set as well, and are not critical in my opinion at this point:
- when I boot with 3 monitors plugged in, the DE (in my case, xfce) waits
forever on login. When I go to console and then back to X, it proceeds. It seems to be https://bugs.freedesktop.org/show_bug.cgi?id=41917.
- after some switching between console and X, I can reproduce
https://bugs.freedesktop.org/show_bug.cgi?id=41976 - sometimes with just one of the pipes, sometimes with both of them.
- when starting fullscreen 3d app (I tested with openarena and nexuiz), all
3 pipes lose signal. When I go to console, kill the processes, and go back to X, it is back into working state (
https://bugs.freedesktop.org/show_bug.cgi?id=42010).
But those can be dealt with later, I think that what we have now is good for upstreaming.
Signature · 2 lines
Eugeni Dodonov <http://eugeni.dodonov.net/>
_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx