drm/i915: VLV/CHV DPLL and DSI stuff
Subsystems (2)
cover drm/i915: VLV/CHV DPLL and DSI stuff
From: Ville Syrjälä <[email protected]>
As my previous half assed attempt [1] avoiding state checker warnings for VLV/CHV DSI output shot down during review, I decided to actually figure out what's the relationship between DSI and the DPLL registers. Turns out there is one, so this series aims to make things robust by properly programming the DPLL/DPLL_MD registers when driving DSI outputs.
I've included the other stragglers from my last DPLL series, mainly dealing with WaPixelRepeatModeFixForC0.
I also got annoyed by DSI not setting up the panel fitter, so I plugged that in as well.
Series available at:git://github.com/vsyrjala/linux.git vlv_chv_dsi_dpll
[1] http://lists.freedesktop.org/archives/intel-gfx/2015-June/070040.html
Ville Syrjälä (14):
drm/i915: Make {vlv,chv}_{disable,update}_pll() more similar drm/i915: Implement WaPixelRepeatModeFixForC0:chv drm/i915: Power down the DSI PLL before reconfiguring it drm/i915: Add a local pipe variable to vlv_enable_pll() drm/i915: assert_panel_unlocked() in chv_enable_pll() drm/i915: Remove the "three times for luck" trick from
vlv_enable_pll()
drm/i915: Setup DPLL/DPLLMD for DSI too on VLV/CHV drm/i915: Compute DSI PLL parameters during .compute_config() drm/i915: Fix CHV DSI PLL refclk during state readout drm/i915: Change lfsr_converts[] to u16
drm/i915: Throw out BUGs from DPLL/PCH functions drm/i915: Hook up pfit for DSI
drm/i915: Reject 'Center' scaling mode for eDP/DSI on GMCH platforms drm/i915: Dump pfit state as hex
drivers/gpu/drm/i915/i915_drv.h | 7 + drivers/gpu/drm/i915/i915_reg.h | 3 + drivers/gpu/drm/i915/intel_display.c | 262 ++++++++++++++++++----------------- drivers/gpu/drm/i915/intel_dp.c | 5 + drivers/gpu/drm/i915/intel_drv.h | 5 + drivers/gpu/drm/i915/intel_dsi.c | 112 +++++++++++---- drivers/gpu/drm/i915/intel_dsi.h | 8 +- drivers/gpu/drm/i915/intel_dsi_pll.c | 60 ++++---- 8 files changed, 281 insertions(+), 181 deletions(-)
Signature · 6 lines
2.4.6 _______________________________________________ Intel-gfx mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH v2 1/14 drm/i915: Make {vlv, chv}_{disable, update}_pll() more similar
From: Ville Syrjälä <[email protected]>
The VLV and CHV DPLL disable and update are almost identical in how the DPLL/DPLL_MD registers need to be set up. But the code looks more different than it really is. Try to bring them into line.
v2: s/chv_update_pll/chv_compute_dpll/
--- drivers/gpu/drm/i915/intel_display.c | 63 ++++++++++++++---------------------- 1 file changed, 25 insertions(+), 38 deletions(-)
drivers/gpu/drm/i915/intel_display.c +25 -38
@@ -1761,16 +1761,13 @@ static void vlv_disable_pll(struct drm_i915_private *dev_priv, enum pipe pipe)/* Make sure the pipe isn't still relying on us */ assert_pipe_disabled (dev_priv, pipe); -/* -* Leave integrated clock source and reference clock enabled for pipe B. -* The latter is needed for VGA hotplug / manual detection. -*/ - val =DPLL_VGA_MODE_DIS ; -if (pipe ==PIPE_B ) - val =DPLL_INTEGRATED_CRI_CLK_VLV |DPLL_REF_CLK_ENABLE_VLV ; + val =DPLL_INTEGRATED_REF_CLK_VLV | +DPLL_REF_CLK_ENABLE_VLV |DPLL_VGA_MODE_DIS ; +if (pipe !=PIPE_A ) + val |=DPLL_INTEGRATED_CRI_CLK_VLV ; +I915_WRITE (DPLL (pipe), val);POSTING_READ (DPLL (pipe)); - }static void chv_disable_pll (struct drm_i915_private *dev_priv,enum pipe pipe)
@@ -1781,11 +1778,11 @@ static void chv_disable_pll(struct drm_i915_private *dev_priv, enum pipe pipe)/* Make sure the pipe isn't still relying on us */ assert_pipe_disabled (dev_priv, pipe); -/* Set PLL en = 0 */ val =DPLL_SSC_REF_CLK_CHV |DPLL_REF_CLK_ENABLE_VLV |DPLL_VGA_MODE_DIS ;if (pipe !=PIPE_A ) val |=DPLL_INTEGRATED_CRI_CLK_VLV ; +I915_WRITE (DPLL (pipe), val);POSTING_READ (DPLL (pipe));
@@ -7178,24 +7175,27 @@ void intel_dp_set_m_n(struct intel_crtc *crtc, enum link_m_n_set m_n)static void vlv_compute_dpll (struct intel_crtc *crtc,struct intel_crtc_state *pipe_config) { -u32 dpll, dpll_md; + pipe_config->dpll_hw_state.dpll =DPLL_INTEGRATED_REF_CLK_VLV | +DPLL_REF_CLK_ENABLE_VLV |DPLL_VGA_MODE_DIS | +DPLL_VCO_ENABLE |DPLL_EXT_BUFFER_ENABLE_VLV ; +if (crtc->pipe !=PIPE_A ) + pipe_config->dpll_hw_state.dpll |=DPLL_INTEGRATED_CRI_CLK_VLV ; -/* -* Enable DPIO clock input. We should never disable the reference -* clock for pipe B, since VGA hotplug / manual detection depends -* on it. -*/ - dpll =DPLL_EXT_BUFFER_ENABLE_VLV |DPLL_REF_CLK_ENABLE_VLV | -DPLL_VGA_MODE_DIS |DPLL_INTEGRATED_REF_CLK_VLV ; -/* We should never disable this, set it here for state tracking */ -if (crtc->pipe ==PIPE_B ) - dpll |=DPLL_INTEGRATED_CRI_CLK_VLV ; - dpll |=DPLL_VCO_ENABLE ; - pipe_config->dpll_hw_state.dpll = dpll; + pipe_config->dpll_hw_state.dpll_md = + (pipe_config->pixel_multiplier -1 ) <<DPLL_MD_UDI_MULTIPLIER_SHIFT ; +} + +static void chv_compute_dpll (struct intel_crtc *crtc, +struct intel_crtc_state *pipe_config) +{ + pipe_config->dpll_hw_state.dpll =DPLL_SSC_REF_CLK_CHV | +DPLL_REF_CLK_ENABLE_VLV |DPLL_VGA_MODE_DIS | +DPLL_VCO_ENABLE ; +if (crtc->pipe !=PIPE_A ) + pipe_config->dpll_hw_state.dpll |=DPLL_INTEGRATED_CRI_CLK_VLV ; - dpll_md = (pipe_config->pixel_multiplier -1 ) - <<DPLL_MD_UDI_MULTIPLIER_SHIFT ; - pipe_config->dpll_hw_state.dpll_md = dpll_md; + pipe_config->dpll_hw_state.dpll_md = + (pipe_config->pixel_multiplier -1 ) <<DPLL_MD_UDI_MULTIPLIER_SHIFT ; } static void vlv_prepare_pll(struct intel_crtc *crtc,
@@ -7289,19 +7289,6 @@ static void vlv_prepare_pll(struct intel_crtc *crtc,mutex_unlock (&dev_priv->sb_lock); } -static void chv_compute_dpll (struct intel_crtc *crtc, -struct intel_crtc_state *pipe_config) -{ - pipe_config->dpll_hw_state.dpll =DPLL_SSC_REF_CLK_CHV | -DPLL_REF_CLK_ENABLE_VLV |DPLL_VGA_MODE_DIS | -DPLL_VCO_ENABLE ; -if (crtc->pipe !=PIPE_A ) - pipe_config->dpll_hw_state.dpll |=DPLL_INTEGRATED_CRI_CLK_VLV ; - - pipe_config->dpll_hw_state.dpll_md = - (pipe_config->pixel_multiplier -1 ) <<DPLL_MD_UDI_MULTIPLIER_SHIFT ; -} -static void chv_prepare_pll (struct intel_crtc *crtc,const struct intel_crtc_state *pipe_config) {
Signature · 6 lines
2.4.6 _______________________________________________ Intel-gfx mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH 2/14 drm/i915: Implement WaPixelRepeatModeFixForC0:chv
In reply to [email protected]From: Ville Syrjälä <[email protected]>
DPLL_MD(PIPE_C) is AWOL on CHV. Instead of fixing it someone added chicken bits to propagate the pixel multiplier from DPLL_MD(PIPE_B) to either pipe B or C. So do that to make pixel repeat work on pipes B and C. Pipe A is fine without any tricks.
Fortunately the pixel repeat propagation appears to be a oneshot operation, so once the value has been written we can clear the chicken bits. So it is still possible to drive pipe B and C with different pixel multipliers simultaneosly.
Looks like DPLL_VGA_MODE_DIS must also be set in DPLL(PIPE_B) for this to work. But since we keep that bit always set in all DPLLs there's no problem.
This of course means we can't reliably read out the pixel multiplier for pipes B and C. That would make the state checker unhappy, so I added shadow copies of those registers in to dev_priv. The other option would have been to skip pixel multiplier, dpll_md an dotclock checks entirely on CHV, but that feels like a serious loss of cross checking, so just pretending that we have working DPLL MD registers seemed better. Obviously with the shadow copies we can't detect if the pixel multiplier was properly configured, nor can we take over its state from the BIOS, but hopefully people won't have displays that would be limitd to such crappy modes.
There is one strange flicker still remaining. It's visible on pipe C/HDMID when HDMIB is enabled while driven by pipe B. It doesn't occur if pipe A drives HDMIB, nor is there any glitch on pipe B/HDMIB when port C/HDMID starts up. I don't have a board with HDMIC so not sure if it happens there too. So I'm not sure if it's somehow tied in with this strange linkage between pipe B and C. Sadly I was unable to find an enable sequence that would avoid the glitch, but at least it's not fatal ie. the output recovers afterwards.
--- drivers/gpu/drm/i915/i915_drv.h | 7 +++++++ drivers/gpu/drm/i915/i915_reg.h | 3 +++ drivers/gpu/drm/i915/intel_display.c | 30 ++++++++++++++++++++++++++---- 3 files changed, 36 insertions(+), 4 deletions(-)
drivers/gpu/drm/i915/i915_drv.h +7 -0
@@ -1900,7 +1900,14 @@ struct drm_i915_private {u32 fdi_rx_config; +/* Shadow for DISPLAY_PHY_CONTROL which can't be safely read */ u32 chv_phy_control; +/* +* Shadows for CHV DPLL_MD regs to keep the state +* checker somewhat working in the presence hardware +* crappiness (can't read out DPLL_MD for pipes B & C). +*/ +u32 chv_dpll_md[I915_MAX_PIPES ];u32 suspend_count;struct i915_suspend_saved_registers regfile;
drivers/gpu/drm/i915/i915_reg.h +3 -0
@@ -4648,6 +4648,9 @@ enum skl_disp_power_wells {#define CBR1_VLV (VLV_DISPLAY_BASE + 0x70400)#define CBR_PND_DEADLINE_DISABLE (1<<31) +#define CBR4_VLV (VLV_DISPLAY_BASE + 0x70450) +#define CBR_DPLLBMD_PIPE_C (1<<29) +#define CBR_DPLLBMD_PIPE_B (1<<18)/* FIFO watermark sizes etc */ #define G4X_FIFO_LINE_SIZE 64
drivers/gpu/drm/i915/intel_display.c +26 -4
@@ -1643,9 +1643,27 @@ static void chv_enable_pll(struct intel_crtc *crtc,if (wait_for (((I915_READ (DPLL (pipe)) &DPLL_LOCK_VLV ) ==DPLL_LOCK_VLV ),1 ))DRM_ERROR ("PLL %d failed to lock\n" , pipe); -/* not sure when this should be written */ -I915_WRITE (DPLL_MD (pipe), pipe_config->dpll_hw_state.dpll_md); -POSTING_READ (DPLL_MD (pipe)); +if (pipe !=PIPE_A ) { +/* +* WaPixelRepeatModeFixForC0:chv +* +* DPLLCMD is AWOL. Use chicken bits to propagate +* the value from DPLLBMD to either pipe B or C. +*/ +I915_WRITE (CBR4_VLV , pipe ==PIPE_B ?CBR_DPLLBMD_PIPE_B :CBR_DPLLBMD_PIPE_C ); +I915_WRITE (DPLL_MD (PIPE_B ), pipe_config->dpll_hw_state.dpll_md); +I915_WRITE (CBR4_VLV ,0 ); + dev_priv->chv_dpll_md[pipe] = pipe_config->dpll_hw_state.dpll_md; + +/* +* DPLLB VGA mode also seems to cause problems. +* We should always have it disabled. +*/ +WARN_ON ((I915_READ (DPLL (PIPE_B )) &DPLL_VGA_MODE_DIS ) ==0 ); + }else { +I915_WRITE (DPLL_MD (pipe), pipe_config->dpll_hw_state.dpll_md); +POSTING_READ (DPLL_MD (pipe)); + } }static int intel_num_dvo_pipes (struct drm_device *dev)
@@ -8035,7 +8053,11 @@ static bool i9xx_get_pipe_config(struct intel_crtc *crtc,i9xx_get_pfit_config (crtc, pipe_config);if (INTEL_INFO (dev)->gen >=4 ) { - tmp =I915_READ (DPLL_MD (crtc->pipe)); +/* No way to read it out on pipes B and C */ +if (IS_CHERRYVIEW (dev) && crtc->pipe !=PIPE_A ) + tmp = dev_priv->chv_dpll_md[crtc->pipe]; +else + tmp =I915_READ (DPLL_MD (crtc->pipe)); pipe_config->pixel_multiplier = ((tmp &DPLL_MD_UDI_MULTIPLIER_MASK ) >>DPLL_MD_UDI_MULTIPLIER_SHIFT ) +1 ;
Signature · 6 lines
2.4.6 _______________________________________________ Intel-gfx mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH 3/14 drm/i915: Power down the DSI PLL before reconfiguring it
In reply to [email protected]From: Ville Syrjälä <[email protected]>
The BIOS may leave the DSI PLL enabled in some wonky state where it just refuses to lock. Simply disabling the PLL before reconfiguring it is not enough to fix it, but power gating the PLL prior to reconfiguring does work.
This happens on BYT FFRD8 when booting with HDMI connected so the DSI display will not be lit up by the BIOS.
--- drivers/gpu/drm/i915/intel_dsi.c | 5 +++++ 1 file changed, 5 insertions(+)
drivers/gpu/drm/i915/intel_dsi.c +5 -0
@@ -915,6 +915,11 @@ static void intel_dsi_pre_pll_enable(struct intel_encoder *encoder)intel_dsi_prepare (encoder); +/* +* The BIOS may leave the PLL in a wonky state where it doesn't +* lock. It needs to be fully powered down to fix it. +*/ +vlv_disable_dsi_pll (encoder);vlv_enable_dsi_pll (encoder); }
Signature · 6 lines
2.4.6 _______________________________________________ Intel-gfx mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH 4/14 drm/i915: Add a local pipe variable to vlv_enable_pll()
In reply to [email protected]From: Ville Syrjälä <[email protected]>
Avoid redundant crtc->pipe lookups by giving vlv_enable_pll() a local pipe variable. Also makes it look more like the corresponding CHV code.
While at is change the CHV code to enum pipe from int,
--- drivers/gpu/drm/i915/intel_display.c | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-)
drivers/gpu/drm/i915/intel_display.c +8 -7
@@ -1575,27 +1575,28 @@ static void vlv_enable_pll(struct intel_crtc *crtc, {struct drm_device *dev = crtc->base.dev;struct drm_i915_private *dev_priv = dev->dev_private; -int reg =DPLL (crtc->pipe); +enum pipe pipe = crtc->pipe; +int reg =DPLL (pipe);u32 dpll = pipe_config->dpll_hw_state.dpll; -assert_pipe_disabled (dev_priv, crtc->pipe); +assert_pipe_disabled (dev_priv, pipe);/* No really, not for ILK+ */ BUG_ON (!IS_VALLEYVIEW (dev_priv->dev));/* PLL is protected by panel, make sure we can write it */ if (IS_MOBILE (dev_priv->dev)) -assert_panel_unlocked (dev_priv, crtc->pipe); +assert_panel_unlocked (dev_priv, pipe);I915_WRITE (reg, dpll);POSTING_READ (reg);udelay (150 );if (wait_for (((I915_READ (reg) &DPLL_LOCK_VLV ) ==DPLL_LOCK_VLV ),1 )) -DRM_ERROR ("DPLL %d failed to lock\n" , crtc->pipe); +DRM_ERROR ("DPLL %d failed to lock\n" , pipe); -I915_WRITE (DPLL_MD (crtc->pipe), pipe_config->dpll_hw_state.dpll_md); -POSTING_READ (DPLL_MD (crtc->pipe)); +I915_WRITE (DPLL_MD (pipe), pipe_config->dpll_hw_state.dpll_md); +POSTING_READ (DPLL_MD (pipe));/* We do this three times for luck */ I915_WRITE (reg, dpll);
@@ -1614,7 +1615,7 @@ static void chv_enable_pll(struct intel_crtc *crtc, {struct drm_device *dev = crtc->base.dev;struct drm_i915_private *dev_priv = dev->dev_private; -int pipe = crtc->pipe; +enum pipe pipe = crtc->pipe;enum dpio_channel port =vlv_pipe_to_channel (pipe);u32 tmp;
Signature · 6 lines
2.4.6 _______________________________________________ Intel-gfx mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH 5/14 drm/i915: assert_panel_unlocked() in chv_enable_pll()
In reply to [email protected]From: Ville Syrjälä <[email protected]>
Supposedly the power sequencer still locks out the DPLL registers on CHV, so let's issue a warning if it's still locked when enabling the DPLL.
Also drop the redundant IS_MOBILE() check for VLV when we check the same thing.
--- drivers/gpu/drm/i915/intel_display.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
drivers/gpu/drm/i915/intel_display.c +4 -2
@@ -1585,8 +1585,7 @@ static void vlv_enable_pll(struct intel_crtc *crtc,BUG_ON (!IS_VALLEYVIEW (dev_priv->dev));/* PLL is protected by panel, make sure we can write it */ -if (IS_MOBILE (dev_priv->dev)) -assert_panel_unlocked (dev_priv, pipe); +assert_panel_unlocked (dev_priv, pipe);I915_WRITE (reg, dpll);POSTING_READ (reg);
@@ -1623,6 +1622,9 @@ static void chv_enable_pll(struct intel_crtc *crtc,BUG_ON (!IS_CHERRYVIEW (dev_priv->dev)); +/* PLL is protected by panel, make sure we can write it */ +assert_panel_unlocked (dev_priv, pipe); +mutex_lock (&dev_priv->sb_lock);/* Enable back the 10bit clock to display controller */
Signature · 6 lines
2.4.6 _______________________________________________ Intel-gfx mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH 6/14 drm/i915: Remove the "three times for luck" trick from vlv_enable_pll()
In reply to [email protected]From: Ville Syrjälä <[email protected]>
VLV DPLL is sane and doesn't run on luck.
--- drivers/gpu/drm/i915/intel_display.c | 11 ----------- 1 file changed, 11 deletions(-)
drivers/gpu/drm/i915/intel_display.c +0 -11
@@ -1596,17 +1596,6 @@ static void vlv_enable_pll(struct intel_crtc *crtc,I915_WRITE (DPLL_MD (pipe), pipe_config->dpll_hw_state.dpll_md);POSTING_READ (DPLL_MD (pipe)); - -/* We do this three times for luck */ -I915_WRITE (reg, dpll); -POSTING_READ (reg); -udelay (150 );/* wait for warmup */ -I915_WRITE (reg, dpll); -POSTING_READ (reg); -udelay (150 );/* wait for warmup */ -I915_WRITE (reg, dpll); -POSTING_READ (reg); -udelay (150 );/* wait for warmup */ } static void chv_enable_pll(struct intel_crtc *crtc,
Signature · 6 lines
2.4.6 _______________________________________________ Intel-gfx mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH 7/14 drm/i915: Setup DPLL/DPLLMD for DSI too on VLV/CHV
In reply to [email protected]From: Ville Syrjälä <[email protected]>
Set up DPLL and DPLL_MD even when driving DSI output on VLV/CHV. While the DPLL isn't used to provide the clock we still need the refclock, and it appears that the pixel repeat factor also has an effect on DSI output. So set up eveyrhing in DPLL and DPLL_MD as we would do for DP/HDMI/VGA, but don't actually enable the DPLL or configure the dividers via DPIO.
--- drivers/gpu/drm/i915/intel_display.c | 136 +++++++++++++++++++---------------- drivers/gpu/drm/i915/intel_dsi.c | 25 ++----- 2 files changed, 82 insertions(+), 79 deletions(-)
drivers/gpu/drm/i915/intel_display.c +75 -61
@@ -1570,14 +1570,25 @@ static void assert_pch_ports_disabled(struct drm_i915_private *dev_priv,assert_pch_hdmi_disabled (dev_priv, pipe,PCH_HDMID ); } +static void _vlv_enable_pll (struct intel_crtc *crtc, +const struct intel_crtc_state *pipe_config) +{ +struct drm_i915_private *dev_priv =to_i915 (crtc->base.dev); +enum pipe pipe = crtc->pipe; + +I915_WRITE (DPLL (pipe), pipe_config->dpll_hw_state.dpll); +POSTING_READ (DPLL (pipe)); +udelay (150 ); + +if (wait_for (((I915_READ (DPLL (pipe)) &DPLL_LOCK_VLV ) ==DPLL_LOCK_VLV ),1 )) +DRM_ERROR ("DPLL %d failed to lock\n" , pipe); +} +static void vlv_enable_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; +struct drm_i915_private *dev_priv =to_i915 (crtc->base.dev);enum pipe pipe = crtc->pipe; -int reg =DPLL (pipe); -u32 dpll = pipe_config->dpll_hw_state.dpll;assert_pipe_disabled (dev_priv, pipe);
@@ -1587,33 +1598,22 @@ static void vlv_enable_pll(struct intel_crtc *crtc,/* PLL is protected by panel, make sure we can write it */ assert_panel_unlocked (dev_priv, pipe); -I915_WRITE (reg, dpll); -POSTING_READ (reg); -udelay (150 ); - -if (wait_for (((I915_READ (reg) &DPLL_LOCK_VLV ) ==DPLL_LOCK_VLV ),1 )) -DRM_ERROR ("DPLL %d failed to lock\n" , pipe); +if (pipe_config->dpll_hw_state.dpll &DPLL_VCO_ENABLE ) +_vlv_enable_pll (crtc, pipe_config);I915_WRITE (DPLL_MD (pipe), pipe_config->dpll_hw_state.dpll_md);POSTING_READ (DPLL_MD (pipe)); } -static void chv_enable_pll (struct intel_crtc *crtc, -const struct intel_crtc_state *pipe_config) + +static void _chv_enable_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; +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; -assert_pipe_disabled (dev_priv, crtc->pipe); - -BUG_ON (!IS_CHERRYVIEW (dev_priv->dev)); - -/* PLL is protected by panel, make sure we can write it */ -assert_panel_unlocked (dev_priv, pipe); -mutex_lock (&dev_priv->sb_lock);/* Enable back the 10bit clock to display controller */
@@ -1634,6 +1634,23 @@ static void chv_enable_pll(struct intel_crtc *crtc,/* Check PLL is locked */ if (wait_for (((I915_READ (DPLL (pipe)) &DPLL_LOCK_VLV ) ==DPLL_LOCK_VLV ),1 ))DRM_ERROR ("PLL %d failed to lock\n" , pipe); +} + +static void chv_enable_pll (struct intel_crtc *crtc, +const struct intel_crtc_state *pipe_config) +{ +struct drm_i915_private *dev_priv =to_i915 (crtc->base.dev); +enum pipe pipe = crtc->pipe; + +assert_pipe_disabled (dev_priv, pipe); + +BUG_ON (!IS_CHERRYVIEW (dev_priv->dev)); + +/* PLL is protected by panel, make sure we can write it */ +assert_panel_unlocked (dev_priv, pipe); + +if (pipe_config->dpll_hw_state.dpll &DPLL_VCO_ENABLE ) +_chv_enable_pll (crtc, pipe_config);if (pipe !=PIPE_A ) {/*
@@ -6006,14 +6023,11 @@ static void valleyview_crtc_enable(struct drm_crtc *crtc)struct drm_i915_private *dev_priv =to_i915 (dev);struct intel_crtc *intel_crtc =to_intel_crtc (crtc);struct intel_encoder *encoder; -int pipe = intel_crtc->pipe; -bool is_dsi; +enum pipe pipe = intel_crtc->pipe;if (WARN_ON (intel_crtc->active))return ; - is_dsi =intel_pipe_has_type (intel_crtc,INTEL_OUTPUT_DSI ); -if (intel_crtc->config->has_dp_encoder)intel_dp_set_m_n (intel_crtc,M1_N1 );
@@ -6036,14 +6050,12 @@ static void valleyview_crtc_enable(struct drm_crtc *crtc)if (encoder->pre_pll_enable) encoder->pre_pll_enable (encoder); -if (!is_dsi) { -if (IS_CHERRYVIEW (dev)) { -chv_prepare_pll (intel_crtc, intel_crtc->config); -chv_enable_pll (intel_crtc, intel_crtc->config); - }else { -vlv_prepare_pll (intel_crtc, intel_crtc->config); -vlv_enable_pll (intel_crtc, intel_crtc->config); - } +if (IS_CHERRYVIEW (dev)) { +chv_prepare_pll (intel_crtc, intel_crtc->config); +chv_enable_pll (intel_crtc, intel_crtc->config); + }else { +vlv_prepare_pll (intel_crtc, intel_crtc->config); +vlv_enable_pll (intel_crtc, intel_crtc->config); }for_each_encoder_on_crtc (dev, crtc, encoder)
@@ -7186,11 +7198,15 @@ static void vlv_compute_dpll(struct intel_crtc *crtc, struct intel_crtc_state *pipe_config) { pipe_config->dpll_hw_state.dpll =DPLL_INTEGRATED_REF_CLK_VLV | -DPLL_REF_CLK_ENABLE_VLV |DPLL_VGA_MODE_DIS | -DPLL_VCO_ENABLE |DPLL_EXT_BUFFER_ENABLE_VLV ; +DPLL_REF_CLK_ENABLE_VLV |DPLL_VGA_MODE_DIS ;if (crtc->pipe !=PIPE_A ) pipe_config->dpll_hw_state.dpll |=DPLL_INTEGRATED_CRI_CLK_VLV ; +/* DPLL not used with DSI, but still need the rest set up */ +if (!intel_pipe_will_have_type (pipe_config,INTEL_OUTPUT_DSI )) + pipe_config->dpll_hw_state.dpll |=DPLL_VCO_ENABLE | +DPLL_EXT_BUFFER_ENABLE_VLV ; + pipe_config->dpll_hw_state.dpll_md = (pipe_config->pixel_multiplier -1 ) <<DPLL_MD_UDI_MULTIPLIER_SHIFT ; }
@@ -7199,11 +7215,14 @@ static void chv_compute_dpll(struct intel_crtc *crtc, struct intel_crtc_state *pipe_config) { pipe_config->dpll_hw_state.dpll =DPLL_SSC_REF_CLK_CHV | -DPLL_REF_CLK_ENABLE_VLV |DPLL_VGA_MODE_DIS | -DPLL_VCO_ENABLE ; +DPLL_REF_CLK_ENABLE_VLV |DPLL_VGA_MODE_DIS ;if (crtc->pipe !=PIPE_A ) pipe_config->dpll_hw_state.dpll |=DPLL_INTEGRATED_CRI_CLK_VLV ; +/* DPLL not used with DSI, but still need the rest set up */ +if (!intel_pipe_will_have_type (pipe_config,INTEL_OUTPUT_DSI )) + pipe_config->dpll_hw_state.dpll |=DPLL_VCO_ENABLE ; + pipe_config->dpll_hw_state.dpll_md = (pipe_config->pixel_multiplier -1 ) <<DPLL_MD_UDI_MULTIPLIER_SHIFT ; }
@@ -7213,11 +7232,20 @@ static void vlv_prepare_pll(struct intel_crtc *crtc, {struct drm_device *dev = crtc->base.dev;struct drm_i915_private *dev_priv = dev->dev_private; -int pipe = crtc->pipe; +enum pipe pipe = crtc->pipe;u32 mdiv;u32 bestn, bestm1, bestm2, bestp1, bestp2;u32 coreclk, reg_val; +/* 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 ; +mutex_lock (&dev_priv->sb_lock); bestn = pipe_config->dpll.n;
@@ -7304,14 +7332,21 @@ static void chv_prepare_pll(struct intel_crtc *crtc, {struct drm_device *dev = crtc->base.dev;struct drm_i915_private *dev_priv = dev->dev_private; -int pipe = crtc->pipe; -int dpll_reg =DPLL (crtc->pipe); +enum pipe pipe = crtc->pipe;enum dpio_channel port =vlv_pipe_to_channel (pipe);u32 loopfilter, tribuf_calcntr;u32 bestn, bestm1, bestm2, bestp1, bestp2, bestm2_frac;u32 dpio_val;int vco; +/* 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 ; + bestn = pipe_config->dpll.n; bestm2_frac = pipe_config->dpll.m2 &0x3fffff ; bestm1 = pipe_config->dpll.m1;
@@ -7322,12 +7357,6 @@ static void chv_prepare_pll(struct intel_crtc *crtc, dpio_val =0 ; loopfilter =0 ; -/* -* Enable Refclk and SSC -*/ -I915_WRITE (dpll_reg, - pipe_config->dpll_hw_state.dpll & ~DPLL_VCO_ENABLE ); -mutex_lock (&dev_priv->sb_lock);/* p1 and p2 divider */
@@ -7772,8 +7801,6 @@ static int i9xx_crtc_compute_clock(struct intel_crtc *crtc,int refclk, num_connectors =0 ;intel_clock_t clock;bool ok; -bool is_dsi = false; -struct intel_encoder *encoder;const intel_limit_t *limit;struct drm_atomic_state *state = crtc_state->base.state;struct drm_connector *connector;
@@ -7787,22 +7814,9 @@ static int i9xx_crtc_compute_clock(struct intel_crtc *crtc,if (connector_state->crtc != &crtc->base)continue ; - encoder =to_intel_encoder (connector_state->best_encoder); - -switch (encoder->type) { -case INTEL_OUTPUT_DSI : - is_dsi = true; -break ; -default : -break ; - } - num_connectors++; } -if (is_dsi) -return 0 ; -if (!crtc_state->clock_set) { refclk =i9xx_get_refclk (crtc_state, num_connectors);
drivers/gpu/drm/i915/intel_dsi.c +7 -18
@@ -279,6 +279,12 @@ static bool intel_dsi_compute_config(struct intel_encoder *encoder,/* DSI uses short packets for sync events, so clear mode flags for DSI */ adjusted_mode->flags =0 ; +/* +* FIXME move the DSI PLL calc from vlv_enable_dsi_pll() +* to .compute_config(). +*/ + config->clock_set = true; +return true; }
@@ -406,8 +412,6 @@ static void intel_dsi_pre_enable(struct intel_encoder *encoder)struct drm_device *dev = encoder->base.dev;struct drm_i915_private *dev_priv = dev->dev_private;struct intel_dsi *intel_dsi =enc_to_intel_dsi (&encoder->base); -struct intel_crtc *intel_crtc =to_intel_crtc (encoder->base.crtc); -enum pipe pipe = intel_crtc->pipe;enum port port;u32 tmp;
@@ -419,16 +423,7 @@ static void intel_dsi_pre_enable(struct intel_encoder *encoder)msleep (intel_dsi->panel_on_delay); -/* Disable DPOunit clock gating, can stall pipe -* and we need DPLL REFA always enabled */ - tmp =I915_READ (DPLL (pipe)); - tmp |=DPLL_REF_CLK_ENABLE_VLV ; -I915_WRITE (DPLL (pipe), tmp); - -/* update the hw state for DPLL */ - intel_crtc->config->dpll_hw_state.dpll =DPLL_INTEGRATED_REF_CLK_VLV | -DPLL_REF_CLK_ENABLE_VLV |DPLL_VGA_MODE_DIS ; - +/* Disable DPOunit clock gating, can stall pipe */ tmp =I915_READ (DSPCLK_GATE_D ); tmp |=DPOUNIT_CLOCK_GATE_DISABLE ;I915_WRITE (DSPCLK_GATE_D , tmp);
@@ -634,12 +629,6 @@ static void intel_dsi_get_config(struct intel_encoder *encoder,u32 pclk;DRM_DEBUG_KMS ("\n" ); -/* -* DPLL_MD is not used in case of DSI, reading will get some default value -* set dpll_md = 0 -*/ - pipe_config->dpll_hw_state.dpll_md =0 ; - pclk =vlv_get_dsi_pclk (encoder, pipe_config->pipe_bpp);if (!pclk)return ;
Signature · 6 lines
2.4.6 _______________________________________________ Intel-gfx mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH 8/14 drm/i915: Compute DSI PLL parameters during .compute_config()
In reply to [email protected]From: Ville Syrjälä <[email protected]>
Compute the DSI PLL parameters during .compute_config() rather than .pre_pll_enable() so that we can fail gracefully if we can't find suitable parameters.
In order to do that we need to store the DSI PLL parameters in pipe_config.
--- drivers/gpu/drm/i915/intel_display.c | 3 ++ drivers/gpu/drm/i915/intel_drv.h | 5 ++++ drivers/gpu/drm/i915/intel_dsi.c | 16 +++++++---- drivers/gpu/drm/i915/intel_dsi.h | 8 ++++-- drivers/gpu/drm/i915/intel_dsi_pll.c | 56 +++++++++++++++++++++--------------- 5 files changed, 57 insertions(+), 31 deletions(-)
drivers/gpu/drm/i915/intel_display.c +3 -0
@@ -12488,6 +12488,9 @@ intel_pipe_config_compare(struct drm_device *dev,PIPE_CONF_CHECK_X (dpll_hw_state.cfgcr1);PIPE_CONF_CHECK_X (dpll_hw_state.cfgcr2); +PIPE_CONF_CHECK_X (dsi_pll.ctrl); +PIPE_CONF_CHECK_X (dsi_pll.div); +if (IS_G4X (dev) ||INTEL_INFO (dev)->gen >=5 )PIPE_CONF_CHECK_I (pipe_bpp);
drivers/gpu/drm/i915/intel_drv.h +5 -0
@@ -407,6 +407,11 @@ struct intel_crtc_state {/* Actual register state of the dpll, for shared dpll cross-checking. */ struct intel_dpll_hw_state dpll_hw_state; +/* DSI PLL registers */ +struct { +u32 ctrl, div; + } dsi_pll; +int pipe_bpp;struct intel_link_m_n dp_m_n;
drivers/gpu/drm/i915/intel_dsi.c +10 -6
@@ -270,6 +270,7 @@ static bool intel_dsi_compute_config(struct intel_encoder *encoder,struct intel_connector *intel_connector = intel_dsi->attached_connector;struct drm_display_mode *fixed_mode = intel_connector->panel.fixed_mode;struct drm_display_mode *adjusted_mode = &config->base.adjusted_mode; +int ret;DRM_DEBUG_KMS ("\n" );
@@ -279,10 +280,10 @@ static bool intel_dsi_compute_config(struct intel_encoder *encoder,/* DSI uses short packets for sync events, so clear mode flags for DSI */ adjusted_mode->flags =0 ; -/* -* FIXME move the DSI PLL calc from vlv_enable_dsi_pll() -* to .compute_config(). -*/ + ret =vlv_compute_dsi_pll (encoder, config); +if (ret) +return false; + config->clock_set = true;return true;
@@ -629,7 +630,8 @@ static void intel_dsi_get_config(struct intel_encoder *encoder,u32 pclk;DRM_DEBUG_KMS ("\n" ); - pclk =vlv_get_dsi_pclk (encoder, pipe_config->pipe_bpp); + pclk =vlv_get_dsi_pclk (encoder, pipe_config->pipe_bpp, + pipe_config);if (!pclk)return ;
@@ -900,6 +902,8 @@ static void intel_dsi_prepare(struct intel_encoder *intel_encoder)static void intel_dsi_pre_pll_enable (struct intel_encoder *encoder) { +struct intel_crtc *intel_crtc =to_intel_crtc (encoder->base.crtc); +DRM_DEBUG_KMS ("\n" );intel_dsi_prepare (encoder);
@@ -909,7 +913,7 @@ static void intel_dsi_pre_pll_enable(struct intel_encoder *encoder)* lock. It needs to be fully powered down to fix it. */ vlv_disable_dsi_pll (encoder); -vlv_enable_dsi_pll (encoder); +vlv_enable_dsi_pll (encoder, intel_crtc->config); } static enum drm_connector_status
drivers/gpu/drm/i915/intel_dsi.h +6 -2
@@ -124,9 +124,13 @@ static inline struct intel_dsi *enc_to_intel_dsi(struct drm_encoder *encoder) return container_of(encoder, struct intel_dsi, base.base); } -extern void vlv_enable_dsi_pll (struct intel_encoder *encoder); +extern int vlv_compute_dsi_pll (struct intel_encoder *encoder, +struct intel_crtc_state *config); +extern void vlv_enable_dsi_pll (struct intel_encoder *encoder, +const struct intel_crtc_state *config);extern void vlv_disable_dsi_pll (struct intel_encoder *encoder); -extern u32 vlv_get_dsi_pclk (struct intel_encoder *encoder,int pipe_bpp); +extern u32 vlv_get_dsi_pclk (struct intel_encoder *encoder,int pipe_bpp, +struct intel_crtc_state *config);struct drm_panel *vbt_panel_init (struct intel_dsi *intel_dsi,u16 panel_id);
drivers/gpu/drm/i915/intel_dsi_pll.c +33 -23
125 lines not on this page · raw message
Signature · 6 lines
2.4.6 _______________________________________________ Intel-gfx mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH 9/14 drm/i915: Fix CHV DSI PLL refclk during state readout
In reply to [email protected]From: Ville Syrjälä <[email protected]>
Use the proper refclock frequency (100MHz) when reading out the current DSI clock on CHV.
--- drivers/gpu/drm/i915/intel_dsi_pll.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/i915/intel_dsi_pll.c +1 -1
@@ -316,7 +316,7 @@ u32 vlv_get_dsi_pclk(struct intel_encoder *encoder, int pipe_bpp,u32 dsi_clock, pclk;u32 pll_ctl, pll_div;u32 m =0 , p =0 , n; -int refclk =25000 ; +int refclk =IS_CHERRYVIEW (dev_priv) ?100000 :25000 ;int i;DRM_DEBUG_KMS ("\n" );
Signature · 6 lines
2.4.6 _______________________________________________ Intel-gfx mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH 10/14 drm/i915: Change lfsr_converts[] to u16
In reply to [email protected]From: Ville Syrjälä <[email protected]>
All the values in the DSI PLL LFSR seed table fit into 9bits, so change the type to u16 from u32 to save a bit of space.
drivers/gpu/drm/i915/i915.ko:
-.rodata 90824
+.rodata 90760
--- drivers/gpu/drm/i915/intel_dsi_pll.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/i915/intel_dsi_pll.c +1 -1
@@ -60,7 +60,7 @@ static int dsi_pixel_format_bpp(int pixel_format) } -static const u32 lfsr_converts[] = { +static const u16 lfsr_converts[] = {426 ,469 ,234 ,373 ,442 ,221 ,110 ,311 ,411 ,/* 62 - 70 */ 461 ,486 ,243 ,377 ,188 ,350 ,175 ,343 ,427 ,213 ,/* 71 - 80 */ 106 ,53 ,282 ,397 ,454 ,227 ,113 ,56 ,284 ,142 ,/* 81 - 90 */
Signature · 6 lines
2.4.6 _______________________________________________ Intel-gfx mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH 11/14 drm/i915: Throw out BUGs from DPLL/PCH functions
In reply to [email protected]From: Ville Syrjälä <[email protected]>
These BUGs don't serve any purpose IMO. Throw them out.
--- drivers/gpu/drm/i915/intel_display.c | 14 -------------- 1 file changed, 14 deletions(-)
drivers/gpu/drm/i915/intel_display.c +0 -14
@@ -1592,9 +1592,6 @@ static void vlv_enable_pll(struct intel_crtc *crtc,assert_pipe_disabled (dev_priv, pipe); -/* No really, not for ILK+ */ -BUG_ON (!IS_VALLEYVIEW (dev_priv->dev)); -/* PLL is protected by panel, make sure we can write it */ assert_panel_unlocked (dev_priv, pipe);
@@ -1644,8 +1641,6 @@ static void chv_enable_pll(struct intel_crtc *crtc,assert_pipe_disabled (dev_priv, pipe); -BUG_ON (!IS_CHERRYVIEW (dev_priv->dev)); -/* PLL is protected by panel, make sure we can write it */ assert_panel_unlocked (dev_priv, pipe);
@@ -1696,9 +1691,6 @@ static void i9xx_enable_pll(struct intel_crtc *crtc)assert_pipe_disabled (dev_priv, crtc->pipe); -/* No really, not for ILK+ */ -BUG_ON (INTEL_INFO (dev)->gen >=5 ); -/* PLL is protected by panel, make sure we can write it */ if (IS_MOBILE (dev) && !IS_I830 (dev))assert_panel_unlocked (dev_priv, crtc->pipe);
@@ -1955,9 +1947,6 @@ static void ironlake_enable_pch_transcoder(struct drm_i915_private *dev_priv,struct intel_crtc *intel_crtc =to_intel_crtc (crtc);uint32_t reg, val, pipeconf_val; -/* PCH only available on ILK+ */ -BUG_ON (!HAS_PCH_SPLIT (dev)); -/* Make sure PCH DPLL is enabled */ assert_shared_dpll_enabled (dev_priv,intel_crtc_to_shared_dpll (intel_crtc));
@@ -2012,9 +2001,6 @@ static void lpt_enable_pch_transcoder(struct drm_i915_private *dev_priv, {u32 val, pipeconf_val; -/* PCH only available on ILK+ */ -BUG_ON (!HAS_PCH_SPLIT (dev_priv->dev)); -/* FDI must be feeding us bits for PCH ports */ assert_fdi_tx_enabled (dev_priv, (enum pipe ) cpu_transcoder);assert_fdi_rx_enabled (dev_priv,TRANSCODER_A );
Signature · 6 lines
2.4.6 _______________________________________________ Intel-gfx mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH 12/14 drm/i915: Hook up pfit for DSI
In reply to [email protected]From: Ville Syrjälä <[email protected]>
Add the scaling mode property to DSI connectors, handle changes in the property value, and compute the panel fitter state during .compute_config().
--- drivers/gpu/drm/i915/intel_dsi.c | 69 +++++++++++++++++++++++++++++++++++++--- 1 file changed, 64 insertions(+), 5 deletions(-)
drivers/gpu/drm/i915/intel_dsi.c +64 -5
@@ -268,15 +268,20 @@ static bool intel_dsi_compute_config(struct intel_encoder *encoder, struct intel_dsi *intel_dsi = container_of(encoder, struct intel_dsi, base);struct intel_connector *intel_connector = intel_dsi->attached_connector; -struct drm_display_mode *fixed_mode = intel_connector->panel.fixed_mode; +struct intel_crtc *crtc =to_intel_crtc (config->base.crtc); +const struct drm_display_mode *fixed_mode = intel_connector->panel.fixed_mode;struct drm_display_mode *adjusted_mode = &config->base.adjusted_mode;int ret;DRM_DEBUG_KMS ("\n" ); -if (fixed_mode) +if (fixed_mode) {intel_fixed_panel_mode (fixed_mode, adjusted_mode); +intel_gmch_panel_fitting (crtc, config, + intel_connector->panel.fitting_mode); + } +/* DSI uses short packets for sync events, so clear mode flags for DSI */ adjusted_mode->flags =0 ;
@@ -644,7 +649,7 @@ intel_dsi_mode_valid(struct drm_connector *connector, struct drm_display_mode *mode) {struct intel_connector *intel_connector =to_intel_connector (connector); -struct drm_display_mode *fixed_mode = intel_connector->panel.fixed_mode; +const struct drm_display_mode *fixed_mode = intel_connector->panel.fixed_mode;int max_dotclk =to_i915 (connector->dev)->max_dotclk_freq;DRM_DEBUG_KMS ("\n" );
@@ -945,6 +950,43 @@ static int intel_dsi_get_modes(struct drm_connector *connector)return 1 ; } +static int intel_dsi_set_property (struct drm_connector *connector, +struct drm_property *property, +uint64_t val) +{ +struct drm_device *dev = connector->dev; +struct intel_connector *intel_connector =to_intel_connector (connector); +struct drm_crtc *crtc; +int ret; + + ret =drm_object_property_set_value (&connector->base, property, val); +if (ret) +return ret; + +if (property == dev->mode_config.scaling_mode_property) { +if (val ==DRM_MODE_SCALE_NONE ) { +DRM_DEBUG_KMS ("no scaling not supported\n" ); +return -EINVAL ; + } + +if (intel_connector->panel.fitting_mode == val) +return 0 ; + + intel_connector->panel.fitting_mode = val; + } + + crtc =intel_attached_encoder (connector)->base.crtc; +if (crtc && crtc->state->enable) { +/* +* If the CRTC is enabled, the display will be changed +* according to the new panel fitting mode. +*/ +intel_crtc_restore_mode (crtc); + } + +return 0 ; +} +static void intel_dsi_connector_destroy (struct drm_connector *connector) {struct intel_connector *intel_connector =to_intel_connector (connector);
@@ -987,11 +1029,25 @@ static const struct drm_connector_funcs intel_dsi_connector_funcs = { .detect = intel_dsi_detect, .destroy = intel_dsi_connector_destroy, .fill_modes = drm_helper_probe_single_connector_modes, + .set_property = intel_dsi_set_property, .atomic_get_property = intel_connector_atomic_get_property, .atomic_destroy_state = drm_atomic_helper_connector_destroy_state, .atomic_duplicate_state = drm_atomic_helper_connector_duplicate_state, }; +static void intel_dsi_add_properties (struct intel_connector *connector) +{ +struct drm_device *dev = connector->base.dev; + +if (connector->panel.fixed_mode) { +drm_mode_create_scaling_mode_property (dev); +drm_object_attach_property (&connector->base.base, + dev->mode_config.scaling_mode_property, +DRM_MODE_SCALE_ASPECT ); + connector->panel.fitting_mode =DRM_MODE_SCALE_ASPECT ; + } +} +void intel_dsi_init (struct drm_device *dev) {struct intel_dsi *intel_dsi;
@@ -1111,8 +1167,6 @@ void intel_dsi_init(struct drm_device *dev)intel_connector_attach_encoder (intel_connector, intel_encoder); -drm_connector_register (connector); -drm_panel_attach (intel_dsi->panel, connector);mutex_lock (&dev->mode_config.mutex);
@@ -1131,6 +1185,11 @@ void intel_dsi_init(struct drm_device *dev) }intel_panel_init (&intel_connector->panel, fixed_mode,NULL ); + +intel_dsi_add_properties (intel_connector); + +drm_connector_register (connector); +intel_panel_setup_backlight (connector,INVALID_PIPE );return ;
Signature · 6 lines
2.4.6 _______________________________________________ Intel-gfx mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH 13/14 drm/i915: Reject 'Center' scaling mode for eDP/DSI on GMCH platforms
In reply to [email protected]From: Ville Syrjälä <[email protected]>
We don't have a LVDS_BORDER_ENABLE type of bit for either eDP or DSI, and just trying to frob the display timings to include borders results in a corrupted picture. So reject the 'Center' scaling mode on GMCH platforms for eDP and DSI.
TODO: Should really filter out the unsupported modes from the prop, but that would be fairly invasive since the prop is now created and stored by drm core. So leave it for a rainy day.
--- drivers/gpu/drm/i915/intel_dp.c | 5 +++++ drivers/gpu/drm/i915/intel_dsi.c | 5 +++++ 2 files changed, 10 insertions(+)
drivers/gpu/drm/i915/intel_dp.c +5 -0
@@ -4981,6 +4981,11 @@ intel_dp_set_property(struct drm_connector *connector,DRM_DEBUG_KMS ("no scaling not supported\n" );return -EINVAL ; } +if (HAS_GMCH_DISPLAY (dev_priv) && + val ==DRM_MODE_SCALE_CENTER ) { +DRM_DEBUG_KMS ("centering not supported\n" ); +return -EINVAL ; + }if (intel_connector->panel.fitting_mode == val) {/* the eDP scaling property is not changed */
drivers/gpu/drm/i915/intel_dsi.c +5 -0
@@ -968,6 +968,11 @@ static int intel_dsi_set_property(struct drm_connector *connector,DRM_DEBUG_KMS ("no scaling not supported\n" );return -EINVAL ; } +if (HAS_GMCH_DISPLAY (dev) && + val ==DRM_MODE_SCALE_CENTER ) { +DRM_DEBUG_KMS ("centering not supported\n" ); +return -EINVAL ; + }if (intel_connector->panel.fitting_mode == val)return 0 ;
Signature · 6 lines
2.4.6 _______________________________________________ Intel-gfx mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH 14/14 drm/i915: Dump pfit state as hex
In reply to [email protected]From: Ville Syrjälä <[email protected]>
The pfit state is stored as register values, so dump them as hex instead of decimal to make some sense of the error messages.
--- drivers/gpu/drm/i915/intel_display.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
drivers/gpu/drm/i915/intel_display.c +4 -4
@@ -12442,16 +12442,16 @@ intel_pipe_config_compare(struct drm_device *dev,PIPE_CONF_CHECK_I (pipe_src_w);PIPE_CONF_CHECK_I (pipe_src_h); -PIPE_CONF_CHECK_I (gmch_pfit.control); +PIPE_CONF_CHECK_X (gmch_pfit.control);/* pfit ratios are autocomputed by the hw on gen4+ */ if (INTEL_INFO (dev)->gen <4 )PIPE_CONF_CHECK_I (gmch_pfit.pgm_ratios); -PIPE_CONF_CHECK_I (gmch_pfit.lvds_border_bits); +PIPE_CONF_CHECK_X (gmch_pfit.lvds_border_bits);PIPE_CONF_CHECK_I (pch_pfit.enabled);if (current_config->pch_pfit.enabled) { -PIPE_CONF_CHECK_I (pch_pfit.pos); -PIPE_CONF_CHECK_I (pch_pfit.size); +PIPE_CONF_CHECK_X (pch_pfit.pos); +PIPE_CONF_CHECK_X (pch_pfit.size); }PIPE_CONF_CHECK_I (scaler_state.scaler_id);
Signature · 6 lines
2.4.6 _______________________________________________ Intel-gfx mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [PATCH 14/14] drm/i915: Dump pfit state as hex
Quoted 6 lines · On Thu, Sep 03, 2015 at 09:50:16PM +0300, [email protected] wrote:
From: Ville Syrjälä <[email protected]>
The pfit state is stored as register values, so dump them as hex instead of decimal to make some sense of the error messages.
Signed-off-by Ville Syrjälä <[email protected]>
Picked just this one because I liked it. No clue about dsi details but the new state handling for dsi makes me happy \o/
Cheers, Daniel
Quoted 36 lines
--- drivers/gpu/drm/i915/intel_display.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)drivers/gpu/drm/i915/intel_display.c +4
-4@@ -12442,16 +12442,16 @@ intel_pipe_config_compare(struct drm_device *dev,PIPE_CONF_CHECK_I (pipe_src_w);PIPE_CONF_CHECK_I (pipe_src_h); -PIPE_CONF_CHECK_I (gmch_pfit.control); +PIPE_CONF_CHECK_X (gmch_pfit.control);/* pfit ratios are autocomputed by the hw on gen4+ */ if (INTEL_INFO (dev)->gen <4 )PIPE_CONF_CHECK_I (gmch_pfit.pgm_ratios); -PIPE_CONF_CHECK_I (gmch_pfit.lvds_border_bits); +PIPE_CONF_CHECK_X (gmch_pfit.lvds_border_bits);PIPE_CONF_CHECK_I (pch_pfit.enabled);if (current_config->pch_pfit.enabled) { -PIPE_CONF_CHECK_I (pch_pfit.pos); -PIPE_CONF_CHECK_I (pch_pfit.size); +PIPE_CONF_CHECK_X (pch_pfit.pos); +PIPE_CONF_CHECK_X (pch_pfit.size); }PIPE_CONF_CHECK_I (scaler_state.scaler_id);Signature · 6 lines
2.4.6 _______________________________________________ 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