drm/i915: use VBT to determine whether to enumerate the VGA port
Subsystems (2)
PATCH 1/6 drm/i915: use VBT to determine whether to enumerate the VGA port
Some platforms may not have it, and enumerating it is both confusing and time consuming due to the hotplug and DDC probing.
--- drivers/gpu/drm/i915/intel_display.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/i915/intel_display.c +1 -1
@@ -10678,7 +10678,7 @@ static void intel_setup_outputs(struct drm_device *dev)intel_lvds_init (dev); -if (!IS_ULT (dev)) +if (!IS_ULT (dev) && dev_priv->vbt.int_crt_support)intel_crt_init (dev);if (HAS_DDI (dev)) {
Signature · 1 line
1.8.4.2
PATCH 2/6 drm/i915: remove unnecessary delays in intel_dp_link_down
The reason for these is lost in the mists of time, and they don't seem to be necessary anymore, so drop them.
--- drivers/gpu/drm/i915/intel_dp.c | 4 ---- 1 file changed, 4 deletions(-)
drivers/gpu/drm/i915/intel_dp.c +0 -4
@@ -2756,9 +2756,6 @@ intel_dp_link_down(struct intel_dp *intel_dp) }POSTING_READ (intel_dp->output_reg); -/* We don't really know why we're doing this */ -intel_wait_for_vblank (dev, intel_crtc->pipe); -if (HAS_PCH_IBX (dev) &&I915_READ (intel_dp->output_reg) &DP_PIPEB_SELECT ) {struct drm_crtc *crtc = intel_dig_port->base.base.crtc;
@@ -2790,7 +2787,6 @@ intel_dp_link_down(struct intel_dp *intel_dp)DP &= ~DP_AUDIO_OUTPUT_ENABLE ;I915_WRITE (intel_dp->output_reg,DP & ~DP_PORT_EN );POSTING_READ (intel_dp->output_reg); -msleep (intel_dp->panel_power_down_delay); } static bool
Signature · 1 line
1.8.4.2
Re: [PATCH 2/6] drm/i915: remove unnecessary delays in intel_dp_link_down
Quoted 2 lines · Jesse Barnes
The reason for these is lost in the mists of time, and they don't seem to be necessary anymore, so drop them.
Separate these two. The first seems to indeed be a random wait, whereas the second appears to be a misapplication of procedure. Either one may turn out to be still required.
-Chris
Signature · 1 line
Chris Wilson, Intel Open Source Technology Centre
PATCH 1/2 drm/i915: remove unexplained vblank wait in the DP off code
I don't think this is necessary; at least it doesn't appear to be on my BYT. Dropping it speeds up our shutdown code a little, in some cases resulting in faster init times.
--- drivers/gpu/drm/i915/intel_dp.c | 3 --- 1 file changed, 3 deletions(-)
drivers/gpu/drm/i915/intel_dp.c +0 -3
@@ -2756,9 +2756,6 @@ intel_dp_link_down(struct intel_dp *intel_dp) }POSTING_READ (intel_dp->output_reg); -/* We don't really know why we're doing this */ -intel_wait_for_vblank (dev, intel_crtc->pipe); -if (HAS_PCH_IBX (dev) &&I915_READ (intel_dp->output_reg) &DP_PIPEB_SELECT ) {struct drm_crtc *crtc = intel_dig_port->base.base.crtc;
Signature · 1 line
1.8.4.2
PATCH 2/2 drm/i915: remove misplaced panel wait in DP off code
We do this wait elsewhere, so drop it to speed things up a bit.
--- drivers/gpu/drm/i915/intel_dp.c | 1 - 1 file changed, 1 deletion(-)
drivers/gpu/drm/i915/intel_dp.c +0 -1
@@ -2787,7 +2787,6 @@ intel_dp_link_down(struct intel_dp *intel_dp)DP &= ~DP_AUDIO_OUTPUT_ENABLE ;I915_WRITE (intel_dp->output_reg,DP & ~DP_PORT_EN );POSTING_READ (intel_dp->output_reg); -msleep (intel_dp->panel_power_down_delay); } static bool
Signature · 1 line
1.8.4.2
Re: [PATCH 1/2] drm/i915: remove unexplained vblank wait in the DP off code
In reply to Jesse BarnesQuoted 5 lines · Jesse Barnes
I don't think this is necessary; at least it doesn't appear to be on my BYT. Dropping it speeds up our shutdown code a little, in some cases resulting in faster init times.
Signed-off-by Jesse Barnes <[email protected]>
Also not required on my IVB.
-Chris
Signature · 1 line
Chris Wilson, Intel Open Source Technology Centre
Re: [PATCH 1/2] drm/i915: remove unexplained vblank wait in the DP off code
In reply to Jesse BarnesQuoted 14 lines · Jesse Barnes
I don't think this is necessary; at least it doesn't appear to be on my BYT. Dropping it speeds up our shutdown code a little, in some cases resulting in faster init times.
Signed-off-by Jesse Barnes <[email protected]>--- drivers/gpu/drm/i915/intel_dp.c | 3 --- 1 file changed, 3 deletions(-)drivers/gpu/drm/i915/intel_dp.c +0
-0
drivers/gpu/drm/i915/intel_dp.c intel_dp_link_down(struct intel_dp *intel_dp) · line 2761
Quoted 6 lines
drivers/gpu/drm/i915/intel_dp.c +0
-3@@ -2756,9 +2756,6 @@ intel_dp_link_down(struct intel_dp *intel_dp) }POSTING_READ (intel_dp->output_reg); -/* We don't really know why we're doing this */ -intel_wait_for_vblank (dev, intel_crtc->pipe); -
Maybe this was here to guarantee we send the magic five idle patterns specified in the DP spec. But since we're going to be turning off the port anyway I don't see why we switch to transmitting the idle pattern at all.
I guess switching to the idle pattern might make sense for the IBX transcoder select workaround to avoid sending some garbage on the main link. Although we don't seem to be doing that workaround quite according to spec. The spec says we should first disable the port, and then re-enable it temporarily w/ transcoder A. What we do is switch the port over to transcoder A while it's still enabled, and only then disable it.
So I guess killing the wait here is fine, but looks like the IBX workaround stuff needs a better look. I can try to clean it up a bit.
Quoted 10 lines
drivers/gpu/drm/i915/intel_dp.c +0
-0if (HAS_PCH_IBX (dev) &&I915_READ (intel_dp->output_reg) &DP_PIPEB_SELECT ) {struct drm_crtc *crtc = intel_dig_port->base.base.crtc;Signature · 6 lines
1.8.4.2 _______________________________________________ Intel-gfx mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Signature · 2 lines
Ville Syrjälä Intel OTC
Daniel Vetter
AppliedRe: [PATCH 1/2] drm/i915: remove unexplained vblank wait in the DP off code
Quoted 34 lines · Ville Syrjälä
Quoted 14 lines · Jesse Barnes
I don't think this is necessary; at least it doesn't appear to be on my BYT. Dropping it speeds up our shutdown code a little, in some cases resulting in faster init times.
Signed-off-by Jesse Barnes <[email protected]>--- drivers/gpu/drm/i915/intel_dp.c | 3 --- 1 file changed, 3 deletions(-)drivers/gpu/drm/i915/intel_dp.c +0
-0drivers/gpu/drm/i915/intel_dp.c intel_dp_link_down(struct intel_dp *intel_dp) · line 2761
Quoted 6 lines
drivers/gpu/drm/i915/intel_dp.c +0
-3@@ -2756,9 +2756,6 @@ intel_dp_link_down(struct intel_dp *intel_dp) }POSTING_READ (intel_dp->output_reg); -/* We don't really know why we're doing this */ -intel_wait_for_vblank (dev, intel_crtc->pipe); -Maybe this was here to guarantee we send the magic five idle patterns specified in the DP spec. But since we're going to be turning off the port anyway I don't see why we switch to transmitting the idle pattern at all.
I guess switching to the idle pattern might make sense for the IBX transcoder select workaround to avoid sending some garbage on the main link. Although we don't seem to be doing that workaround quite according to spec. The spec says we should first disable the port, and then re-enable it temporarily w/ transcoder A. What we do is switch the port over to transcoder A while it's still enabled, and only then disable it.
Quoted 4 lines
So I guess killing the wait here is fine, but looks like the IBX workaround stuff needs a better look. I can try to clean it up a bit.
Reviewed-by Ville Syrjälä <[email protected]>
Queued for -next, thanks for the patch.
-Daniel
Signature · 3 lines
Daniel Vetter Software Engineer, Intel Corporation +41 (0) 79 365 57 48 - http://blog.ffwll.ch
PATCH 3/6 drm/i915: warn when a vblank wait times out
In reply to Jesse BarnesThis always indicates a bug somewhere.
--- drivers/gpu/drm/i915/intel_display.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/i915/intel_display.c +1 -1
@@ -765,7 +765,7 @@ static void g4x_wait_for_vblank(struct drm_device *dev, int pipe) frame =I915_READ (frame_reg);if (wait_for (I915_READ_NOTRACE (frame_reg) != frame,50 )) -DRM_DEBUG_KMS ("vblank wait timed out\n" ); +WARN (1 ,"vblank wait timed out\n" ); }/**
Signature · 1 line
1.8.4.2
Re: [PATCH 3/6] drm/i915: warn when a vblank wait times out
Quoted 1 line · Jesse Barnes
This always indicates a bug somewhere.
We keep turning this off because we hadn't fixed all the bugs - as we try to wait on a dead pipe. Maybe this time we won't be inundated with WARNs...
-Chris
Signature · 1 line
Chris Wilson, Intel Open Source Technology Centre
Re: [PATCH 3/6] drm/i915: warn when a vblank wait times out
Quoted 6 lines · Chris Wilson
Quoted 1 line · Jesse Barnes
This always indicates a bug somewhere.
We keep turning this off because we hadn't fixed all the bugs - as we try to wait on a dead pipe. Maybe this time we won't be inundated with WARNs...
We're really early in the 3.16 cycle. If Jesse promises to chase down all the fallout I'll happily merge this - we really need to get this done sometimes.
-Daniel
Signature · 3 lines
Daniel Vetter Software Engineer, Intel Corporation +41 (0) 79 365 57 48 - http://blog.ffwll.ch
Re: [PATCH 3/6] drm/i915: warn when a vblank wait times out
Quoted 11 lines · On Sat, 5 Apr 2014 17:22:40 +0200 Daniel Vetter <[email protected]> wrote:
Quoted 6 lines · Chris Wilson
Quoted 1 line · Jesse Barnes
This always indicates a bug somewhere.
We keep turning this off because we hadn't fixed all the bugs - as we try to wait on a dead pipe. Maybe this time we won't be inundated with WARNs...
We're really early in the 3.16 cycle. If Jesse promises to chase down all the fallout I'll happily merge this - we really need to get this done sometimes.
It helped me find a missing backport in the Chromium tree for the vblank code on BYT, so it's already been helpful.
Let the flood of bug reports begin!
Signature · 1 line
Jesse Barnes, Intel Open Source Technology Center
Re: [PATCH 3/6] drm/i915: warn when a vblank wait times out
Quoted 11 lines · Jesse Barnes
Quoted 8 lines · On Sat, 5 Apr 2014 17:22:40 +0200 Daniel Vetter <[email protected]> wrote:
Quoted 6 lines · Chris Wilson
Quoted 1 line · Jesse Barnes
This always indicates a bug somewhere.
We keep turning this off because we hadn't fixed all the bugs - as we try to wait on a dead pipe. Maybe this time we won't be inundated with WARNs...
Quoted 8 lines
Quoted 3 lines
We're really early in the 3.16 cycle. If Jesse promises to chase down all the fallout I'll happily merge this - we really need to get this done sometimes.
It helped me find a missing backport in the Chromium tree for the vblank code on BYT, so it's already been helpful.
Let the flood of bug reports begin!
Ok ;-) Queued for -next, thanks for the patch.
-Daniel
Signature · 3 lines
Daniel Vetter Software Engineer, Intel Corporation +41 (0) 79 365 57 48 - http://blog.ffwll.ch
PATCH 4/6 drm/i915: don't set sink DPMS status on eDP
In reply to Jesse BarnesThis only applies to external sinks.
--- drivers/gpu/drm/i915/intel_dp.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
drivers/gpu/drm/i915/intel_dp.c +4 -2
@@ -1783,7 +1783,8 @@ static void intel_disable_dp(struct intel_encoder *encoder)* ensure that we have vdd while we switch off the panel. */ intel_edp_panel_vdd_on (intel_dp);intel_edp_backlight_off (intel_dp); -intel_dp_sink_dpms (intel_dp,DRM_MODE_DPMS_OFF ); +if (!is_edp (intel_dp)) +intel_dp_sink_dpms (intel_dp,DRM_MODE_DPMS_OFF );intel_edp_panel_off (intel_dp);/* cpu edp my only be disable _after_ the cpu pipe/plane is disabled. */
@@ -1821,7 +1822,8 @@ static void intel_enable_dp(struct intel_encoder *encoder)return ;intel_edp_panel_vdd_on (intel_dp); -intel_dp_sink_dpms (intel_dp,DRM_MODE_DPMS_ON ); +if (!is_edp (intel_dp)) +intel_dp_sink_dpms (intel_dp,DRM_MODE_DPMS_ON );intel_dp_start_link_train (intel_dp);intel_edp_panel_on (intel_dp);edp_panel_vdd_off (intel_dp, true);
Signature · 1 line
1.8.4.2
Jani Nikula
maintainerRe: [PATCH 4/6] drm/i915: don't set sink DPMS status on eDP
Quoted 1 line · Jesse Barnes
This only applies to external sinks.
[citation needed]
eDP 1.3 has SET_POWER_CAPABLE (bit 7) in in DPCD EDP_GENERAL_CAPABILITY_REGISTER_1 (register 0x702) which indicates whether panel power state can be controlled through DP_SET_POWER. Even when the panel is not capable, writing to DP_SET_POWER should have no effect on the panel.
BR,
Jani.
Quoted 37 lines
Signed-off-by Jesse Barnes <[email protected]>--- drivers/gpu/drm/i915/intel_dp.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)drivers/gpu/drm/i915/intel_dp.c +4
-2@@ -1783,7 +1783,8 @@ static void intel_disable_dp(struct intel_encoder *encoder)* ensure that we have vdd while we switch off the panel. */ intel_edp_panel_vdd_on (intel_dp);intel_edp_backlight_off (intel_dp); -intel_dp_sink_dpms (intel_dp,DRM_MODE_DPMS_OFF ); +if (!is_edp (intel_dp)) +intel_dp_sink_dpms (intel_dp,DRM_MODE_DPMS_OFF );intel_edp_panel_off (intel_dp);/* cpu edp my only be disable _after_ the cpu pipe/plane is disabled. */ @@ -1821,7 +1822,8 @@ static void intel_enable_dp(struct intel_encoder *encoder)return ;intel_edp_panel_vdd_on (intel_dp); -intel_dp_sink_dpms (intel_dp,DRM_MODE_DPMS_ON ); +if (!is_edp (intel_dp)) +intel_dp_sink_dpms (intel_dp,DRM_MODE_DPMS_ON );intel_dp_start_link_train (intel_dp);intel_edp_panel_on (intel_dp);edp_panel_vdd_off (intel_dp, true);Signature · 6 lines
1.8.4.2 _______________________________________________ Intel-gfx mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Signature · 1 line
Jani Nikula, Intel Open Source Technology Center
Re: [PATCH 4/6] drm/i915: don't set sink DPMS status on eDP
Quoted 11 lines · On Mon, 07 Apr 2014 11:36:46 +0300 Jani Nikula <[email protected]>…
Quoted 1 line · Jesse Barnes
This only applies to external sinks.
[citation needed]
eDP 1.3 has
SET_POWER_CAPABLE(bit 7) in in DPCDEDP_GENERAL_CAPABILITY_REGISTER_1(register0x702) which indicates whether panel power state can be controlled throughDP_SET_POWER. Even when the panel is not capable, writing toDP_SET_POWERshould have no effect on the panel.
This one comes from chromium tree. I checked the DP spec but obviously should have checked eDP too!
I mainly added this to get rid of some noise in the logs about aux timeouts due to these messages. But on eDP that turned out to be an unrelated bug, and not due to us sending these messages after all.
So patch withdrawn...
Signature · 1 line
Jesse Barnes, Intel Open Source Technology Center
PATCH 5/6 drm/i915/vlv: move DP enable after plane/pipe enable per latest spec
In reply to Jesse BarnesThe spec changed the order awhile back to put the ports at the end again, but we never updated. Things seem to work ok either way, but apparently there are some failures fixed by the new order, so let's just go ahead and do it.
--- drivers/gpu/drm/i915/intel_dp.c | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-)
drivers/gpu/drm/i915/intel_dp.c +16 -4
@@ -1842,7 +1842,23 @@ static void g4x_enable_dp(struct intel_encoder *encoder)static void vlv_enable_dp (struct intel_encoder *encoder) {struct intel_dp *intel_dp =enc_to_intel_dp (&encoder->base); +struct intel_digital_port *dport =dp_to_dig_port (intel_dp); +struct drm_device *dev = encoder->base.dev; +struct drm_i915_private *dev_priv = dev->dev_private; +uint32_t dp_reg =I915_READ (intel_dp->output_reg); + +if (WARN_ON (dp_reg &DP_PORT_EN )) +return ; +intel_edp_panel_vdd_on (intel_dp); +intel_dp_start_link_train (intel_dp); +if (!is_edp (intel_dp)) +intel_dp_sink_dpms (intel_dp,DRM_MODE_DPMS_ON ); +intel_edp_panel_on (intel_dp); +vlv_wait_port_ready (dev_priv, dport); +edp_panel_vdd_off (intel_dp, true); +intel_dp_complete_link_train (intel_dp); +intel_dp_stop_link_train (intel_dp);intel_edp_backlight_on (intel_dp); }
@@ -1888,10 +1904,6 @@ static void vlv_pre_enable_dp(struct intel_encoder *encoder)intel_dp_init_panel_power_sequencer_registers (dev, intel_dp, &power_seq); } - -intel_enable_dp (encoder); - -vlv_wait_port_ready (dev_priv, dport); }static void vlv_dp_pre_pll_enable (struct intel_encoder *encoder)
Signature · 1 line
1.8.4.2
PATCH 6/6 drm/i915/vlv: re-order TX lane reset per latest spec
In reply to Jesse BarnesThis is supposed to fix some eDP PPS issues on some platforms.
--- drivers/gpu/drm/i915/intel_dp.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-)
drivers/gpu/drm/i915/intel_dp.c +6 -3
@@ -1844,6 +1844,7 @@ static void vlv_enable_dp(struct intel_encoder *encoder)struct intel_dp *intel_dp =enc_to_intel_dp (&encoder->base);struct intel_digital_port *dport =dp_to_dig_port (intel_dp);struct drm_device *dev = encoder->base.dev; +struct intel_crtc *intel_crtc =to_intel_crtc (encoder->base.crtc);struct drm_i915_private *dev_priv = dev->dev_private;uint32_t dp_reg =I915_READ (intel_dp->output_reg);
@@ -1855,6 +1856,11 @@ static void vlv_enable_dp(struct intel_encoder *encoder)if (!is_edp (intel_dp))intel_dp_sink_dpms (intel_dp,DRM_MODE_DPMS_ON );intel_edp_panel_on (intel_dp); +mutex_lock (&dev_priv->dpio_lock); +vlv_dpio_write (dev_priv, intel_crtc->pipe,VLV_PCS_DW0 (dport->port), +DPIO_PCS_TX_LANE2_RESET | +DPIO_PCS_TX_LANE1_RESET ); +mutex_unlock (&dev_priv->dpio_lock);vlv_wait_port_ready (dev_priv, dport);edp_panel_vdd_off (intel_dp, true);intel_dp_complete_link_train (intel_dp);
@@ -1918,9 +1924,6 @@ static void vlv_dp_pre_pll_enable(struct intel_encoder *encoder)/* Program Tx lane resets to default */ mutex_lock (&dev_priv->dpio_lock); -vlv_dpio_write (dev_priv, pipe,VLV_PCS_DW0 (port), -DPIO_PCS_TX_LANE2_RESET | -DPIO_PCS_TX_LANE1_RESET ); vlv_dpio_write(dev_priv, pipe, VLV_PCS_DW1(port), DPIO_PCS_CLK_CRI_RXEB_EIOS_EN | DPIO_PCS_CLK_CRI_RXDIGFILTSG_EN |
Signature · 1 line
1.8.4.2
Quoted 13 lines · Jesse Barnes
Some platforms may not have it, and enumerating it is both confusing and time consuming due to the hotplug and DDC probing.
Signed-off-by Jesse Barnes <[email protected]>--- drivers/gpu/drm/i915/intel_display.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/gpu/drm/i915/intel_display.c +0
-0
drivers/gpu/drm/i915/intel_display.c static void intel_setup_outputs(struct drm_device *dev) · line 10684
Quoted 8 lines
drivers/gpu/drm/i915/intel_display.c +1
-1@@ -10678,7 +10678,7 @@ static void intel_setup_outputs(struct drm_device *dev)intel_lvds_init (dev); -if (!IS_ULT (dev)) +if (!IS_ULT (dev) && dev_priv->vbt.int_crt_support)intel_crt_init (dev);if (HAS_DDI (dev)) {
For the love of god, can we please rename "bits X" in the struct bdb_general_features? That caused me endless pain. It should be "byte 0"
Also, I guess there is a problem when the VBT is missing, and we have a dont have a CRT on non-ULT (since the default seems to be true). This however is no worse than the current situation AFAICT.
Signature · 1 line
Ben Widawsky, Intel Open Source Technology Center
Daniel Vetter
AppliedQuoted 27 lines · Ben Widawsky
Quoted 13 lines · Jesse Barnes
Some platforms may not have it, and enumerating it is both confusing and time consuming due to the hotplug and DDC probing.
Signed-off-by Jesse Barnes <[email protected]>--- drivers/gpu/drm/i915/intel_display.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/gpu/drm/i915/intel_display.c +0
-0drivers/gpu/drm/i915/intel_display.c static void intel_setup_outputs(struct drm_device *dev) · line 10684
Quoted 8 lines
drivers/gpu/drm/i915/intel_display.c +1
-1@@ -10678,7 +10678,7 @@ static void intel_setup_outputs(struct drm_device *dev)intel_lvds_init (dev); -if (!IS_ULT (dev)) +if (!IS_ULT (dev) && dev_priv->vbt.int_crt_support)intel_crt_init (dev);if (HAS_DDI (dev)) {For the love of god, can we please rename "bits X" in the struct
bdb_general_features? That caused me endless pain. It should be "byte 0"
Quoted 5 lines
Also, I guess there is a problem when the VBT is missing, and we have a dont have a CRT on non-ULT (since the default seems to be true). This however is no worse than the current situation AFAICT.
Reviewed-by Ben Widawsky <[email protected]>
Queued for -next, thanks for the patch.
-Daniel
Signature · 3 lines
Daniel Vetter Software Engineer, Intel Corporation +41 (0) 79 365 57 48 - http://blog.ffwll.ch