drm/i915: Try to sort out ironlake_check_fdi_lanes()
Subsystems (2)
cover drm/i915: Try to sort out ironlake_check_fdi_lanes()
From: Ville Syrjälä <[email protected]>
So these on top of Ander's latest FDI bifurcation patch [1] should hopefully result in something sane. Didn't test them though, but assuming Ander has that test somewhere maybe some of the problematic cases I identified [2] could be checked with these.
[1] http://lists.freedesktop.org/archives/intel-gfx/2015-March/061802.html
[2] http://lists.freedesktop.org/archives/intel-gfx/2015-March/061806.html
Ville Syrjälä (2):
drm/i915: Rewrite some some of the FDI lane checks drm/i915: Rewrite IVB FDI bifurcation conflict checks
drivers/gpu/drm/i915/intel_display.c | 40 ++++++++++++++++++------------------ 1 file changed, 20 insertions(+), 20 deletions(-)
Signature · 6 lines
2.0.5 _______________________________________________ Intel-gfx mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH 1/2 drm/i915: Rewrite some some of the FDI lane checks
From: Ville Syrjälä <[email protected]>
The logic in the FDI lane checks is very hard for my poor brain to grasp. Rewrite it in a more straightforward way.
--- drivers/gpu/drm/i915/intel_display.c | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-)
drivers/gpu/drm/i915/intel_display.c +7 -8
@@ -5589,14 +5589,13 @@ static bool ironlake_check_fdi_lanes(struct drm_device *dev, enum pipe pipe, }return true;case PIPE_C : -if (!pipe_has_enabled_pch (pipe_B_crtc) || - pipe_B_crtc->config->fdi_lanes <=2 ) { -if (pipe_config->fdi_lanes >2 ) { -DRM_DEBUG_KMS ("invalid shared fdi lane config on pipe %c: %i lanes\n" , -pipe_name (pipe), pipe_config->fdi_lanes); -return false; - } - }else { +if (pipe_config->fdi_lanes >2 ) { +DRM_DEBUG_KMS ("only 2 lanes on pipe %c: required %i lanes\n" , +pipe_name (pipe), pipe_config->fdi_lanes); +return false; + } +if (pipe_has_enabled_pch (pipe_B_crtc) && + pipe_B_crtc->config->fdi_lanes >2 ) {DRM_DEBUG_KMS ("fdi link B uses too many lanes to enable link C\n" );return false; }
Signature · 6 lines
2.0.5 _______________________________________________ Intel-gfx mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH 2/2 drm/i915: Rewrite IVB FDI bifurcation conflict checks
In reply to [email protected]From: Ville Syrjälä <[email protected]>
Ignore the current state of the pipe and just check crtc_state->enable and the number of FDI lanes required. This means we don't accidentally mistake the FDI lanes as being available of one of the pipes just happens to be disabled at the time of the check. Also we no longer consider pipe C to require FDI lanes when it's driving the eDP transcoder.
We also take the opportunity to make the code a bit nicer looking by hiding the ugly bits in the new pipe_required_fdi_lanes() function.
--- drivers/gpu/drm/i915/intel_display.c | 29 +++++++++++++++-------------- 1 file changed, 15 insertions(+), 14 deletions(-)
drivers/gpu/drm/i915/intel_display.c +15 -14
@@ -3152,12 +3152,6 @@ static void intel_fdi_normal_train(struct drm_crtc *crtc) FDI_FE_ERRC_ENABLE); } -static bool pipe_has_enabled_pch (struct intel_crtc *crtc) -{ -return crtc->base.state->enable && crtc->active && - crtc->config->has_pch_encoder; -} -/* The FDI link training functions for ILK/Ibexpeak. */ static void ironlake_fdi_link_train (struct drm_crtc *crtc) {
@@ -5548,13 +5542,21 @@ bool intel_connector_get_hw_state(struct intel_connector *connector)return encoder->get_hw_state (encoder, &pipe); } +static int pipe_required_fdi_lanes (struct drm_device *dev,enum pipe pipe) +{ +struct intel_crtc *crtc = +to_intel_crtc (intel_get_crtc_for_pipe (dev, pipe)); + +if (crtc->base.state->enable && + crtc->config->has_pch_encoder) +return crtc->config->fdi_lanes; + +return 0 ; +} +static bool ironlake_check_fdi_lanes (struct drm_device *dev,enum pipe pipe,struct intel_crtc_state *pipe_config) { -struct drm_i915_private *dev_priv = dev->dev_private; -struct intel_crtc *pipe_B_crtc = -to_intel_crtc (dev_priv->pipe_to_crtc_mapping[PIPE_B ]); -DRM_DEBUG_KMS ("checking fdi config on pipe %c, lanes %i\n" ,pipe_name (pipe), pipe_config->fdi_lanes);if (pipe_config->fdi_lanes >4 ) {
@@ -5581,8 +5583,8 @@ static bool ironlake_check_fdi_lanes(struct drm_device *dev, enum pipe pipe,case PIPE_A :return true;case PIPE_B : -if (dev_priv->pipe_to_crtc_mapping[PIPE_C ]->enabled && - pipe_config->fdi_lanes >2 ) { +if (pipe_config->fdi_lanes >2 && +pipe_required_fdi_lanes (dev,PIPE_C ) >0 ) {DRM_DEBUG_KMS ("invalid shared fdi lane config on pipe %c: %i lanes\n" ,pipe_name (pipe), pipe_config->fdi_lanes);return false;
@@ -5594,8 +5596,7 @@ static bool ironlake_check_fdi_lanes(struct drm_device *dev, enum pipe pipe, pipe_name(pipe), pipe_config->fdi_lanes);return false; } -if (pipe_has_enabled_pch (pipe_B_crtc) && - pipe_B_crtc->config->fdi_lanes >2 ) { +if (pipe_required_fdi_lanes (dev,PIPE_B ) >2 ) {DRM_DEBUG_KMS ("fdi link B uses too many lanes to enable link C\n" );return false; }
Signature · 6 lines
2.0.5 _______________________________________________ Intel-gfx mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [PATCH 2/2] drm/i915: Rewrite IVB FDI bifurcation conflict checks
(for the series)
Quoted 74 lines · On Wed, 2015-03-11 at 18:52 +0200, [email protected] wrote:
From: Ville Syrjälä <[email protected]>
Ignore the current state of the pipe and just check
crtc_state->enableand the number of FDI lanes required. This means we don't accidentally mistake the FDI lanes as being available of one of the pipes just happens to be disabled at the time of the check. Also we no longer consider pipe C to require FDI lanes when it's driving the eDP transcoder.We also take the opportunity to make the code a bit nicer looking by hiding the ugly bits in the new
pipe_required_fdi_lanes()function.Cc Ander Conselvan de Oliveira <[email protected]>Cc Daniel Vetter <[email protected]>Signed-off-by Ville Syrjälä <[email protected]>--- drivers/gpu/drm/i915/intel_display.c | 29 +++++++++++++++-------------- 1 file changed, 15 insertions(+), 14 deletions(-)drivers/gpu/drm/i915/intel_display.c +14
-12@@ -3152,12 +3152,6 @@ static void intel_fdi_normal_train(struct drm_crtc *crtc) FDI_FE_ERRC_ENABLE); } -static bool pipe_has_enabled_pch (struct intel_crtc *crtc) -{ -return crtc->base.state->enable && crtc->active && - crtc->config->has_pch_encoder; -} -/* The FDI link training functions for ILK/Ibexpeak. */ static void ironlake_fdi_link_train (struct drm_crtc *crtc) {@@ -5548,13 +5542,21 @@ bool intel_connector_get_hw_state(struct intel_connector *connector)return encoder->get_hw_state (encoder, &pipe); } +static int pipe_required_fdi_lanes (struct drm_device *dev,enum pipe pipe) +{ +struct intel_crtc *crtc = +to_intel_crtc (intel_get_crtc_for_pipe (dev, pipe)); + +if (crtc->base.state->enable && + crtc->config->has_pch_encoder) +return crtc->config->fdi_lanes; + +return 0 ; +} +static bool ironlake_check_fdi_lanes (struct drm_device *dev,enum pipe pipe,struct intel_crtc_state *pipe_config) { -struct drm_i915_private *dev_priv = dev->dev_private; -struct intel_crtc *pipe_B_crtc = -to_intel_crtc (dev_priv->pipe_to_crtc_mapping[PIPE_B ]); -DRM_DEBUG_KMS ("checking fdi config on pipe %c, lanes %i\n" ,pipe_name (pipe), pipe_config->fdi_lanes);if (pipe_config->fdi_lanes >4 ) {@@ -5581,8 +5583,8 @@ static bool ironlake_check_fdi_lanes(struct drm_device *dev, enum pipe pipe,case PIPE_A :return true;case PIPE_B : -if (dev_priv->pipe_to_crtc_mapping[PIPE_C ]->enabled && - pipe_config->fdi_lanes >2 ) { +if (pipe_config->fdi_lanes >2 && +pipe_required_fdi_lanes (dev,PIPE_C ) >0 ) {DRM_DEBUG_KMS ("invalid shared fdi lane config on pipe %c: %i lanes\n" ,pipe_name (pipe), pipe_config->fdi_lanes);return false;
drivers/gpu/drm/i915/intel_display.c static bool ironlake_check_fdi_lanes(struct drm_device *dev, enum pipe pipe, · line 5602
Quoted 9 lines
drivers/gpu/drm/i915/intel_display.c +1
-2@@ -5594,8 +5596,7 @@ static bool ironlake_check_fdi_lanes(struct drm_device *dev, enum pipe pipe, pipe_name(pipe), pipe_config->fdi_lanes);return false; } -if (pipe_has_enabled_pch (pipe_B_crtc) && - pipe_B_crtc->config->fdi_lanes >2 ) { +if (pipe_required_fdi_lanes (dev,PIPE_B ) >2 ) {DRM_DEBUG_KMS ("fdi link B uses too many lanes to enable link C\n" );return false; }
_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [PATCH 2/2] drm/i915: Rewrite IVB FDI bifurcation conflict checks
Quoted 2 lines · Ander Conselvan De Oliveira
(for the series)
Reviewed-by Ander Conselvan de Oliveira <[email protected]>
Both merged to dinq, thanks.
-Daniel
Quoted 91 lines · On Wed, 2015-03-11 at 18:52 +0200, [email protected] wrote:
Quoted 74 lines
From: Ville Syrjälä <[email protected]>
Ignore the current state of the pipe and just check
crtc_state->enableand the number of FDI lanes required. This means we don't accidentally mistake the FDI lanes as being available of one of the pipes just happens to be disabled at the time of the check. Also we no longer consider pipe C to require FDI lanes when it's driving the eDP transcoder.We also take the opportunity to make the code a bit nicer looking by hiding the ugly bits in the new
pipe_required_fdi_lanes()function.Cc Ander Conselvan de Oliveira <[email protected]>Cc Daniel Vetter <[email protected]>Signed-off-by Ville Syrjälä <[email protected]>--- drivers/gpu/drm/i915/intel_display.c | 29 +++++++++++++++-------------- 1 file changed, 15 insertions(+), 14 deletions(-)drivers/gpu/drm/i915/intel_display.c +14
-12@@ -3152,12 +3152,6 @@ static void intel_fdi_normal_train(struct drm_crtc *crtc) FDI_FE_ERRC_ENABLE); } -static bool pipe_has_enabled_pch (struct intel_crtc *crtc) -{ -return crtc->base.state->enable && crtc->active && - crtc->config->has_pch_encoder; -} -/* The FDI link training functions for ILK/Ibexpeak. */ static void ironlake_fdi_link_train (struct drm_crtc *crtc) {@@ -5548,13 +5542,21 @@ bool intel_connector_get_hw_state(struct intel_connector *connector)return encoder->get_hw_state (encoder, &pipe); } +static int pipe_required_fdi_lanes (struct drm_device *dev,enum pipe pipe) +{ +struct intel_crtc *crtc = +to_intel_crtc (intel_get_crtc_for_pipe (dev, pipe)); + +if (crtc->base.state->enable && + crtc->config->has_pch_encoder) +return crtc->config->fdi_lanes; + +return 0 ; +} +static bool ironlake_check_fdi_lanes (struct drm_device *dev,enum pipe pipe,struct intel_crtc_state *pipe_config) { -struct drm_i915_private *dev_priv = dev->dev_private; -struct intel_crtc *pipe_B_crtc = -to_intel_crtc (dev_priv->pipe_to_crtc_mapping[PIPE_B ]); -DRM_DEBUG_KMS ("checking fdi config on pipe %c, lanes %i\n" ,pipe_name (pipe), pipe_config->fdi_lanes);if (pipe_config->fdi_lanes >4 ) {@@ -5581,8 +5583,8 @@ static bool ironlake_check_fdi_lanes(struct drm_device *dev, enum pipe pipe,case PIPE_A :return true;case PIPE_B : -if (dev_priv->pipe_to_crtc_mapping[PIPE_C ]->enabled && - pipe_config->fdi_lanes >2 ) { +if (pipe_config->fdi_lanes >2 && +pipe_required_fdi_lanes (dev,PIPE_C ) >0 ) {DRM_DEBUG_KMS ("invalid shared fdi lane config on pipe %c: %i lanes\n" ,pipe_name (pipe), pipe_config->fdi_lanes);return false;drivers/gpu/drm/i915/intel_display.c static bool ironlake_check_fdi_lanes(struct drm_device *dev, enum pipe pipe, · line 5602
Quoted 9 lines
drivers/gpu/drm/i915/intel_display.c +1
-2@@ -5594,8 +5596,7 @@ static bool ironlake_check_fdi_lanes(struct drm_device *dev, enum pipe pipe, pipe_name(pipe), pipe_config->fdi_lanes);return false; } -if (pipe_has_enabled_pch (pipe_B_crtc) && - pipe_B_crtc->config->fdi_lanes >2 ) { +if (pipe_required_fdi_lanes (dev,PIPE_B ) >2 ) {DRM_DEBUG_KMS ("fdi link B uses too many lanes to enable link C\n" );return false; }_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Signature · 7 lines
Daniel Vetter Software Engineer, Intel Corporation +41 (0) 79 365 57 48 - http://blog.ffwll.ch _______________________________________________ Intel-gfx mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Quoted 6 lines · On Wed, 2015-03-11 at 18:52 +0200, [email protected] wrote:
From: Ville Syrjälä <[email protected]>
So these on top of Ander's latest FDI bifurcation patch [1] should hopefully result in something sane. Didn't test them though, but assuming Ander has that test somewhere maybe some of the problematic cases I identified [2] could be checked with these.
I run the tests I wrote here and they all passed. However, the tests don't cover the eDP on pipe C case. Moreover, I don't have an IVB laptop I could use for testing that case.
Ander
Quoted 10 lines
[1] http://lists.freedesktop.org/archives/intel-gfx/2015-March/061802.html
[2] http://lists.freedesktop.org/archives/intel-gfx/2015-March/061806.htmlVille Syrjälä (2):
drm/i915: Rewrite some some of the FDI lane checks drm/i915: Rewrite IVB FDI bifurcation conflict checksdrivers/gpu/drm/i915/intel_display.c | 40 ++++++++++++++++++------------------ 1 file changed, 20 insertions(+), 20 deletions(-)
_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx