Skip to contentSkip to conversation

Move dpio access out of intel_display.c

PATCH New Ander Conselvan de Oliveira 2 participants 7 messages May 17, 2016

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

v2 cover Move dpio access out of intel_display.c

Hi,

Update series. The first patch that renames struct dpll was dropped and some of the new functions were renamed.

Ander

Cc Ville Syrjälä <[email protected]>

Ander Conselvan de Oliveira (5):
drm/i915: Move dpio code of VLV/CHV dpll enabling to intel_dpio_phy.c drm/i915: Merge vlv/chv _prepare_pll() with their enable counterpart drm/i915: Move VLV divider readout to intel_dpio_phy.c drm/i915: Move CHV divider readout to intel_dpio_phy.c drm/i915: Move toggling of CHV DPIO_DCLKP_EN to intel_dpio_phy.c

 drivers/gpu/drm/i915/i915_drv.h       |  12 ++
 drivers/gpu/drm/i915/intel_display.c  | 319 ++++------------------------------
 drivers/gpu/drm/i915/intel_dpio_phy.c | 260 +++++++++++++++++++++++++++
 3 files changed, 302 insertions(+), 289 deletions(-)
Signature · 6 lines
2.5.5

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
#1 lore raw

PATCH v2 1/5 drm/i915: Move dpio code of VLV/CHV dpll enabling to intel_dpio_phy.c

Hide the dpio details of setting up the dplls on VLV/CHV to intel_dpio_phy.c. This will allow the prepare and enable pll functions to be merged in a follow up. It also creates a better split of the code where most of the dpio access are concentrated in one place.

---
 drivers/gpu/drm/i915/i915_drv.h       |   6 +
 drivers/gpu/drm/i915/intel_display.c  | 207 ++--------------------------------
 drivers/gpu/drm/i915/intel_dpio_phy.c | 202 +++++++++++++++++++++++++++++++++
 3 files changed, 217 insertions(+), 198 deletions(-)
drivers/gpu/drm/i915/i915_drv.h +6 -0
index 72f0b02..032f052 100644
@@ -3644,6 +3644,9 @@ void chv_phy_pre_pll_enable(struct intel_encoder *encoder);
 void chv_phy_pre_encoder_enable(struct intel_encoder *encoder);
 void chv_phy_release_cl2_override(struct intel_encoder *encoder);
 void chv_phy_post_pll_disable(struct intel_encoder *encoder);
+void chv_phy_prepare_pll(struct intel_crtc *crtc, u32 bestn,
+			 u32 bestm1, u32 bestm2, u32 bestp1, u32 bestp2,
+			 int vco);
 
 void vlv_set_phy_signal_level(struct intel_encoder *encoder,
 			      u32 demph_reg_value, u32 preemph_reg_value,
@@ -3651,6 +3654,9 @@ void vlv_set_phy_signal_level(struct intel_encoder *encoder,
 void vlv_phy_pre_pll_enable(struct intel_encoder *encoder);
 void vlv_phy_pre_encoder_enable(struct intel_encoder *encoder);
 void vlv_phy_reset_lanes(struct intel_encoder *encoder);
+void vlv_phy_prepare_pll(struct intel_crtc *crtc, u32 bestn,
+			 u32 bestm1, u32 bestm2, u32 bestp1, u32 bestp2,
+			 int port_clock, bool dp);
 
 int intel_gpu_freq(struct drm_i915_private *dev_priv, int val);
 int intel_freq_opcode(struct drm_i915_private *dev_priv, int val);
drivers/gpu/drm/i915/intel_display.c +9 -198

238 lines not on this page · raw message

drivers/gpu/drm/i915/intel_dpio_phy.c +202 -0

211 lines not on this page · raw message

Signature · 6 lines
2.5.5

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
#2 lore raw

PATCH v2 2/5 drm/i915: Merge vlv/chv _prepare_pll() with their enable counterpart

In reply to Ander Conselvan de Oliveira

With the bulk of the dpio code moved out of the vlv/chv prepare pll functions into intel_dpio_phy.c, those functions became simple enough that they can be merged with the pll enabling function, that always succeeds the prepare call.

---
 drivers/gpu/drm/i915/intel_display.c | 82 ++++++++++++------------------------
 1 file changed, 26 insertions(+), 56 deletions(-)
drivers/gpu/drm/i915/intel_display.c +26 -56
index 5372d9c..56ae2e9 100644
@@ -104,10 +104,6 @@ static void intel_cpu_transcoder_set_m_n(struct intel_crtc *crtc,
 static void ironlake_set_pipeconf(struct drm_crtc *crtc);
 static void haswell_set_pipeconf(struct drm_crtc *crtc);
 static void haswell_set_pipemisc(struct drm_crtc *crtc);
-static void vlv_prepare_pll(struct intel_crtc *crtc,
-			    const struct intel_crtc_state *pipe_config);
-static void chv_prepare_pll(struct intel_crtc *crtc,
-			    const struct intel_crtc_state *pipe_config);
 static void intel_begin_crtc_commit(struct drm_crtc *, struct drm_crtc_state *);
 static void intel_finish_crtc_commit(struct drm_crtc *, struct drm_crtc_state *);
 static void skl_init_scalers(struct drm_device *dev, struct intel_crtc *intel_crtc,
@@ -1548,6 +1544,19 @@ static void vlv_enable_pll(struct intel_crtc *crtc,
 	struct drm_i915_private *dev_priv = to_i915(crtc->base.dev);
 	enum pipe pipe = crtc->pipe;
 
+	/* Enable Refclk */
+	I915_WRITE(DPLL(pipe),
+		   pipe_config->dpll_hw_state.dpll &
+		   ~(DPLL_VCO_ENABLE | DPLL_EXT_BUFFER_ENABLE_VLV));
+
+	/* No need to actually set up the DPLL with DSI */
+	if ((pipe_config->dpll_hw_state.dpll & DPLL_VCO_ENABLE) != 0)
+		vlv_phy_prepare_pll(crtc, pipe_config->dpll.n,
+				    pipe_config->dpll.m1, pipe_config->dpll.m2,
+				    pipe_config->dpll.p1, pipe_config->dpll.p2,
+				    pipe_config->port_clock,
+				    pipe_config->has_dp_encoder);
+
 	assert_pipe_disabled(dev_priv, pipe);
 
 	/* PLL is protected by panel, make sure we can write it */
@@ -1597,6 +1606,17 @@ static void chv_enable_pll(struct intel_crtc *crtc,
 	struct drm_i915_private *dev_priv = to_i915(crtc->base.dev);
 	enum pipe pipe = crtc->pipe;
 
+	/* Enable Refclk and SSC */
+	I915_WRITE(DPLL(pipe),
+		   pipe_config->dpll_hw_state.dpll & ~DPLL_VCO_ENABLE);
+
+	/* No need to actually set up the DPLL with DSI */
+	if ((pipe_config->dpll_hw_state.dpll & DPLL_VCO_ENABLE) != 0)
+		chv_phy_prepare_pll(crtc, pipe_config->dpll.n,
+				    pipe_config->dpll.m1, pipe_config->dpll.m2,
+				    pipe_config->dpll.p1, pipe_config->dpll.p2,
+				    pipe_config->dpll.vco);
+
 	assert_pipe_disabled(dev_priv, pipe);
 
 	/* PLL is protected by panel, make sure we can write it */
@@ -6076,13 +6096,10 @@ static void valleyview_crtc_enable(struct drm_crtc *crtc)
 		if (encoder->pre_pll_enable)
 			encoder->pre_pll_enable(encoder);
 
-	if (IS_CHERRYVIEW(dev)) {
-		chv_prepare_pll(intel_crtc, intel_crtc->config);
+	if (IS_CHERRYVIEW(dev))
 		chv_enable_pll(intel_crtc, intel_crtc->config);
-	} else {
-		vlv_prepare_pll(intel_crtc, intel_crtc->config);
+	else
 		vlv_enable_pll(intel_crtc, intel_crtc->config);
-	}
 
 	for_each_encoder_on_crtc(dev, crtc, encoder)
 		if (encoder->pre_enable)
@@ -7175,51 +7192,6 @@ static void chv_compute_dpll(struct intel_crtc *crtc,
 		(pipe_config->pixel_multiplier - 1) << DPLL_MD_UDI_MULTIPLIER_SHIFT;
 }
 
-static void vlv_prepare_pll(struct intel_crtc *crtc,
-			    const struct intel_crtc_state *pipe_config)
-{
-	struct drm_device *dev = crtc->base.dev;
-	struct drm_i915_private *dev_priv = dev->dev_private;
-	enum pipe pipe = crtc->pipe;
-
-	/* Enable Refclk */
-	I915_WRITE(DPLL(pipe),
-		   pipe_config->dpll_hw_state.dpll &
-		   ~(DPLL_VCO_ENABLE | DPLL_EXT_BUFFER_ENABLE_VLV));
-
-	/* No need to actually set up the DPLL with DSI */
-	if ((pipe_config->dpll_hw_state.dpll & DPLL_VCO_ENABLE) == 0)
-		return;
-
-	vlv_phy_prepare_pll(crtc, pipe_config->dpll.n,
-			    pipe_config->dpll.m1, pipe_config->dpll.m2,
-			    pipe_config->dpll.p1, pipe_config->dpll.p2,
-			    pipe_config->port_clock,
-			    pipe_config->has_dp_encoder);
-
-}
-
-static void chv_prepare_pll(struct intel_crtc *crtc,
-			    const struct intel_crtc_state *pipe_config)
-{
-	struct drm_device *dev = crtc->base.dev;
-	struct drm_i915_private *dev_priv = dev->dev_private;
-	enum pipe pipe = crtc->pipe;
-
-	/* Enable Refclk and SSC */
-	I915_WRITE(DPLL(pipe),
-		   pipe_config->dpll_hw_state.dpll & ~DPLL_VCO_ENABLE);
-
-	/* No need to actually set up the DPLL with DSI */
-	if ((pipe_config->dpll_hw_state.dpll & DPLL_VCO_ENABLE) == 0)
-		return;
-
-	chv_phy_prepare_pll(crtc, pipe_config->dpll.n,
-			    pipe_config->dpll.m1, pipe_config->dpll.m2,
-			    pipe_config->dpll.p1, pipe_config->dpll.p2,
-			    pipe_config->dpll.vco);
-}
-
 /**
  * vlv_force_pll_on - forcibly enable just the PLL
  * @dev_priv: i915 private structure
@@ -7247,11 +7219,9 @@ int vlv_force_pll_on(struct drm_device *dev, enum pipe pipe,
 
 	if (IS_CHERRYVIEW(dev)) {
 		chv_compute_dpll(crtc, pipe_config);
-		chv_prepare_pll(crtc, pipe_config);
 		chv_enable_pll(crtc, pipe_config);
 	} else {
 		vlv_compute_dpll(crtc, pipe_config);
-		vlv_prepare_pll(crtc, pipe_config);
 		vlv_enable_pll(crtc, pipe_config);
 	}
 
Signature · 6 lines
2.5.5

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
#3 lore raw

PATCH v2 3/5 drm/i915: Move VLV divider readout to intel_dpio_phy.c

In reply to Ander Conselvan de Oliveira

Reading the dividers depends on sideband messaging, so it fits well if the other functions in intel_dpio_phy.c. The new function will also be used in a future patch.

v2: Add _pll_ to the function name. (Ville)

---
 drivers/gpu/drm/i915/i915_drv.h       |  2 ++
 drivers/gpu/drm/i915/intel_display.c  | 11 +----------
 drivers/gpu/drm/i915/intel_dpio_phy.c | 16 ++++++++++++++++
 3 files changed, 19 insertions(+), 10 deletions(-)
drivers/gpu/drm/i915/i915_drv.h +2 -0
index 032f052..0c32ef3 100644
@@ -3657,6 +3657,8 @@ void vlv_phy_reset_lanes(struct intel_encoder *encoder);
 void vlv_phy_prepare_pll(struct intel_crtc *crtc, u32 bestn,
 			 u32 bestm1, u32 bestm2, u32 bestp1, u32 bestp2,
 			 int port_clock, bool dp);
+void vlv_phy_read_pll_dividers(struct drm_i915_private *dev_priv,
+			       enum pipe pipe, struct dpll *clock);
 
 int intel_gpu_freq(struct drm_i915_private *dev_priv, int val);
 int intel_freq_opcode(struct drm_i915_private *dev_priv, int val);
drivers/gpu/drm/i915/intel_display.c +1 -10
index 56ae2e9..9d42caf 100644
@@ -7796,22 +7796,13 @@ static void vlv_crtc_clock_get(struct intel_crtc *crtc,
 	struct drm_i915_private *dev_priv = dev->dev_private;
 	int pipe = pipe_config->cpu_transcoder;
 	struct dpll clock;
-	u32 mdiv;
 	int refclk = 100000;
 
 	/* In case of DSI, DPLL will not be used */
 	if ((pipe_config->dpll_hw_state.dpll & DPLL_VCO_ENABLE) == 0)
 		return;
 
-	mutex_lock(&dev_priv->sb_lock);
-	mdiv = vlv_dpio_read(dev_priv, pipe, VLV_PLL_DW3(pipe));
-	mutex_unlock(&dev_priv->sb_lock);
-
-	clock.m1 = (mdiv >> DPIO_M1DIV_SHIFT) & 7;
-	clock.m2 = mdiv & DPIO_M2DIV_MASK;
-	clock.n = (mdiv >> DPIO_N_SHIFT) & 0xf;
-	clock.p1 = (mdiv >> DPIO_P1_SHIFT) & 7;
-	clock.p2 = (mdiv >> DPIO_P2_SHIFT) & 0x1f;
+	vlv_phy_read_pll_dividers(dev_priv, pipe, &clock);
 
 	pipe_config->port_clock = vlv_calc_dpll_params(refclk, &clock);
 }
drivers/gpu/drm/i915/intel_dpio_phy.c +16 -0
index fcadc92..1856e5f 100644
@@ -670,3 +670,19 @@ void vlv_phy_prepare_pll(struct intel_crtc *crtc, u32 bestn,
 	vlv_dpio_write(dev_priv, pipe, VLV_PLL_DW11(pipe), 0x87871000);
 	mutex_unlock(&dev_priv->sb_lock);
 }
+
+void vlv_phy_read_pll_dividers(struct drm_i915_private *dev_priv,
+			       enum pipe pipe, struct dpll *clock)
+{
+	u32 mdiv;
+
+	mutex_lock(&dev_priv->sb_lock);
+	mdiv = vlv_dpio_read(dev_priv, pipe, VLV_PLL_DW3(pipe));
+	mutex_unlock(&dev_priv->sb_lock);
+
+	clock->m1 = (mdiv >> DPIO_M1DIV_SHIFT) & 7;
+	clock->m2 = mdiv & DPIO_M2DIV_MASK;
+	clock->n = (mdiv >> DPIO_N_SHIFT) & 0xf;
+	clock->p1 = (mdiv >> DPIO_P1_SHIFT) & 7;
+	clock->p2 = (mdiv >> DPIO_P2_SHIFT) & 0x1f;
+}
Signature · 6 lines
2.5.5

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
#4 lore raw

PATCH v2 4/5 drm/i915: Move CHV divider readout to intel_dpio_phy.c

In reply to Ander Conselvan de Oliveira

Reading the dividers depends on sideband messaging, so it fits well if the other functions in intel_dpio_phy.c. The new function will also be used in a future patch.

v2: Add _pll_ to the new function name. (Ville)

---
 drivers/gpu/drm/i915/i915_drv.h       |  2 ++
 drivers/gpu/drm/i915/intel_display.c  | 18 +-----------------
 drivers/gpu/drm/i915/intel_dpio_phy.c | 24 ++++++++++++++++++++++++
 3 files changed, 27 insertions(+), 17 deletions(-)
drivers/gpu/drm/i915/i915_drv.h +2 -0
index 0c32ef3..894830b 100644
@@ -3647,6 +3647,8 @@ void chv_phy_post_pll_disable(struct intel_encoder *encoder);
 void chv_phy_prepare_pll(struct intel_crtc *crtc, u32 bestn,
 			 u32 bestm1, u32 bestm2, u32 bestp1, u32 bestp2,
 			 int vco);
+void chv_phy_read_pll_dividers(struct drm_i915_private *dev_priv,
+			       enum pipe pipe, struct dpll *clock);
 
 void vlv_set_phy_signal_level(struct intel_encoder *encoder,
 			      u32 demph_reg_value, u32 preemph_reg_value,
drivers/gpu/drm/i915/intel_display.c +1 -17
index 9d42caf..47cc150 100644
@@ -7882,30 +7882,14 @@ static void chv_crtc_clock_get(struct intel_crtc *crtc,
 	struct drm_device *dev = crtc->base.dev;
 	struct drm_i915_private *dev_priv = dev->dev_private;
 	int pipe = pipe_config->cpu_transcoder;
-	enum dpio_channel port = vlv_pipe_to_channel(pipe);
 	struct dpll clock;
-	u32 cmn_dw13, pll_dw0, pll_dw1, pll_dw2, pll_dw3;
 	int refclk = 100000;
 
 	/* In case of DSI, DPLL will not be used */
 	if ((pipe_config->dpll_hw_state.dpll & DPLL_VCO_ENABLE) == 0)
 		return;
 
-	mutex_lock(&dev_priv->sb_lock);
-	cmn_dw13 = vlv_dpio_read(dev_priv, pipe, CHV_CMN_DW13(port));
-	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;
-	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;
+	chv_phy_read_pll_dividers(dev_priv, pipe, &clock);
 
 	pipe_config->port_clock = chv_calc_dpll_params(refclk, &clock);
 }
drivers/gpu/drm/i915/intel_dpio_phy.c +24 -0
index 1856e5f..bdd82df 100644
@@ -461,6 +461,30 @@ void chv_phy_prepare_pll(struct intel_crtc *crtc, u32 bestn,
 	mutex_unlock(&dev_priv->sb_lock);
 }
 
+void chv_phy_read_pll_dividers(struct drm_i915_private *dev_priv,
+			       enum pipe pipe, struct dpll *clock)
+{
+	enum dpio_channel port = vlv_pipe_to_channel(pipe);
+	u32 cmn_dw13, pll_dw0, pll_dw1, pll_dw2, pll_dw3;
+
+	mutex_lock(&dev_priv->sb_lock);
+	cmn_dw13 = vlv_dpio_read(dev_priv, pipe, CHV_CMN_DW13(port));
+	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;
+	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;
+}
+
+
 void vlv_set_phy_signal_level(struct intel_encoder *encoder,
 			      u32 demph_reg_value, u32 preemph_reg_value,
 			      u32 uniqtranscale_reg_value, u32 tx3_demph)
Signature · 6 lines
2.5.5

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
#5 lore raw

PATCH v2 5/5 drm/i915: Move toggling of CHV DPIO_DCLKP_EN to intel_dpio_phy.c

In reply to Ander Conselvan de Oliveira

This simplifies the pll enable/disable a code a bit and hides the sideband message neatly in intel_dpio_phy.c.

v2: Rename chv_phy_toggle_dclkp() to chv_phy_set_dclkp(). (Ville)

---
 drivers/gpu/drm/i915/i915_drv.h       |  2 ++
 drivers/gpu/drm/i915/intel_display.c  | 19 ++-----------------
 drivers/gpu/drm/i915/intel_dpio_phy.c | 18 ++++++++++++++++++
 3 files changed, 22 insertions(+), 17 deletions(-)
drivers/gpu/drm/i915/i915_drv.h +2 -0
index 894830b..36ffad6 100644
@@ -3647,6 +3647,8 @@ void chv_phy_post_pll_disable(struct intel_encoder *encoder);
 void chv_phy_prepare_pll(struct intel_crtc *crtc, u32 bestn,
 			 u32 bestm1, u32 bestm2, u32 bestp1, u32 bestp2,
 			 int vco);
+void chv_phy_set_dclkp(struct drm_i915_private *dev_priv, enum pipe pipe,
+		       bool enable);
 void chv_phy_read_pll_dividers(struct drm_i915_private *dev_priv,
 			       enum pipe pipe, struct dpll *clock);
 
drivers/gpu/drm/i915/intel_display.c +2 -17
index 47cc150..64661c0 100644
@@ -1575,17 +1575,9 @@ static void _chv_enable_pll(struct intel_crtc *crtc,
 {
 	struct drm_i915_private *dev_priv = to_i915(crtc->base.dev);
 	enum pipe pipe = crtc->pipe;
-	enum dpio_channel port = vlv_pipe_to_channel(pipe);
-	u32 tmp;
-
-	mutex_lock(&dev_priv->sb_lock);
 
 	/* Enable back the 10bit clock to display controller */
-	tmp = vlv_dpio_read(dev_priv, pipe, CHV_CMN_DW14(port));
-	tmp |= DPIO_DCLKP_EN;
-	vlv_dpio_write(dev_priv, pipe, CHV_CMN_DW14(port), tmp);
-
-	mutex_unlock(&dev_priv->sb_lock);
+	chv_phy_set_dclkp(dev_priv, pipe, true);
 
 	/*
 	 * Need to wait > 100ns between dclkp clock enable bit and PLL enable.
@@ -1778,7 +1770,6 @@ static void vlv_disable_pll(struct drm_i915_private *dev_priv, enum pipe pipe)
 
 static void chv_disable_pll(struct drm_i915_private *dev_priv, enum pipe pipe)
 {
-	enum dpio_channel port = vlv_pipe_to_channel(pipe);
 	u32 val;
 
 	/* Make sure the pipe isn't still relying on us */
@@ -1792,14 +1783,8 @@ static void chv_disable_pll(struct drm_i915_private *dev_priv, enum pipe pipe)
 	I915_WRITE(DPLL(pipe), val);
 	POSTING_READ(DPLL(pipe));
 
-	mutex_lock(&dev_priv->sb_lock);
-
 	/* Disable 10bit clock to display controller */
-	val = vlv_dpio_read(dev_priv, pipe, CHV_CMN_DW14(port));
-	val &= ~DPIO_DCLKP_EN;
-	vlv_dpio_write(dev_priv, pipe, CHV_CMN_DW14(port), val);
-
-	mutex_unlock(&dev_priv->sb_lock);
+	chv_phy_set_dclkp(dev_priv, pipe, false);
 }
 
 void vlv_wait_port_ready(struct drm_i915_private *dev_priv,
drivers/gpu/drm/i915/intel_dpio_phy.c +18 -0
index bdd82df..9dad2d1 100644
@@ -461,6 +461,24 @@ void chv_phy_prepare_pll(struct intel_crtc *crtc, u32 bestn,
 	mutex_unlock(&dev_priv->sb_lock);
 }
 
+void chv_phy_set_dclkp(struct drm_i915_private *dev_priv, enum pipe pipe,
+		       bool enable)
+{
+	enum dpio_channel port = vlv_pipe_to_channel(pipe);
+	u32 dpio_val;
+
+	mutex_lock(&dev_priv->sb_lock);
+
+	dpio_val = vlv_dpio_read(dev_priv, pipe, CHV_CMN_DW14(port));
+	if (enable)
+		dpio_val |= DPIO_DCLKP_EN;
+	else
+		dpio_val &= ~DPIO_DCLKP_EN;
+	vlv_dpio_write(dev_priv, pipe, CHV_CMN_DW14(port), dpio_val);
+
+	mutex_unlock(&dev_priv->sb_lock);
+}
+
 void chv_phy_read_pll_dividers(struct drm_i915_private *dev_priv,
 			       enum pipe pipe, struct dpll *clock)
 {
Signature · 6 lines
2.5.5

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
#6 lore raw

✗ Ro.CI.BAT: warning for Move dpio access out of intel_display.c (rev2)

In reply to Ander Conselvan de Oliveira
== Series Details ==

== Series Details ==

Series: Move dpio access out of intel_display.c (rev2)
URL : https://patchwork.freedesktop.org/series/7150/
State : warning

== Summary ==

Series 7150v2 Move dpio access out of intel_display.c
http://patchwork.freedesktop.org/api/1.0/series/7150/revisions/2/mbox

Test gem_exec_flush:

        Subgroup basic-batch-kernel-default-cmd:
                fail       -> PASS       (ro-byt-n2820)
Test kms_pipe_crc_basic:
        Subgroup hang-read-crc-pipe-a:
                pass       -> DMESG-WARN (ro-ivb2-i7-3770)
        Subgroup hang-read-crc-pipe-b:
                pass       -> DMESG-WARN (ro-ivb2-i7-3770)
fi-hsw-i7-4770k  total:206  pass:186  dwarn:0   dfail:0   fail:0   skip:19 
fi-hsw-i7-4770r  total:219  pass:193  dwarn:0   dfail:0   fail:0   skip:26 
fi-skl-i5-6260u  total:219  pass:207  dwarn:0   dfail:0   fail:0   skip:12 
fi-skl-i7-6700k  total:219  pass:191  dwarn:0   dfail:0   fail:0   skip:28 
fi-snb-i7-2600   total:37   pass:27   dwarn:0   dfail:0   fail:0   skip:9  
ro-bdw-i5-5250u  total:219  pass:181  dwarn:0   dfail:0   fail:0   skip:38 
ro-bdw-i7-5557U  total:219  pass:206  dwarn:0   dfail:0   fail:0   skip:13 
ro-bdw-i7-5600u  total:219  pass:187  dwarn:0   dfail:0   fail:0   skip:32 
ro-bsw-n3050     total:219  pass:175  dwarn:0   dfail:0   fail:2   skip:42 
ro-byt-n2820     total:218  pass:175  dwarn:0   dfail:0   fail:2   skip:41 
ro-hsw-i3-4010u  total:218  pass:193  dwarn:0   dfail:0   fail:0   skip:25 
ro-hsw-i7-4770r  total:219  pass:194  dwarn:0   dfail:0   fail:0   skip:25 
ro-ilk-i7-620lm  total:219  pass:151  dwarn:0   dfail:0   fail:1   skip:67 
ro-ilk1-i5-650   total:214  pass:152  dwarn:0   dfail:0   fail:1   skip:61 
ro-ivb-i7-3770   total:219  pass:183  dwarn:0   dfail:0   fail:0   skip:36 
ro-ivb2-i7-3770  total:219  pass:185  dwarn:2   dfail:0   fail:0   skip:32 
ro-skl-i7-6700hq total:214  pass:189  dwarn:0   dfail:0   fail:0   skip:25 
ro-snb-i7-2620M  total:219  pass:177  dwarn:0   dfail:0   fail:1   skip:41 

fi-byt-n2820 failed to connect after reboot

Results at /archive/results/CI_IGT_test/RO_Patchwork_915/

e76bda7 drm-intel-nightly: 2016y-05m-17d-07h-12m-14s UTC integration manifest 33882ec drm/i915: Move toggling of CHV DPIO_DCLKP_EN to intel_dpio_phy.c b626ad5 drm/i915: Move CHV divider readout to intel_dpio_phy.c 68f2fa9 drm/i915: Move VLV divider readout to intel_dpio_phy.c 9948efd drm/i915: Merge vlv/chv _prepare_pll() with their enable counterpart 76c7c70 drm/i915: Move dpio code of VLV/CHV dpll enabling to intel_dpio_phy.c

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx