drm/i915: Move DP link retraining to hotplug work etc.
Subsystems (2)
cover drm/i915: Move DP link retraining to hotplug work etc.
From: Ville Syrjälä <[email protected]>
Ok, so while looking at the upfront link training stuff, it became obvious that we needs to do something about the link training stuff that we have in hpd_pulse currently. The thing is, you can't grab any modeset locks from that work since it could lead to a deadlock with MST sideband stuff. So here's a quick attempt at moving the stuff over to the hotplug work.
I've included a few other things at the start just to make the surroundings a little less broken (some of that I've posted before). And there are a few potentially helpful snippets at the end too. The main meat is in the middle.
Entire series avaialable here:git://github.com/vsyrjala/linux.git dp_retrain_fixes
Ville Syrjälä (12):
drm/i915: Ignore initial lid state for eDP
drm/i915: Read PSR caps/intermediate freqs/etc. only once on eDP drm/i915: Avoid mixing up SST and MST in DDI setup drm/i915: Reject mixing MST and SST/HDMI on the same digital port drm/i915: Track active streams also for DP SST drm/i915: Allow MST sinks to work even if drm_probe_ddc() fails drm/i915: Move DP link retraining into intel_dp_detect() drm/i915: Skip dpcd/edid read unless there was a long hpd drm/i915: Remove useless rate_to_index() usage drm/i915: Allow rate_to_index() to return non-exact matches drm/i915: Don't try to ack sink irqs when there are none drm/i915: Add encoder .sync_state() hook
drivers/gpu/drm/i915/intel_ddi.c | 35 ++-- drivers/gpu/drm/i915/intel_display.c | 14 ++ drivers/gpu/drm/i915/intel_dp.c | 390 ++++++++++++++++++----------------- drivers/gpu/drm/i915/intel_dp_mst.c | 16 +- drivers/gpu/drm/i915/intel_drv.h | 12 +- 5 files changed, 255 insertions(+), 212 deletions(-)
Signature · 6 lines
2.7.4 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH 1/12 drm/i915: Ignore initial lid state for eDP
From: Ville Syrjälä <[email protected]>
Currently we try to check the lid status to see whether eDP is connected or not. However we ignore the result anyway, and we have no lid notifier to fire off uevents, so let's just ignore the lid stuff for eDP entirely.
While at it, rip out the eDP case from intel_dp_detect_dpcd() since we never call that thing with eDP displays anyway.
--- drivers/gpu/drm/i915/intel_dp.c | 19 +------------------ 1 file changed, 1 insertion(+), 18 deletions(-)
drivers/gpu/drm/i915/intel_dp.c +1 -18
@@ -3965,9 +3965,6 @@ intel_dp_detect_dpcd(struct intel_dp *intel_dp)if (!intel_dp_get_dpcd (intel_dp))return connector_status_disconnected; -if (is_edp (intel_dp)) -return connector_status_connected; -/* if there's no downstream port, we're done */ if (!(dpcd[DP_DOWNSTREAMPORT_PRESENT ] &DP_DWN_STRM_PORT_PRESENT ))return connector_status_connected;
@@ -4003,19 +4000,6 @@ intel_dp_detect_dpcd(struct intel_dp *intel_dp)return connector_status_disconnected; } -static enum drm_connector_status -edp_detect (struct intel_dp *intel_dp) -{ -struct drm_device *dev =intel_dp_to_dev (intel_dp); -enum drm_connector_status status; - - status =intel_panel_detect (dev); -if (status == connector_status_unknown) - status = connector_status_connected; - -return status; -} -static bool ibx_digital_port_connected (struct drm_i915_private *dev_priv,struct intel_digital_port *port) {
@@ -4223,9 +4207,8 @@ intel_dp_long_pulse(struct intel_connector *intel_connector) power_domain =intel_display_port_aux_power_domain (intel_encoder);intel_display_power_get (to_i915 (dev), power_domain); -/* Can't disconnect eDP, but you can close the lid... */ if (is_edp (intel_dp)) - status =edp_detect (intel_dp); + status = connector_status_connected;else if (intel_digital_port_connected (to_i915 (dev),dp_to_dig_port (intel_dp))) status =intel_dp_detect_dpcd (intel_dp);
Signature · 6 lines
2.7.4 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [PATCH 01/12] drm/i915: Ignore initial lid state for eDP
Quoted 6 lines · On Thu, Jul 28, 2016 at 05:50:37PM +0300, [email protected] wrote:
From: Ville Syrjälä <[email protected]>
Currently we try to check the lid status to see whether eDP is connected or not. However we ignore the result anyway, and we have no lid notifier to fire off uevents, so let's just ignore the lid stuff for eDP entirely.
You mean the OpRegion no longer contains lid_state? I don't see it being disabled... The lid notifier is from acpi/button.c. I haven't looked at why the result would be ignored, but you haven't convinced me why eDP is special.
-Chris
Signature · 5 lines
Chris Wilson, Intel Open Source Technology Centre _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [PATCH 01/12] drm/i915: Ignore initial lid state for eDP
Quoted 8 lines · Chris Wilson
Quoted 6 lines · On Thu, Jul 28, 2016 at 05:50:37PM +0300, [email protected] wrote:
From: Ville Syrjälä <[email protected]>
Currently we try to check the lid status to see whether eDP is connected or not. However we ignore the result anyway, and we have no lid notifier to fire off uevents, so let's just ignore the lid stuff for eDP entirely.
Quoted 4 lines
You mean the OpRegion no longer contains
lid_state? I don't see it being disabled... The lid notifier is fromacpi/button.c. I haven't looked at why the result would be ignored, but you haven't convinced me why eDP is special.
We don't register a lid notifier for eDP. So if the initial detect would happen with lid closed we'd mark eDP as disconnected, and when the lid gets opened we won't even notice, and thus the connector never becomes connected.
IIRC on my ILK the lid state in OpRegion didn't work anyway. But I should probably double check.
Signature · 6 lines
Ville Syrjälä Intel OTC _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [PATCH 01/12] drm/i915: Ignore initial lid state for eDP
Quoted 14 lines · Ville Syrjälä
Quoted 8 lines · Chris Wilson
Quoted 6 lines · On Thu, Jul 28, 2016 at 05:50:37PM +0300, [email protected] wrote:
From: Ville Syrjälä <[email protected]>
Currently we try to check the lid status to see whether eDP is connected or not. However we ignore the result anyway, and we have no lid notifier to fire off uevents, so let's just ignore the lid stuff for eDP entirely.
Quoted 4 lines
You mean the OpRegion no longer contains
lid_state? I don't see it being disabled... The lid notifier is fromacpi/button.c. I haven't looked at why the result would be ignored, but you haven't convinced me why eDP is special.
Quoted 4 lines
We don't register a lid notifier for eDP. So if the initial detect would happen with lid closed we'd mark eDP as disconnected, and when the lid gets opened we won't even notice, and thus the connector never becomes connected.
That was meant to be part of the intel_panel so that we have consistent behaviour on any laptop. I would still rather we have consistent behaviour, but eDP has been different for so long that any change now is going to be painful.
Quoted 2 lines
IIRC on my ILK the lid state in OpRegion didn't work anyway. But I should probably double check.
Yup, the lid button was unreliable as every other piece of hw. Looking at intel_lid_notify(), would it not be easier just to send the hotplug uevent.
-Chris
Signature · 5 lines
Chris Wilson, Intel Open Source Technology Centre _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [PATCH 01/12] drm/i915: Ignore initial lid state for eDP
Quoted 25 lines · Chris Wilson
Quoted 14 lines · Ville Syrjälä
Quoted 8 lines · Chris Wilson
Quoted 6 lines · On Thu, Jul 28, 2016 at 05:50:37PM +0300, [email protected] wrote:
From: Ville Syrjälä <[email protected]>
Currently we try to check the lid status to see whether eDP is connected or not. However we ignore the result anyway, and we have no lid notifier to fire off uevents, so let's just ignore the lid stuff for eDP entirely.
Quoted 4 lines
You mean the OpRegion no longer contains
lid_state? I don't see it being disabled... The lid notifier is fromacpi/button.c. I haven't looked at why the result would be ignored, but you haven't convinced me why eDP is special.Quoted 4 lines
We don't register a lid notifier for eDP. So if the initial detect would happen with lid closed we'd mark eDP as disconnected, and when the lid gets opened we won't even notice, and thus the connector never becomes connected.
That was meant to be part of the
intel_panelso that we have consistent behaviour on any laptop. I would still rather we have consistent behaviour, but eDP has been different for so long that any change now is going to be painful.
Quoted 6 lines
Quoted 2 lines
IIRC on my ILK the lid state in OpRegion didn't work anyway. But I should probably double check.
Yup, the lid button was unreliable as every other piece of hw. Looking at
intel_lid_notify(), would it not be easier just to send the hotplug uevent.
I thought the main point of the lid notifier was to restore any state trampled by the VBIOS. I've been hoping that I'd find some magic thing to get the VBIOS to not do that. IIRC there are some semi-interesting looking things in OpRegion that might just do it. But to know for sure I'd first have to get my hands on a machine that suffers from this affliction.
Signature · 6 lines
Ville Syrjälä Intel OTC _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH 2/12 drm/i915: Read PSR caps/intermediate freqs/etc. only once on eDP
In reply to [email protected]From: Ville Syrjälä <[email protected]>
Currently we re-read a bunch of static eDP panel caps from the DPCD over and over again. Let's do it only once to save some time and effort.
--- drivers/gpu/drm/i915/intel_dp.c | 121 +++++++++++++++++++++------------------- 1 file changed, 63 insertions(+), 58 deletions(-)
drivers/gpu/drm/i915/intel_dp.c +63 -58
@@ -3394,12 +3394,70 @@ intel_dp_link_down(struct intel_dp *intel_dp) intel_dp->DP =DP ; } +static void +intel_edp_get_dpcd (struct intel_dp *intel_dp) +{ +struct drm_i915_private *dev_priv = +to_i915 (dp_to_dig_port (intel_dp)->base.base.dev); + +/* Check if the panel supports PSR */ +drm_dp_dpcd_read (&intel_dp->aux,DP_PSR_SUPPORT , + intel_dp->psr_dpcd, +sizeof (intel_dp->psr_dpcd)); +if (intel_dp->psr_dpcd[0 ] &DP_PSR_IS_SUPPORTED ) { + dev_priv->psr.sink_support = true; +DRM_DEBUG_KMS ("Detected EDP PSR Panel.\n" ); + } + +if (INTEL_GEN (dev_priv) >=9 && + (intel_dp->psr_dpcd[0 ] &DP_PSR2_IS_SUPPORTED )) { +uint8_t frame_sync_cap; + + dev_priv->psr.sink_support = true; +drm_dp_dpcd_read (&intel_dp->aux, +DP_SINK_DEVICE_AUX_FRAME_SYNC_CAP , + &frame_sync_cap,1 ); + dev_priv->psr.aux_frame_sync = frame_sync_cap ? true : false; +/* PSR2 needs frame sync as well */ + dev_priv->psr.psr2_support = dev_priv->psr.aux_frame_sync; +DRM_DEBUG_KMS ("PSR2 %s on sink" , + dev_priv->psr.psr2_support ?"supported" :"not supported" ); + } + +/* Read the eDP Display control capabilities registers */ +if ((intel_dp->dpcd[DP_EDP_CONFIGURATION_CAP ] &DP_DPCD_DISPLAY_CONTROL_CAPABLE ) && +drm_dp_dpcd_read (&intel_dp->aux,DP_EDP_DPCD_REV , + intel_dp->edp_dpcd,sizeof (intel_dp->edp_dpcd) == +sizeof (intel_dp->edp_dpcd))) +DRM_DEBUG_KMS ("EDP DPCD : %*ph\n" , (int )sizeof (intel_dp->edp_dpcd), + intel_dp->edp_dpcd); + +/* Intermediate frequency support */ +if (intel_dp->edp_dpcd[0 ] >=0x03 ) {/* eDp v1.4 or higher */ +__le16 sink_rates[DP_MAX_SUPPORTED_RATES ]; +int i; + +drm_dp_dpcd_read (&intel_dp->aux,DP_SUPPORTED_LINK_RATES , + sink_rates,sizeof (sink_rates)); + +for (i =0 ; i <ARRAY_SIZE (sink_rates); i++) { +int val =le16_to_cpu (sink_rates[i]); + +if (val ==0 ) +break ; + +/* Value read is in kHz while drm clock is saved in deca-kHz */ + intel_dp->sink_rates[i] = (val *200 ) /10 ; + } + intel_dp->num_sink_rates = i; + } +} +static bool intel_dp_get_dpcd (struct intel_dp *intel_dp) { -struct intel_digital_port *dig_port =dp_to_dig_port (intel_dp); -struct drm_device *dev = dig_port->base.base.dev; -struct drm_i915_private *dev_priv =to_i915 (dev); +bool init_edp_dpcd =is_edp (intel_dp) && + intel_dp->dpcd[DP_DPCD_REV ] ==0 ;if (drm_dp_dpcd_read (&intel_dp->aux,0x000 , intel_dp->dpcd,sizeof (intel_dp->dpcd)) <0 )
@@ -3431,66 +3489,13 @@ intel_dp_get_dpcd(struct intel_dp *intel_dp)if (!is_edp (intel_dp) && !intel_dp->sink_count)return false; -/* Check if the panel supports PSR */ -memset (intel_dp->psr_dpcd,0 ,sizeof (intel_dp->psr_dpcd)); -if (is_edp (intel_dp)) { -drm_dp_dpcd_read (&intel_dp->aux,DP_PSR_SUPPORT , - intel_dp->psr_dpcd, -sizeof (intel_dp->psr_dpcd)); -if (intel_dp->psr_dpcd[0 ] &DP_PSR_IS_SUPPORTED ) { - dev_priv->psr.sink_support = true; -DRM_DEBUG_KMS ("Detected EDP PSR Panel.\n" ); - } - -if (INTEL_INFO (dev)->gen >=9 && - (intel_dp->psr_dpcd[0 ] &DP_PSR2_IS_SUPPORTED )) { -uint8_t frame_sync_cap; - - dev_priv->psr.sink_support = true; -drm_dp_dpcd_read (&intel_dp->aux, -DP_SINK_DEVICE_AUX_FRAME_SYNC_CAP , - &frame_sync_cap,1 ); - dev_priv->psr.aux_frame_sync = frame_sync_cap ? true : false; -/* PSR2 needs frame sync as well */ - dev_priv->psr.psr2_support = dev_priv->psr.aux_frame_sync; -DRM_DEBUG_KMS ("PSR2 %s on sink" , - dev_priv->psr.psr2_support ?"supported" :"not supported" ); - } - -/* Read the eDP Display control capabilities registers */ -memset (intel_dp->edp_dpcd,0 ,sizeof (intel_dp->edp_dpcd)); -if ((intel_dp->dpcd[DP_EDP_CONFIGURATION_CAP ] &DP_DPCD_DISPLAY_CONTROL_CAPABLE ) && - (drm_dp_dpcd_read (&intel_dp->aux,DP_EDP_DPCD_REV , - intel_dp->edp_dpcd,sizeof (intel_dp->edp_dpcd)) == -sizeof (intel_dp->edp_dpcd))) -DRM_DEBUG_KMS ("EDP DPCD : %*ph\n" , (int )sizeof (intel_dp->edp_dpcd), - intel_dp->edp_dpcd); - } +if (init_edp_dpcd) +intel_edp_get_dpcd (intel_dp);DRM_DEBUG_KMS ("Display Port TPS3 support: source %s, sink %s\n" ,yesno (intel_dp_source_supports_hbr2 (intel_dp)),yesno (drm_dp_tps3_supported (intel_dp->dpcd))); -/* Intermediate frequency support */ -if (is_edp (intel_dp) && (intel_dp->edp_dpcd[0 ] >=0x03 )) {/* eDp v1.4 or higher */ -__le16 sink_rates[DP_MAX_SUPPORTED_RATES ]; -int i; - -drm_dp_dpcd_read (&intel_dp->aux,DP_SUPPORTED_LINK_RATES , - sink_rates,sizeof (sink_rates)); - -for (i =0 ; i <ARRAY_SIZE (sink_rates); i++) { -int val =le16_to_cpu (sink_rates[i]); - -if (val ==0 ) -break ; - -/* Value read is in kHz while drm clock is saved in deca-kHz */ - intel_dp->sink_rates[i] = (val *200 ) /10 ; - } - intel_dp->num_sink_rates = i; - } -intel_dp_print_rates (intel_dp); if (!(intel_dp->dpcd[DP_DOWNSTREAMPORT_PRESENT] &
Signature · 6 lines
2.7.4 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [PATCH 02/12] drm/i915: Read PSR caps/intermediate freqs/etc. only once on eDP
Quoted 6 lines · On Thu, Jul 28, 2016 at 05:50:38PM +0300, [email protected] wrote:
From: Ville Syrjälä <[email protected]>
Currently we re-read a bunch of static eDP panel caps from the DPCD over and over again. Let's do it only once to save some time and effort.
Signed-off-by Ville Syrjälä <[email protected]>
Quoted 4 lines
static bool
intel_dp_get_dpcd(struct intel_dp *intel_dp)
{drivers/gpu/drm/i915/intel_dp.c +0
-1-struct intel_digital_port *dig_port =dp_to_dig_port (intel_dp);
drivers/gpu/drm/i915/intel_dp.c intel_dp_link_down(struct intel_dp *intel_dp)
Quoted 10 lines
drivers/gpu/drm/i915/intel_dp.c +4
-2-struct drm_device *dev = dig_port->base.base.dev; -struct drm_i915_private *dev_priv =to_i915 (dev); +bool init_edp_dpcd =is_edp (intel_dp) && + intel_dp->dpcd[DP_DPCD_REV ] ==0 ;if (drm_dp_dpcd_read (&intel_dp->aux,0x000 , intel_dp->dpcd,sizeof (intel_dp->dpcd)) <0 ) +if (init_edp_dpcd) +intel_edp_get_dpcd (intel_dp);
I have to admit it took me a few passes to realise how this achieves init once.
bool intel_dp_dpcd_is_unset(intel_dp)
{
return intel_dp->dpcd[DP_DPCD_REV] == 0;
}Not really sure how else to make it clear to the causal reader that test is only true on the first call.
-Chris
Signature · 5 lines
Chris Wilson, Intel Open Source Technology Centre _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [PATCH 02/12] drm/i915: Read PSR caps/intermediate freqs/etc. only once on eDP
Quoted 27 lines · Chris Wilson
Quoted 6 lines · On Thu, Jul 28, 2016 at 05:50:38PM +0300, [email protected] wrote:
From: Ville Syrjälä <[email protected]>
Currently we re-read a bunch of static eDP panel caps from the DPCD over and over again. Let's do it only once to save some time and effort.
Signed-off-by Ville Syrjälä <[email protected]>Reviewed-by Chris Wilson <[email protected]>Quoted 4 lines
static bool
intel_dp_get_dpcd(struct intel_dp *intel_dp)
{drivers/gpu/drm/i915/intel_dp.c +0
-1-struct intel_digital_port *dig_port =dp_to_dig_port (intel_dp);drivers/gpu/drm/i915/intel_dp.c intel_dp_link_down(struct intel_dp *intel_dp)
Quoted 10 lines
drivers/gpu/drm/i915/intel_dp.c +4
-2-struct drm_device *dev = dig_port->base.base.dev; -struct drm_i915_private *dev_priv =to_i915 (dev); +bool init_edp_dpcd =is_edp (intel_dp) && + intel_dp->dpcd[DP_DPCD_REV ] ==0 ;if (drm_dp_dpcd_read (&intel_dp->aux,0x000 , intel_dp->dpcd,sizeof (intel_dp->dpcd)) <0 ) +if (init_edp_dpcd) +intel_edp_get_dpcd (intel_dp);I have to admit it took me a few passes to realise how this achieves init once.
Quoted 7 lines
bool intel_dp_dpcd_is_unset(intel_dp) { return intel_dp->dpcd[DP_DPCD_REV] == 0; }Not really sure how else to make it clear to the causal reader that test is only true on the first call.
First I thought I'd just call the eDP specific function from the connector init, but then I realized it needs to happen after reading the regular DPCD stuff, but before printing out the rates/etc. So in the end I just left it where it was and added the bool. I suppose it should be possible to refactor the thing somehow to make it less confusing.
I guess I can give it one more try, and if I should fail, I'll suck in your intel_dp_dpcd_is_unset() at least...
Signature · 6 lines
Ville Syrjälä Intel OTC _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH v3 2/12 drm/i915: Read PSR caps/intermediate freqs/etc. only once on eDP
In reply to [email protected]From: Ville Syrjälä <[email protected]>
Currently we re-read a bunch of static eDP panel caps from the DPCD over and over again. Let's do it only once to save some time and effort.
v2: Make thing less confusing with intel_edp_init_dpcd() (Chris)
Move no_aux_handshake setup in there as well
v3: Move tps3/rate printout to intel_dp_long_pulse() so that
we'll still get them on eDP as well
--- drivers/gpu/drm/i915/intel_dp.c | 165 ++++++++++++++++++++++------------------ 1 file changed, 89 insertions(+), 76 deletions(-)
drivers/gpu/drm/i915/intel_dp.c +89 -76
@@ -3395,20 +3395,94 @@ intel_dp_link_down(struct intel_dp *intel_dp) }static bool -intel_dp_get_dpcd (struct intel_dp *intel_dp) +intel_dp_read_dpcd (struct intel_dp *intel_dp) { -struct intel_digital_port *dig_port =dp_to_dig_port (intel_dp); -struct drm_device *dev = dig_port->base.base.dev; -struct drm_i915_private *dev_priv =to_i915 (dev); -if (drm_dp_dpcd_read (&intel_dp->aux,0x000 , intel_dp->dpcd,sizeof (intel_dp->dpcd)) <0 )return false;/* aux transfer failed */ DRM_DEBUG_KMS ("DPCD: %*ph\n" , (int )sizeof (intel_dp->dpcd), intel_dp->dpcd); -if (intel_dp->dpcd[DP_DPCD_REV ] ==0 ) -return false;/* DPCD not present */ +return intel_dp->dpcd[DP_DPCD_REV ] !=0 ; +} + +static bool +intel_edp_init_dpcd (struct intel_dp *intel_dp) +{ +struct drm_i915_private *dev_priv = +to_i915 (dp_to_dig_port (intel_dp)->base.base.dev); + +/* this function is meant to be called only once */ +WARN_ON (intel_dp->dpcd[DP_DPCD_REV ] !=0 ); + +if (!intel_dp_read_dpcd (intel_dp)) +return false; + +if (intel_dp->dpcd[DP_DPCD_REV ] >=0x11 ) + dev_priv->no_aux_handshake = intel_dp->dpcd[DP_MAX_DOWNSPREAD ] & +DP_NO_AUX_HANDSHAKE_LINK_TRAINING ; + +/* Check if the panel supports PSR */ +drm_dp_dpcd_read (&intel_dp->aux,DP_PSR_SUPPORT , + intel_dp->psr_dpcd, +sizeof (intel_dp->psr_dpcd)); +if (intel_dp->psr_dpcd[0 ] &DP_PSR_IS_SUPPORTED ) { + dev_priv->psr.sink_support = true; +DRM_DEBUG_KMS ("Detected EDP PSR Panel.\n" ); + } + +if (INTEL_GEN (dev_priv) >=9 && + (intel_dp->psr_dpcd[0 ] &DP_PSR2_IS_SUPPORTED )) { +uint8_t frame_sync_cap; + + dev_priv->psr.sink_support = true; +drm_dp_dpcd_read (&intel_dp->aux, +DP_SINK_DEVICE_AUX_FRAME_SYNC_CAP , + &frame_sync_cap,1 ); + dev_priv->psr.aux_frame_sync = frame_sync_cap ? true : false; +/* PSR2 needs frame sync as well */ + dev_priv->psr.psr2_support = dev_priv->psr.aux_frame_sync; +DRM_DEBUG_KMS ("PSR2 %s on sink" , + dev_priv->psr.psr2_support ?"supported" :"not supported" ); + } + +/* Read the eDP Display control capabilities registers */ +if ((intel_dp->dpcd[DP_EDP_CONFIGURATION_CAP ] &DP_DPCD_DISPLAY_CONTROL_CAPABLE ) && +drm_dp_dpcd_read (&intel_dp->aux,DP_EDP_DPCD_REV , + intel_dp->edp_dpcd,sizeof (intel_dp->edp_dpcd) == +sizeof (intel_dp->edp_dpcd))) +DRM_DEBUG_KMS ("EDP DPCD : %*ph\n" , (int )sizeof (intel_dp->edp_dpcd), + intel_dp->edp_dpcd); + +/* Intermediate frequency support */ +if (intel_dp->edp_dpcd[0 ] >=0x03 ) {/* eDp v1.4 or higher */ +__le16 sink_rates[DP_MAX_SUPPORTED_RATES ]; +int i; + +drm_dp_dpcd_read (&intel_dp->aux,DP_SUPPORTED_LINK_RATES , + sink_rates,sizeof (sink_rates)); + +for (i =0 ; i <ARRAY_SIZE (sink_rates); i++) { +int val =le16_to_cpu (sink_rates[i]); + +if (val ==0 ) +break ; + +/* Value read is in kHz while drm clock is saved in deca-kHz */ + intel_dp->sink_rates[i] = (val *200 ) /10 ; + } + intel_dp->num_sink_rates = i; + } + +return true; +} + + +static bool +intel_dp_get_dpcd (struct intel_dp *intel_dp) +{ +if (!intel_dp_read_dpcd (intel_dp)) +return false;if (drm_dp_dpcd_read (&intel_dp->aux,DP_SINK_COUNT , &intel_dp->sink_count,1 ) <0 )
@@ -3431,68 +3505,6 @@ intel_dp_get_dpcd(struct intel_dp *intel_dp)if (!is_edp (intel_dp) && !intel_dp->sink_count)return false; -/* Check if the panel supports PSR */ -memset (intel_dp->psr_dpcd,0 ,sizeof (intel_dp->psr_dpcd)); -if (is_edp (intel_dp)) { -drm_dp_dpcd_read (&intel_dp->aux,DP_PSR_SUPPORT , - intel_dp->psr_dpcd, -sizeof (intel_dp->psr_dpcd)); -if (intel_dp->psr_dpcd[0 ] &DP_PSR_IS_SUPPORTED ) { - dev_priv->psr.sink_support = true; -DRM_DEBUG_KMS ("Detected EDP PSR Panel.\n" ); - } - -if (INTEL_INFO (dev)->gen >=9 && - (intel_dp->psr_dpcd[0 ] &DP_PSR2_IS_SUPPORTED )) { -uint8_t frame_sync_cap; - - dev_priv->psr.sink_support = true; -drm_dp_dpcd_read (&intel_dp->aux, -DP_SINK_DEVICE_AUX_FRAME_SYNC_CAP , - &frame_sync_cap,1 ); - dev_priv->psr.aux_frame_sync = frame_sync_cap ? true : false; -/* PSR2 needs frame sync as well */ - dev_priv->psr.psr2_support = dev_priv->psr.aux_frame_sync; -DRM_DEBUG_KMS ("PSR2 %s on sink" , - dev_priv->psr.psr2_support ?"supported" :"not supported" ); - } - -/* Read the eDP Display control capabilities registers */ -memset (intel_dp->edp_dpcd,0 ,sizeof (intel_dp->edp_dpcd)); -if ((intel_dp->dpcd[DP_EDP_CONFIGURATION_CAP ] &DP_DPCD_DISPLAY_CONTROL_CAPABLE ) && - (drm_dp_dpcd_read (&intel_dp->aux,DP_EDP_DPCD_REV , - intel_dp->edp_dpcd,sizeof (intel_dp->edp_dpcd)) == -sizeof (intel_dp->edp_dpcd))) -DRM_DEBUG_KMS ("EDP DPCD : %*ph\n" , (int )sizeof (intel_dp->edp_dpcd), - intel_dp->edp_dpcd); - } - -DRM_DEBUG_KMS ("Display Port TPS3 support: source %s, sink %s\n" , -yesno (intel_dp_source_supports_hbr2 (intel_dp)), -yesno (drm_dp_tps3_supported (intel_dp->dpcd))); - -/* Intermediate frequency support */ -if (is_edp (intel_dp) && (intel_dp->edp_dpcd[0 ] >=0x03 )) {/* eDp v1.4 or higher */ -__le16 sink_rates[DP_MAX_SUPPORTED_RATES ]; -int i; - -drm_dp_dpcd_read (&intel_dp->aux,DP_SUPPORTED_LINK_RATES , - sink_rates,sizeof (sink_rates)); - -for (i =0 ; i <ARRAY_SIZE (sink_rates); i++) { -int val =le16_to_cpu (sink_rates[i]); - -if (val ==0 ) -break ; - -/* Value read is in kHz while drm clock is saved in deca-kHz */ - intel_dp->sink_rates[i] = (val *200 ) /10 ; - } - intel_dp->num_sink_rates = i; - } - -intel_dp_print_rates (intel_dp); -if (!(intel_dp->dpcd[DP_DOWNSTREAMPORT_PRESENT ] &DP_DWN_STRM_PORT_PRESENT ))return true;/* native DP sink */
@@ -4235,6 +4247,12 @@ intel_dp_long_pulse(struct intel_connector *intel_connector)if (intel_encoder->type !=INTEL_OUTPUT_EDP ) intel_encoder->type =INTEL_OUTPUT_DP ; +DRM_DEBUG_KMS ("Display Port TPS3 support: source %s, sink %s\n" , +yesno (intel_dp_source_supports_hbr2 (intel_dp)), +yesno (drm_dp_tps3_supported (intel_dp->dpcd))); + +intel_dp_print_rates (intel_dp); +intel_dp_probe_oui (intel_dp); ret =intel_dp_probe_mst (intel_dp);
@@ -5396,14 +5414,9 @@ static bool intel_edp_init_connector(struct intel_dp *intel_dp,pps_unlock (intel_dp);/* Cache DPCD and EDID for edp. */ - has_dpcd =intel_dp_get_dpcd (intel_dp); + has_dpcd =intel_edp_init_dpcd (intel_dp); -if (has_dpcd) { -if (intel_dp->dpcd[DP_DPCD_REV ] >=0x11 ) - dev_priv->no_aux_handshake = - intel_dp->dpcd[DP_MAX_DOWNSPREAD ] & -DP_NO_AUX_HANDSHAKE_LINK_TRAINING ; - }else { +if (!has_dpcd) {/* if this fails, presume the device is a ghost */ DRM_INFO ("failed to retrieve link info, disabling eDP\n" ); goto out_vdd_off;
Signature · 6 lines
2.7.4 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH 3/12 drm/i915: Avoid mixing up SST and MST in DDI setup
In reply to [email protected]From: Ville Syrjälä <[email protected]>
The MST vs. SST selection should depend purely on the choice of the connector/encoder. So don't try to determine the correct DDI mode based on the intel_dp->is_mst, which simply tells us whether the sink is in MST mode or not. Instead derive the information from the encoder type. Since the link training code deals in non-fake encoders, we'll also need to keep a second copy of that information around, which we'll now designate as 'link_mst'.
--- drivers/gpu/drm/i915/intel_ddi.c | 21 +++------------------ drivers/gpu/drm/i915/intel_dp.c | 1 + drivers/gpu/drm/i915/intel_drv.h | 1 + 3 files changed, 5 insertions(+), 18 deletions(-)
drivers/gpu/drm/i915/intel_ddi.c +3 -18
@@ -1111,7 +1111,6 @@ void intel_ddi_enable_transcoder_func(struct drm_crtc *crtc) {struct intel_crtc *intel_crtc =to_intel_crtc (crtc);struct intel_encoder *intel_encoder =intel_ddi_get_crtc_encoder (crtc); -struct drm_encoder *encoder = &intel_encoder->base;struct drm_device *dev = crtc->dev;struct drm_i915_private *dev_priv =to_i915 (dev);enum pipe pipe = intel_crtc->pipe;
@@ -1177,29 +1176,15 @@ void intel_ddi_enable_transcoder_func(struct drm_crtc *crtc) temp |=TRANS_DDI_MODE_SELECT_HDMI ; else temp |= TRANS_DDI_MODE_SELECT_DVI; - }else if (type ==INTEL_OUTPUT_ANALOG ) { temp |=TRANS_DDI_MODE_SELECT_FDI ; temp |= (intel_crtc->config->fdi_lanes -1 ) <<1 ; - }else if (type ==INTEL_OUTPUT_DP || type ==INTEL_OUTPUT_EDP ) { -struct intel_dp *intel_dp =enc_to_intel_dp (encoder); - -if (intel_dp->is_mst) { - temp |=TRANS_DDI_MODE_SELECT_DP_MST ; - }else - temp |=TRANS_DDI_MODE_SELECT_DP_SST ; - + temp |=TRANS_DDI_MODE_SELECT_DP_SST ; temp |=DDI_PORT_WIDTH (intel_crtc->config->lane_count); }else if (type ==INTEL_OUTPUT_DP_MST ) { -struct intel_dp *intel_dp = &enc_to_mst (encoder)->primary->dp; - -if (intel_dp->is_mst) { - temp |=TRANS_DDI_MODE_SELECT_DP_MST ; - }else - temp |=TRANS_DDI_MODE_SELECT_DP_SST ; - + temp |=TRANS_DDI_MODE_SELECT_DP_MST ; temp |=DDI_PORT_WIDTH (intel_crtc->config->lane_count); }else { WARN(1, "Invalid encoder type %d for pipe %c\n",
@@ -2105,7 +2090,7 @@ void intel_ddi_prepare_link_retrain(struct intel_dp *intel_dp) val =DP_TP_CTL_ENABLE |DP_TP_CTL_LINK_TRAIN_PAT1 |DP_TP_CTL_SCRAMBLE_DISABLE ; -if (intel_dp->is_mst) +if (intel_dp->link_mst) val |=DP_TP_CTL_MODE_MST ;else { val |=DP_TP_CTL_MODE_SST ;
drivers/gpu/drm/i915/intel_dp.c +1 -0
@@ -1651,6 +1651,7 @@ void intel_dp_set_link_params(struct intel_dp *intel_dp, { intel_dp->link_rate = pipe_config->port_clock; intel_dp->lane_count = pipe_config->lane_count; + intel_dp->link_mst =intel_crtc_has_type (pipe_config,INTEL_OUTPUT_DP_MST ); }static void intel_dp_prepare (struct intel_encoder *encoder)
drivers/gpu/drm/i915/intel_drv.h +1 -0
@@ -852,6 +852,7 @@ struct intel_dp {int link_rate;uint8_t lane_count;uint8_t sink_count; +bool link_mst;bool has_audio;bool detect_done;enum hdmi_force_audio force_audio;
Signature · 6 lines
2.7.4 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [PATCH 03/12] drm/i915: Avoid mixing up SST and MST in DDI setup
Quoted 10 lines · On Thu, Jul 28, 2016 at 05:50:39PM +0300, [email protected] wrote:
From: Ville Syrjälä <[email protected]>
The MST vs. SST selection should depend purely on the choice of the connector/encoder. So don't try to determine the correct DDI mode based on the
intel_dp->is_mst, which simply tells us whether the sink is in MST mode or not. Instead derive the information from the encoder type. Since the link training code deals in non-fake encoders, we'll also need to keep a second copy of that information around, which we'll now designate as 'link_mst'.
Quoted 2 lines
Cc Maarten Lankhorst <[email protected]>Signed-off-by Ville Syrjälä <[email protected]>
Hm, I think it'd be nice if we could shovel all this stuff into the crtc state I think, instead of noodling it out of somewhere else. But since we always update it in pre_enable hooks it should be all fine even with TEST_ONLY atomic.
I digress, change looks good.
Quoted 90 lines
--- drivers/gpu/drm/i915/intel_ddi.c | 21 +++------------------ drivers/gpu/drm/i915/intel_dp.c | 1 + drivers/gpu/drm/i915/intel_drv.h | 1 + 3 files changed, 5 insertions(+), 18 deletions(-)drivers/gpu/drm/i915/intel_ddi.c +3
-18@@ -1111,7 +1111,6 @@ void intel_ddi_enable_transcoder_func(struct drm_crtc *crtc) {struct intel_crtc *intel_crtc =to_intel_crtc (crtc);struct intel_encoder *intel_encoder =intel_ddi_get_crtc_encoder (crtc); -struct drm_encoder *encoder = &intel_encoder->base;struct drm_device *dev = crtc->dev;struct drm_i915_private *dev_priv =to_i915 (dev);enum pipe pipe = intel_crtc->pipe;@@ -1177,29 +1176,15 @@ void intel_ddi_enable_transcoder_func(struct drm_crtc *crtc) temp |=TRANS_DDI_MODE_SELECT_HDMI ; else temp |= TRANS_DDI_MODE_SELECT_DVI; - }else if (type ==INTEL_OUTPUT_ANALOG ) { temp |=TRANS_DDI_MODE_SELECT_FDI ; temp |= (intel_crtc->config->fdi_lanes -1 ) <<1 ; - }else if (type ==INTEL_OUTPUT_DP || type ==INTEL_OUTPUT_EDP ) { -struct intel_dp *intel_dp =enc_to_intel_dp (encoder); - -if (intel_dp->is_mst) { - temp |=TRANS_DDI_MODE_SELECT_DP_MST ; - }else - temp |=TRANS_DDI_MODE_SELECT_DP_SST ; - + temp |=TRANS_DDI_MODE_SELECT_DP_SST ; temp |=DDI_PORT_WIDTH (intel_crtc->config->lane_count); }else if (type ==INTEL_OUTPUT_DP_MST ) { -struct intel_dp *intel_dp = &enc_to_mst (encoder)->primary->dp; - -if (intel_dp->is_mst) { - temp |=TRANS_DDI_MODE_SELECT_DP_MST ; - }else - temp |=TRANS_DDI_MODE_SELECT_DP_SST ; - + temp |=TRANS_DDI_MODE_SELECT_DP_MST ; temp |=DDI_PORT_WIDTH (intel_crtc->config->lane_count); }else { WARN(1, "Invalid encoder type %d for pipe %c\n",@@ -2105,7 +2090,7 @@ void intel_ddi_prepare_link_retrain(struct intel_dp *intel_dp) val =DP_TP_CTL_ENABLE |DP_TP_CTL_LINK_TRAIN_PAT1 |DP_TP_CTL_SCRAMBLE_DISABLE ; -if (intel_dp->is_mst) +if (intel_dp->link_mst) val |=DP_TP_CTL_MODE_MST ;else { val |=DP_TP_CTL_MODE_SST ;drivers/gpu/drm/i915/intel_dp.c +1
-0@@ -1651,6 +1651,7 @@ void intel_dp_set_link_params(struct intel_dp *intel_dp, { intel_dp->link_rate = pipe_config->port_clock; intel_dp->lane_count = pipe_config->lane_count; + intel_dp->link_mst =intel_crtc_has_type (pipe_config,INTEL_OUTPUT_DP_MST ); }static void intel_dp_prepare (struct intel_encoder *encoder)drivers/gpu/drm/i915/intel_drv.h +1
-0@@ -852,6 +852,7 @@ struct intel_dp {int link_rate;uint8_t lane_count;uint8_t sink_count; +bool link_mst;bool has_audio;bool detect_done;enum hdmi_force_audio force_audio;Signature · 6 lines
2.7.4 _______________________________________________ Intel-gfx mailing list [email protected] https://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] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [PATCH 03/12] drm/i915: Avoid mixing up SST and MST in DDI setup
Quoted 11 lines · Daniel Vetter
Quoted 10 lines · On Thu, Jul 28, 2016 at 05:50:39PM +0300, [email protected] wrote:
From: Ville Syrjälä <[email protected]>
The MST vs. SST selection should depend purely on the choice of the connector/encoder. So don't try to determine the correct DDI mode based on the
intel_dp->is_mst, which simply tells us whether the sink is in MST mode or not. Instead derive the information from the encoder type. Since the link training code deals in non-fake encoders, we'll also need to keep a second copy of that information around, which we'll now designate as 'link_mst'.
Quoted 5 lines
Quoted 2 lines
Cc Maarten Lankhorst <[email protected]>Signed-off-by Ville Syrjälä <[email protected]>Hm, I think it'd be nice if we could shovel all this stuff into the crtc state I think, instead of noodling it out of somewhere else.
You mean stuffing a pre-computed (partial?) register value in the crtc state? That could work too.
Quoted 103 lines
But since we
always update it inpre_enablehooks it should be all fine even withTEST_ONLYatomic.I digress, change looks good.
Reviewed-by Daniel Vetter <[email protected]>Quoted 90 lines
--- drivers/gpu/drm/i915/intel_ddi.c | 21 +++------------------ drivers/gpu/drm/i915/intel_dp.c | 1 + drivers/gpu/drm/i915/intel_drv.h | 1 + 3 files changed, 5 insertions(+), 18 deletions(-)drivers/gpu/drm/i915/intel_ddi.c +3
-18@@ -1111,7 +1111,6 @@ void intel_ddi_enable_transcoder_func(struct drm_crtc *crtc) {struct intel_crtc *intel_crtc =to_intel_crtc (crtc);struct intel_encoder *intel_encoder =intel_ddi_get_crtc_encoder (crtc); -struct drm_encoder *encoder = &intel_encoder->base;struct drm_device *dev = crtc->dev;struct drm_i915_private *dev_priv =to_i915 (dev);enum pipe pipe = intel_crtc->pipe;@@ -1177,29 +1176,15 @@ void intel_ddi_enable_transcoder_func(struct drm_crtc *crtc) temp |=TRANS_DDI_MODE_SELECT_HDMI ; else temp |= TRANS_DDI_MODE_SELECT_DVI; - }else if (type ==INTEL_OUTPUT_ANALOG ) { temp |=TRANS_DDI_MODE_SELECT_FDI ; temp |= (intel_crtc->config->fdi_lanes -1 ) <<1 ; - }else if (type ==INTEL_OUTPUT_DP || type ==INTEL_OUTPUT_EDP ) { -struct intel_dp *intel_dp =enc_to_intel_dp (encoder); - -if (intel_dp->is_mst) { - temp |=TRANS_DDI_MODE_SELECT_DP_MST ; - }else - temp |=TRANS_DDI_MODE_SELECT_DP_SST ; - + temp |=TRANS_DDI_MODE_SELECT_DP_SST ; temp |=DDI_PORT_WIDTH (intel_crtc->config->lane_count); }else if (type ==INTEL_OUTPUT_DP_MST ) { -struct intel_dp *intel_dp = &enc_to_mst (encoder)->primary->dp; - -if (intel_dp->is_mst) { - temp |=TRANS_DDI_MODE_SELECT_DP_MST ; - }else - temp |=TRANS_DDI_MODE_SELECT_DP_SST ; - + temp |=TRANS_DDI_MODE_SELECT_DP_MST ; temp |=DDI_PORT_WIDTH (intel_crtc->config->lane_count); }else { WARN(1, "Invalid encoder type %d for pipe %c\n",@@ -2105,7 +2090,7 @@ void intel_ddi_prepare_link_retrain(struct intel_dp *intel_dp) val =DP_TP_CTL_ENABLE |DP_TP_CTL_LINK_TRAIN_PAT1 |DP_TP_CTL_SCRAMBLE_DISABLE ; -if (intel_dp->is_mst) +if (intel_dp->link_mst) val |=DP_TP_CTL_MODE_MST ;else { val |=DP_TP_CTL_MODE_SST ;drivers/gpu/drm/i915/intel_dp.c +1
-0@@ -1651,6 +1651,7 @@ void intel_dp_set_link_params(struct intel_dp *intel_dp, { intel_dp->link_rate = pipe_config->port_clock; intel_dp->lane_count = pipe_config->lane_count; + intel_dp->link_mst =intel_crtc_has_type (pipe_config,INTEL_OUTPUT_DP_MST ); }static void intel_dp_prepare (struct intel_encoder *encoder)drivers/gpu/drm/i915/intel_drv.h +1
-0@@ -852,6 +852,7 @@ struct intel_dp {int link_rate;uint8_t lane_count;uint8_t sink_count; +bool link_mst;bool has_audio;bool detect_done;enum hdmi_force_audio force_audio;Signature · 6 lines
2.7.4 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfxSignature · 3 lines
Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch
Signature · 6 lines
Ville Syrjälä Intel OTC _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [PATCH 03/12] drm/i915: Avoid mixing up SST and MST in DDI setup
Quoted 12 lines · Ville Syrjälä
Quoted 11 lines · Daniel Vetter
Quoted 10 lines · On Thu, Jul 28, 2016 at 05:50:39PM +0300, [email protected] wrote:
From: Ville Syrjälä <[email protected]>
The MST vs. SST selection should depend purely on the choice of the connector/encoder. So don't try to determine the correct DDI mode based on the
intel_dp->is_mst, which simply tells us whether the sink is in MST mode or not. Instead derive the information from the encoder type. Since the link training code deals in non-fake encoders, we'll also need to keep a second copy of that information around, which we'll now designate as 'link_mst'.
Quoted 8 lines
Quoted 5 lines
Quoted 2 lines
Cc Maarten Lankhorst <[email protected]>Signed-off-by Ville Syrjälä <[email protected]>Hm, I think it'd be nice if we could shovel all this stuff into the crtc state I think, instead of noodling it out of somewhere else.
You mean stuffing a pre-computed (partial?) register value in the crtc state? That could work too.
Yeah. But reading ahead I'm not sure where exactly we need to store that, since recovering that with your sync_state rfc might get tricky. -Daniel
Quoted 108 lines
Quoted 104 lines
But since we
always update it inpre_enablehooks it should be all fine even withTEST_ONLYatomic.I digress, change looks good.
Reviewed-by Daniel Vetter <[email protected]>Quoted 90 lines
--- drivers/gpu/drm/i915/intel_ddi.c | 21 +++------------------ drivers/gpu/drm/i915/intel_dp.c | 1 + drivers/gpu/drm/i915/intel_drv.h | 1 + 3 files changed, 5 insertions(+), 18 deletions(-)drivers/gpu/drm/i915/intel_ddi.c +3
-18@@ -1111,7 +1111,6 @@ void intel_ddi_enable_transcoder_func(struct drm_crtc *crtc) {struct intel_crtc *intel_crtc =to_intel_crtc (crtc);struct intel_encoder *intel_encoder =intel_ddi_get_crtc_encoder (crtc); -struct drm_encoder *encoder = &intel_encoder->base;struct drm_device *dev = crtc->dev;struct drm_i915_private *dev_priv =to_i915 (dev);enum pipe pipe = intel_crtc->pipe;@@ -1177,29 +1176,15 @@ void intel_ddi_enable_transcoder_func(struct drm_crtc *crtc) temp |=TRANS_DDI_MODE_SELECT_HDMI ; else temp |= TRANS_DDI_MODE_SELECT_DVI; - }else if (type ==INTEL_OUTPUT_ANALOG ) { temp |=TRANS_DDI_MODE_SELECT_FDI ; temp |= (intel_crtc->config->fdi_lanes -1 ) <<1 ; - }else if (type ==INTEL_OUTPUT_DP || type ==INTEL_OUTPUT_EDP ) { -struct intel_dp *intel_dp =enc_to_intel_dp (encoder); - -if (intel_dp->is_mst) { - temp |=TRANS_DDI_MODE_SELECT_DP_MST ; - }else - temp |=TRANS_DDI_MODE_SELECT_DP_SST ; - + temp |=TRANS_DDI_MODE_SELECT_DP_SST ; temp |=DDI_PORT_WIDTH (intel_crtc->config->lane_count); }else if (type ==INTEL_OUTPUT_DP_MST ) { -struct intel_dp *intel_dp = &enc_to_mst (encoder)->primary->dp; - -if (intel_dp->is_mst) { - temp |=TRANS_DDI_MODE_SELECT_DP_MST ; - }else - temp |=TRANS_DDI_MODE_SELECT_DP_SST ; - + temp |=TRANS_DDI_MODE_SELECT_DP_MST ; temp |=DDI_PORT_WIDTH (intel_crtc->config->lane_count); }else { WARN(1, "Invalid encoder type %d for pipe %c\n",@@ -2105,7 +2090,7 @@ void intel_ddi_prepare_link_retrain(struct intel_dp *intel_dp) val =DP_TP_CTL_ENABLE |DP_TP_CTL_LINK_TRAIN_PAT1 |DP_TP_CTL_SCRAMBLE_DISABLE ; -if (intel_dp->is_mst) +if (intel_dp->link_mst) val |=DP_TP_CTL_MODE_MST ;else { val |=DP_TP_CTL_MODE_SST ;drivers/gpu/drm/i915/intel_dp.c +1
-0@@ -1651,6 +1651,7 @@ void intel_dp_set_link_params(struct intel_dp *intel_dp, { intel_dp->link_rate = pipe_config->port_clock; intel_dp->lane_count = pipe_config->lane_count; + intel_dp->link_mst =intel_crtc_has_type (pipe_config,INTEL_OUTPUT_DP_MST ); }static void intel_dp_prepare (struct intel_encoder *encoder)drivers/gpu/drm/i915/intel_drv.h +1
-0@@ -852,6 +852,7 @@ struct intel_dp {int link_rate;uint8_t lane_count;uint8_t sink_count; +bool link_mst;bool has_audio;bool detect_done;enum hdmi_force_audio force_audio;Signature · 6 lines
2.7.4 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfxSignature · 3 lines
Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.chSignature · 2 lines
Ville Syrjälä Intel OTC
Signature · 7 lines
Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [PATCH 03/12] drm/i915: Avoid mixing up SST and MST in DDI setup
In reply to [email protected]Op 28-07-16 om 16:50 schreef [email protected]:
Quoted 10 lines
From: Ville Syrjälä <[email protected]>
The MST vs. SST selection should depend purely on the choice of the connector/encoder. So don't try to determine the correct DDI mode based on the
intel_dp->is_mst, which simply tells us whether the sink is in MST mode or not. Instead derive the information from the encoder type. Since the link training code deals in non-fake encoders, we'll also need to keep a second copy of that information around, which we'll now designate as 'link_mst'.
Quoted 2 lines
Cc Maarten Lankhorst <[email protected]>Signed-off-by Ville Syrjälä <[email protected]>
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH 4/12 drm/i915: Reject mixing MST and SST/HDMI on the same digital port
In reply to [email protected]From: Ville Syrjälä <[email protected]>
We can't mix MST with SST/HDMI on the same physical port, so we'll need to reject such configurations in check_digital_port_conflicts(). Nothing else will prevent this as MST has its fake encoders and its own connectors so the cloning checks won't catch this.
The same digital port can be used multiple times, but only if all the encoders involved are MST encoders, so we only want to check MST vs. SST/HDMI, not MST vs. MST. And SST/HDMI vs. SST/HDMI we already check.
--- drivers/gpu/drm/i915/intel_display.c | 10 ++++++++++ 1 file changed, 10 insertions(+)
drivers/gpu/drm/i915/intel_display.c +10 -0
@@ -12305,6 +12305,7 @@ static bool check_digital_port_conflicts(struct drm_atomic_state *state)struct drm_device *dev = state->dev;struct drm_connector *connector;unsigned int used_ports =0 ; +unsigned int used_mst_ports =0 ;/* * Walk the connector list instead of the encoder
@@ -12341,11 +12342,20 @@ static bool check_digital_port_conflicts(struct drm_atomic_state *state)return false; used_ports |= port_mask; +break ; +case INTEL_OUTPUT_DP_MST : + used_mst_ports |= +1 <<enc_to_mst (&encoder->base)->primary->port; +break ;default :break ; } } +/* can't mix MST and SST/HDMI on the same port */ +if (used_ports & used_mst_ports) +return false; +return true; }
Signature · 6 lines
2.7.4 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [PATCH 04/12] drm/i915: Reject mixing MST and SST/HDMI on the same digital port
Quoted 7 lines · On Thu, Jul 28, 2016 at 05:50:40PM +0300, [email protected] wrote:
From: Ville Syrjälä <[email protected]>
We can't mix MST with SST/HDMI on the same physical port, so we'll need to reject such configurations in
check_digital_port_conflicts(). Nothing else will prevent this as MST has its fake encoders and its own connectors so the cloning checks won't catch this.
Quoted 6 lines
The same digital port can be used multiple times, but only if all the encoders involved are MST encoders, so we only want to check MST vs. SST/HDMI, not MST vs. MST. And SST/HDMI vs. SST/HDMI we already check.
Cc Maarten Lankhorst <[email protected]>Signed-off-by Ville Syrjälä <[email protected]>
I'd be awesome if we could have some testcases for this. We can e.g. try to enable HDMI without it being connected (it'll fall back to dvi mode), so could use that to try enabling both hdmi and dp or dp mst out of sheer nastiness. I don't even think we need to check that it gets rejected correctly, just trying to do such a modeset on a broken kernel should result in plenty of fireworks in dmesg (state checker for sure will be unhapy) to make it obvious it's broken. Aka would absolutely love if this patch gained a Testcase: line. Either way:
Quoted 44 lines
--- drivers/gpu/drm/i915/intel_display.c | 10 ++++++++++ 1 file changed, 10 insertions(+)drivers/gpu/drm/i915/intel_display.c +10
-0@@ -12305,6 +12305,7 @@ static bool check_digital_port_conflicts(struct drm_atomic_state *state)struct drm_device *dev = state->dev;struct drm_connector *connector;unsigned int used_ports =0 ; +unsigned int used_mst_ports =0 ;/* * Walk the connector list instead of the encoder @@ -12341,11 +12342,20 @@ static bool check_digital_port_conflicts(struct drm_atomic_state *state)return false; used_ports |= port_mask; +break ; +case INTEL_OUTPUT_DP_MST : + used_mst_ports |= +1 <<enc_to_mst (&encoder->base)->primary->port; +break ;default :break ; } } +/* can't mix MST and SST/HDMI on the same port */ +if (used_ports & used_mst_ports) +return false; +return true; }Signature · 6 lines
2.7.4 _______________________________________________ Intel-gfx mailing list [email protected] https://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] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [PATCH 04/12] drm/i915: Reject mixing MST and SST/HDMI on the same digital port
Quoted 15 lines · Daniel Vetter
Quoted 7 lines · On Thu, Jul 28, 2016 at 05:50:40PM +0300, [email protected] wrote:
From: Ville Syrjälä <[email protected]>
We can't mix MST with SST/HDMI on the same physical port, so we'll need to reject such configurations in
check_digital_port_conflicts(). Nothing else will prevent this as MST has its fake encoders and its own connectors so the cloning checks won't catch this.Quoted 6 lines
The same digital port can be used multiple times, but only if all the encoders involved are MST encoders, so we only want to check MST vs. SST/HDMI, not MST vs. MST. And SST/HDMI vs. SST/HDMI we already check.
Cc Maarten Lankhorst <[email protected]>Signed-off-by Ville Syrjälä <[email protected]>
Quoted 8 lines
I'd be awesome if we could have some testcases for this. We can e.g. try to enable HDMI without it being connected (it'll fall back to dvi mode), so could use that to try enabling both hdmi and dp or dp mst out of sheer nastiness. I don't even think we need to check that it gets rejected correctly, just trying to do such a modeset on a broken kernel should result in plenty of fireworks in dmesg (state checker for sure will be unhapy) to make it obvious it's broken. Aka would absolutely love if this patch gained a Testcase: line. Either way:
What I've occasionally used for testing is kms_setmode with a patch to ignore all errors from setcrtc so that it doesn't abort midway. IIRC last time I did that on eg. HSW there were plenty of state checker complaints. In its default state kms_setmode has a bit of a problem because it doesn't know about conflicting connectors, nor does it know if we're supposed to have one encoder per connector or pair of connectors (DDI vs. !DDI). And also IIRC encoder/connector stealing will wreac some extra havoc here. Not sure if there's a good way to try and fix it so that by default kms_setmode would really test what's it's pretending to test on all platforms.
I guess we could at least promote my hack to a proper command line option, so that we can try to feed as many combinations to the kernel as possible.
Quoted 52 lines
Reviewed-by Daniel Vetter <[email protected]>Quoted 44 lines
--- drivers/gpu/drm/i915/intel_display.c | 10 ++++++++++ 1 file changed, 10 insertions(+)drivers/gpu/drm/i915/intel_display.c +10
-0@@ -12305,6 +12305,7 @@ static bool check_digital_port_conflicts(struct drm_atomic_state *state)struct drm_device *dev = state->dev;struct drm_connector *connector;unsigned int used_ports =0 ; +unsigned int used_mst_ports =0 ;/* * Walk the connector list instead of the encoder @@ -12341,11 +12342,20 @@ static bool check_digital_port_conflicts(struct drm_atomic_state *state)return false; used_ports |= port_mask; +break ; +case INTEL_OUTPUT_DP_MST : + used_mst_ports |= +1 <<enc_to_mst (&encoder->base)->primary->port; +break ;default :break ; } } +/* can't mix MST and SST/HDMI on the same port */ +if (used_ports & used_mst_ports) +return false; +return true; }Signature · 6 lines
2.7.4 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfxSignature · 3 lines
Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch
Signature · 6 lines
Ville Syrjälä Intel OTC _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [PATCH 04/12] drm/i915: Reject mixing MST and SST/HDMI on the same digital port
Quoted 36 lines · Ville Syrjälä
Quoted 15 lines · Daniel Vetter
Quoted 7 lines · On Thu, Jul 28, 2016 at 05:50:40PM +0300, [email protected] wrote:
From: Ville Syrjälä <[email protected]>
We can't mix MST with SST/HDMI on the same physical port, so we'll need to reject such configurations in
check_digital_port_conflicts(). Nothing else will prevent this as MST has its fake encoders and its own connectors so the cloning checks won't catch this.Quoted 6 lines
The same digital port can be used multiple times, but only if all the encoders involved are MST encoders, so we only want to check MST vs. SST/HDMI, not MST vs. MST. And SST/HDMI vs. SST/HDMI we already check.
Cc Maarten Lankhorst <[email protected]>Signed-off-by Ville Syrjälä <[email protected]>Quoted 8 lines
I'd be awesome if we could have some testcases for this. We can e.g. try to enable HDMI without it being connected (it'll fall back to dvi mode), so could use that to try enabling both hdmi and dp or dp mst out of sheer nastiness. I don't even think we need to check that it gets rejected correctly, just trying to do such a modeset on a broken kernel should result in plenty of fireworks in dmesg (state checker for sure will be unhapy) to make it obvious it's broken. Aka would absolutely love if this patch gained a Testcase: line. Either way:
What I've occasionally used for testing is
kms_setmodewith a patch to ignore all errors from setcrtc so that it doesn't abort midway. IIRC last time I did that on eg. HSW there were plenty of state checker complaints. In its default statekms_setmodehas a bit of a problem because it doesn't know about conflicting connectors, nor does it know if we're supposed to have one encoder per connector or pair of connectors (DDI vs. !DDI). And also IIRC encoder/connector stealing will wreac some extra havoc here. Not sure if there's a good way to try and fix it so that by defaultkms_setmodewould really test what's it's pretending to test on all platforms.
Quoted 3 lines
I guess we could at least promote my hack to a proper command line option, so that we can try to feed as many combinations to the kernel as possible.
We could promote it to a full test using atomic. Do a TEST_ONLY atomic commit, then a real one and compare whether results agree. And if there's any noise on dmesg then also fall over (like we do with all tests).
Of course that doens't encode the expectations we have on all platforms, but I'm not sure there's enough value in maintaining such a detailed testcase. The above would be generic, could run everywhere, doesn't need updating and should at least uncover any internal inconsistencies. -Daniel
Quoted 57 lines
Quoted 53 lines
Reviewed-by Daniel Vetter <[email protected]>Quoted 44 lines
--- drivers/gpu/drm/i915/intel_display.c | 10 ++++++++++ 1 file changed, 10 insertions(+)drivers/gpu/drm/i915/intel_display.c +10
-0@@ -12305,6 +12305,7 @@ static bool check_digital_port_conflicts(struct drm_atomic_state *state)struct drm_device *dev = state->dev;struct drm_connector *connector;unsigned int used_ports =0 ; +unsigned int used_mst_ports =0 ;/* * Walk the connector list instead of the encoder @@ -12341,11 +12342,20 @@ static bool check_digital_port_conflicts(struct drm_atomic_state *state)return false; used_ports |= port_mask; +break ; +case INTEL_OUTPUT_DP_MST : + used_mst_ports |= +1 <<enc_to_mst (&encoder->base)->primary->port; +break ;default :break ; } } +/* can't mix MST and SST/HDMI on the same port */ +if (used_ports & used_mst_ports) +return false; +return true; }Signature · 6 lines
2.7.4 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfxSignature · 3 lines
Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.chSignature · 2 lines
Ville Syrjälä Intel OTC
Signature · 7 lines
Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [PATCH 04/12] drm/i915: Reject mixing MST and SST/HDMI on the same digital port
In reply to [email protected]Op 28-07-16 om 16:50 schreef [email protected]:
Quoted 10 lines
From: Ville Syrjälä <[email protected]>
We can't mix MST with SST/HDMI on the same physical port, so we'll need to reject such configurations in
check_digital_port_conflicts(). Nothing else will prevent this as MST has its fake encoders and its own connectors so the cloning checks won't catch this.The same digital port can be used multiple times, but only if all the encoders involved are MST encoders, so we only want to check MST vs. SST/HDMI, not MST vs. MST. And SST/HDMI vs. SST/HDMI we already check.
I guess this is to prevent DP1 and DP1-2 to be both set simultaneously? I'm not sure kms_setmode would handle this case correctly, but the idea is correct.
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH 5/12 drm/i915: Track active streams also for DP SST
In reply to [email protected]From: Ville Syrjälä <[email protected]>
s/active_mst_links/active_streams/ and use it also for SST. We can then use this information in the hpd handling to see if the link is active or not, and thus whether we may need to retrain.
--- drivers/gpu/drm/i915/intel_ddi.c | 10 ++++++++++ drivers/gpu/drm/i915/intel_dp.c | 8 +++++++- drivers/gpu/drm/i915/intel_dp_mst.c | 16 ++++++++-------- drivers/gpu/drm/i915/intel_drv.h | 2 +- 4 files changed, 26 insertions(+), 10 deletions(-)
drivers/gpu/drm/i915/intel_ddi.c +10 -0
@@ -1616,6 +1616,9 @@ static void intel_ddi_pre_enable(struct intel_encoder *intel_encoder)intel_ddi_init_dp_buf_reg (intel_encoder); +WARN_ON (intel_dp->active_streams !=0 ); + intel_dp->active_streams++; +intel_dp_sink_dpms (intel_dp,DRM_MODE_DPMS_ON );intel_dp_start_link_train (intel_dp);if (port !=PORT_A ||INTEL_INFO (dev_priv)->gen >=9 )
@@ -1733,6 +1736,13 @@ static void intel_disable_ddi(struct intel_encoder *intel_encoder)intel_psr_disable (intel_dp);intel_edp_backlight_off (intel_dp); } + +if (type ==INTEL_OUTPUT_DP || type ==INTEL_OUTPUT_EDP ) { +struct intel_dp *intel_dp =enc_to_intel_dp (encoder); + + intel_dp->active_streams--; +WARN_ON (intel_dp->active_streams !=0 ); + } } bool bxt_ddi_phy_is_enabled(struct drm_i915_private *dev_priv,
drivers/gpu/drm/i915/intel_dp.c +7 -1
@@ -2685,6 +2685,9 @@ static void intel_enable_dp(struct intel_encoder *encoder) lane_mask); } +WARN_ON (intel_dp->active_streams !=0 ); + intel_dp->active_streams++; +intel_dp_sink_dpms (intel_dp,DRM_MODE_DPMS_ON );intel_dp_start_link_train (intel_dp);intel_dp_stop_link_train (intel_dp);
@@ -3344,6 +3347,9 @@ intel_dp_link_down(struct intel_dp *intel_dp)DRM_DEBUG_KMS ("\n" ); + intel_dp->active_streams--; +WARN_ON (intel_dp->active_streams !=0 ); +if ((IS_GEN7 (dev) && port ==PORT_A ) || (HAS_PCH_CPT (dev) && port !=PORT_A )) {DP &= ~DP_LINK_TRAIN_MASK_CPT ;
@@ -3826,7 +3832,7 @@ go_again:if (bret == true) {/* check link status - esi[10] = 0x200c */ -if (intel_dp->active_mst_links && +if (intel_dp->active_streams && !drm_dp_channel_eq_ok (&esi[10 ], intel_dp->lane_count)) {DRM_DEBUG_KMS ("channel EQ not ok, retraining\n" );intel_dp_start_link_train (intel_dp);
drivers/gpu/drm/i915/intel_dp_mst.c +8 -8
@@ -99,7 +99,7 @@ static void intel_mst_disable_dp(struct intel_encoder *encoder)struct intel_dp *intel_dp = &intel_dig_port->dp;int ret; -DRM_DEBUG_KMS ("%d\n" , intel_dp->active_mst_links); +DRM_DEBUG_KMS ("%d\n" , intel_dp->active_streams);drm_dp_mst_reset_vcpi_slots (&intel_dp->mst_mgr, intel_mst->connector->port);
@@ -115,7 +115,7 @@ static void intel_mst_post_disable_dp(struct intel_encoder *encoder)struct intel_digital_port *intel_dig_port = intel_mst->primary;struct intel_dp *intel_dp = &intel_dig_port->dp; -DRM_DEBUG_KMS ("%d\n" , intel_dp->active_mst_links); +DRM_DEBUG_KMS ("%d\n" , intel_dp->active_streams);/* this can fail */ drm_dp_check_act_status (&intel_dp->mst_mgr);
@@ -124,10 +124,10 @@ static void intel_mst_post_disable_dp(struct intel_encoder *encoder)drm_dp_mst_deallocate_vcpi (&intel_dp->mst_mgr, intel_mst->connector->port); - intel_dp->active_mst_links--; + intel_dp->active_streams--; intel_mst->connector =NULL ; -if (intel_dp->active_mst_links ==0 ) { +if (intel_dp->active_streams ==0 ) { intel_dig_port->base.post_disable (&intel_dig_port->base);intel_dp_sink_dpms (intel_dp,DRM_MODE_DPMS_OFF ); }
@@ -165,11 +165,11 @@ static void intel_mst_pre_enable_dp(struct intel_encoder *encoder)*/ found->encoder = encoder; -DRM_DEBUG_KMS ("%d\n" , intel_dp->active_mst_links); +DRM_DEBUG_KMS ("%d\n" , intel_dp->active_streams); intel_mst->connector = found; -if (intel_dp->active_mst_links ==0 ) { +if (intel_dp->active_streams ==0 ) {intel_prepare_ddi_buffer (&intel_dig_port->base);intel_ddi_clk_select (&intel_dig_port->base, intel_crtc->config);
@@ -193,7 +193,7 @@ static void intel_mst_pre_enable_dp(struct intel_encoder *encoder) } - intel_dp->active_mst_links++; + intel_dp->active_streams++; temp =I915_READ (DP_TP_STATUS (port));I915_WRITE (DP_TP_STATUS (port), temp);
@@ -210,7 +210,7 @@ static void intel_mst_enable_dp(struct intel_encoder *encoder)enum port port = intel_dig_port->port;int ret; -DRM_DEBUG_KMS ("%d\n" , intel_dp->active_mst_links); +DRM_DEBUG_KMS ("%d\n" , intel_dp->active_streams); if (intel_wait_for_register(dev_priv, DP_TP_STATUS(port),
drivers/gpu/drm/i915/intel_drv.h +1 -1
@@ -894,7 +894,7 @@ struct intel_dp {bool can_mst;/* this port supports mst */ bool is_mst; -int active_mst_links; +int active_streams;/* number of active streams (for SST and MST both) */ /* connector directly attached - won't be use for modeset in mst world */ struct intel_connector *attached_connector;
Signature · 6 lines
2.7.4 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [PATCH 05/12] drm/i915: Track active streams also for DP SST
Quoted 11 lines · On Thu, Jul 28, 2016 at 05:50:41PM +0300, [email protected] wrote:
From: Ville Syrjälä <[email protected]>
s/active_mst_links/active_streams/ and use it also for SST. We can then use this information in the hpd handling to see if the link is active or not, and thus whether we may need to retrain.
Cc Ander Conselvan de Oliveira <[email protected]>Cc Jim Bride <[email protected]>Cc Manasi D Navare <[email protected]>Cc Durgadoss R <[email protected]>Signed-off-by Ville Syrjälä <[email protected]>
Hm, more state not in the state structures, and not cross-checked :( Ben Skeggs just pinged me on this, and one of the ideas he's now looking into is a separate state array for mst ports to fully keep track of this. Kinda like we keep track of the shared dplls.
Again just ideas, code looks correct.
Quoted 155 lines
--- drivers/gpu/drm/i915/intel_ddi.c | 10 ++++++++++ drivers/gpu/drm/i915/intel_dp.c | 8 +++++++- drivers/gpu/drm/i915/intel_dp_mst.c | 16 ++++++++-------- drivers/gpu/drm/i915/intel_drv.h | 2 +- 4 files changed, 26 insertions(+), 10 deletions(-)drivers/gpu/drm/i915/intel_ddi.c +10
-0@@ -1616,6 +1616,9 @@ static void intel_ddi_pre_enable(struct intel_encoder *intel_encoder)intel_ddi_init_dp_buf_reg (intel_encoder); +WARN_ON (intel_dp->active_streams !=0 ); + intel_dp->active_streams++; +intel_dp_sink_dpms (intel_dp,DRM_MODE_DPMS_ON );intel_dp_start_link_train (intel_dp);if (port !=PORT_A ||INTEL_INFO (dev_priv)->gen >=9 )@@ -1733,6 +1736,13 @@ static void intel_disable_ddi(struct intel_encoder *intel_encoder)intel_psr_disable (intel_dp);intel_edp_backlight_off (intel_dp); } + +if (type ==INTEL_OUTPUT_DP || type ==INTEL_OUTPUT_EDP ) { +struct intel_dp *intel_dp =enc_to_intel_dp (encoder); + + intel_dp->active_streams--; +WARN_ON (intel_dp->active_streams !=0 ); + } } bool bxt_ddi_phy_is_enabled(struct drm_i915_private *dev_priv,drivers/gpu/drm/i915/intel_dp.c +7
-1@@ -2685,6 +2685,9 @@ static void intel_enable_dp(struct intel_encoder *encoder) lane_mask); } +WARN_ON (intel_dp->active_streams !=0 ); + intel_dp->active_streams++; +intel_dp_sink_dpms (intel_dp,DRM_MODE_DPMS_ON );intel_dp_start_link_train (intel_dp);intel_dp_stop_link_train (intel_dp);@@ -3344,6 +3347,9 @@ intel_dp_link_down(struct intel_dp *intel_dp)DRM_DEBUG_KMS ("\n" ); + intel_dp->active_streams--; +WARN_ON (intel_dp->active_streams !=0 ); +if ((IS_GEN7 (dev) && port ==PORT_A ) || (HAS_PCH_CPT (dev) && port !=PORT_A )) {DP &= ~DP_LINK_TRAIN_MASK_CPT ;@@ -3826,7 +3832,7 @@ go_again:if (bret == true) {/* check link status - esi[10] = 0x200c */ -if (intel_dp->active_mst_links && +if (intel_dp->active_streams && !drm_dp_channel_eq_ok (&esi[10 ], intel_dp->lane_count)) {DRM_DEBUG_KMS ("channel EQ not ok, retraining\n" );intel_dp_start_link_train (intel_dp);drivers/gpu/drm/i915/intel_dp_mst.c +8
-8@@ -99,7 +99,7 @@ static void intel_mst_disable_dp(struct intel_encoder *encoder)struct intel_dp *intel_dp = &intel_dig_port->dp;int ret; -DRM_DEBUG_KMS ("%d\n" , intel_dp->active_mst_links); +DRM_DEBUG_KMS ("%d\n" , intel_dp->active_streams);drm_dp_mst_reset_vcpi_slots (&intel_dp->mst_mgr, intel_mst->connector->port);@@ -115,7 +115,7 @@ static void intel_mst_post_disable_dp(struct intel_encoder *encoder)struct intel_digital_port *intel_dig_port = intel_mst->primary;struct intel_dp *intel_dp = &intel_dig_port->dp; -DRM_DEBUG_KMS ("%d\n" , intel_dp->active_mst_links); +DRM_DEBUG_KMS ("%d\n" , intel_dp->active_streams);/* this can fail */ drm_dp_check_act_status (&intel_dp->mst_mgr);@@ -124,10 +124,10 @@ static void intel_mst_post_disable_dp(struct intel_encoder *encoder)drm_dp_mst_deallocate_vcpi (&intel_dp->mst_mgr, intel_mst->connector->port); - intel_dp->active_mst_links--; + intel_dp->active_streams--; intel_mst->connector =NULL ; -if (intel_dp->active_mst_links ==0 ) { +if (intel_dp->active_streams ==0 ) { intel_dig_port->base.post_disable (&intel_dig_port->base);intel_dp_sink_dpms (intel_dp,DRM_MODE_DPMS_OFF ); }@@ -165,11 +165,11 @@ static void intel_mst_pre_enable_dp(struct intel_encoder *encoder)*/ found->encoder = encoder; -DRM_DEBUG_KMS ("%d\n" , intel_dp->active_mst_links); +DRM_DEBUG_KMS ("%d\n" , intel_dp->active_streams); intel_mst->connector = found; -if (intel_dp->active_mst_links ==0 ) { +if (intel_dp->active_streams ==0 ) {intel_prepare_ddi_buffer (&intel_dig_port->base);intel_ddi_clk_select (&intel_dig_port->base, intel_crtc->config);@@ -193,7 +193,7 @@ static void intel_mst_pre_enable_dp(struct intel_encoder *encoder) } - intel_dp->active_mst_links++; + intel_dp->active_streams++; temp =I915_READ (DP_TP_STATUS (port));I915_WRITE (DP_TP_STATUS (port), temp);@@ -210,7 +210,7 @@ static void intel_mst_enable_dp(struct intel_encoder *encoder)enum port port = intel_dig_port->port;int ret; -DRM_DEBUG_KMS ("%d\n" , intel_dp->active_mst_links); +DRM_DEBUG_KMS ("%d\n" , intel_dp->active_streams); if (intel_wait_for_register(dev_priv, DP_TP_STATUS(port),drivers/gpu/drm/i915/intel_drv.h +1
-1@@ -894,7 +894,7 @@ struct intel_dp {bool can_mst;/* this port supports mst */ bool is_mst; -int active_mst_links; +int active_streams;/* number of active streams (for SST and MST both) */ /* connector directly attached - won't be use for modeset in mst world */ struct intel_connector *attached_connector;Signature · 6 lines
2.7.4 _______________________________________________ Intel-gfx mailing list [email protected] https://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] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [PATCH 05/12] drm/i915: Track active streams also for DP SST
Quoted 13 lines · Daniel Vetter
Quoted 11 lines · On Thu, Jul 28, 2016 at 05:50:41PM +0300, [email protected] wrote:
From: Ville Syrjälä <[email protected]>
s/active_mst_links/active_streams/ and use it also for SST. We can then use this information in the hpd handling to see if the link is active or not, and thus whether we may need to retrain.
Cc Ander Conselvan de Oliveira <[email protected]>Cc Jim Bride <[email protected]>Cc Manasi D Navare <[email protected]>Cc Durgadoss R <[email protected]>Signed-off-by Ville Syrjälä <[email protected]>
Quoted 4 lines
Hm, more state not in the state structures, and not cross-checked :( Ben Skeggs just pinged me on this, and one of the ideas he's now looking into is a separate state array for mst ports to fully keep track of this. Kinda like we keep track of the shared dplls.
Yeah it's a bit a mess. The other option I've outlined before might be a fake crtc to drive the primary, and then use atomic enable/disable it at the right time depending the state the of the actual MST streams.
Speaking of atomic/mst, I'm not sure our link retraining is really good enough for MST. IIRC I saw a note in the spec that the payloads and whatnot might get deallocated by the sink/hub if the link drops. I think I have to re-read the spec a few times to make sure, but if that's the case then we'd have to pimp up the link retraining to be MST aware. But, I had an alternative idea recently; What if we just force a modeset on all the pipes on that port? IIRC the spec even says that for link retraining we should really be doing more or less the full modeset sequence. It should also get rid of the FIFO underruns we now get every time we retrain the link. Any thoughts?
Quoted 165 lines
Again just ideas, code looks correct.
Reviewed-by Daniel Vetter <[email protected]>Quoted 155 lines
--- drivers/gpu/drm/i915/intel_ddi.c | 10 ++++++++++ drivers/gpu/drm/i915/intel_dp.c | 8 +++++++- drivers/gpu/drm/i915/intel_dp_mst.c | 16 ++++++++-------- drivers/gpu/drm/i915/intel_drv.h | 2 +- 4 files changed, 26 insertions(+), 10 deletions(-)drivers/gpu/drm/i915/intel_ddi.c +10
-0@@ -1616,6 +1616,9 @@ static void intel_ddi_pre_enable(struct intel_encoder *intel_encoder)intel_ddi_init_dp_buf_reg (intel_encoder); +WARN_ON (intel_dp->active_streams !=0 ); + intel_dp->active_streams++; +intel_dp_sink_dpms (intel_dp,DRM_MODE_DPMS_ON );intel_dp_start_link_train (intel_dp);if (port !=PORT_A ||INTEL_INFO (dev_priv)->gen >=9 )@@ -1733,6 +1736,13 @@ static void intel_disable_ddi(struct intel_encoder *intel_encoder)intel_psr_disable (intel_dp);intel_edp_backlight_off (intel_dp); } + +if (type ==INTEL_OUTPUT_DP || type ==INTEL_OUTPUT_EDP ) { +struct intel_dp *intel_dp =enc_to_intel_dp (encoder); + + intel_dp->active_streams--; +WARN_ON (intel_dp->active_streams !=0 ); + } } bool bxt_ddi_phy_is_enabled(struct drm_i915_private *dev_priv,drivers/gpu/drm/i915/intel_dp.c +7
-1@@ -2685,6 +2685,9 @@ static void intel_enable_dp(struct intel_encoder *encoder) lane_mask); } +WARN_ON (intel_dp->active_streams !=0 ); + intel_dp->active_streams++; +intel_dp_sink_dpms (intel_dp,DRM_MODE_DPMS_ON );intel_dp_start_link_train (intel_dp);intel_dp_stop_link_train (intel_dp);@@ -3344,6 +3347,9 @@ intel_dp_link_down(struct intel_dp *intel_dp)DRM_DEBUG_KMS ("\n" ); + intel_dp->active_streams--; +WARN_ON (intel_dp->active_streams !=0 ); +if ((IS_GEN7 (dev) && port ==PORT_A ) || (HAS_PCH_CPT (dev) && port !=PORT_A )) {DP &= ~DP_LINK_TRAIN_MASK_CPT ;@@ -3826,7 +3832,7 @@ go_again:if (bret == true) {/* check link status - esi[10] = 0x200c */ -if (intel_dp->active_mst_links && +if (intel_dp->active_streams && !drm_dp_channel_eq_ok (&esi[10 ], intel_dp->lane_count)) {DRM_DEBUG_KMS ("channel EQ not ok, retraining\n" );intel_dp_start_link_train (intel_dp);drivers/gpu/drm/i915/intel_dp_mst.c +8
-8@@ -99,7 +99,7 @@ static void intel_mst_disable_dp(struct intel_encoder *encoder)struct intel_dp *intel_dp = &intel_dig_port->dp;int ret; -DRM_DEBUG_KMS ("%d\n" , intel_dp->active_mst_links); +DRM_DEBUG_KMS ("%d\n" , intel_dp->active_streams);drm_dp_mst_reset_vcpi_slots (&intel_dp->mst_mgr, intel_mst->connector->port);@@ -115,7 +115,7 @@ static void intel_mst_post_disable_dp(struct intel_encoder *encoder)struct intel_digital_port *intel_dig_port = intel_mst->primary;struct intel_dp *intel_dp = &intel_dig_port->dp; -DRM_DEBUG_KMS ("%d\n" , intel_dp->active_mst_links); +DRM_DEBUG_KMS ("%d\n" , intel_dp->active_streams);/* this can fail */ drm_dp_check_act_status (&intel_dp->mst_mgr);@@ -124,10 +124,10 @@ static void intel_mst_post_disable_dp(struct intel_encoder *encoder)drm_dp_mst_deallocate_vcpi (&intel_dp->mst_mgr, intel_mst->connector->port); - intel_dp->active_mst_links--; + intel_dp->active_streams--; intel_mst->connector =NULL ; -if (intel_dp->active_mst_links ==0 ) { +if (intel_dp->active_streams ==0 ) { intel_dig_port->base.post_disable (&intel_dig_port->base);intel_dp_sink_dpms (intel_dp,DRM_MODE_DPMS_OFF ); }@@ -165,11 +165,11 @@ static void intel_mst_pre_enable_dp(struct intel_encoder *encoder)*/ found->encoder = encoder; -DRM_DEBUG_KMS ("%d\n" , intel_dp->active_mst_links); +DRM_DEBUG_KMS ("%d\n" , intel_dp->active_streams); intel_mst->connector = found; -if (intel_dp->active_mst_links ==0 ) { +if (intel_dp->active_streams ==0 ) {intel_prepare_ddi_buffer (&intel_dig_port->base);intel_ddi_clk_select (&intel_dig_port->base, intel_crtc->config);@@ -193,7 +193,7 @@ static void intel_mst_pre_enable_dp(struct intel_encoder *encoder) } - intel_dp->active_mst_links++; + intel_dp->active_streams++; temp =I915_READ (DP_TP_STATUS (port));I915_WRITE (DP_TP_STATUS (port), temp);@@ -210,7 +210,7 @@ static void intel_mst_enable_dp(struct intel_encoder *encoder)enum port port = intel_dig_port->port;int ret; -DRM_DEBUG_KMS ("%d\n" , intel_dp->active_mst_links); +DRM_DEBUG_KMS ("%d\n" , intel_dp->active_streams); if (intel_wait_for_register(dev_priv, DP_TP_STATUS(port),drivers/gpu/drm/i915/intel_drv.h +1
-1@@ -894,7 +894,7 @@ struct intel_dp {bool can_mst;/* this port supports mst */ bool is_mst; -int active_mst_links; +int active_streams;/* number of active streams (for SST and MST both) */ /* connector directly attached - won't be use for modeset in mst world */ struct intel_connector *attached_connector;Signature · 6 lines
2.7.4 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfxSignature · 3 lines
Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch
Signature · 6 lines
Ville Syrjälä Intel OTC _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [PATCH 05/12] drm/i915: Track active streams also for DP SST
Quoted 23 lines · Ville Syrjälä
Quoted 13 lines · Daniel Vetter
Quoted 11 lines · On Thu, Jul 28, 2016 at 05:50:41PM +0300, [email protected] wrote:
From: Ville Syrjälä <[email protected]>
s/active_mst_links/active_streams/ and use it also for SST. We can then use this information in the hpd handling to see if the link is active or not, and thus whether we may need to retrain.
Cc Ander Conselvan de Oliveira <[email protected]>Cc Jim Bride <[email protected]>Cc Manasi D Navare <[email protected]>Cc Durgadoss R <[email protected]>Signed-off-by Ville Syrjälä <[email protected]>Quoted 4 lines
Hm, more state not in the state structures, and not cross-checked :( Ben Skeggs just pinged me on this, and one of the ideas he's now looking into is a separate state array for mst ports to fully keep track of this. Kinda like we keep track of the shared dplls.
Yeah it's a bit a mess. The other option I've outlined before might be a fake crtc to drive the primary, and then use atomic enable/disable it at the right time depending the state the of the actual MST streams.
Quoted 10 lines
Speaking of atomic/mst, I'm not sure our link retraining is really good enough for MST. IIRC I saw a note in the spec that the payloads and whatnot might get deallocated by the sink/hub if the link drops. I think I have to re-read the spec a few times to make sure, but if that's the case then we'd have to pimp up the link retraining to be MST aware. But, I had an alternative idea recently; What if we just force a modeset on all the pipes on that port? IIRC the spec even says that for link retraining we should really be doing more or less the full modeset sequence. It should also get rid of the FIFO underruns we now get every time we retrain the link. Any thoughts?
If we ensure that we train the link at the widest and fastest configuration possible in the first place (which is how I interpret what the DP spec says to do for link training) then we shouldn't be in a situation where we need to retrain the main link unless the link is lost, in which case all of the pipes & payloads associated with the link will need to be re-configured anyhow (since there's no guarantee that the link bandwidth will be the same once the re-training was done.) This seems like a simpler solution, IMHO.
Jim
Quoted 156 lines
Quoted 156 lines
Again just ideas, code looks correct.
Reviewed-by Daniel Vetter <[email protected]>Quoted 151 lines
--- drivers/gpu/drm/i915/intel_ddi.c | 10 ++++++++++ drivers/gpu/drm/i915/intel_dp.c | 8 +++++++- drivers/gpu/drm/i915/intel_dp_mst.c | 16 ++++++++-------- drivers/gpu/drm/i915/intel_drv.h | 2 +- 4 files changed, 26 insertions(+), 10 deletions(-)drivers/gpu/drm/i915/intel_ddi.c +10
-0@@ -1616,6 +1616,9 @@ static void intel_ddi_pre_enable(struct intel_encoder *intel_encoder)intel_ddi_init_dp_buf_reg (intel_encoder); +WARN_ON (intel_dp->active_streams !=0 ); + intel_dp->active_streams++; +intel_dp_sink_dpms (intel_dp,DRM_MODE_DPMS_ON );intel_dp_start_link_train (intel_dp);if (port !=PORT_A ||INTEL_INFO (dev_priv)->gen >=9 )@@ -1733,6 +1736,13 @@ static void intel_disable_ddi(struct intel_encoder *intel_encoder)intel_psr_disable (intel_dp);intel_edp_backlight_off (intel_dp); } + +if (type ==INTEL_OUTPUT_DP || type ==INTEL_OUTPUT_EDP ) { +struct intel_dp *intel_dp =enc_to_intel_dp (encoder); + + intel_dp->active_streams--; +WARN_ON (intel_dp->active_streams !=0 ); + } } bool bxt_ddi_phy_is_enabled(struct drm_i915_private *dev_priv,drivers/gpu/drm/i915/intel_dp.c +7
-1@@ -2685,6 +2685,9 @@ static void intel_enable_dp(struct intel_encoder *encoder) lane_mask); } +WARN_ON (intel_dp->active_streams !=0 ); + intel_dp->active_streams++; +intel_dp_sink_dpms (intel_dp,DRM_MODE_DPMS_ON );intel_dp_start_link_train (intel_dp);intel_dp_stop_link_train (intel_dp);@@ -3344,6 +3347,9 @@ intel_dp_link_down(struct intel_dp *intel_dp)DRM_DEBUG_KMS ("\n" ); + intel_dp->active_streams--; +WARN_ON (intel_dp->active_streams !=0 ); +if ((IS_GEN7 (dev) && port ==PORT_A ) || (HAS_PCH_CPT (dev) && port !=PORT_A )) {DP &= ~DP_LINK_TRAIN_MASK_CPT ;@@ -3826,7 +3832,7 @@ go_again:if (bret == true) {/* check link status - esi[10] = 0x200c */ -if (intel_dp->active_mst_links && +if (intel_dp->active_streams && !drm_dp_channel_eq_ok (&esi[10 ], intel_dp->lane_count)) {DRM_DEBUG_KMS ("channel EQ not ok, retraining\n" );intel_dp_start_link_train (intel_dp);drivers/gpu/drm/i915/intel_dp_mst.c +8
-8@@ -99,7 +99,7 @@ static void intel_mst_disable_dp(struct intel_encoder *encoder)struct intel_dp *intel_dp = &intel_dig_port->dp;int ret; -DRM_DEBUG_KMS ("%d\n" , intel_dp->active_mst_links); +DRM_DEBUG_KMS ("%d\n" , intel_dp->active_streams);drm_dp_mst_reset_vcpi_slots (&intel_dp->mst_mgr, intel_mst->connector->port);@@ -115,7 +115,7 @@ static void intel_mst_post_disable_dp(struct intel_encoder *encoder)struct intel_digital_port *intel_dig_port = intel_mst->primary;struct intel_dp *intel_dp = &intel_dig_port->dp; -DRM_DEBUG_KMS ("%d\n" , intel_dp->active_mst_links); +DRM_DEBUG_KMS ("%d\n" , intel_dp->active_streams);/* this can fail */ drm_dp_check_act_status (&intel_dp->mst_mgr);@@ -124,10 +124,10 @@ static void intel_mst_post_disable_dp(struct intel_encoder *encoder)drm_dp_mst_deallocate_vcpi (&intel_dp->mst_mgr, intel_mst->connector->port); - intel_dp->active_mst_links--; + intel_dp->active_streams--; intel_mst->connector =NULL ; -if (intel_dp->active_mst_links ==0 ) { +if (intel_dp->active_streams ==0 ) { intel_dig_port->base.post_disable (&intel_dig_port->base);intel_dp_sink_dpms (intel_dp,DRM_MODE_DPMS_OFF ); }@@ -165,11 +165,11 @@ static void intel_mst_pre_enable_dp(struct intel_encoder *encoder)*/ found->encoder = encoder; -DRM_DEBUG_KMS ("%d\n" , intel_dp->active_mst_links); +DRM_DEBUG_KMS ("%d\n" , intel_dp->active_streams); intel_mst->connector = found; -if (intel_dp->active_mst_links ==0 ) { +if (intel_dp->active_streams ==0 ) {intel_prepare_ddi_buffer (&intel_dig_port->base);intel_ddi_clk_select (&intel_dig_port->base, intel_crtc->config);@@ -193,7 +193,7 @@ static void intel_mst_pre_enable_dp(struct intel_encoder *encoder) } - intel_dp->active_mst_links++; + intel_dp->active_streams++; temp =I915_READ (DP_TP_STATUS (port));I915_WRITE (DP_TP_STATUS (port), temp);@@ -210,7 +210,7 @@ static void intel_mst_enable_dp(struct intel_encoder *encoder)enum port port = intel_dig_port->port;int ret; -DRM_DEBUG_KMS ("%d\n" , intel_dp->active_mst_links); +DRM_DEBUG_KMS ("%d\n" , intel_dp->active_streams); if (intel_wait_for_register(dev_priv, DP_TP_STATUS(port),drivers/gpu/drm/i915/intel_drv.h +1
-1@@ -894,7 +894,7 @@ struct intel_dp {bool can_mst;/* this port supports mst */ bool is_mst; -int active_mst_links; +int active_streams;/* number of active streams (for SST and MST both) */ /* connector directly attached - won't be use for modeset in mst world */ struct intel_connector *attached_connector;Signature · 1 line
2.7.4
Quoted 17 lines
Quoted 9 lines
Quoted 4 lines
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfxSignature · 3 lines
Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.chSignature · 6 lines
Ville Syrjälä Intel OTC _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [PATCH 05/12] drm/i915: Track active streams also for DP SST
Quoted 15 lines · Jim Bride
Quoted 14 lines · Ville Syrjälä
Quoted 13 lines · Daniel Vetter
Quoted 11 lines · On Thu, Jul 28, 2016 at 05:50:41PM +0300, [email protected] wrote:
From: Ville Syrjälä <[email protected]>
s/active_mst_links/active_streams/ and use it also for SST. We can then use this information in the hpd handling to see if the link is active or not, and thus whether we may need to retrain.
Cc Ander Conselvan de Oliveira <[email protected]>Cc Jim Bride <[email protected]>Cc Manasi D Navare <[email protected]>Cc Durgadoss R <[email protected]>Signed-off-by Ville Syrjälä <[email protected]>
Quoted 8 lines
Quoted 8 lines
Quoted 4 lines
Hm, more state not in the state structures, and not cross-checked :( Ben Skeggs just pinged me on this, and one of the ideas he's now looking into is a separate state array for mst ports to fully keep track of this. Kinda like we keep track of the shared dplls.
Yeah it's a bit a mess. The other option I've outlined before might be a fake crtc to drive the primary, and then use atomic enable/disable it at the right time depending the state the of the actual MST streams.
Was more thinking of tracking a intel_dp_mst_port_state per mst capable port. And then treating it similarly to how we treat the shared dpll, including state readout, tracking, checking and all that. Fake crtc seems like abusing the wrong concept.
But tbh I'm not entirely sure what really makes the most sense, maybe better to keep on stitching stuff together to at least fix the bugs for now.
Quoted 11 lines
Quoted 10 lines
Speaking of atomic/mst, I'm not sure our link retraining is really good enough for MST. IIRC I saw a note in the spec that the payloads and whatnot might get deallocated by the sink/hub if the link drops. I think I have to re-read the spec a few times to make sure, but if that's the case then we'd have to pimp up the link retraining to be MST aware. But, I had an alternative idea recently; What if we just force a modeset on all the pipes on that port? IIRC the spec even says that for link retraining we should really be doing more or less the full modeset sequence. It should also get rid of the FIFO underruns we now get every time we retrain the link. Any thoughts?
Quoted 7 lines
If we ensure that we train the link at the widest and fastest configuration possible in the first place (which is how I interpret what the DP spec says to do for link training) then we shouldn't be in a situation where we need to retrain the main link unless the link is lost, in which case all of the pipes & payloads associated with the link will need to be re-configured anyhow (since there's no guarantee that the link bandwidth will be the same once the re-training was done.) This seems like a simpler solution, IMHO.
We already link train the widest/faster link for mst. And this is about retraining when the link is lost.
One question I have on this plan is what happens for a full unplug. Atm I think we expect userspace to do a full modeset and we won't reconnect the current state to the replugged hw. This is a bit different from all other connectors (and dp sst) where an accidental cable trip doesn't result in a black screen (assuming userspace doesn't fix things up on its own).
But reconnecting our internal dp objects with the replugged physical ones might be tricky, so not sure this is a feasible plane. Besides this it makes sense.
-Daniel
Quoted 177 lines
Jim
Quoted 173 lines
Quoted 165 lines
Again just ideas, code looks correct.
Reviewed-by Daniel Vetter <[email protected]>Quoted 155 lines
--- drivers/gpu/drm/i915/intel_ddi.c | 10 ++++++++++ drivers/gpu/drm/i915/intel_dp.c | 8 +++++++- drivers/gpu/drm/i915/intel_dp_mst.c | 16 ++++++++-------- drivers/gpu/drm/i915/intel_drv.h | 2 +- 4 files changed, 26 insertions(+), 10 deletions(-)drivers/gpu/drm/i915/intel_ddi.c +10
-0@@ -1616,6 +1616,9 @@ static void intel_ddi_pre_enable(struct intel_encoder *intel_encoder)intel_ddi_init_dp_buf_reg (intel_encoder); +WARN_ON (intel_dp->active_streams !=0 ); + intel_dp->active_streams++; +intel_dp_sink_dpms (intel_dp,DRM_MODE_DPMS_ON );intel_dp_start_link_train (intel_dp);if (port !=PORT_A ||INTEL_INFO (dev_priv)->gen >=9 )@@ -1733,6 +1736,13 @@ static void intel_disable_ddi(struct intel_encoder *intel_encoder)intel_psr_disable (intel_dp);intel_edp_backlight_off (intel_dp); } + +if (type ==INTEL_OUTPUT_DP || type ==INTEL_OUTPUT_EDP ) { +struct intel_dp *intel_dp =enc_to_intel_dp (encoder); + + intel_dp->active_streams--; +WARN_ON (intel_dp->active_streams !=0 ); + } } bool bxt_ddi_phy_is_enabled(struct drm_i915_private *dev_priv,drivers/gpu/drm/i915/intel_dp.c +7
-1@@ -2685,6 +2685,9 @@ static void intel_enable_dp(struct intel_encoder *encoder) lane_mask); } +WARN_ON (intel_dp->active_streams !=0 ); + intel_dp->active_streams++; +intel_dp_sink_dpms (intel_dp,DRM_MODE_DPMS_ON );intel_dp_start_link_train (intel_dp);intel_dp_stop_link_train (intel_dp);@@ -3344,6 +3347,9 @@ intel_dp_link_down(struct intel_dp *intel_dp)DRM_DEBUG_KMS ("\n" ); + intel_dp->active_streams--; +WARN_ON (intel_dp->active_streams !=0 ); +if ((IS_GEN7 (dev) && port ==PORT_A ) || (HAS_PCH_CPT (dev) && port !=PORT_A )) {DP &= ~DP_LINK_TRAIN_MASK_CPT ;@@ -3826,7 +3832,7 @@ go_again:if (bret == true) {/* check link status - esi[10] = 0x200c */ -if (intel_dp->active_mst_links && +if (intel_dp->active_streams && !drm_dp_channel_eq_ok (&esi[10 ], intel_dp->lane_count)) {DRM_DEBUG_KMS ("channel EQ not ok, retraining\n" );intel_dp_start_link_train (intel_dp);drivers/gpu/drm/i915/intel_dp_mst.c +8
-8@@ -99,7 +99,7 @@ static void intel_mst_disable_dp(struct intel_encoder *encoder)struct intel_dp *intel_dp = &intel_dig_port->dp;int ret; -DRM_DEBUG_KMS ("%d\n" , intel_dp->active_mst_links); +DRM_DEBUG_KMS ("%d\n" , intel_dp->active_streams);drm_dp_mst_reset_vcpi_slots (&intel_dp->mst_mgr, intel_mst->connector->port);@@ -115,7 +115,7 @@ static void intel_mst_post_disable_dp(struct intel_encoder *encoder)struct intel_digital_port *intel_dig_port = intel_mst->primary;struct intel_dp *intel_dp = &intel_dig_port->dp; -DRM_DEBUG_KMS ("%d\n" , intel_dp->active_mst_links); +DRM_DEBUG_KMS ("%d\n" , intel_dp->active_streams);/* this can fail */ drm_dp_check_act_status (&intel_dp->mst_mgr);@@ -124,10 +124,10 @@ static void intel_mst_post_disable_dp(struct intel_encoder *encoder)drm_dp_mst_deallocate_vcpi (&intel_dp->mst_mgr, intel_mst->connector->port); - intel_dp->active_mst_links--; + intel_dp->active_streams--; intel_mst->connector =NULL ; -if (intel_dp->active_mst_links ==0 ) { +if (intel_dp->active_streams ==0 ) { intel_dig_port->base.post_disable (&intel_dig_port->base);intel_dp_sink_dpms (intel_dp,DRM_MODE_DPMS_OFF ); }@@ -165,11 +165,11 @@ static void intel_mst_pre_enable_dp(struct intel_encoder *encoder)*/ found->encoder = encoder; -DRM_DEBUG_KMS ("%d\n" , intel_dp->active_mst_links); +DRM_DEBUG_KMS ("%d\n" , intel_dp->active_streams); intel_mst->connector = found; -if (intel_dp->active_mst_links ==0 ) { +if (intel_dp->active_streams ==0 ) {intel_prepare_ddi_buffer (&intel_dig_port->base);intel_ddi_clk_select (&intel_dig_port->base, intel_crtc->config);@@ -193,7 +193,7 @@ static void intel_mst_pre_enable_dp(struct intel_encoder *encoder) } - intel_dp->active_mst_links++; + intel_dp->active_streams++; temp =I915_READ (DP_TP_STATUS (port));I915_WRITE (DP_TP_STATUS (port), temp);@@ -210,7 +210,7 @@ static void intel_mst_enable_dp(struct intel_encoder *encoder)enum port port = intel_dig_port->port;int ret; -DRM_DEBUG_KMS ("%d\n" , intel_dp->active_mst_links); +DRM_DEBUG_KMS ("%d\n" , intel_dp->active_streams); if (intel_wait_for_register(dev_priv, DP_TP_STATUS(port),drivers/gpu/drm/i915/intel_drv.h +1
-1@@ -894,7 +894,7 @@ struct intel_dp {bool can_mst;/* this port supports mst */ bool is_mst; -int active_mst_links; +int active_streams;/* number of active streams (for SST and MST both) */ /* connector directly attached - won't be use for modeset in mst world */ struct intel_connector *attached_connector;Signature · 6 lines
2.7.4 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfxSignature · 3 lines
Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.chSignature · 6 lines
Ville Syrjälä Intel OTC _______________________________________________ Intel-gfx mailing list [email protected] https://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] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH 6/12 drm/i915: Allow MST sinks to work even if drm_probe_ddc() fails
In reply to [email protected]From: Ville Syrjälä <[email protected]>
With HSW + Dell UP2414Q (at least) drm_probe_ddc() occasionally fails, and then we'll assume that the entire display has been disconnected. We don't need the EDID from the main link, so we can simply check if the sink is MST capable, and if so treat is as connected.
--- drivers/gpu/drm/i915/intel_dp.c | 45 +++++++++++++++++++++++++++-------------- 1 file changed, 30 insertions(+), 15 deletions(-)
drivers/gpu/drm/i915/intel_dp.c +30 -15
@@ -3538,7 +3538,7 @@ intel_dp_probe_oui(struct intel_dp *intel_dp) }static bool -intel_dp_probe_mst (struct intel_dp *intel_dp) +intel_dp_can_mst (struct intel_dp *intel_dp) {u8 buf[1 ];
@@ -3551,18 +3551,30 @@ intel_dp_probe_mst(struct intel_dp *intel_dp)if (intel_dp->dpcd[DP_DPCD_REV ] <0x12 )return false; -if (drm_dp_dpcd_read (&intel_dp->aux,DP_MSTM_CAP , buf,1 )) { -if (buf[0 ] &DP_MST_CAP ) { -DRM_DEBUG_KMS ("Sink is MST capable\n" ); - intel_dp->is_mst = true; - }else { -DRM_DEBUG_KMS ("Sink is not MST capable\n" ); - intel_dp->is_mst = false; - } - } +if (drm_dp_dpcd_read (&intel_dp->aux,DP_MSTM_CAP , buf,1 ) !=1 ) +return false; -drm_dp_mst_topology_mgr_set_mst (&intel_dp->mst_mgr, intel_dp->is_mst); -return intel_dp->is_mst; +return buf[0 ] &DP_MST_CAP ; +} + +static void +intel_dp_configure_mst (struct intel_dp *intel_dp) +{ +if (!i915.enable_dp_mst) +return ; + +if (!intel_dp->can_mst) +return ; + + intel_dp->is_mst =intel_dp_can_mst (intel_dp); + +if (intel_dp->is_mst) +DRM_DEBUG_KMS ("Sink is MST capable\n" ); +else +DRM_DEBUG_KMS ("Sink is not MST capable\n" ); + +drm_dp_mst_topology_mgr_set_mst (&intel_dp->mst_mgr, + intel_dp->is_mst); }static int intel_dp_sink_crc_stop (struct intel_dp *intel_dp)
@@ -3993,6 +4005,9 @@ intel_dp_detect_dpcd(struct intel_dp *intel_dp)if (drm_probe_ddc (&intel_dp->aux.ddc))return connector_status_connected; +if (intel_dp_can_mst (intel_dp)) +return connector_status_connected; +/* Well we tried, say unknown for unreliable port types */ if (intel_dp->dpcd[DP_DPCD_REV ] >=0x11 ) { type = intel_dp->downstream_ports[0 ] &DP_DS_PORT_TYPE_MASK ;
@@ -4213,7 +4228,6 @@ intel_dp_long_pulse(struct intel_connector *intel_connector)struct drm_device *dev = connector->dev;enum drm_connector_status status;enum intel_display_power_domain power_domain; -bool ret;u8 sink_irq_vector; power_domain =intel_display_port_aux_power_domain (intel_encoder);
@@ -4249,8 +4263,9 @@ intel_dp_long_pulse(struct intel_connector *intel_connector)intel_dp_probe_oui (intel_dp); - ret =intel_dp_probe_mst (intel_dp); -if (ret) { +intel_dp_configure_mst (intel_dp); + +if (intel_dp->is_mst) {/* * If we are in MST mode then this connector * won't appear connected or have anything
Signature · 6 lines
2.7.4 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [PATCH 06/12] drm/i915: Allow MST sinks to work even if drm_probe_ddc() fails
Quoted 50 lines · On Thu, Jul 28, 2016 at 05:50:42PM +0300, [email protected] wrote:
From: Ville Syrjälä <[email protected]>
With HSW + Dell UP2414Q (at least)
drm_probe_ddc()occasionally fails, and then we'll assume that the entire display has been disconnected. We don't need the EDID from the main link, so we can simply check if the sink is MST capable, and if so treat is as connected.Cc Ander Conselvan de Oliveira <[email protected]>Cc Jim Bride <[email protected]>Cc Manasi D Navare <[email protected]>Cc Durgadoss R <[email protected]>Signed-off-by Ville Syrjälä <[email protected]>--- drivers/gpu/drm/i915/intel_dp.c | 45 +++++++++++++++++++++++++++-------------- 1 file changed, 30 insertions(+), 15 deletions(-)drivers/gpu/drm/i915/intel_dp.c +6
-12@@ -3538,7 +3538,7 @@ intel_dp_probe_oui(struct intel_dp *intel_dp) }static bool -intel_dp_probe_mst (struct intel_dp *intel_dp) +intel_dp_can_mst (struct intel_dp *intel_dp) {u8 buf[1 ];@@ -3551,18 +3551,30 @@ intel_dp_probe_mst(struct intel_dp *intel_dp)if (intel_dp->dpcd[DP_DPCD_REV ] <0x12 )return false; -if (drm_dp_dpcd_read (&intel_dp->aux,DP_MSTM_CAP , buf,1 )) { -if (buf[0 ] &DP_MST_CAP ) { -DRM_DEBUG_KMS ("Sink is MST capable\n" ); - intel_dp->is_mst = true; - }else { -DRM_DEBUG_KMS ("Sink is not MST capable\n" ); - intel_dp->is_mst = false; - } - } +if (drm_dp_dpcd_read (&intel_dp->aux,DP_MSTM_CAP , buf,1 ) !=1 ) +return false; -drm_dp_mst_topology_mgr_set_mst (&intel_dp->mst_mgr, intel_dp->is_mst); -return intel_dp->is_mst; +return buf[0 ] &DP_MST_CAP ; +} +
drivers/gpu/drm/i915/intel_dp.c intel_dp_probe_mst(struct intel_dp *intel_dp) · line 3569
Quoted 10 lines
drivers/gpu/drm/i915/intel_dp.c +10
-0+static void +intel_dp_configure_mst (struct intel_dp *intel_dp) +{ +if (!i915.enable_dp_mst) +return ; + +if (!intel_dp->can_mst) +return ; + + intel_dp->is_mst =intel_dp_can_mst (intel_dp);
can_mst (is the hw capable) vs. can_mst (is the sink capable). Needs a can_sink_mst or something else.
Also this really should be part of the mst helpers imo ...
Quoted 12 lines
drivers/gpu/drm/i915/intel_dp.c +8
-0+ +if (intel_dp->is_mst) +DRM_DEBUG_KMS ("Sink is MST capable\n" ); +else +DRM_DEBUG_KMS ("Sink is not MST capable\n" ); + +drm_dp_mst_topology_mgr_set_mst (&intel_dp->mst_mgr, + intel_dp->is_mst); }static int intel_dp_sink_crc_stop (struct intel_dp *intel_dp)
drivers/gpu/drm/i915/intel_dp.c intel_dp_detect_dpcd(struct intel_dp *intel_dp) · line 4009
Quoted 5 lines
drivers/gpu/drm/i915/intel_dp.c +2
-0@@ -3993,6 +4005,9 @@ intel_dp_detect_dpcd(struct intel_dp *intel_dp)if (drm_probe_ddc (&intel_dp->aux.ddc))return connector_status_connected; +if (intel_dp_can_mst (intel_dp)) +return connector_status_connected;
Shouldn't we instead just outright not poke the ddc when there's an mst branch connected? The dp mst helpers will read the ddc for the final leaf ports, anything intermediate is kinda bonghits anyway. So
if (!intel_dp_can_mst() && drm_probe_ddc(&intel_dp->aux.ddc)) return connector_status_connected;
I think with that it makes a lot more sense and is
And again, this so should be all shared in dp helpers somehow. -Daniel
Quoted 31 lines
drivers/gpu/drm/i915/intel_dp.c +4
-3+/* Well we tried, say unknown for unreliable port types */ if (intel_dp->dpcd[DP_DPCD_REV ] >=0x11 ) { type = intel_dp->downstream_ports[0 ] &DP_DS_PORT_TYPE_MASK ;@@ -4213,7 +4228,6 @@ intel_dp_long_pulse(struct intel_connector *intel_connector)struct drm_device *dev = connector->dev;enum drm_connector_status status;enum intel_display_power_domain power_domain; -bool ret;u8 sink_irq_vector; power_domain =intel_display_port_aux_power_domain (intel_encoder);@@ -4249,8 +4263,9 @@ intel_dp_long_pulse(struct intel_connector *intel_connector)intel_dp_probe_oui (intel_dp); - ret =intel_dp_probe_mst (intel_dp); -if (ret) { +intel_dp_configure_mst (intel_dp); + +if (intel_dp->is_mst) {/* * If we are in MST mode then this connector * won't appear connected or have anything Signature · 6 lines
2.7.4 _______________________________________________ Intel-gfx mailing list [email protected] https://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] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [PATCH 06/12] drm/i915: Allow MST sinks to work even if drm_probe_ddc() fails
Quoted 82 lines · Daniel Vetter
Quoted 50 lines · On Thu, Jul 28, 2016 at 05:50:42PM +0300, [email protected] wrote:
From: Ville Syrjälä <[email protected]>
With HSW + Dell UP2414Q (at least)
drm_probe_ddc()occasionally fails, and then we'll assume that the entire display has been disconnected. We don't need the EDID from the main link, so we can simply check if the sink is MST capable, and if so treat is as connected.Cc Ander Conselvan de Oliveira <[email protected]>Cc Jim Bride <[email protected]>Cc Manasi D Navare <[email protected]>Cc Durgadoss R <[email protected]>Signed-off-by Ville Syrjälä <[email protected]>--- drivers/gpu/drm/i915/intel_dp.c | 45 +++++++++++++++++++++++++++-------------- 1 file changed, 30 insertions(+), 15 deletions(-)drivers/gpu/drm/i915/intel_dp.c +6
-12@@ -3538,7 +3538,7 @@ intel_dp_probe_oui(struct intel_dp *intel_dp) }static bool -intel_dp_probe_mst (struct intel_dp *intel_dp) +intel_dp_can_mst (struct intel_dp *intel_dp) {u8 buf[1 ];@@ -3551,18 +3551,30 @@ intel_dp_probe_mst(struct intel_dp *intel_dp)if (intel_dp->dpcd[DP_DPCD_REV ] <0x12 )return false; -if (drm_dp_dpcd_read (&intel_dp->aux,DP_MSTM_CAP , buf,1 )) { -if (buf[0 ] &DP_MST_CAP ) { -DRM_DEBUG_KMS ("Sink is MST capable\n" ); - intel_dp->is_mst = true; - }else { -DRM_DEBUG_KMS ("Sink is not MST capable\n" ); - intel_dp->is_mst = false; - } - } +if (drm_dp_dpcd_read (&intel_dp->aux,DP_MSTM_CAP , buf,1 ) !=1 ) +return false; -drm_dp_mst_topology_mgr_set_mst (&intel_dp->mst_mgr, intel_dp->is_mst); -return intel_dp->is_mst; +return buf[0 ] &DP_MST_CAP ; +} +drivers/gpu/drm/i915/intel_dp.c intel_dp_probe_mst(struct intel_dp *intel_dp) · line 3569
Quoted 10 lines
drivers/gpu/drm/i915/intel_dp.c +10
-0+static void +intel_dp_configure_mst (struct intel_dp *intel_dp) +{ +if (!i915.enable_dp_mst) +return ; + +if (!intel_dp->can_mst) +return ; + + intel_dp->is_mst =intel_dp_can_mst (intel_dp);
can_mst(is the hw capable) vs.can_mst(is the sink capable). Needs acan_sink_mstor something else.Also this really should be part of the mst helpers imo ...
Quoted 15 lines
drivers/gpu/drm/i915/intel_dp.c +8
-0+ +if (intel_dp->is_mst) +DRM_DEBUG_KMS ("Sink is MST capable\n" ); +else +DRM_DEBUG_KMS ("Sink is not MST capable\n" ); + +drm_dp_mst_topology_mgr_set_mst (&intel_dp->mst_mgr, + intel_dp->is_mst); }static int intel_dp_sink_crc_stop (struct intel_dp *intel_dp)@@ -3993,6 +4005,9 @@ intel_dp_detect_dpcd(struct intel_dp *intel_dp)if (drm_probe_ddc (&intel_dp->aux.ddc))return connector_status_connected;
Quoted 5 lines
drivers/gpu/drm/i915/intel_dp.c intel_dp_detect_dpcd(struct intel_dp *intel_dp) · line 4009
Quoted 2 lines
drivers/gpu/drm/i915/intel_dp.c +2
-0+if (intel_dp_can_mst (intel_dp)) +return connector_status_connected;Shouldn't we instead just outright not poke the ddc when there's an mst branch connected?
I suppose. We won't read the EDID anyway. Not really sure why this display has problems with DDC sometimes, but then again it has a lot of other problems too, the biggest of which is that it refuses to do the payload allocation if I reboot the machine with display already on. I have to turn it off and on again after rebooting to get it back into a working state.
Quoted 11 lines
The dp mst helpers will read the ddc for the final leaf ports, anything intermediate is kinda bonghits anyway. So
if (!intel_dp_can_mst() && drm_probe_ddc(&intel_dp->aux.ddc)) return connector_status_connected;I think with that it makes a lot more sense and is
Reviewed-by Daniel Vetter <[email protected]>And again, this so should be all shared in dp helpers somehow.
Yeah, we should try to unify all of the probe and long/short pulse handling across drivers.
Quoted 38 lines
-Daniel
Quoted 31 lines
drivers/gpu/drm/i915/intel_dp.c +4
-3+/* Well we tried, say unknown for unreliable port types */ if (intel_dp->dpcd[DP_DPCD_REV ] >=0x11 ) { type = intel_dp->downstream_ports[0 ] &DP_DS_PORT_TYPE_MASK ;@@ -4213,7 +4228,6 @@ intel_dp_long_pulse(struct intel_connector *intel_connector)struct drm_device *dev = connector->dev;enum drm_connector_status status;enum intel_display_power_domain power_domain; -bool ret;u8 sink_irq_vector; power_domain =intel_display_port_aux_power_domain (intel_encoder);@@ -4249,8 +4263,9 @@ intel_dp_long_pulse(struct intel_connector *intel_connector)intel_dp_probe_oui (intel_dp); - ret =intel_dp_probe_mst (intel_dp); -if (ret) { +intel_dp_configure_mst (intel_dp); + +if (intel_dp->is_mst) {/* * If we are in MST mode then this connector * won't appear connected or have anything Signature · 6 lines
2.7.4 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfxSignature · 3 lines
Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch
Signature · 6 lines
Ville Syrjälä Intel OTC _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH v2 6/12 drm/i915: Allow MST sinks to work even if drm_probe_ddc() fails
In reply to [email protected]From: Ville Syrjälä <[email protected]>
With HSW + Dell UP2414Q (at least) drm_probe_ddc() occasionally fails, and then we'll assume that the entire display has been disconnected. We don't need the EDID from the main link, so we can simply check if the sink is MST capable, and if so treat is as connected.
v2: Skip drm_probe_ddc() entirely for MST (Daniel)
--- drivers/gpu/drm/i915/intel_dp.c | 45 +++++++++++++++++++++++++++-------------- 1 file changed, 30 insertions(+), 15 deletions(-)
drivers/gpu/drm/i915/intel_dp.c +30 -15
@@ -3545,7 +3545,7 @@ intel_dp_probe_oui(struct intel_dp *intel_dp) }static bool -intel_dp_probe_mst (struct intel_dp *intel_dp) +intel_dp_can_mst (struct intel_dp *intel_dp) {u8 buf[1 ];
@@ -3558,18 +3558,30 @@ intel_dp_probe_mst(struct intel_dp *intel_dp)if (intel_dp->dpcd[DP_DPCD_REV ] <0x12 )return false; -if (drm_dp_dpcd_read (&intel_dp->aux,DP_MSTM_CAP , buf,1 )) { -if (buf[0 ] &DP_MST_CAP ) { -DRM_DEBUG_KMS ("Sink is MST capable\n" ); - intel_dp->is_mst = true; - }else { -DRM_DEBUG_KMS ("Sink is not MST capable\n" ); - intel_dp->is_mst = false; - } - } +if (drm_dp_dpcd_read (&intel_dp->aux,DP_MSTM_CAP , buf,1 ) !=1 ) +return false; -drm_dp_mst_topology_mgr_set_mst (&intel_dp->mst_mgr, intel_dp->is_mst); -return intel_dp->is_mst; +return buf[0 ] &DP_MST_CAP ; +} + +static void +intel_dp_configure_mst (struct intel_dp *intel_dp) +{ +if (!i915.enable_dp_mst) +return ; + +if (!intel_dp->can_mst) +return ; + + intel_dp->is_mst =intel_dp_can_mst (intel_dp); + +if (intel_dp->is_mst) +DRM_DEBUG_KMS ("Sink is MST capable\n" ); +else +DRM_DEBUG_KMS ("Sink is not MST capable\n" ); + +drm_dp_mst_topology_mgr_set_mst (&intel_dp->mst_mgr, + intel_dp->is_mst); }static int intel_dp_sink_crc_stop (struct intel_dp *intel_dp)
@@ -3996,6 +4008,9 @@ intel_dp_detect_dpcd(struct intel_dp *intel_dp) connector_status_connected : connector_status_disconnected; } +if (intel_dp_can_mst (intel_dp)) +return connector_status_connected; +/* If no HPD, poke DDC gently */ if (drm_probe_ddc (&intel_dp->aux.ddc))return connector_status_connected;
@@ -4220,7 +4235,6 @@ intel_dp_long_pulse(struct intel_connector *intel_connector)struct drm_device *dev = connector->dev;enum drm_connector_status status;enum intel_display_power_domain power_domain; -bool ret;u8 sink_irq_vector; power_domain =intel_display_port_aux_power_domain (intel_encoder);
@@ -4262,8 +4276,9 @@ intel_dp_long_pulse(struct intel_connector *intel_connector)intel_dp_probe_oui (intel_dp); - ret =intel_dp_probe_mst (intel_dp); -if (ret) { +intel_dp_configure_mst (intel_dp); + +if (intel_dp->is_mst) {/* * If we are in MST mode then this connector * won't appear connected or have anything
Signature · 6 lines
2.7.4 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH 7/12 drm/i915: Move DP link retraining into intel_dp_detect()
In reply to [email protected]From: Ville Syrjälä <[email protected]>
DP link retraining needs to grab some modeset locks to not race with modesets, so we can't really do it safely from the hpd_pulse, lest we risk deadlocking due to MST sideband stuff.
Move the link retraining to happen from the hotplug work instead. Doing at the end of intel_dp_detect() seems like a good place in case the sink already got disconnected, in which case retraining is pointless.
To determine if we need to schedule the hotplug work, we'll just check the sink lane status without locks from hpd_pulse. A little racy still eg. due to useing intel_dp->lane_count, but no less racy than what we already had. We'll repeat the check in from intel_dp_detect() with proper locking, where we'll also check if the link as actually active or not.
--- drivers/gpu/drm/i915/intel_dp.c | 154 +++++++++++++++++----------------------- 1 file changed, 66 insertions(+), 88 deletions(-)
drivers/gpu/drm/i915/intel_dp.c +66 -88
@@ -3842,15 +3842,6 @@ intel_dp_check_mst_status(struct intel_dp *intel_dp) bret =intel_dp_get_sink_irq_esi (intel_dp, esi); go_again:if (bret == true) { - -/* check link status - esi[10] = 0x200c */ -if (intel_dp->active_streams && - !drm_dp_channel_eq_ok (&esi[10 ], intel_dp->lane_count)) { -DRM_DEBUG_KMS ("channel EQ not ok, retraining\n" ); -intel_dp_start_link_train (intel_dp); -intel_dp_stop_link_train (intel_dp); - } -DRM_DEBUG_KMS ("got esi %3ph\n" , esi); ret =drm_dp_mst_hpd_irq (&intel_dp->mst_mgr, esi, &handled);
@@ -3886,34 +3877,42 @@ go_again:return -EINVAL ; } -static void -intel_dp_check_link_status (struct intel_dp *intel_dp) +static bool +intel_dp_link_needs_retrain (struct intel_dp *intel_dp) { -struct intel_encoder *intel_encoder = &dp_to_dig_port (intel_dp)->base; -struct drm_device *dev =intel_dp_to_dev (intel_dp);u8 link_status[DP_LINK_STATUS_SIZE ]; -WARN_ON (!drm_modeset_is_locked (&dev->mode_config.connection_mutex)); +if (intel_dp->active_streams ==0 ) +return false; + +if (intel_dp->compliance_test_type ==DP_TEST_LINK_TRAINING ) +return true;if (!intel_dp_get_link_status (intel_dp, link_status)) {DRM_ERROR ("Failed to get link status\n" ); -return ; +return false; } -if (!intel_encoder->base.crtc) -return ; +return !drm_dp_channel_eq_ok (link_status, intel_dp->lane_count); +} -if (!to_intel_crtc (intel_encoder->base.crtc)->active) -return ; +static void +intel_dp_link_retrain (struct intel_dp *intel_dp) +{ +struct intel_encoder *encoder = &dp_to_dig_port (intel_dp)->base; +struct drm_device *dev =intel_dp_to_dev (intel_dp); + +drm_modeset_lock (&dev->mode_config.connection_mutex,NULL ); -/* if link training is requested we should perform it always */ -if ((intel_dp->compliance_test_type ==DP_TEST_LINK_TRAINING ) || - (!drm_dp_channel_eq_ok (link_status, intel_dp->lane_count))) { +if (intel_dp_link_needs_retrain (intel_dp)) {DRM_DEBUG_KMS ("%s: channel EQ not ok, retraining\n" , - intel_encoder->base.name); + encoder->base.name); +intel_dp_start_link_train (intel_dp);intel_dp_stop_link_train (intel_dp); } + +drm_modeset_unlock (&dev->mode_config.connection_mutex); }/*
@@ -3932,7 +3931,6 @@ intel_dp_check_link_status(struct intel_dp *intel_dp)static bool intel_dp_short_pulse (struct intel_dp *intel_dp) { -struct drm_device *dev =intel_dp_to_dev (intel_dp);u8 sink_irq_vector;u8 old_sink_count = intel_dp->sink_count;bool ret;
@@ -3972,10 +3970,6 @@ intel_dp_short_pulse(struct intel_dp *intel_dp)DRM_DEBUG_DRIVER ("CP or sink specific irq unhandled\n" ); } -drm_modeset_lock (&dev->mode_config.connection_mutex,NULL ); -intel_dp_check_link_status (intel_dp); -drm_modeset_unlock (&dev->mode_config.connection_mutex); -return true; }
@@ -3986,6 +3980,8 @@ intel_dp_detect_dpcd(struct intel_dp *intel_dp)uint8_t *dpcd = intel_dp->dpcd;uint8_t type; +WARN_ON (is_edp (intel_dp)); +if (!intel_dp_get_dpcd (intel_dp))return connector_status_disconnected;
@@ -4218,7 +4214,7 @@ intel_dp_unset_edid(struct intel_dp *intel_dp) intel_dp->has_audio = false; } -static void +static enum drm_connector_status intel_dp_long_pulse (struct intel_connector *intel_connector) {struct drm_connector *connector = &intel_connector->base;
@@ -4273,18 +4269,12 @@ intel_dp_long_pulse(struct intel_connector *intel_connector)*/ status = connector_status_disconnected; goto out; - }else if (connector->status == connector_status_connected) { -/* -* If display was connected already and is still connected -* check links status, there has been known issues of -* link loss triggerring long pulse!!!! -*/ -drm_modeset_lock (&dev->mode_config.connection_mutex,NULL ); -intel_dp_check_link_status (intel_dp); -drm_modeset_unlock (&dev->mode_config.connection_mutex); - goto out; } +/* connected->connected, nothing to do */ +if (connector->status == connector_status_connected) + goto out; +/* * Clearing NACK and defer counts to get their exact values * while reading EDID which are required by Compliance tests
@@ -4296,7 +4286,6 @@ intel_dp_long_pulse(struct intel_connector *intel_connector)intel_dp_set_edid (intel_dp); status = connector_status_connected; - intel_dp->detect_done = true;/* Try to read the source of the interrupt */ if (intel_dp->dpcd[DP_DPCD_REV] >= 0x11 &&
@@ -4313,43 +4302,30 @@ intel_dp_long_pulse(struct intel_connector *intel_connector) } out: -if ((status != connector_status_connected) && - (intel_dp->is_mst == false)) +if (status != connector_status_connected)intel_dp_unset_edid (intel_dp);intel_display_power_put (to_i915 (dev), power_domain); -return ; + +return status; }static enum drm_connector_status intel_dp_detect (struct drm_connector *connector,bool force) {struct intel_dp *intel_dp =intel_attached_dp (connector); -struct intel_digital_port *intel_dig_port =dp_to_dig_port (intel_dp); -struct intel_encoder *intel_encoder = &intel_dig_port->base;struct intel_connector *intel_connector =to_intel_connector (connector); +enum drm_connector_status status;DRM_DEBUG_KMS ("[CONNECTOR:%d:%s]\n" , connector->base.id, connector->name); -if (intel_dp->is_mst) { -/* MST devices are disconnected from a monitor POV */ -intel_dp_unset_edid (intel_dp); -if (intel_encoder->type !=INTEL_OUTPUT_EDP ) - intel_encoder->type =INTEL_OUTPUT_DP ; -return connector_status_disconnected; - } - -/* If full detect is not performed yet, do a full detect */ -if (!intel_dp->detect_done) -intel_dp_long_pulse (intel_dp->attached_connector); + status =intel_dp_long_pulse (intel_connector); - intel_dp->detect_done = false; +if (status == connector_status_connected || intel_dp->is_mst) +intel_dp_link_retrain (intel_dp); -if (is_edp (intel_dp) || intel_connector->detect_edid) -return connector_status_connected; -else -return connector_status_disconnected; +return status; } static void
@@ -4706,39 +4682,41 @@ intel_dp_hpd_pulse(struct intel_digital_port *intel_dig_port, bool long_hpd)port_name (intel_dig_port->port), long_hpd ? "long" : "short"); +if (long_hpd) +return IRQ_NONE ; + power_domain =intel_display_port_aux_power_domain (intel_encoder);intel_display_power_get (dev_priv, power_domain); -if (long_hpd) { -intel_dp_long_pulse (intel_dp->attached_connector); -if (intel_dp->is_mst) - ret =IRQ_HANDLED ; - goto put_power; - - }else { -if (intel_dp->is_mst) { -if (intel_dp_check_mst_status (intel_dp) == -EINVAL ) { -/* -* If we were in MST mode, and device is not -* there, get out of MST mode -*/ -DRM_DEBUG_KMS ("MST device may have disappeared %d vs %d\n" , - intel_dp->is_mst, intel_dp->mst_mgr.mst_state); - intel_dp->is_mst = false; -drm_dp_mst_topology_mgr_set_mst (&intel_dp->mst_mgr, - intel_dp->is_mst); - goto put_power; - } - } - -if (!intel_dp->is_mst) { -if (!intel_dp_short_pulse (intel_dp)) { -intel_dp_long_pulse (intel_dp->attached_connector); - goto put_power; - } +if (intel_dp->is_mst) { +if (intel_dp_check_mst_status (intel_dp) == -EINVAL ) { +/* +* If we were in MST mode, and device is not +* there, get out of MST mode +*/ +DRM_DEBUG_KMS ("MST device may have disappeared %d vs %d\n" , + intel_dp->is_mst, intel_dp->mst_mgr.mst_state); + intel_dp->is_mst = false; +drm_dp_mst_topology_mgr_set_mst (&intel_dp->mst_mgr, + intel_dp->is_mst); + goto put_power; } + }else { +if (!intel_dp_short_pulse (intel_dp)) + goto put_power; } +/* +* Link retraining happens from the hotplug work, +* check if we might need to schdule it. +* +* There has been known issues of link loss +* triggerring long pulse, so let's check both +* for short and long pulse. +*/ +if (intel_dp_link_needs_retrain (intel_dp)) + goto put_power; + ret =IRQ_HANDLED ; put_power:
Signature · 6 lines
2.7.4 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [PATCH 07/12] drm/i915: Move DP link retraining into intel_dp_detect()
Quoted 66 lines · On Thu, Jul 28, 2016 at 05:50:43PM +0300, [email protected] wrote:
From: Ville Syrjälä <[email protected]>
DP link retraining needs to grab some modeset locks to not race with modesets, so we can't really do it safely from the
hpd_pulse, lest we risk deadlocking due to MST sideband stuff.Move the link retraining to happen from the hotplug work instead. Doing at the end of
intel_dp_detect()seems like a good place in case the sink already got disconnected, in which case retraining is pointless.To determine if we need to schedule the hotplug work, we'll just check the sink lane status without locks from
hpd_pulse. A little racy still eg. due to useingintel_dp->lane_count, but no less racy than what we already had. We'll repeat the check in fromintel_dp_detect()with proper locking, where we'll also check if the link as actually active or not.Cc Ander Conselvan de Oliveira <[email protected]>Cc Jim Bride <[email protected]>Cc Manasi D Navare <[email protected]>Cc Durgadoss R <[email protected]>Signed-off-by Ville Syrjälä <[email protected]>--- drivers/gpu/drm/i915/intel_dp.c | 154 +++++++++++++++++----------------------- 1 file changed, 66 insertions(+), 88 deletions(-)drivers/gpu/drm/i915/intel_dp.c +7
-14@@ -3842,15 +3842,6 @@ intel_dp_check_mst_status(struct intel_dp *intel_dp) bret =intel_dp_get_sink_irq_esi (intel_dp, esi); go_again:if (bret == true) { - -/* check link status - esi[10] = 0x200c */ -if (intel_dp->active_streams && - !drm_dp_channel_eq_ok (&esi[10 ], intel_dp->lane_count)) { -DRM_DEBUG_KMS ("channel EQ not ok, retraining\n" ); -intel_dp_start_link_train (intel_dp); -intel_dp_stop_link_train (intel_dp); - } -DRM_DEBUG_KMS ("got esi %3ph\n" , esi); ret =drm_dp_mst_hpd_irq (&intel_dp->mst_mgr, esi, &handled);@@ -3886,34 +3877,42 @@ go_again:return -EINVAL ; } -static void -intel_dp_check_link_status (struct intel_dp *intel_dp) +static bool +intel_dp_link_needs_retrain (struct intel_dp *intel_dp) { -struct intel_encoder *intel_encoder = &dp_to_dig_port (intel_dp)->base; -struct drm_device *dev =intel_dp_to_dev (intel_dp);u8 link_status[DP_LINK_STATUS_SIZE ]; -WARN_ON (!drm_modeset_is_locked (&dev->mode_config.connection_mutex)); +if (intel_dp->active_streams ==0 ) +return false; + +if (intel_dp->compliance_test_type ==DP_TEST_LINK_TRAINING ) +return true;
drivers/gpu/drm/i915/intel_dp.c go_again: · line 3896
Quoted 10 lines
drivers/gpu/drm/i915/intel_dp.c +2
-3if (!intel_dp_get_link_status (intel_dp, link_status)) {DRM_ERROR ("Failed to get link status\n" ); -return ; +return false; } -if (!intel_encoder->base.crtc) -return ; +return !drm_dp_channel_eq_ok (link_status, intel_dp->lane_count);
According to the DP spec, we should also check for the clock recovery bit in DPCD We should also add a check drm_dp_clock_recovery_ok(link_status, intel_dp->lane_count)
Quoted 129 lines
drivers/gpu/drm/i915/intel_dp.c +13
-6+} -if (!to_intel_crtc (intel_encoder->base.crtc)->active) -return ; +static void +intel_dp_link_retrain (struct intel_dp *intel_dp) +{ +struct intel_encoder *encoder = &dp_to_dig_port (intel_dp)->base; +struct drm_device *dev =intel_dp_to_dev (intel_dp); + +drm_modeset_lock (&dev->mode_config.connection_mutex,NULL ); -/* if link training is requested we should perform it always */ -if ((intel_dp->compliance_test_type ==DP_TEST_LINK_TRAINING ) || - (!drm_dp_channel_eq_ok (link_status, intel_dp->lane_count))) { +if (intel_dp_link_needs_retrain (intel_dp)) {DRM_DEBUG_KMS ("%s: channel EQ not ok, retraining\n" , - intel_encoder->base.name); + encoder->base.name); +intel_dp_start_link_train (intel_dp);intel_dp_stop_link_train (intel_dp); } + +drm_modeset_unlock (&dev->mode_config.connection_mutex); }/*
drivers/gpu/drm/i915/intel_dp.c +11
-27@@ -3932,7 +3931,6 @@ intel_dp_check_link_status(struct intel_dp *intel_dp)static bool intel_dp_short_pulse (struct intel_dp *intel_dp) { -struct drm_device *dev =intel_dp_to_dev (intel_dp);u8 sink_irq_vector;u8 old_sink_count = intel_dp->sink_count;bool ret;@@ -3972,10 +3970,6 @@ intel_dp_short_pulse(struct intel_dp *intel_dp)DRM_DEBUG_DRIVER ("CP or sink specific irq unhandled\n" ); } -drm_modeset_lock (&dev->mode_config.connection_mutex,NULL ); -intel_dp_check_link_status (intel_dp); -drm_modeset_unlock (&dev->mode_config.connection_mutex); -return true; }@@ -3986,6 +3980,8 @@ intel_dp_detect_dpcd(struct intel_dp *intel_dp)uint8_t *dpcd = intel_dp->dpcd;uint8_t type; +WARN_ON (is_edp (intel_dp)); +if (!intel_dp_get_dpcd (intel_dp))return connector_status_disconnected;@@ -4218,7 +4214,7 @@ intel_dp_unset_edid(struct intel_dp *intel_dp) intel_dp->has_audio = false; } -static void +static enum drm_connector_status intel_dp_long_pulse (struct intel_connector *intel_connector) {struct drm_connector *connector = &intel_connector->base;@@ -4273,18 +4269,12 @@ intel_dp_long_pulse(struct intel_connector *intel_connector)*/ status = connector_status_disconnected; goto out; - }else if (connector->status == connector_status_connected) { -/* -* If display was connected already and is still connected -* check links status, there has been known issues of -* link loss triggerring long pulse!!!! -*/ -drm_modeset_lock (&dev->mode_config.connection_mutex,NULL ); -intel_dp_check_link_status (intel_dp); -drm_modeset_unlock (&dev->mode_config.connection_mutex); - goto out; } +/* connected->connected, nothing to do */ +if (connector->status == connector_status_connected) + goto out; +/* * Clearing NACK and defer counts to get their exact values * while reading EDID which are required by Compliance tests @@ -4296,7 +4286,6 @@ intel_dp_long_pulse(struct intel_connector *intel_connector)intel_dp_set_edid (intel_dp); status = connector_status_connected; - intel_dp->detect_done = true;/* Try to read the source of the interrupt */ if (intel_dp->dpcd[DP_DPCD_REV] >= 0x11 &&@@ -4313,43 +4302,30 @@ intel_dp_long_pulse(struct intel_connector *intel_connector) } out: -if ((status != connector_status_connected) && - (intel_dp->is_mst == false)) +if (status != connector_status_connected)intel_dp_unset_edid (intel_dp);intel_display_power_put (to_i915 (dev), power_domain); -return ; + +return status; }static enum drm_connector_status intel_dp_detect (struct drm_connector *connector,bool force) {struct intel_dp *intel_dp =intel_attached_dp (connector); -struct intel_digital_port *intel_dig_port =dp_to_dig_port (intel_dp); -struct intel_encoder *intel_encoder = &intel_dig_port->base;struct intel_connector *intel_connector =to_intel_connector (connector); +enum drm_connector_status status;DRM_DEBUG_KMS ("[CONNECTOR:%d:%s]\n" , connector->base.id, connector->name); -if (intel_dp->is_mst) { -/* MST devices are disconnected from a monitor POV */ -intel_dp_unset_edid (intel_dp); -if (intel_encoder->type !=INTEL_OUTPUT_EDP ) - intel_encoder->type =INTEL_OUTPUT_DP ;
drivers/gpu/drm/i915/intel_dp.c intel_dp_long_pulse(struct intel_connector *intel_connector) · line 4325
Quoted 10 lines
drivers/gpu/drm/i915/intel_dp.c +2
-7-return connector_status_disconnected; - } - -/* If full detect is not performed yet, do a full detect */ -if (!intel_dp->detect_done) -intel_dp_long_pulse (intel_dp->attached_connector); + status =intel_dp_long_pulse (intel_connector); - intel_dp->detect_done = false; +if (status == connector_status_connected || intel_dp->is_mst)
Whya re we not checking for (!intel_encoder->crtc.base) before retraining? I had seen issues with connected boot case when connector status is connected and if it tries to retrain it fails with retries because there is no active pipe. In that case it should not attempt to retrain.
Quoted 82 lines
drivers/gpu/drm/i915/intel_dp.c +31
-31+intel_dp_link_retrain (intel_dp); -if (is_edp (intel_dp) || intel_connector->detect_edid) -return connector_status_connected; -else -return connector_status_disconnected; +return status; } static void@@ -4706,39 +4682,41 @@ intel_dp_hpd_pulse(struct intel_digital_port *intel_dig_port, bool long_hpd)port_name (intel_dig_port->port), long_hpd ? "long" : "short"); +if (long_hpd) +return IRQ_NONE ; + power_domain =intel_display_port_aux_power_domain (intel_encoder);intel_display_power_get (dev_priv, power_domain); -if (long_hpd) { -intel_dp_long_pulse (intel_dp->attached_connector); -if (intel_dp->is_mst) - ret =IRQ_HANDLED ; - goto put_power; - - }else { -if (intel_dp->is_mst) { -if (intel_dp_check_mst_status (intel_dp) == -EINVAL ) { -/* -* If we were in MST mode, and device is not -* there, get out of MST mode -*/ -DRM_DEBUG_KMS ("MST device may have disappeared %d vs %d\n" , - intel_dp->is_mst, intel_dp->mst_mgr.mst_state); - intel_dp->is_mst = false; -drm_dp_mst_topology_mgr_set_mst (&intel_dp->mst_mgr, - intel_dp->is_mst); - goto put_power; - } - } - -if (!intel_dp->is_mst) { -if (!intel_dp_short_pulse (intel_dp)) { -intel_dp_long_pulse (intel_dp->attached_connector); - goto put_power; - } +if (intel_dp->is_mst) { +if (intel_dp_check_mst_status (intel_dp) == -EINVAL ) { +/* +* If we were in MST mode, and device is not +* there, get out of MST mode +*/ +DRM_DEBUG_KMS ("MST device may have disappeared %d vs %d\n" , + intel_dp->is_mst, intel_dp->mst_mgr.mst_state); + intel_dp->is_mst = false; +drm_dp_mst_topology_mgr_set_mst (&intel_dp->mst_mgr, + intel_dp->is_mst); + goto put_power; } + }else { +if (!intel_dp_short_pulse (intel_dp)) + goto put_power; } +/* +* Link retraining happens from the hotplug work, +* check if we might need to schdule it. +* +* There has been known issues of link loss +* triggerring long pulse, so let's check both +* for short and long pulse. +*/ +if (intel_dp_link_needs_retrain (intel_dp)) + goto put_power; + ret =IRQ_HANDLED ; put_power:Signature · 1 line
2.7.4
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [PATCH 07/12] drm/i915: Move DP link retraining into intel_dp_detect()
Quoted 74 lines · Manasi Navare
Quoted 73 lines · On Thu, Jul 28, 2016 at 05:50:43PM +0300, [email protected] wrote:
From: Ville Syrjälä <[email protected]>
DP link retraining needs to grab some modeset locks to not race with modesets, so we can't really do it safely from the
hpd_pulse, lest we risk deadlocking due to MST sideband stuff.Move the link retraining to happen from the hotplug work instead. Doing at the end of
intel_dp_detect()seems like a good place in case the sink already got disconnected, in which case retraining is pointless.To determine if we need to schedule the hotplug work, we'll just check the sink lane status without locks from
hpd_pulse. A little racy still eg. due to useingintel_dp->lane_count, but no less racy than what we already had. We'll repeat the check in fromintel_dp_detect()with proper locking, where we'll also check if the link as actually active or not.Cc Ander Conselvan de Oliveira <[email protected]>Cc Jim Bride <[email protected]>Cc Manasi D Navare <[email protected]>Cc Durgadoss R <[email protected]>Signed-off-by Ville Syrjälä <[email protected]>--- drivers/gpu/drm/i915/intel_dp.c | 154 +++++++++++++++++----------------------- 1 file changed, 66 insertions(+), 88 deletions(-)drivers/gpu/drm/i915/intel_dp.c +8
-15@@ -3842,15 +3842,6 @@ intel_dp_check_mst_status(struct intel_dp *intel_dp) bret =intel_dp_get_sink_irq_esi (intel_dp, esi); go_again:if (bret == true) { - -/* check link status - esi[10] = 0x200c */ -if (intel_dp->active_streams && - !drm_dp_channel_eq_ok (&esi[10 ], intel_dp->lane_count)) { -DRM_DEBUG_KMS ("channel EQ not ok, retraining\n" ); -intel_dp_start_link_train (intel_dp); -intel_dp_stop_link_train (intel_dp); - } -DRM_DEBUG_KMS ("got esi %3ph\n" , esi); ret =drm_dp_mst_hpd_irq (&intel_dp->mst_mgr, esi, &handled);@@ -3886,34 +3877,42 @@ go_again:return -EINVAL ; } -static void -intel_dp_check_link_status (struct intel_dp *intel_dp) +static bool +intel_dp_link_needs_retrain (struct intel_dp *intel_dp) { -struct intel_encoder *intel_encoder = &dp_to_dig_port (intel_dp)->base; -struct drm_device *dev =intel_dp_to_dev (intel_dp);u8 link_status[DP_LINK_STATUS_SIZE ]; -WARN_ON (!drm_modeset_is_locked (&dev->mode_config.connection_mutex)); +if (intel_dp->active_streams ==0 ) +return false; + +if (intel_dp->compliance_test_type ==DP_TEST_LINK_TRAINING ) +return true;if (!intel_dp_get_link_status (intel_dp, link_status)) {DRM_ERROR ("Failed to get link status\n" ); -return ; +return false; }
Quoted 6 lines
drivers/gpu/drm/i915/intel_dp.c go_again: · line 3896
Quoted 3 lines
drivers/gpu/drm/i915/intel_dp.c +1
-2-if (!intel_encoder->base.crtc) -return ; +return !drm_dp_channel_eq_ok (link_status, intel_dp->lane_count);According to the DP spec, we should also check for the clock recovery bit in DPCD We should also add a check
drm_dp_clock_recovery_ok(link_status, intel_dp->lane_count)
I think drm_dp_channel_eq_ok() checks all the bits: INTERLANE_ALIGN_DONE, CR_DONE, EQ_DONE, and SYMBOL_LOCKED.
Anyways, while I was looking at the short pulse handling a bit more, I came to the conclusion that we should rewrite it a bit.
The CTS docs seem to say that we're expected to read DPCD 0x200-0x205 on short pulse, and use that information to determine what we should do. Currently we don't do that.
So I was thunking that we'd adjust the link_status stuff to read 0x200-0x207 instead of 0x202-0x207, like so:
-#define DP_LINK_STATUS_SIZE 6
+#define DP_LINK_STATUS_SIZE 8
static u8 dp_link_status(const u8 link_status[DP_LINK_STATUS_SIZE], int r) {
- return link_status[r - DP_LANE0_1_STATUS];
+ return link_status[r - DP_SINK_COUNT];
}
And then we'd use something like this as our short pulse handler:
static boolintel_dp_short_pulse(struct intel_dp *intel_dp)
{
u8 link_status[DP_LINK_STATUS_SIZE], tmp;
/*
* Clearing compliance test variables to allow capturing
* of values for next automated test request.
*/
intel_dp->compliance_test_active = 0;
intel_dp->compliance_test_type = 0;
intel_dp->compliance_test_data = 0;
if (!intel_dp_get_link_status(intel_dp, link_status))
return false;
tmp = drm_dp_link_status(link_status, DP_DEVICE_SERVICE_IRQ_VECTOR);
if (tmp)
drm_dp_dpcd_writeb(&intel_dp->aux,
DP_DEVICE_SERVICE_IRQ_VECTOR,
tmp);
if (tmp & DP_AUTOMATED_TEST_REQUEST)
DRM_DEBUG_DRIVER("Test request in short pulse not handled\n");
if (tmp & (DP_CP_IRQ | DP_SINK_SPECIFIC_IRQ))
DRM_DEBUG_DRIVER("CP or sink specific irq unhandled\n");
tmp = drm_dp_link_status(link_status, DP_LANE_ALIGN_STATUS_UPDATED);
if (tmp & DP_DOWNSTREAM_PORT_STATUS_CHANGED)
return false;
tmp = drm_dp_link_status(link_status, DP_SINK_COUNT);
if (DP_GET_SINK_COUNT(tmp) != intel_dp->sink_count)
return false;
if (intel_dp->active_streams != 0 &&
!drm_dp_channel_eq_ok(link_status, intel_dp->lane_count))
return false;
return true;
}and obviously fill in whatever else sink irq handling we need.
Thoughts? Does that look sane?
<snip>
Quoted 26 lines
Quoted 26 lines
drivers/gpu/drm/i915/intel_dp.c +2
-13static enum drm_connector_status intel_dp_detect (struct drm_connector *connector,bool force) {struct intel_dp *intel_dp =intel_attached_dp (connector); -struct intel_digital_port *intel_dig_port =dp_to_dig_port (intel_dp); -struct intel_encoder *intel_encoder = &intel_dig_port->base;struct intel_connector *intel_connector =to_intel_connector (connector); +enum drm_connector_status status;DRM_DEBUG_KMS ("[CONNECTOR:%d:%s]\n" , connector->base.id, connector->name); -if (intel_dp->is_mst) { -/* MST devices are disconnected from a monitor POV */ -intel_dp_unset_edid (intel_dp); -if (intel_encoder->type !=INTEL_OUTPUT_EDP ) - intel_encoder->type =INTEL_OUTPUT_DP ; -return connector_status_disconnected; - } - -/* If full detect is not performed yet, do a full detect */ -if (!intel_dp->detect_done) -intel_dp_long_pulse (intel_dp->attached_connector); + status =intel_dp_long_pulse (intel_connector);
Quoted 7 lines
drivers/gpu/drm/i915/intel_dp.c intel_dp_long_pulse(struct intel_connector *intel_connector) · line 4325
Quoted 2 lines
drivers/gpu/drm/i915/intel_dp.c +1
-1- intel_dp->detect_done = false; +if (status == connector_status_connected || intel_dp->is_mst)Whya re we not checking for (!intel_encoder->crtc.base) before retraining? I had seen issues with connected boot case when connector status is connected and if it tries to retrain it fails with retries because there is no active pipe. In that case it should not attempt to retrain.
I changed it to use intel_dp->active_streams instead. That'll work for MST as well as SST. Checking for the crtc would only cover SST.
Quoted 84 lines
Quoted 84 lines
drivers/gpu/drm/i915/intel_dp.c +31
-31+intel_dp_link_retrain (intel_dp); -if (is_edp (intel_dp) || intel_connector->detect_edid) -return connector_status_connected; -else -return connector_status_disconnected; +return status; } static void@@ -4706,39 +4682,41 @@ intel_dp_hpd_pulse(struct intel_digital_port *intel_dig_port, bool long_hpd)port_name (intel_dig_port->port), long_hpd ? "long" : "short"); +if (long_hpd) +return IRQ_NONE ; + power_domain =intel_display_port_aux_power_domain (intel_encoder);intel_display_power_get (dev_priv, power_domain); -if (long_hpd) { -intel_dp_long_pulse (intel_dp->attached_connector); -if (intel_dp->is_mst) - ret =IRQ_HANDLED ; - goto put_power; - - }else { -if (intel_dp->is_mst) { -if (intel_dp_check_mst_status (intel_dp) == -EINVAL ) { -/* -* If we were in MST mode, and device is not -* there, get out of MST mode -*/ -DRM_DEBUG_KMS ("MST device may have disappeared %d vs %d\n" , - intel_dp->is_mst, intel_dp->mst_mgr.mst_state); - intel_dp->is_mst = false; -drm_dp_mst_topology_mgr_set_mst (&intel_dp->mst_mgr, - intel_dp->is_mst); - goto put_power; - } - } - -if (!intel_dp->is_mst) { -if (!intel_dp_short_pulse (intel_dp)) { -intel_dp_long_pulse (intel_dp->attached_connector); - goto put_power; - } +if (intel_dp->is_mst) { +if (intel_dp_check_mst_status (intel_dp) == -EINVAL ) { +/* +* If we were in MST mode, and device is not +* there, get out of MST mode +*/ +DRM_DEBUG_KMS ("MST device may have disappeared %d vs %d\n" , + intel_dp->is_mst, intel_dp->mst_mgr.mst_state); + intel_dp->is_mst = false; +drm_dp_mst_topology_mgr_set_mst (&intel_dp->mst_mgr, + intel_dp->is_mst); + goto put_power; } + }else { +if (!intel_dp_short_pulse (intel_dp)) + goto put_power; } +/* +* Link retraining happens from the hotplug work, +* check if we might need to schdule it. +* +* There has been known issues of link loss +* triggerring long pulse, so let's check both +* for short and long pulse. +*/ +if (intel_dp_link_needs_retrain (intel_dp)) + goto put_power; + ret =IRQ_HANDLED ; put_power:Signature · 1 line
2.7.4
Signature · 6 lines
Ville Syrjälä Intel OTC _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [PATCH 07/12] drm/i915: Move DP link retraining into intel_dp_detect()
Quoted 82 lines · Ville Syrjälä
Quoted 74 lines · Manasi Navare
Quoted 73 lines · On Thu, Jul 28, 2016 at 05:50:43PM +0300, [email protected] wrote:
From: Ville Syrjälä <[email protected]>
DP link retraining needs to grab some modeset locks to not race with modesets, so we can't really do it safely from the
hpd_pulse, lest we risk deadlocking due to MST sideband stuff.Move the link retraining to happen from the hotplug work instead. Doing at the end of
intel_dp_detect()seems like a good place in case the sink already got disconnected, in which case retraining is pointless.To determine if we need to schedule the hotplug work, we'll just check the sink lane status without locks from
hpd_pulse. A little racy still eg. due to useingintel_dp->lane_count, but no less racy than what we already had. We'll repeat the check in fromintel_dp_detect()with proper locking, where we'll also check if the link as actually active or not.Cc Ander Conselvan de Oliveira <[email protected]>Cc Jim Bride <[email protected]>Cc Manasi D Navare <[email protected]>Cc Durgadoss R <[email protected]>Signed-off-by Ville Syrjälä <[email protected]>--- drivers/gpu/drm/i915/intel_dp.c | 154 +++++++++++++++++----------------------- 1 file changed, 66 insertions(+), 88 deletions(-)drivers/gpu/drm/i915/intel_dp.c +8
-15@@ -3842,15 +3842,6 @@ intel_dp_check_mst_status(struct intel_dp *intel_dp) bret =intel_dp_get_sink_irq_esi (intel_dp, esi); go_again:if (bret == true) { - -/* check link status - esi[10] = 0x200c */ -if (intel_dp->active_streams && - !drm_dp_channel_eq_ok (&esi[10 ], intel_dp->lane_count)) { -DRM_DEBUG_KMS ("channel EQ not ok, retraining\n" ); -intel_dp_start_link_train (intel_dp); -intel_dp_stop_link_train (intel_dp); - } -DRM_DEBUG_KMS ("got esi %3ph\n" , esi); ret =drm_dp_mst_hpd_irq (&intel_dp->mst_mgr, esi, &handled);@@ -3886,34 +3877,42 @@ go_again:return -EINVAL ; } -static void -intel_dp_check_link_status (struct intel_dp *intel_dp) +static bool +intel_dp_link_needs_retrain (struct intel_dp *intel_dp) { -struct intel_encoder *intel_encoder = &dp_to_dig_port (intel_dp)->base; -struct drm_device *dev =intel_dp_to_dev (intel_dp);u8 link_status[DP_LINK_STATUS_SIZE ]; -WARN_ON (!drm_modeset_is_locked (&dev->mode_config.connection_mutex)); +if (intel_dp->active_streams ==0 ) +return false; + +if (intel_dp->compliance_test_type ==DP_TEST_LINK_TRAINING ) +return true;if (!intel_dp_get_link_status (intel_dp, link_status)) {DRM_ERROR ("Failed to get link status\n" ); -return ; +return false; }Quoted 6 lines
drivers/gpu/drm/i915/intel_dp.c go_again: · line 3896
Quoted 3 lines
drivers/gpu/drm/i915/intel_dp.c +1
-2-if (!intel_encoder->base.crtc) -return ; +return !drm_dp_channel_eq_ok (link_status, intel_dp->lane_count);According to the DP spec, we should also check for the clock recovery bit in DPCD We should also add a check
drm_dp_clock_recovery_ok(link_status, intel_dp->lane_count)
Quoted 2 lines
I think
drm_dp_channel_eq_ok()checks all the bits:INTERLANE_ALIGN_DONE,CR_DONE,EQ_DONE, andSYMBOL_LOCKED.
It only checks for EQ_DONE and INTERLANE_ALIGN_DONE. drm_dp_clock_recovery_ok() checks for DP_LANE_CR_DONE bit.
Quoted 63 lines
Anyways, while I was looking at the short pulse handling a bit more, I came to the conclusion that we should rewrite it a bit.
The CTS docs seem to say that we're expected to read DPCD 0x200-0x205 on short pulse, and use that information to determine what we should do. Currently we don't do that.
So I was thunking that we'd adjust the
link_statusstuff to read 0x200-0x207 instead of 0x202-0x207, like so:(quoted diff) +2
-2-#define DP_LINK_STATUS_SIZE 6 +#define DP_LINK_STATUS_SIZE 8 static u8 dp_link_status(const u8 link_status[DP_LINK_STATUS_SIZE], int r) { - return link_status[r - DP_LANE0_1_STATUS]; + return link_status[r - DP_SINK_COUNT]; }And then we'd use something like this as our short pulse handler:
static bool
intel_dp_short_pulse(struct intel_dp *intel_dp){ u8 link_status[DP_LINK_STATUS_SIZE], tmp; /* * Clearing compliance test variables to allow capturing * of values for next automated test request. */ intel_dp->compliance_test_active = 0; intel_dp->compliance_test_type = 0; intel_dp->compliance_test_data = 0; if (!intel_dp_get_link_status(intel_dp, link_status)) return false; tmp = drm_dp_link_status(link_status, DP_DEVICE_SERVICE_IRQ_VECTOR); if (tmp) drm_dp_dpcd_writeb(&intel_dp->aux, DP_DEVICE_SERVICE_IRQ_VECTOR, tmp); if (tmp & DP_AUTOMATED_TEST_REQUEST) DRM_DEBUG_DRIVER("Test request in short pulse not handled\n"); if (tmp & (DP_CP_IRQ | DP_SINK_SPECIFIC_IRQ)) DRM_DEBUG_DRIVER("CP or sink specific irq unhandled\n"); tmp = drm_dp_link_status(link_status, DP_LANE_ALIGN_STATUS_UPDATED); if (tmp & DP_DOWNSTREAM_PORT_STATUS_CHANGED) return false; tmp = drm_dp_link_status(link_status, DP_SINK_COUNT); if (DP_GET_SINK_COUNT(tmp) != intel_dp->sink_count) return false; if (intel_dp->active_streams != 0 && !drm_dp_channel_eq_ok(link_status, intel_dp->lane_count)) return false; return true; }
Quoted 3 lines
and obviously fill in whatever else sink irq handling we need.
Thoughts? Does that look sane?
Yes all the Link maintenance tests in CTS spec expect DPCD registers 0200h-0205h to be read on loss of symbol lock or loss of clock recovery. So I think it makes sense to read 0200-0205h.
Quoted 119 lines
<snip>
Quoted 26 lines
Quoted 26 lines
static enum
drm_connector_statusintel_dp_detect(struct drm_connector *connector, bool force){drivers/gpu/drm/i915/intel_dp.c +2
-13struct intel_dp *intel_dp =intel_attached_dp (connector); -struct intel_digital_port *intel_dig_port =dp_to_dig_port (intel_dp); -struct intel_encoder *intel_encoder = &intel_dig_port->base;struct intel_connector *intel_connector =to_intel_connector (connector); +enum drm_connector_status status;DRM_DEBUG_KMS ("[CONNECTOR:%d:%s]\n" , connector->base.id, connector->name); -if (intel_dp->is_mst) { -/* MST devices are disconnected from a monitor POV */ -intel_dp_unset_edid (intel_dp); -if (intel_encoder->type !=INTEL_OUTPUT_EDP ) - intel_encoder->type =INTEL_OUTPUT_DP ; -return connector_status_disconnected; - } - -/* If full detect is not performed yet, do a full detect */ -if (!intel_dp->detect_done) -intel_dp_long_pulse (intel_dp->attached_connector); + status =intel_dp_long_pulse (intel_connector);Quoted 7 lines
drivers/gpu/drm/i915/intel_dp.c intel_dp_long_pulse(struct intel_connector *intel_connector) · line 4325
Quoted 2 lines
drivers/gpu/drm/i915/intel_dp.c +1
-1- intel_dp->detect_done = false; +if (status == connector_status_connected || intel_dp->is_mst)Whya re we not checking for (!intel_encoder->crtc.base) before retraining? I had seen issues with connected boot case when connector status is connected and if it tries to retrain it fails with retries because there is no active pipe. In that case it should not attempt to retrain.
I changed it to use
intel_dp->active_streamsinstead. That'll work for MST as well as SST. Checking for the crtc would only cover SST.Quoted 80 lines
Quoted 80 lines
drivers/gpu/drm/i915/intel_dp.c +31
-31+intel_dp_link_retrain (intel_dp); -if (is_edp (intel_dp) || intel_connector->detect_edid) -return connector_status_connected; -else -return connector_status_disconnected; +return status; } static void@@ -4706,39 +4682,41 @@ intel_dp_hpd_pulse(struct intel_digital_port *intel_dig_port, bool long_hpd)port_name (intel_dig_port->port), long_hpd ? "long" : "short"); +if (long_hpd) +return IRQ_NONE ; + power_domain =intel_display_port_aux_power_domain (intel_encoder);intel_display_power_get (dev_priv, power_domain); -if (long_hpd) { -intel_dp_long_pulse (intel_dp->attached_connector); -if (intel_dp->is_mst) - ret =IRQ_HANDLED ; - goto put_power; - - }else { -if (intel_dp->is_mst) { -if (intel_dp_check_mst_status (intel_dp) == -EINVAL ) { -/* -* If we were in MST mode, and device is not -* there, get out of MST mode -*/ -DRM_DEBUG_KMS ("MST device may have disappeared %d vs %d\n" , - intel_dp->is_mst, intel_dp->mst_mgr.mst_state); - intel_dp->is_mst = false; -drm_dp_mst_topology_mgr_set_mst (&intel_dp->mst_mgr, - intel_dp->is_mst); - goto put_power; - } - } - -if (!intel_dp->is_mst) { -if (!intel_dp_short_pulse (intel_dp)) { -intel_dp_long_pulse (intel_dp->attached_connector); - goto put_power; - } +if (intel_dp->is_mst) { +if (intel_dp_check_mst_status (intel_dp) == -EINVAL ) { +/* +* If we were in MST mode, and device is not +* there, get out of MST mode +*/ +DRM_DEBUG_KMS ("MST device may have disappeared %d vs %d\n" , + intel_dp->is_mst, intel_dp->mst_mgr.mst_state); + intel_dp->is_mst = false; +drm_dp_mst_topology_mgr_set_mst (&intel_dp->mst_mgr, + intel_dp->is_mst); + goto put_power; } + }else { +if (!intel_dp_short_pulse (intel_dp)) + goto put_power; } +/* +* Link retraining happens from the hotplug work, +* check if we might need to schdule it. +* +* There has been known issues of link loss +* triggerring long pulse, so let's check both +* for short and long pulse. +*/ +if (intel_dp_link_needs_retrain (intel_dp)) + goto put_power; + ret =IRQ_HANDLED ;
Quoted 8 lines
Quoted 4 lines
Quoted 4 lines
drivers/gpu/drm/i915/intel_dp.c +0
-0put_power:Signature · 1 line
2.7.4Signature · 2 lines
Ville Syrjälä Intel OTC
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [PATCH 07/12] drm/i915: Move DP link retraining into intel_dp_detect()
Quoted 83 lines · Manasi Navare
Quoted 82 lines · Ville Syrjälä
Quoted 80 lines · Manasi Navare
Quoted 66 lines · On Thu, Jul 28, 2016 at 05:50:43PM +0300, [email protected] wrote:
From: Ville Syrjälä <[email protected]>
DP link retraining needs to grab some modeset locks to not race with modesets, so we can't really do it safely from the
hpd_pulse, lest we risk deadlocking due to MST sideband stuff.Move the link retraining to happen from the hotplug work instead. Doing at the end of
intel_dp_detect()seems like a good place in case the sink already got disconnected, in which case retraining is pointless.To determine if we need to schedule the hotplug work, we'll just check the sink lane status without locks from
hpd_pulse. A little racy still eg. due to useingintel_dp->lane_count, but no less racy than what we already had. We'll repeat the check in fromintel_dp_detect()with proper locking, where we'll also check if the link as actually active or not.Cc Ander Conselvan de Oliveira <[email protected]>Cc Jim Bride <[email protected]>Cc Manasi D Navare <[email protected]>Cc Durgadoss R <[email protected]>Signed-off-by Ville Syrjälä <[email protected]>--- drivers/gpu/drm/i915/intel_dp.c | 154 +++++++++++++++++----------------------- 1 file changed, 66 insertions(+), 88 deletions(-)drivers/gpu/drm/i915/intel_dp.c +7
-14@@ -3842,15 +3842,6 @@ intel_dp_check_mst_status(struct intel_dp *intel_dp) bret =intel_dp_get_sink_irq_esi (intel_dp, esi); go_again:if (bret == true) { - -/* check link status - esi[10] = 0x200c */ -if (intel_dp->active_streams && - !drm_dp_channel_eq_ok (&esi[10 ], intel_dp->lane_count)) { -DRM_DEBUG_KMS ("channel EQ not ok, retraining\n" ); -intel_dp_start_link_train (intel_dp); -intel_dp_stop_link_train (intel_dp); - } -DRM_DEBUG_KMS ("got esi %3ph\n" , esi); ret =drm_dp_mst_hpd_irq (&intel_dp->mst_mgr, esi, &handled);@@ -3886,34 +3877,42 @@ go_again:return -EINVAL ; } -static void -intel_dp_check_link_status (struct intel_dp *intel_dp) +static bool +intel_dp_link_needs_retrain (struct intel_dp *intel_dp) { -struct intel_encoder *intel_encoder = &dp_to_dig_port (intel_dp)->base; -struct drm_device *dev =intel_dp_to_dev (intel_dp);u8 link_status[DP_LINK_STATUS_SIZE ]; -WARN_ON (!drm_modeset_is_locked (&dev->mode_config.connection_mutex)); +if (intel_dp->active_streams ==0 ) +return false; + +if (intel_dp->compliance_test_type ==DP_TEST_LINK_TRAINING ) +return true;drivers/gpu/drm/i915/intel_dp.c go_again: · line 3896
Quoted 10 lines
drivers/gpu/drm/i915/intel_dp.c +2
-3if (!intel_dp_get_link_status (intel_dp, link_status)) {DRM_ERROR ("Failed to get link status\n" ); -return ; +return false; } -if (!intel_encoder->base.crtc) -return ; +return !drm_dp_channel_eq_ok (link_status, intel_dp->lane_count);According to the DP spec, we should also check for the clock recovery bit in DPCD We should also add a check
drm_dp_clock_recovery_ok(link_status, intel_dp->lane_count)
Quoted 4 lines
Quoted 2 lines
I think
drm_dp_channel_eq_ok()checks all the bits:INTERLANE_ALIGN_DONE,CR_DONE,EQ_DONE, andSYMBOL_LOCKED.It only checks for
EQ_DONEandINTERLANE_ALIGN_DONE.
It checks DP_CHANNEL_EQ_BITS which is
#define DP_CHANNEL_EQ_BITS (DP_LANE_CR_DONE | \
DP_LANE_CHANNEL_EQ_DONE | \
DP_LANE_SYMBOL_LOCKED)Quoted 2 lines
drm_dp_clock_recovery_ok()checks forDP_LANE_CR_DONEbit.Quoted 1 line
Signature · 6 lines
Ville Syrjälä Intel OTC _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [PATCH 07/12] drm/i915: Move DP link retraining into intel_dp_detect()
Quoted 87 lines · Ville Syrjälä
Quoted 86 lines · Manasi Navare
Quoted 84 lines · Ville Syrjälä
Quoted 74 lines · Manasi Navare
Quoted 73 lines · On Thu, Jul 28, 2016 at 05:50:43PM +0300, [email protected] wrote:
From: Ville Syrjälä <[email protected]>
DP link retraining needs to grab some modeset locks to not race with modesets, so we can't really do it safely from the
hpd_pulse, lest we risk deadlocking due to MST sideband stuff.Move the link retraining to happen from the hotplug work instead. Doing at the end of
intel_dp_detect()seems like a good place in case the sink already got disconnected, in which case retraining is pointless.To determine if we need to schedule the hotplug work, we'll just check the sink lane status without locks from
hpd_pulse. A little racy still eg. due to useingintel_dp->lane_count, but no less racy than what we already had. We'll repeat the check in fromintel_dp_detect()with proper locking, where we'll also check if the link as actually active or not.Cc Ander Conselvan de Oliveira <[email protected]>Cc Jim Bride <[email protected]>Cc Manasi D Navare <[email protected]>Cc Durgadoss R <[email protected]>Signed-off-by Ville Syrjälä <[email protected]>--- drivers/gpu/drm/i915/intel_dp.c | 154 +++++++++++++++++----------------------- 1 file changed, 66 insertions(+), 88 deletions(-)drivers/gpu/drm/i915/intel_dp.c +8
-15@@ -3842,15 +3842,6 @@ intel_dp_check_mst_status(struct intel_dp *intel_dp) bret =intel_dp_get_sink_irq_esi (intel_dp, esi); go_again:if (bret == true) { - -/* check link status - esi[10] = 0x200c */ -if (intel_dp->active_streams && - !drm_dp_channel_eq_ok (&esi[10 ], intel_dp->lane_count)) { -DRM_DEBUG_KMS ("channel EQ not ok, retraining\n" ); -intel_dp_start_link_train (intel_dp); -intel_dp_stop_link_train (intel_dp); - } -DRM_DEBUG_KMS ("got esi %3ph\n" , esi); ret =drm_dp_mst_hpd_irq (&intel_dp->mst_mgr, esi, &handled);@@ -3886,34 +3877,42 @@ go_again:return -EINVAL ; } -static void -intel_dp_check_link_status (struct intel_dp *intel_dp) +static bool +intel_dp_link_needs_retrain (struct intel_dp *intel_dp) { -struct intel_encoder *intel_encoder = &dp_to_dig_port (intel_dp)->base; -struct drm_device *dev =intel_dp_to_dev (intel_dp);u8 link_status[DP_LINK_STATUS_SIZE ]; -WARN_ON (!drm_modeset_is_locked (&dev->mode_config.connection_mutex)); +if (intel_dp->active_streams ==0 ) +return false; + +if (intel_dp->compliance_test_type ==DP_TEST_LINK_TRAINING ) +return true;if (!intel_dp_get_link_status (intel_dp, link_status)) {DRM_ERROR ("Failed to get link status\n" ); -return ; +return false; }Quoted 6 lines
drivers/gpu/drm/i915/intel_dp.c go_again: · line 3896
Quoted 3 lines
drivers/gpu/drm/i915/intel_dp.c +1
-2-if (!intel_encoder->base.crtc) -return ; +return !drm_dp_channel_eq_ok (link_status, intel_dp->lane_count);According to the DP spec, we should also check for the clock recovery bit in DPCD We should also add a check
drm_dp_clock_recovery_ok(link_status, intel_dp->lane_count)I think
drm_dp_channel_eq_ok()checks all the bits:INTERLANE_ALIGN_DONE,CR_DONE,EQ_DONE, andSYMBOL_LOCKED.
Quoted 8 lines
Quoted 1 line
It only checks for
EQ_DONEandINTERLANE_ALIGN_DONE.It checks
DP_CHANNEL_EQ_BITSwhich is#define DP_CHANNEL_EQ_BITS (DP_LANE_CR_DONE | \ DP_LANE_CHANNEL_EQ_DONE | \ DP_LANE_SYMBOL_LOCKED)
Ok looks good then.
Manasi
Quoted 6 lines
Quoted 2 lines
drm_dp_clock_recovery_ok()checks forDP_LANE_CR_DONEbit.Quoted 1 line
Signature · 2 lines
Ville Syrjälä Intel OTC
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [PATCH 07/12] drm/i915: Move DP link retraining into intel_dp_detect()
In reply to Manasi NavareQuoted 265 lines · Manasi Navare
Quoted 82 lines · Ville Syrjälä
Quoted 74 lines · Manasi Navare
Quoted 73 lines · On Thu, Jul 28, 2016 at 05:50:43PM +0300, [email protected] wrote:
From: Ville Syrjälä <[email protected]>
DP link retraining needs to grab some modeset locks to not race with modesets, so we can't really do it safely from the
hpd_pulse, lest we risk deadlocking due to MST sideband stuff.Move the link retraining to happen from the hotplug work instead. Doing at the end of
intel_dp_detect()seems like a good place in case the sink already got disconnected, in which case retraining is pointless.To determine if we need to schedule the hotplug work, we'll just check the sink lane status without locks from
hpd_pulse. A little racy still eg. due to useingintel_dp->lane_count, but no less racy than what we already had. We'll repeat the check in fromintel_dp_detect()with proper locking, where we'll also check if the link as actually active or not.Cc Ander Conselvan de Oliveira <[email protected]>Cc Jim Bride <[email protected]>Cc Manasi D Navare <[email protected]>Cc Durgadoss R <[email protected]>Signed-off-by Ville Syrjälä <[email protected]>--- drivers/gpu/drm/i915/intel_dp.c | 154 +++++++++++++++++----------------------- 1 file changed, 66 insertions(+), 88 deletions(-)drivers/gpu/drm/i915/intel_dp.c +8
-15@@ -3842,15 +3842,6 @@ intel_dp_check_mst_status(struct intel_dp *intel_dp) bret =intel_dp_get_sink_irq_esi (intel_dp, esi); go_again:if (bret == true) { - -/* check link status - esi[10] = 0x200c */ -if (intel_dp->active_streams && - !drm_dp_channel_eq_ok (&esi[10 ], intel_dp->lane_count)) { -DRM_DEBUG_KMS ("channel EQ not ok, retraining\n" ); -intel_dp_start_link_train (intel_dp); -intel_dp_stop_link_train (intel_dp); - } -DRM_DEBUG_KMS ("got esi %3ph\n" , esi); ret =drm_dp_mst_hpd_irq (&intel_dp->mst_mgr, esi, &handled);@@ -3886,34 +3877,42 @@ go_again:return -EINVAL ; } -static void -intel_dp_check_link_status (struct intel_dp *intel_dp) +static bool +intel_dp_link_needs_retrain (struct intel_dp *intel_dp) { -struct intel_encoder *intel_encoder = &dp_to_dig_port (intel_dp)->base; -struct drm_device *dev =intel_dp_to_dev (intel_dp);u8 link_status[DP_LINK_STATUS_SIZE ]; -WARN_ON (!drm_modeset_is_locked (&dev->mode_config.connection_mutex)); +if (intel_dp->active_streams ==0 ) +return false; + +if (intel_dp->compliance_test_type ==DP_TEST_LINK_TRAINING ) +return true;if (!intel_dp_get_link_status (intel_dp, link_status)) {DRM_ERROR ("Failed to get link status\n" ); -return ; +return false; }Quoted 6 lines
drivers/gpu/drm/i915/intel_dp.c go_again: · line 3896
Quoted 3 lines
drivers/gpu/drm/i915/intel_dp.c +1
-2-if (!intel_encoder->base.crtc) -return ; +return !drm_dp_channel_eq_ok (link_status, intel_dp->lane_count);According to the DP spec, we should also check for the clock recovery bit in DPCD We should also add a check
drm_dp_clock_recovery_ok(link_status, intel_dp->lane_count)Quoted 2 lines
I think
drm_dp_channel_eq_ok()checks all the bits:INTERLANE_ALIGN_DONE,CR_DONE,EQ_DONE, andSYMBOL_LOCKED.It only checks for
EQ_DONEandINTERLANE_ALIGN_DONE.drm_dp_clock_recovery_ok()checks forDP_LANE_CR_DONEbit.Quoted 63 lines
Anyways, while I was looking at the short pulse handling a bit more, I came to the conclusion that we should rewrite it a bit.
The CTS docs seem to say that we're expected to read DPCD 0x200-0x205 on short pulse, and use that information to determine what we should do. Currently we don't do that.
So I was thunking that we'd adjust the
link_statusstuff to read 0x200-0x207 instead of 0x202-0x207, like so:(quoted diff) +2
-2-#define DP_LINK_STATUS_SIZE 6 +#define DP_LINK_STATUS_SIZE 8 static u8 dp_link_status(const u8 link_status[DP_LINK_STATUS_SIZE], int r) { - return link_status[r - DP_LANE0_1_STATUS]; + return link_status[r - DP_SINK_COUNT]; }And then we'd use something like this as our short pulse handler:
static bool
intel_dp_short_pulse(struct intel_dp *intel_dp){ u8 link_status[DP_LINK_STATUS_SIZE], tmp; /* * Clearing compliance test variables to allow capturing * of values for next automated test request. */ intel_dp->compliance_test_active = 0; intel_dp->compliance_test_type = 0; intel_dp->compliance_test_data = 0; if (!intel_dp_get_link_status(intel_dp, link_status)) return false; tmp = drm_dp_link_status(link_status, DP_DEVICE_SERVICE_IRQ_VECTOR); if (tmp) drm_dp_dpcd_writeb(&intel_dp->aux, DP_DEVICE_SERVICE_IRQ_VECTOR, tmp); if (tmp & DP_AUTOMATED_TEST_REQUEST) DRM_DEBUG_DRIVER("Test request in short pulse not handled\n"); if (tmp & (DP_CP_IRQ | DP_SINK_SPECIFIC_IRQ)) DRM_DEBUG_DRIVER("CP or sink specific irq unhandled\n"); tmp = drm_dp_link_status(link_status, DP_LANE_ALIGN_STATUS_UPDATED); if (tmp & DP_DOWNSTREAM_PORT_STATUS_CHANGED) return false; tmp = drm_dp_link_status(link_status, DP_SINK_COUNT); if (DP_GET_SINK_COUNT(tmp) != intel_dp->sink_count) return false; if (intel_dp->active_streams != 0 && !drm_dp_channel_eq_ok(link_status, intel_dp->lane_count)) return false; return true; }Quoted 3 lines
and obviously fill in whatever else sink irq handling we need.
Thoughts? Does that look sane?
Yes all the Link maintenance tests in CTS spec expect DPCD registers 0200h-0205h to be read on loss of symbol lock or loss of clock recovery. So I think it makes sense to read 0200-0205h.
Quoted 106 lines
<snip>
Quoted 26 lines
Quoted 26 lines
static enum
drm_connector_statusintel_dp_detect(struct drm_connector *connector, bool force){drivers/gpu/drm/i915/intel_dp.c +2
-13struct intel_dp *intel_dp =intel_attached_dp (connector); -struct intel_digital_port *intel_dig_port =dp_to_dig_port (intel_dp); -struct intel_encoder *intel_encoder = &intel_dig_port->base;struct intel_connector *intel_connector =to_intel_connector (connector); +enum drm_connector_status status;DRM_DEBUG_KMS ("[CONNECTOR:%d:%s]\n" , connector->base.id, connector->name); -if (intel_dp->is_mst) { -/* MST devices are disconnected from a monitor POV */ -intel_dp_unset_edid (intel_dp); -if (intel_encoder->type !=INTEL_OUTPUT_EDP ) - intel_encoder->type =INTEL_OUTPUT_DP ; -return connector_status_disconnected; - } - -/* If full detect is not performed yet, do a full detect */ -if (!intel_dp->detect_done) -intel_dp_long_pulse (intel_dp->attached_connector); + status =intel_dp_long_pulse (intel_connector);Quoted 7 lines
drivers/gpu/drm/i915/intel_dp.c intel_dp_long_pulse(struct intel_connector *intel_connector) · line 4325
Quoted 2 lines
drivers/gpu/drm/i915/intel_dp.c +1
-1- intel_dp->detect_done = false; +if (status == connector_status_connected || intel_dp->is_mst)Whya re we not checking for (!intel_encoder->crtc.base) before retraining? I had seen issues with connected boot case when connector status is connected and if it tries to retrain it fails with retries because there is no active pipe. In that case it should not attempt to retrain.
I changed it to use
intel_dp->active_streamsinstead. That'll work for MST as well as SST. Checking for the crtc would only cover SST.Quoted 67 lines
Quoted 67 lines
drivers/gpu/drm/i915/intel_dp.c +20
-31+intel_dp_link_retrain (intel_dp); -if (is_edp (intel_dp) || intel_connector->detect_edid) -return connector_status_connected; -else -return connector_status_disconnected; +return status; } static void@@ -4706,39 +4682,41 @@ intel_dp_hpd_pulse(struct intel_digital_port *intel_dig_port, bool long_hpd)port_name (intel_dig_port->port), long_hpd ? "long" : "short"); +if (long_hpd) +return IRQ_NONE ; + power_domain =intel_display_port_aux_power_domain (intel_encoder);intel_display_power_get (dev_priv, power_domain); -if (long_hpd) { -intel_dp_long_pulse (intel_dp->attached_connector); -if (intel_dp->is_mst) - ret =IRQ_HANDLED ; - goto put_power; - - }else { -if (intel_dp->is_mst) { -if (intel_dp_check_mst_status (intel_dp) == -EINVAL ) { -/* -* If we were in MST mode, and device is not -* there, get out of MST mode -*/ -DRM_DEBUG_KMS ("MST device may have disappeared %d vs %d\n" , - intel_dp->is_mst, intel_dp->mst_mgr.mst_state); - intel_dp->is_mst = false; -drm_dp_mst_topology_mgr_set_mst (&intel_dp->mst_mgr, - intel_dp->is_mst); - goto put_power; - } - } - -if (!intel_dp->is_mst) { -if (!intel_dp_short_pulse (intel_dp)) { -intel_dp_long_pulse (intel_dp->attached_connector); - goto put_power; - } +if (intel_dp->is_mst) { +if (intel_dp_check_mst_status (intel_dp) == -EINVAL ) { +/* +* If we were in MST mode, and device is not +* there, get out of MST mode +*/ +DRM_DEBUG_KMS ("MST device may have disappeared %d vs %d\n" , + intel_dp->is_mst, intel_dp->mst_mgr.mst_state); + intel_dp->is_mst = false; +drm_dp_mst_topology_mgr_set_mst (&intel_dp->mst_mgr, + intel_dp->is_mst); + goto put_power; } + }else { +if (!intel_dp_short_pulse (intel_dp)) + goto put_power; }
Quoted 10 lines
Quoted 10 lines
Quoted 10 lines
drivers/gpu/drm/i915/intel_dp.c intel_dp_hpd_pulse(struct intel_digital_port *intel_dig_port, bool long_hpd) · line 4718
Quoted 10 lines
drivers/gpu/drm/i915/intel_dp.c +10
-0+/* +* Link retraining happens from the hotplug work, +* check if we might need to schdule it. +* +* There has been known issues of link loss +* triggerring long pulse, so let's check both +* for short and long pulse. +*/ +if (intel_dp_link_needs_retrain (intel_dp)) + goto put_power;
What happens in case of link loss triggering long pulse, does this link retraining also get handled in intel_dp_detect()?
Manasi
Quoted 8 lines
Quoted 8 lines
Quoted 7 lines
Quoted 7 lines
drivers/gpu/drm/i915/intel_dp.c +1
-0+ ret =IRQ_HANDLED ; put_power:Signature · 1 line
2.7.4
Quoted 7 lines
Quoted 3 lines
Signature · 2 lines
Ville Syrjälä Intel OTC_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [PATCH 07/12] drm/i915: Move DP link retraining into intel_dp_detect()
Quoted 266 lines · Manasi Navare
Quoted 265 lines · Manasi Navare
Quoted 82 lines · Ville Syrjälä
Quoted 74 lines · Manasi Navare
Quoted 73 lines · On Thu, Jul 28, 2016 at 05:50:43PM +0300, [email protected] wrote:
From: Ville Syrjälä <[email protected]>
DP link retraining needs to grab some modeset locks to not race with modesets, so we can't really do it safely from the
hpd_pulse, lest we risk deadlocking due to MST sideband stuff.Move the link retraining to happen from the hotplug work instead. Doing at the end of
intel_dp_detect()seems like a good place in case the sink already got disconnected, in which case retraining is pointless.To determine if we need to schedule the hotplug work, we'll just check the sink lane status without locks from
hpd_pulse. A little racy still eg. due to useingintel_dp->lane_count, but no less racy than what we already had. We'll repeat the check in fromintel_dp_detect()with proper locking, where we'll also check if the link as actually active or not.Cc Ander Conselvan de Oliveira <[email protected]>Cc Jim Bride <[email protected]>Cc Manasi D Navare <[email protected]>Cc Durgadoss R <[email protected]>Signed-off-by Ville Syrjälä <[email protected]>--- drivers/gpu/drm/i915/intel_dp.c | 154 +++++++++++++++++----------------------- 1 file changed, 66 insertions(+), 88 deletions(-)drivers/gpu/drm/i915/intel_dp.c +8
-15@@ -3842,15 +3842,6 @@ intel_dp_check_mst_status(struct intel_dp *intel_dp) bret =intel_dp_get_sink_irq_esi (intel_dp, esi); go_again:if (bret == true) { - -/* check link status - esi[10] = 0x200c */ -if (intel_dp->active_streams && - !drm_dp_channel_eq_ok (&esi[10 ], intel_dp->lane_count)) { -DRM_DEBUG_KMS ("channel EQ not ok, retraining\n" ); -intel_dp_start_link_train (intel_dp); -intel_dp_stop_link_train (intel_dp); - } -DRM_DEBUG_KMS ("got esi %3ph\n" , esi); ret =drm_dp_mst_hpd_irq (&intel_dp->mst_mgr, esi, &handled);@@ -3886,34 +3877,42 @@ go_again:return -EINVAL ; } -static void -intel_dp_check_link_status (struct intel_dp *intel_dp) +static bool +intel_dp_link_needs_retrain (struct intel_dp *intel_dp) { -struct intel_encoder *intel_encoder = &dp_to_dig_port (intel_dp)->base; -struct drm_device *dev =intel_dp_to_dev (intel_dp);u8 link_status[DP_LINK_STATUS_SIZE ]; -WARN_ON (!drm_modeset_is_locked (&dev->mode_config.connection_mutex)); +if (intel_dp->active_streams ==0 ) +return false; + +if (intel_dp->compliance_test_type ==DP_TEST_LINK_TRAINING ) +return true;if (!intel_dp_get_link_status (intel_dp, link_status)) {DRM_ERROR ("Failed to get link status\n" ); -return ; +return false; }Quoted 6 lines
drivers/gpu/drm/i915/intel_dp.c go_again: · line 3896
Quoted 3 lines
drivers/gpu/drm/i915/intel_dp.c +1
-2-if (!intel_encoder->base.crtc) -return ; +return !drm_dp_channel_eq_ok (link_status, intel_dp->lane_count);According to the DP spec, we should also check for the clock recovery bit in DPCD We should also add a check
drm_dp_clock_recovery_ok(link_status, intel_dp->lane_count)Quoted 2 lines
I think
drm_dp_channel_eq_ok()checks all the bits:INTERLANE_ALIGN_DONE,CR_DONE,EQ_DONE, andSYMBOL_LOCKED.It only checks for
EQ_DONEandINTERLANE_ALIGN_DONE.drm_dp_clock_recovery_ok()checks forDP_LANE_CR_DONEbit.Quoted 63 lines
Anyways, while I was looking at the short pulse handling a bit more, I came to the conclusion that we should rewrite it a bit.
The CTS docs seem to say that we're expected to read DPCD 0x200-0x205 on short pulse, and use that information to determine what we should do. Currently we don't do that.
So I was thunking that we'd adjust the
link_statusstuff to read 0x200-0x207 instead of 0x202-0x207, like so:(quoted diff) +2
-2-#define DP_LINK_STATUS_SIZE 6 +#define DP_LINK_STATUS_SIZE 8 static u8 dp_link_status(const u8 link_status[DP_LINK_STATUS_SIZE], int r) { - return link_status[r - DP_LANE0_1_STATUS]; + return link_status[r - DP_SINK_COUNT]; }And then we'd use something like this as our short pulse handler:
static bool
intel_dp_short_pulse(struct intel_dp *intel_dp){ u8 link_status[DP_LINK_STATUS_SIZE], tmp; /* * Clearing compliance test variables to allow capturing * of values for next automated test request. */ intel_dp->compliance_test_active = 0; intel_dp->compliance_test_type = 0; intel_dp->compliance_test_data = 0; if (!intel_dp_get_link_status(intel_dp, link_status)) return false; tmp = drm_dp_link_status(link_status, DP_DEVICE_SERVICE_IRQ_VECTOR); if (tmp) drm_dp_dpcd_writeb(&intel_dp->aux, DP_DEVICE_SERVICE_IRQ_VECTOR, tmp); if (tmp & DP_AUTOMATED_TEST_REQUEST) DRM_DEBUG_DRIVER("Test request in short pulse not handled\n"); if (tmp & (DP_CP_IRQ | DP_SINK_SPECIFIC_IRQ)) DRM_DEBUG_DRIVER("CP or sink specific irq unhandled\n"); tmp = drm_dp_link_status(link_status, DP_LANE_ALIGN_STATUS_UPDATED); if (tmp & DP_DOWNSTREAM_PORT_STATUS_CHANGED) return false; tmp = drm_dp_link_status(link_status, DP_SINK_COUNT); if (DP_GET_SINK_COUNT(tmp) != intel_dp->sink_count) return false; if (intel_dp->active_streams != 0 && !drm_dp_channel_eq_ok(link_status, intel_dp->lane_count)) return false; return true; }Quoted 3 lines
and obviously fill in whatever else sink irq handling we need.
Thoughts? Does that look sane?
Yes all the Link maintenance tests in CTS spec expect DPCD registers 0200h-0205h to be read on loss of symbol lock or loss of clock recovery. So I think it makes sense to read 0200-0205h.
Quoted 106 lines
<snip>
Quoted 26 lines
Quoted 26 lines
static enum
drm_connector_statusintel_dp_detect(struct drm_connector *connector, bool force){drivers/gpu/drm/i915/intel_dp.c +2
-13struct intel_dp *intel_dp =intel_attached_dp (connector); -struct intel_digital_port *intel_dig_port =dp_to_dig_port (intel_dp); -struct intel_encoder *intel_encoder = &intel_dig_port->base;struct intel_connector *intel_connector =to_intel_connector (connector); +enum drm_connector_status status;DRM_DEBUG_KMS ("[CONNECTOR:%d:%s]\n" , connector->base.id, connector->name); -if (intel_dp->is_mst) { -/* MST devices are disconnected from a monitor POV */ -intel_dp_unset_edid (intel_dp); -if (intel_encoder->type !=INTEL_OUTPUT_EDP ) - intel_encoder->type =INTEL_OUTPUT_DP ; -return connector_status_disconnected; - } - -/* If full detect is not performed yet, do a full detect */ -if (!intel_dp->detect_done) -intel_dp_long_pulse (intel_dp->attached_connector); + status =intel_dp_long_pulse (intel_connector);Quoted 7 lines
drivers/gpu/drm/i915/intel_dp.c intel_dp_long_pulse(struct intel_connector *intel_connector) · line 4325
Quoted 2 lines
drivers/gpu/drm/i915/intel_dp.c +1
-1- intel_dp->detect_done = false; +if (status == connector_status_connected || intel_dp->is_mst)Whya re we not checking for (!intel_encoder->crtc.base) before retraining? I had seen issues with connected boot case when connector status is connected and if it tries to retrain it fails with retries because there is no active pipe. In that case it should not attempt to retrain.
I changed it to use
intel_dp->active_streamsinstead. That'll work for MST as well as SST. Checking for the crtc would only cover SST.Quoted 67 lines
Quoted 67 lines
drivers/gpu/drm/i915/intel_dp.c +20
-31+intel_dp_link_retrain (intel_dp); -if (is_edp (intel_dp) || intel_connector->detect_edid) -return connector_status_connected; -else -return connector_status_disconnected; +return status; } static void@@ -4706,39 +4682,41 @@ intel_dp_hpd_pulse(struct intel_digital_port *intel_dig_port, bool long_hpd)port_name (intel_dig_port->port), long_hpd ? "long" : "short"); +if (long_hpd) +return IRQ_NONE ; + power_domain =intel_display_port_aux_power_domain (intel_encoder);intel_display_power_get (dev_priv, power_domain); -if (long_hpd) { -intel_dp_long_pulse (intel_dp->attached_connector); -if (intel_dp->is_mst) - ret =IRQ_HANDLED ; - goto put_power; - - }else { -if (intel_dp->is_mst) { -if (intel_dp_check_mst_status (intel_dp) == -EINVAL ) { -/* -* If we were in MST mode, and device is not -* there, get out of MST mode -*/ -DRM_DEBUG_KMS ("MST device may have disappeared %d vs %d\n" , - intel_dp->is_mst, intel_dp->mst_mgr.mst_state); - intel_dp->is_mst = false; -drm_dp_mst_topology_mgr_set_mst (&intel_dp->mst_mgr, - intel_dp->is_mst); - goto put_power; - } - } - -if (!intel_dp->is_mst) { -if (!intel_dp_short_pulse (intel_dp)) { -intel_dp_long_pulse (intel_dp->attached_connector); - goto put_power; - } +if (intel_dp->is_mst) { +if (intel_dp_check_mst_status (intel_dp) == -EINVAL ) { +/* +* If we were in MST mode, and device is not +* there, get out of MST mode +*/ +DRM_DEBUG_KMS ("MST device may have disappeared %d vs %d\n" , + intel_dp->is_mst, intel_dp->mst_mgr.mst_state); + intel_dp->is_mst = false; +drm_dp_mst_topology_mgr_set_mst (&intel_dp->mst_mgr, + intel_dp->is_mst); + goto put_power; } + }else { +if (!intel_dp_short_pulse (intel_dp)) + goto put_power; }
Quoted 13 lines
Quoted 10 lines
Quoted 10 lines
Quoted 10 lines
drivers/gpu/drm/i915/intel_dp.c intel_dp_hpd_pulse(struct intel_digital_port *intel_dig_port, bool long_hpd) · line 4718
Quoted 10 lines
drivers/gpu/drm/i915/intel_dp.c +10
-0+/* +* Link retraining happens from the hotplug work, +* check if we might need to schdule it. +* +* There has been known issues of link loss +* triggerring long pulse, so let's check both +* for short and long pulse. +*/ +if (intel_dp_link_needs_retrain (intel_dp)) + goto put_power;What happens in case of link loss triggering long pulse, does this link retraining also get handled in
intel_dp_detect()?
Yes, in fact link training is _only_ done from intel_dp_detect(). So if we detect a link loss from a short hpd, we'll schedule the full intel_dp_detect() to retrain the link.
Quoted 17 lines
Manasi
Quoted 15 lines
Quoted 11 lines
Quoted 7 lines
Quoted 7 lines
drivers/gpu/drm/i915/intel_dp.c +1
-0+ ret =IRQ_HANDLED ; put_power:Signature · 1 line
2.7.4Signature · 2 lines
Ville Syrjälä Intel OTC_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Signature · 6 lines
Ville Syrjälä Intel OTC _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [PATCH 07/12] drm/i915: Move DP link retraining into intel_dp_detect()
In reply to [email protected]Quoted 268 lines · On Thu, Jul 28, 2016 at 05:50:43PM +0300, [email protected] wrote:
From: Ville Syrjälä <[email protected]>
DP link retraining needs to grab some modeset locks to not race with modesets, so we can't really do it safely from the
hpd_pulse, lest we risk deadlocking due to MST sideband stuff.Move the link retraining to happen from the hotplug work instead. Doing at the end of
intel_dp_detect()seems like a good place in case the sink already got disconnected, in which case retraining is pointless.To determine if we need to schedule the hotplug work, we'll just check the sink lane status without locks from
hpd_pulse. A little racy still eg. due to useingintel_dp->lane_count, but no less racy than what we already had. We'll repeat the check in fromintel_dp_detect()with proper locking, where we'll also check if the link as actually active or not.Cc Ander Conselvan de Oliveira <[email protected]>Cc Jim Bride <[email protected]>Cc Manasi D Navare <[email protected]>Cc Durgadoss R <[email protected]>Signed-off-by Ville Syrjälä <[email protected]>--- drivers/gpu/drm/i915/intel_dp.c | 154 +++++++++++++++++----------------------- 1 file changed, 66 insertions(+), 88 deletions(-)drivers/gpu/drm/i915/intel_dp.c +47
-88@@ -3842,15 +3842,6 @@ intel_dp_check_mst_status(struct intel_dp *intel_dp) bret =intel_dp_get_sink_irq_esi (intel_dp, esi); go_again:if (bret == true) { - -/* check link status - esi[10] = 0x200c */ -if (intel_dp->active_streams && - !drm_dp_channel_eq_ok (&esi[10 ], intel_dp->lane_count)) { -DRM_DEBUG_KMS ("channel EQ not ok, retraining\n" ); -intel_dp_start_link_train (intel_dp); -intel_dp_stop_link_train (intel_dp); - } -DRM_DEBUG_KMS ("got esi %3ph\n" , esi); ret =drm_dp_mst_hpd_irq (&intel_dp->mst_mgr, esi, &handled);@@ -3886,34 +3877,42 @@ go_again:return -EINVAL ; } -static void -intel_dp_check_link_status (struct intel_dp *intel_dp) +static bool +intel_dp_link_needs_retrain (struct intel_dp *intel_dp) { -struct intel_encoder *intel_encoder = &dp_to_dig_port (intel_dp)->base; -struct drm_device *dev =intel_dp_to_dev (intel_dp);u8 link_status[DP_LINK_STATUS_SIZE ]; -WARN_ON (!drm_modeset_is_locked (&dev->mode_config.connection_mutex)); +if (intel_dp->active_streams ==0 ) +return false; + +if (intel_dp->compliance_test_type ==DP_TEST_LINK_TRAINING ) +return true;if (!intel_dp_get_link_status (intel_dp, link_status)) {DRM_ERROR ("Failed to get link status\n" ); -return ; +return false; } -if (!intel_encoder->base.crtc) -return ; +return !drm_dp_channel_eq_ok (link_status, intel_dp->lane_count); +} -if (!to_intel_crtc (intel_encoder->base.crtc)->active) -return ; +static void +intel_dp_link_retrain (struct intel_dp *intel_dp) +{ +struct intel_encoder *encoder = &dp_to_dig_port (intel_dp)->base; +struct drm_device *dev =intel_dp_to_dev (intel_dp); + +drm_modeset_lock (&dev->mode_config.connection_mutex,NULL ); -/* if link training is requested we should perform it always */ -if ((intel_dp->compliance_test_type ==DP_TEST_LINK_TRAINING ) || - (!drm_dp_channel_eq_ok (link_status, intel_dp->lane_count))) { +if (intel_dp_link_needs_retrain (intel_dp)) {DRM_DEBUG_KMS ("%s: channel EQ not ok, retraining\n" , - intel_encoder->base.name); + encoder->base.name); +intel_dp_start_link_train (intel_dp);intel_dp_stop_link_train (intel_dp); } + +drm_modeset_unlock (&dev->mode_config.connection_mutex); }/* @@ -3932,7 +3931,6 @@ intel_dp_check_link_status(struct intel_dp *intel_dp)static bool intel_dp_short_pulse (struct intel_dp *intel_dp) { -struct drm_device *dev =intel_dp_to_dev (intel_dp);u8 sink_irq_vector;u8 old_sink_count = intel_dp->sink_count;bool ret;@@ -3972,10 +3970,6 @@ intel_dp_short_pulse(struct intel_dp *intel_dp)DRM_DEBUG_DRIVER ("CP or sink specific irq unhandled\n" ); } -drm_modeset_lock (&dev->mode_config.connection_mutex,NULL ); -intel_dp_check_link_status (intel_dp); -drm_modeset_unlock (&dev->mode_config.connection_mutex); -return true; }@@ -3986,6 +3980,8 @@ intel_dp_detect_dpcd(struct intel_dp *intel_dp)uint8_t *dpcd = intel_dp->dpcd;uint8_t type; +WARN_ON (is_edp (intel_dp)); +if (!intel_dp_get_dpcd (intel_dp))return connector_status_disconnected;@@ -4218,7 +4214,7 @@ intel_dp_unset_edid(struct intel_dp *intel_dp) intel_dp->has_audio = false; } -static void +static enum drm_connector_status intel_dp_long_pulse (struct intel_connector *intel_connector) {struct drm_connector *connector = &intel_connector->base;@@ -4273,18 +4269,12 @@ intel_dp_long_pulse(struct intel_connector *intel_connector)*/ status = connector_status_disconnected; goto out; - }else if (connector->status == connector_status_connected) { -/* -* If display was connected already and is still connected -* check links status, there has been known issues of -* link loss triggerring long pulse!!!! -*/ -drm_modeset_lock (&dev->mode_config.connection_mutex,NULL ); -intel_dp_check_link_status (intel_dp); -drm_modeset_unlock (&dev->mode_config.connection_mutex); - goto out; } +/* connected->connected, nothing to do */ +if (connector->status == connector_status_connected) + goto out; +/* * Clearing NACK and defer counts to get their exact values * while reading EDID which are required by Compliance tests @@ -4296,7 +4286,6 @@ intel_dp_long_pulse(struct intel_connector *intel_connector)intel_dp_set_edid (intel_dp); status = connector_status_connected; - intel_dp->detect_done = true;/* Try to read the source of the interrupt */ if (intel_dp->dpcd[DP_DPCD_REV] >= 0x11 &&@@ -4313,43 +4302,30 @@ intel_dp_long_pulse(struct intel_connector *intel_connector) } out: -if ((status != connector_status_connected) && - (intel_dp->is_mst == false)) +if (status != connector_status_connected)intel_dp_unset_edid (intel_dp);intel_display_power_put (to_i915 (dev), power_domain); -return ; + +return status; }static enum drm_connector_status intel_dp_detect (struct drm_connector *connector,bool force) {struct intel_dp *intel_dp =intel_attached_dp (connector); -struct intel_digital_port *intel_dig_port =dp_to_dig_port (intel_dp); -struct intel_encoder *intel_encoder = &intel_dig_port->base;struct intel_connector *intel_connector =to_intel_connector (connector); +enum drm_connector_status status;DRM_DEBUG_KMS ("[CONNECTOR:%d:%s]\n" , connector->base.id, connector->name); -if (intel_dp->is_mst) { -/* MST devices are disconnected from a monitor POV */ -intel_dp_unset_edid (intel_dp); -if (intel_encoder->type !=INTEL_OUTPUT_EDP ) - intel_encoder->type =INTEL_OUTPUT_DP ; -return connector_status_disconnected; - } - -/* If full detect is not performed yet, do a full detect */ -if (!intel_dp->detect_done) -intel_dp_long_pulse (intel_dp->attached_connector); + status =intel_dp_long_pulse (intel_connector); - intel_dp->detect_done = false; +if (status == connector_status_connected || intel_dp->is_mst) +intel_dp_link_retrain (intel_dp); -if (is_edp (intel_dp) || intel_connector->detect_edid) -return connector_status_connected; -else -return connector_status_disconnected; +return status; } static void@@ -4706,39 +4682,41 @@ intel_dp_hpd_pulse(struct intel_digital_port *intel_dig_port, bool long_hpd)port_name (intel_dig_port->port), long_hpd ? "long" : "short"); +if (long_hpd) +return IRQ_NONE ; + power_domain =intel_display_port_aux_power_domain (intel_encoder);intel_display_power_get (dev_priv, power_domain); -if (long_hpd) { -intel_dp_long_pulse (intel_dp->attached_connector); -if (intel_dp->is_mst) - ret =IRQ_HANDLED ; - goto put_power; - - }else { -if (intel_dp->is_mst) { -if (intel_dp_check_mst_status (intel_dp) == -EINVAL ) { -/* -* If we were in MST mode, and device is not -* there, get out of MST mode -*/ -DRM_DEBUG_KMS ("MST device may have disappeared %d vs %d\n" , - intel_dp->is_mst, intel_dp->mst_mgr.mst_state); - intel_dp->is_mst = false; -drm_dp_mst_topology_mgr_set_mst (&intel_dp->mst_mgr, - intel_dp->is_mst); - goto put_power; - } - } - -if (!intel_dp->is_mst) { -if (!intel_dp_short_pulse (intel_dp)) { -intel_dp_long_pulse (intel_dp->attached_connector); - goto put_power; - } +if (intel_dp->is_mst) { +if (intel_dp_check_mst_status (intel_dp) == -EINVAL ) { +/* +* If we were in MST mode, and device is not +* there, get out of MST mode +*/ + DRM_DEBUG_KMS("MST device may have disappeared %d vs %d\n",
drivers/gpu/drm/i915/intel_dp.c intel_dp_hpd_pulse(struct intel_digital_port *intel_dig_port, bool long_hpd) · line 4707
Quoted 10 lines
drivers/gpu/drm/i915/intel_dp.c +8
-0+ intel_dp->is_mst, intel_dp->mst_mgr.mst_state); + intel_dp->is_mst = false; +drm_dp_mst_topology_mgr_set_mst (&intel_dp->mst_mgr, + intel_dp->is_mst); + goto put_power; } + }else { +if (!intel_dp_short_pulse (intel_dp)) + goto put_power; }
Don't we need a way for short pulses to be processed on MST connections as well? In particular, I'm thinking of DP compliance testing on MST topologies.
Jim
Quoted 16 lines
drivers/gpu/drm/i915/intel_dp.c +11
-0+/* +* Link retraining happens from the hotplug work, +* check if we might need to schdule it. +* +* There has been known issues of link loss +* triggerring long pulse, so let's check both +* for short and long pulse. +*/ +if (intel_dp_link_needs_retrain (intel_dp)) + goto put_power; + ret =IRQ_HANDLED ; put_power:Signature · 1 line
2.7.4
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH 8/12 drm/i915: Skip dpcd/edid read unless there was a long hpd
In reply to [email protected]From: Ville Syrjälä <[email protected]>
Supposedly nothing should have change in the DPCD/EDID deparment unless there was a long HPD. Let's skip the work in ->detect() in that case. We'll still want to do the link status check thouhg.
--- drivers/gpu/drm/i915/intel_dp.c | 19 +++++++++++++++---- drivers/gpu/drm/i915/intel_drv.h | 2 +- 2 files changed, 16 insertions(+), 5 deletions(-)
drivers/gpu/drm/i915/intel_dp.c +15 -4
@@ -4315,12 +4315,15 @@ intel_dp_detect(struct drm_connector *connector, bool force) {struct intel_dp *intel_dp =intel_attached_dp (connector);struct intel_connector *intel_connector =to_intel_connector (connector); -enum drm_connector_status status; +enum drm_connector_status status = connector->status;DRM_DEBUG_KMS ("[CONNECTOR:%d:%s]\n" , connector->base.id, connector->name); - status =intel_dp_long_pulse (intel_connector); +if (intel_dp->long_hpd_pending) { + intel_dp->long_hpd_pending = false; + status =intel_dp_long_pulse (intel_connector); + }if (status == connector_status_connected || intel_dp->is_mst)intel_dp_link_retrain (intel_dp);
@@ -4608,6 +4611,8 @@ void intel_dp_encoder_reset(struct drm_encoder *encoder)struct drm_i915_private *dev_priv =to_i915 (encoder->dev);struct intel_dp *intel_dp =enc_to_intel_dp (encoder); + intel_dp->long_hpd_pending = true; +if (!HAS_DDI (dev_priv)) intel_dp->DP =I915_READ (intel_dp->output_reg);
@@ -4682,8 +4687,10 @@ intel_dp_hpd_pulse(struct intel_digital_port *intel_dig_port, bool long_hpd)port_name (intel_dig_port->port), long_hpd ? "long" : "short"); -if (long_hpd) +if (long_hpd) { + intel_dp->long_hpd_pending = true;return IRQ_NONE ; + } power_domain =intel_display_port_aux_power_domain (intel_encoder);intel_display_power_get (dev_priv, power_domain);
@@ -4699,11 +4706,14 @@ intel_dp_hpd_pulse(struct intel_digital_port *intel_dig_port, bool long_hpd) intel_dp->is_mst = false;drm_dp_mst_topology_mgr_set_mst (&intel_dp->mst_mgr, intel_dp->is_mst); + intel_dp->long_hpd_pending = true; goto put_power; } }else { -if (!intel_dp_short_pulse (intel_dp)) +if (!intel_dp_short_pulse (intel_dp)) { + intel_dp->long_hpd_pending = true; goto put_power; + } }/*
@@ -5512,6 +5522,7 @@ intel_dp_init_connector(struct intel_digital_port *intel_dig_port, intel_dig_port->max_lanes, port_name(port)))return false; + intel_dp->long_hpd_pending = true; intel_dp->pps_pipe =INVALID_PIPE ;/* intel_dp vfuncs */
drivers/gpu/drm/i915/intel_drv.h +1 -1
@@ -854,7 +854,7 @@ struct intel_dp {uint8_t sink_count;bool link_mst;bool has_audio; -bool detect_done; +bool long_hpd_pending;enum hdmi_force_audio force_audio;bool limited_color_range;bool color_range_auto;
Signature · 6 lines
2.7.4 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [PATCH 08/12] drm/i915: Skip dpcd/edid read unless there was a long hpd
Quoted 22 lines · On Thu, Jul 28, 2016 at 05:50:44PM +0300, [email protected] wrote:
From: Ville Syrjälä <[email protected]>
Supposedly nothing should have change in the DPCD/EDID deparment unless there was a long HPD. Let's skip the work in ->detect() in that case. We'll still want to do the link status check thouhg.
Cc Ander Conselvan de Oliveira <[email protected]>Cc Jim Bride <[email protected]>Cc Manasi D Navare <[email protected]>Cc Durgadoss R <[email protected]>Signed-off-by Ville Syrjälä <[email protected]>--- drivers/gpu/drm/i915/intel_dp.c | 19 +++++++++++++++---- drivers/gpu/drm/i915/intel_drv.h | 2 +- 2 files changed, 16 insertions(+), 5 deletions(-)drivers/gpu/drm/i915/intel_dp.c +0
-0@@ -4315,12 +4315,15 @@ intel_dp_detect(struct drm_connector *connector, bool force) {
drivers/gpu/drm/i915/intel_dp.c intel_dp_detect(struct drm_connector *connector, bool force) · line 4323
Quoted 10 lines
drivers/gpu/drm/i915/intel_dp.c +2
-2struct intel_dp *intel_dp =intel_attached_dp (connector);struct intel_connector *intel_connector =to_intel_connector (connector); -enum drm_connector_status status; +enum drm_connector_status status = connector->status;DRM_DEBUG_KMS ("[CONNECTOR:%d:%s]\n" , connector->base.id, connector->name); - status =intel_dp_long_pulse (intel_connector); +if (intel_dp->long_hpd_pending) {
Set from a worker unlocked, consumed unlocked. At the very least you want a WRITE_ONCE() to document this should be unset before intel_dp_long_pulse(), if (cmpxchg(long_hpd_pending, 1, 0) {} and a smp_store_mb() when setting for belt-and-braces approach.
drivers/gpu/drm/i915/intel_drv.h struct intel_dp { · line 857
Quoted 9 lines
drivers/gpu/drm/i915/intel_drv.h +0
-1@@ -854,7 +854,7 @@ struct intel_dp {uint8_t sink_count;bool link_mst;bool has_audio; -bool detect_done;
Unrelated cleanup?
Quoted 4 lines
drivers/gpu/drm/i915/intel_drv.h +1
-0+bool long_hpd_pending;enum hdmi_force_audio force_audio;bool limited_color_range;bool color_range_auto;
Signature · 5 lines
Chris Wilson, Intel Open Source Technology Centre _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [PATCH 08/12] drm/i915: Skip dpcd/edid read unless there was a long hpd
Quoted 31 lines · Chris Wilson
Quoted 30 lines · On Thu, Jul 28, 2016 at 05:50:44PM +0300, [email protected] wrote:
From: Ville Syrjälä <[email protected]>
Supposedly nothing should have change in the DPCD/EDID deparment unless there was a long HPD. Let's skip the work in ->detect() in that case. We'll still want to do the link status check thouhg.
Cc Ander Conselvan de Oliveira <[email protected]>Cc Jim Bride <[email protected]>Cc Manasi D Navare <[email protected]>Cc Durgadoss R <[email protected]>Signed-off-by Ville Syrjälä <[email protected]>--- drivers/gpu/drm/i915/intel_dp.c | 19 +++++++++++++++---- drivers/gpu/drm/i915/intel_drv.h | 2 +- 2 files changed, 16 insertions(+), 5 deletions(-)drivers/gpu/drm/i915/intel_dp.c +1
-1@@ -4315,12 +4315,15 @@ intel_dp_detect(struct drm_connector *connector, bool force) {struct intel_dp *intel_dp =intel_attached_dp (connector);struct intel_connector *intel_connector =to_intel_connector (connector); -enum drm_connector_status status; +enum drm_connector_status status = connector->status;DRM_DEBUG_KMS ("[CONNECTOR:%d:%s]\n" , connector->base.id, connector->name);
Quoted 7 lines
drivers/gpu/drm/i915/intel_dp.c intel_dp_detect(struct drm_connector *connector, bool force) · line 4323
Quoted 2 lines
drivers/gpu/drm/i915/intel_dp.c +1
-1- status =intel_dp_long_pulse (intel_connector); +if (intel_dp->long_hpd_pending) {Set from a worker unlocked, consumed unlocked. At the very least you want a
WRITE_ONCE()to document this should be unset beforeintel_dp_long_pulse(), if (cmpxchg(long_hpd_pending, 1, 0){} and asmp_store_mb()when setting for belt-and-braces approach.
Yeah, I guess we should do something like that. There is other junk also getting set/checked unlocked in this work as well, and I haven't had the energy to figure it all out yet.
Quoted 12 lines
drivers/gpu/drm/i915/intel_drv.h struct intel_dp { · line 857
Quoted 10 lines
drivers/gpu/drm/i915/intel_drv.h +0
-1@@ -854,7 +854,7 @@ struct intel_dp {uint8_t sink_count;bool link_mst;bool has_audio; -bool detect_done;Unrelated cleanup?
That one should be part of the previous patch, I think.
Quoted 8 lines
Quoted 5 lines
drivers/gpu/drm/i915/intel_drv.h +1
-0+bool long_hpd_pending;enum hdmi_force_audio force_audio;bool limited_color_range;bool color_range_auto;Signature · 1 line
Chris Wilson, Intel Open Source Technology Centre
Signature · 6 lines
Ville Syrjälä Intel OTC _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH 9/12 drm/i915: Remove useless rate_to_index() usage
In reply to [email protected]From: Ville Syrjälä <[email protected]>
No need to iterate the rates array in intel_dp_max_link_rate(). We know the max rate will be the last entry, and we already know the size.
--- drivers/gpu/drm/i915/intel_dp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/i915/intel_dp.c +1 -1
@@ -1447,7 +1447,7 @@ intel_dp_max_link_rate(struct intel_dp *intel_dp)if (WARN_ON (len <=0 ))return 162000 ; -return rates[rate_to_index (0 , rates) -1 ]; +return rates[len -1 ]; }int intel_dp_rate_select (struct intel_dp *intel_dp,int rate)
Signature · 6 lines
2.7.4 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [PATCH 09/12] drm/i915: Remove useless rate_to_index() usage
Quoted 10 lines · On Thu, Jul 28, 2016 at 05:50:45PM +0300, [email protected] wrote:
From: Ville Syrjälä <[email protected]>
No need to iterate the rates array in
intel_dp_max_link_rate(). We know the max rate will be the last entry, and we already know the size.Cc Ander Conselvan de Oliveira <[email protected]>Cc Jim Bride <[email protected]>Cc Manasi D Navare <[email protected]>Cc Durgadoss R <[email protected]>Signed-off-by Ville Syrjälä <[email protected]>
Yeah, that's some rather convoluted logic.
Quoted 24 lines
--- drivers/gpu/drm/i915/intel_dp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/gpu/drm/i915/intel_dp.c +1
-1@@ -1447,7 +1447,7 @@ intel_dp_max_link_rate(struct intel_dp *intel_dp)if (WARN_ON (len <=0 ))return 162000 ; -return rates[rate_to_index (0 , rates) -1 ]; +return rates[len -1 ]; }int intel_dp_rate_select (struct intel_dp *intel_dp,int rate)Signature · 6 lines
2.7.4 _______________________________________________ Intel-gfx mailing list [email protected] https://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] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH 10/12 drm/i915: Allow rate_to_index() to return non-exact matches
In reply to [email protected]From: Ville Syrjälä <[email protected]>
Let's make rate_to_index() return the highest rate available that's less than or equal to the rate requested by the caller. The function can then be used to filter out rates higher than a certain maximum rate.
--- drivers/gpu/drm/i915/intel_dp.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-)
drivers/gpu/drm/i915/intel_dp.c +5 -2
@@ -1431,10 +1431,13 @@ static int rate_to_index(int find, const int *rates)int i =0 ;for (i =0 ; i <DP_MAX_SUPPORTED_RATES ; ++i) -if (find == rates[i]) +if (find < rates[i])break ; -return i; +if (WARN_ON (i ==0 )) +return 0 ; + +return i -1 ; }int
Signature · 6 lines
2.7.4 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [PATCH 10/12] drm/i915: Allow rate_to_index() to return non-exact matches
Quoted 7 lines · On Thu, Jul 28, 2016 at 05:50:46PM +0300, [email protected] wrote:
From: Ville Syrjälä <[email protected]>
Let's make
rate_to_index()return the highest rate available that's less than or equal to the rate requested by the caller. The function can then be used to filter out rates higher than a certain maximum rate.
Quoted 5 lines
Cc Ander Conselvan de Oliveira <[email protected]>Cc Jim Bride <[email protected]>Cc Manasi D Navare <[email protected]>Cc Durgadoss R <[email protected]>Signed-off-by Ville Syrjälä <[email protected]>
Not sure what this will be used for, couldn't figure it out looking at later patches?
-Daneil
Quoted 31 lines
--- drivers/gpu/drm/i915/intel_dp.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-)drivers/gpu/drm/i915/intel_dp.c +5
-2@@ -1431,10 +1431,13 @@ static int rate_to_index(int find, const int *rates)int i =0 ;for (i =0 ; i <DP_MAX_SUPPORTED_RATES ; ++i) -if (find == rates[i]) +if (find < rates[i])break ; -return i; +if (WARN_ON (i ==0 )) +return 0 ; + +return i -1 ; }int Signature · 6 lines
2.7.4 _______________________________________________ Intel-gfx mailing list [email protected] https://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] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [PATCH 10/12] drm/i915: Allow rate_to_index() to return non-exact matches
Quoted 8 lines · Daniel Vetter
Quoted 7 lines · On Thu, Jul 28, 2016 at 05:50:46PM +0300, [email protected] wrote:
From: Ville Syrjälä <[email protected]>
Let's make
rate_to_index()return the highest rate available that's less than or equal to the rate requested by the caller. The function can then be used to filter out rates higher than a certain maximum rate.
Quoted 8 lines
Quoted 5 lines
Cc Ander Conselvan de Oliveira <[email protected]>Cc Jim Bride <[email protected]>Cc Manasi D Navare <[email protected]>Cc Durgadoss R <[email protected]>Signed-off-by Ville Syrjälä <[email protected]>Not sure what this will be used for, couldn't figure it out looking at later patches?
Ah, forgot to mention that part. It seemed like there was a hunk in the upfront link training patch that could use this, rather than hand rolling yet another way of looking through the rate array.
Quoted 38 lines
-Daneil
Quoted 31 lines
--- drivers/gpu/drm/i915/intel_dp.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-)drivers/gpu/drm/i915/intel_dp.c +5
-2@@ -1431,10 +1431,13 @@ static int rate_to_index(int find, const int *rates)int i =0 ;for (i =0 ; i <DP_MAX_SUPPORTED_RATES ; ++i) -if (find == rates[i]) +if (find < rates[i])break ; -return i; +if (WARN_ON (i ==0 )) +return 0 ; + +return i -1 ; }int Signature · 6 lines
2.7.4 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfxSignature · 3 lines
Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch
Signature · 6 lines
Ville Syrjälä Intel OTC _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH 11/12 drm/i915: Don't try to ack sink irqs when there are none
In reply to [email protected]From: Ville Syrjälä <[email protected]>
My ASUS PB278 at least doesn't seem to appreciate when you try to ack sink irqs when there are none. Results in thus sort of dmesg spam [drm:drm_dp_dpcd_access] too many retries, giving up
Let's skip the ack if there are no pending irqs. I have no clue why we do this in two places. One of them likely should just go away. Oh, and MST has its own sink irq handler too...
--- drivers/gpu/drm/i915/intel_dp.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-)
drivers/gpu/drm/i915/intel_dp.c +6 -4
@@ -3934,7 +3934,7 @@ intel_dp_link_retrain(struct intel_dp *intel_dp)static bool intel_dp_short_pulse (struct intel_dp *intel_dp) { -u8 sink_irq_vector; +u8 sink_irq_vector =0 ;u8 old_sink_count = intel_dp->sink_count;bool ret;
@@ -3961,7 +3961,8 @@ intel_dp_short_pulse(struct intel_dp *intel_dp)/* Try to read the source of the interrupt */ if (intel_dp->dpcd[DP_DPCD_REV ] >=0x11 && -intel_dp_get_sink_irq (intel_dp, &sink_irq_vector)) { +intel_dp_get_sink_irq (intel_dp, &sink_irq_vector) && + sink_irq_vector !=0 ) {/* Clear interrupt source */ drm_dp_dpcd_writeb(&intel_dp->aux, DP_DEVICE_SERVICE_IRQ_VECTOR,
@@ -4227,7 +4228,7 @@ intel_dp_long_pulse(struct intel_connector *intel_connector)struct drm_device *dev = connector->dev;enum drm_connector_status status;enum intel_display_power_domain power_domain; -u8 sink_irq_vector; +u8 sink_irq_vector =0 ; power_domain =intel_display_port_aux_power_domain (intel_encoder);intel_display_power_get (to_i915 (dev), power_domain);
@@ -4292,7 +4293,8 @@ intel_dp_long_pulse(struct intel_connector *intel_connector)/* Try to read the source of the interrupt */ if (intel_dp->dpcd[DP_DPCD_REV ] >=0x11 && -intel_dp_get_sink_irq (intel_dp, &sink_irq_vector)) { +intel_dp_get_sink_irq (intel_dp, &sink_irq_vector) && + sink_irq_vector !=0 ) {/* Clear interrupt source */ drm_dp_dpcd_writeb(&intel_dp->aux, DP_DEVICE_SERVICE_IRQ_VECTOR,
Signature · 6 lines
2.7.4 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [PATCH 11/12] drm/i915: Don't try to ack sink irqs when there are none
Quoted 11 lines · On Thu, Jul 28, 2016 at 05:50:47PM +0300, [email protected] wrote:
From: Ville Syrjälä <[email protected]>
My ASUS PB278 at least doesn't seem to appreciate when you try to ack sink irqs when there are none. Results in thus sort of dmesg spam [drm:drm_dp_dpcd_access] too many retries, giving up
Let's skip the ack if there are no pending irqs. I have no clue why we do this in two places. One of them likely should just go away. Oh, and MST has its own sink irq handler too...
Signed-off-by Ville Syrjälä <[email protected]>
Yeah it's a mess still :( Change itself makes sense.
Quoted 53 lines
--- drivers/gpu/drm/i915/intel_dp.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-)drivers/gpu/drm/i915/intel_dp.c +6
-4@@ -3934,7 +3934,7 @@ intel_dp_link_retrain(struct intel_dp *intel_dp)static bool intel_dp_short_pulse (struct intel_dp *intel_dp) { -u8 sink_irq_vector; +u8 sink_irq_vector =0 ;u8 old_sink_count = intel_dp->sink_count;bool ret;@@ -3961,7 +3961,8 @@ intel_dp_short_pulse(struct intel_dp *intel_dp)/* Try to read the source of the interrupt */ if (intel_dp->dpcd[DP_DPCD_REV ] >=0x11 && -intel_dp_get_sink_irq (intel_dp, &sink_irq_vector)) { +intel_dp_get_sink_irq (intel_dp, &sink_irq_vector) && + sink_irq_vector !=0 ) {/* Clear interrupt source */ drm_dp_dpcd_writeb(&intel_dp->aux, DP_DEVICE_SERVICE_IRQ_VECTOR,@@ -4227,7 +4228,7 @@ intel_dp_long_pulse(struct intel_connector *intel_connector)struct drm_device *dev = connector->dev;enum drm_connector_status status;enum intel_display_power_domain power_domain; -u8 sink_irq_vector; +u8 sink_irq_vector =0 ; power_domain =intel_display_port_aux_power_domain (intel_encoder);intel_display_power_get (to_i915 (dev), power_domain);@@ -4292,7 +4293,8 @@ intel_dp_long_pulse(struct intel_connector *intel_connector)/* Try to read the source of the interrupt */ if (intel_dp->dpcd[DP_DPCD_REV ] >=0x11 && -intel_dp_get_sink_irq (intel_dp, &sink_irq_vector)) { +intel_dp_get_sink_irq (intel_dp, &sink_irq_vector) && + sink_irq_vector !=0 ) {/* Clear interrupt source */ drm_dp_dpcd_writeb(&intel_dp->aux, DP_DEVICE_SERVICE_IRQ_VECTOR,Signature · 6 lines
2.7.4 _______________________________________________ Intel-gfx mailing list [email protected] https://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] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
RFC PATCH 12/12 drm/i915: Add encoder .sync_state() hook
In reply to [email protected]From: Ville Syrjälä <[email protected]>
We cache a bunch of state under the encoders (eg. link freq and lane count for DP). We need to refresh that cached state on init/resume during hardware readout. Since we have already read out most interesting details into the pipe config, let's add a new optional encoder hook that can move the information from the pipe config into the encoder.
We can't really use the pipe config directly since this cached information is used during link retraining, which doesn't have access to a pipe config (mainly due to MST). Redoing MST in a way where the actual link would be part of the modeset with its own pipe config could be an alternative solution, but that would be a much more massive undertaking. For now, let's at least try to keep the two pieces of state in sync.
--- drivers/gpu/drm/i915/intel_ddi.c | 4 ++++ drivers/gpu/drm/i915/intel_display.c | 4 ++++ drivers/gpu/drm/i915/intel_dp.c | 18 ++++++++++++++++++ drivers/gpu/drm/i915/intel_drv.h | 7 +++++++ 4 files changed, 33 insertions(+)
drivers/gpu/drm/i915/intel_ddi.c +4 -0
@@ -2314,6 +2314,9 @@ intel_ddi_init_hdmi_connector(struct intel_digital_port *intel_dig_port)return connector; } +void intel_dp_sync_state (struct intel_encoder *encoder, +const struct intel_crtc_state *pipe_config); +void intel_ddi_init (struct drm_device *dev,enum port port) {struct drm_i915_private *dev_priv =to_i915 (dev);
@@ -2377,6 +2380,7 @@ void intel_ddi_init(struct drm_device *dev, enum port port) intel_encoder->post_disable = intel_ddi_post_disable; intel_encoder->get_hw_state = intel_ddi_get_hw_state; intel_encoder->get_config = intel_ddi_get_config; + intel_encoder->sync_state = intel_dp_sync_state; intel_encoder->suspend = intel_dp_encoder_suspend; intel_dig_port->port = port;
drivers/gpu/drm/i915/intel_display.c +4 -0
@@ -16031,8 +16031,12 @@ static void intel_modeset_readout_hw_state(struct drm_device *dev) encoder->base.crtc = &crtc->base; crtc->config->output_types |=1 << encoder->type; encoder->get_config (encoder, crtc->config); +if (encoder->sync_state) + encoder->sync_state (encoder, crtc->config); }else { encoder->base.crtc =NULL ; +if (encoder->sync_state) + encoder->sync_state (encoder,NULL ); } DRM_DEBUG_KMS("[ENCODER:%d:%s] hw state readout: %s, pipe %c\n",
drivers/gpu/drm/i915/intel_dp.c +18 -0
@@ -2482,6 +2482,23 @@ static void intel_dp_get_config(struct intel_encoder *encoder, } } +void intel_dp_sync_state (struct intel_encoder *encoder, +const struct intel_crtc_state *pipe_config) +{ +struct intel_dp *intel_dp =enc_to_intel_dp (&encoder->base); + +if (pipe_config) { +/* FIXME MST */ + intel_dp->active_streams =1 ; + intel_dp->link_rate = pipe_config->port_clock; + intel_dp->lane_count = pipe_config->lane_count; + }else { + intel_dp->active_streams =0 ; + intel_dp->link_rate =0 ; + intel_dp->lane_count =0 ; + } +} +static void intel_disable_dp (struct intel_encoder *encoder) {struct intel_dp *intel_dp =enc_to_intel_dp (&encoder->base);
@@ -5675,6 +5692,7 @@ bool intel_dp_init(struct drm_device *dev, intel_encoder->disable = intel_disable_dp; intel_encoder->get_hw_state = intel_dp_get_hw_state; intel_encoder->get_config = intel_dp_get_config; + intel_encoder->sync_state = intel_dp_sync_state; intel_encoder->suspend = intel_dp_encoder_suspend;if (IS_CHERRYVIEW (dev)) { intel_encoder->pre_pll_enable = chv_dp_pre_pll_enable;
drivers/gpu/drm/i915/intel_drv.h +7 -0
@@ -213,6 +213,13 @@ struct intel_encoder {void (*get_config)(struct intel_encoder *,struct intel_crtc_state *pipe_config);/* +* Used during init/resume to sync any cached state +* stored outside the pipe config (eg. active DP link +* parameters). +*/ +void (*sync_state)(struct intel_encoder *, +const struct intel_crtc_state *); +/* * Called during system suspend after all pending requests for the * encoder are flushed (for example for DP AUX transactions) and * device interrupts are disabled.
Signature · 6 lines
2.7.4 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [RFC][PATCH 12/12] drm/i915: Add encoder .sync_state() hook
Quoted 17 lines · On Thu, Jul 28, 2016 at 05:50:48PM +0300, [email protected] wrote:
From: Ville Syrjälä <[email protected]>
We cache a bunch of state under the encoders (eg. link freq and lane count for DP). We need to refresh that cached state on init/resume during hardware readout. Since we have already read out most interesting details into the pipe config, let's add a new optional encoder hook that can move the information from the pipe config into the encoder.
We can't really use the pipe config directly since this cached information is used during link retraining, which doesn't have access to a pipe config (mainly due to MST). Redoing MST in a way where the actual link would be part of the modeset with its own pipe config could be an alternative solution, but that would be a much more massive undertaking. For now, let's at least try to keep the two pieces of state in sync.
Quoted 1 line
Signed-off-by Ville Syrjälä <[email protected]>
I really don't like that we have state stored in non-state structure places. Especially with upfront link training at hpd time it probably makes sense to figure this all out at compute_config time, and then store it in the crtc state. Ok probably it needs to be somewhere else, not attached to crtc, so maybe an array of port states. And cross-checking would be real great for this too ...
-Daniel
Quoted 107 lines
--- drivers/gpu/drm/i915/intel_ddi.c | 4 ++++ drivers/gpu/drm/i915/intel_display.c | 4 ++++ drivers/gpu/drm/i915/intel_dp.c | 18 ++++++++++++++++++ drivers/gpu/drm/i915/intel_drv.h | 7 +++++++ 4 files changed, 33 insertions(+)drivers/gpu/drm/i915/intel_ddi.c +4
-0@@ -2314,6 +2314,9 @@ intel_ddi_init_hdmi_connector(struct intel_digital_port *intel_dig_port)return connector; } +void intel_dp_sync_state (struct intel_encoder *encoder, +const struct intel_crtc_state *pipe_config); +void intel_ddi_init (struct drm_device *dev,enum port port) {struct drm_i915_private *dev_priv =to_i915 (dev);@@ -2377,6 +2380,7 @@ void intel_ddi_init(struct drm_device *dev, enum port port) intel_encoder->post_disable = intel_ddi_post_disable; intel_encoder->get_hw_state = intel_ddi_get_hw_state; intel_encoder->get_config = intel_ddi_get_config; + intel_encoder->sync_state = intel_dp_sync_state; intel_encoder->suspend = intel_dp_encoder_suspend; intel_dig_port->port = port;drivers/gpu/drm/i915/intel_display.c +4
-0@@ -16031,8 +16031,12 @@ static void intel_modeset_readout_hw_state(struct drm_device *dev) encoder->base.crtc = &crtc->base; crtc->config->output_types |=1 << encoder->type; encoder->get_config (encoder, crtc->config); +if (encoder->sync_state) + encoder->sync_state (encoder, crtc->config); }else { encoder->base.crtc =NULL ; +if (encoder->sync_state) + encoder->sync_state (encoder,NULL ); } DRM_DEBUG_KMS("[ENCODER:%d:%s] hw state readout: %s, pipe %c\n",drivers/gpu/drm/i915/intel_dp.c +18
-0@@ -2482,6 +2482,23 @@ static void intel_dp_get_config(struct intel_encoder *encoder, } } +void intel_dp_sync_state (struct intel_encoder *encoder, +const struct intel_crtc_state *pipe_config) +{ +struct intel_dp *intel_dp =enc_to_intel_dp (&encoder->base); + +if (pipe_config) { +/* FIXME MST */ + intel_dp->active_streams =1 ; + intel_dp->link_rate = pipe_config->port_clock; + intel_dp->lane_count = pipe_config->lane_count; + }else { + intel_dp->active_streams =0 ; + intel_dp->link_rate =0 ; + intel_dp->lane_count =0 ; + } +} +static void intel_disable_dp (struct intel_encoder *encoder) {struct intel_dp *intel_dp =enc_to_intel_dp (&encoder->base);@@ -5675,6 +5692,7 @@ bool intel_dp_init(struct drm_device *dev, intel_encoder->disable = intel_disable_dp; intel_encoder->get_hw_state = intel_dp_get_hw_state; intel_encoder->get_config = intel_dp_get_config; + intel_encoder->sync_state = intel_dp_sync_state; intel_encoder->suspend = intel_dp_encoder_suspend;if (IS_CHERRYVIEW (dev)) { intel_encoder->pre_pll_enable = chv_dp_pre_pll_enable;drivers/gpu/drm/i915/intel_drv.h +7
-0@@ -213,6 +213,13 @@ struct intel_encoder {void (*get_config)(struct intel_encoder *,struct intel_crtc_state *pipe_config);/* +* Used during init/resume to sync any cached state +* stored outside the pipe config (eg. active DP link +* parameters). +*/ +void (*sync_state)(struct intel_encoder *, +const struct intel_crtc_state *); +/* * Called during system suspend after all pending requests for the * encoder are flushed (for example for DP AUX transactions) and * device interrupts are disabled. Signature · 6 lines
2.7.4 _______________________________________________ Intel-gfx mailing list [email protected] https://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] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Patchwork
CI✗ Ro.CI.BAT: failure for drm/i915: Move DP link retraining to hotplug work etc.
In reply to [email protected]== Series Details ==
== Series Details ==
Series: drm/i915: Move DP link retraining to hotplug work etc.
URL : https://patchwork.freedesktop.org/series/10354/
State : failure
== Summary ==
Series 10354v1 drm/i915: Move DP link retraining to hotplug work etc.
http://patchwork.freedesktop.org/api/1.0/series/10354/revisions/1/mbox
Test drv_module_reload_basic:
skip -> PASS (ro-ivb-i7-3770)
skip -> PASS (ro-skl3-i5-6260u)
Test kms_cursor_legacy:
Subgroup basic-cursor-vs-flip-legacy:
fail -> PASS (ro-ilk1-i5-650)
Subgroup basic-flip-vs-cursor-legacy:
pass -> FAIL (fi-hsw-i7-4770k)
pass -> FAIL (ro-bdw-i5-5250u)
Subgroup basic-flip-vs-cursor-varying-size:
fail -> PASS (ro-snb-i7-2620M)
pass -> FAIL (ro-bdw-i5-5250u)
Test kms_flip:
Subgroup basic-flip-vs-wf_vblank:
fail -> PASS (ro-byt-n2820)fi-hsw-i7-4770k total:239 pass:216 dwarn:0 dfail:0 fail:1 skip:22 fi-kbl-qkkr total:239 pass:181 dwarn:28 dfail:0 fail:3 skip:27 fi-skl-i5-6260u total:239 pass:223 dwarn:0 dfail:0 fail:2 skip:14 fi-skl-i7-6700k total:239 pass:207 dwarn:0 dfail:0 fail:4 skip:28 fi-snb-i7-2600 total:239 pass:197 dwarn:0 dfail:0 fail:0 skip:42 ro-bdw-i5-5250u total:239 pass:217 dwarn:4 dfail:0 fail:2 skip:16 ro-bdw-i7-5557U total:239 pass:221 dwarn:1 dfail:0 fail:1 skip:16 ro-bdw-i7-5600u total:239 pass:206 dwarn:0 dfail:0 fail:1 skip:32 ro-bsw-n3050 total:239 pass:193 dwarn:0 dfail:0 fail:4 skip:42 ro-byt-n2820 total:239 pass:196 dwarn:0 dfail:0 fail:3 skip:40 ro-hsw-i3-4010u total:239 pass:213 dwarn:0 dfail:0 fail:0 skip:26 ro-hsw-i7-4770r total:239 pass:213 dwarn:0 dfail:0 fail:0 skip:26 ro-ilk-i7-620lm total:239 pass:172 dwarn:1 dfail:0 fail:1 skip:65 ro-ilk1-i5-650 total:234 pass:173 dwarn:0 dfail:0 fail:1 skip:60 ro-ivb-i7-3770 total:239 pass:204 dwarn:0 dfail:0 fail:0 skip:35 ro-ivb2-i7-3770 total:239 pass:208 dwarn:0 dfail:0 fail:0 skip:31 ro-skl3-i5-6260u total:239 pass:221 dwarn:0 dfail:0 fail:4 skip:14 ro-snb-i7-2620M total:239 pass:197 dwarn:0 dfail:0 fail:1 skip:41
Results at /archive/results/CI_IGT_test/RO_Patchwork_1633/
cb7629d drm-intel-nightly: 2016y-07m-28d-11h-02m-33s UTC integration manifest ba9e503 drm/i915: Add encoder .sync_state() hook
d5c4353 drm/i915: Don't try to ack sink irqs when there are none b508c1c drm/i915: Allow rate_to_index() to return non-exact matches 08b7db9 drm/i915: Remove useless rate_to_index() usage
5550271 drm/i915: Skip dpcd/edid read unless there was a long hpd d267845 drm/i915: Move DP link retraining into intel_dp_detect() 4cfc2f2 drm/i915: Allow MST sinks to work even if drm_probe_ddc() fails 67bc562 drm/i915: Track active streams also for DP SST
cd47dbf drm/i915: Reject mixing MST and SST/HDMI on the same digital port 6123fa2 drm/i915: Avoid mixing up SST and MST in DDI setup b2addee drm/i915: Read PSR caps/intermediate freqs/etc. only once on eDP 8371771 drm/i915: Ignore initial lid state for eDP
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Patchwork
CI✗ Ro.CI.BAT: failure for drm/i915: Move DP link retraining to hotplug work etc. (rev3)
In reply to [email protected]== Series Details ==
== Series Details ==
Series: drm/i915: Move DP link retraining to hotplug work etc. (rev3)
URL : https://patchwork.freedesktop.org/series/10354/
State : failure
== Summary ==
Series 10354v3 drm/i915: Move DP link retraining to hotplug work etc.
http://patchwork.freedesktop.org/api/1.0/series/10354/revisions/3/mbox
Test drv_module_reload_basic:
skip -> PASS (ro-ivb-i7-3770)
skip -> PASS (ro-skl3-i5-6260u)
Test kms_cursor_legacy:
Subgroup basic-cursor-vs-flip-varying-size:
pass -> FAIL (ro-ilk1-i5-650)
Subgroup basic-flip-vs-cursor-legacy:
pass -> FAIL (ro-bdw-i5-5250u)
Subgroup basic-flip-vs-cursor-varying-size:
fail -> PASS (ro-skl3-i5-6260u)
fail -> PASS (ro-snb-i7-2620M)
pass -> FAIL (ro-bdw-i5-5250u)fi-kbl-qkkr total:239 pass:180 dwarn:29 dfail:0 fail:3 skip:27 fi-skl-i5-6260u total:239 pass:223 dwarn:0 dfail:0 fail:2 skip:14 fi-snb-i7-2600 total:239 pass:197 dwarn:0 dfail:0 fail:0 skip:42 ro-bdw-i5-5250u total:239 pass:217 dwarn:4 dfail:0 fail:2 skip:16 ro-bdw-i7-5557U total:239 pass:222 dwarn:0 dfail:0 fail:1 skip:16 ro-bdw-i7-5600u total:239 pass:206 dwarn:0 dfail:0 fail:1 skip:32 ro-bsw-n3050 total:239 pass:193 dwarn:0 dfail:0 fail:4 skip:42 ro-hsw-i3-4010u total:239 pass:213 dwarn:0 dfail:0 fail:0 skip:26 ro-hsw-i7-4770r total:239 pass:213 dwarn:0 dfail:0 fail:0 skip:26 ro-ilk-i7-620lm total:239 pass:171 dwarn:1 dfail:0 fail:2 skip:65 ro-ilk1-i5-650 total:234 pass:171 dwarn:0 dfail:0 fail:3 skip:60 ro-ivb-i7-3770 total:239 pass:204 dwarn:0 dfail:0 fail:0 skip:35 ro-ivb2-i7-3770 total:239 pass:208 dwarn:0 dfail:0 fail:0 skip:31 ro-skl3-i5-6260u total:239 pass:222 dwarn:0 dfail:0 fail:3 skip:14 ro-snb-i7-2620M total:239 pass:197 dwarn:0 dfail:0 fail:1 skip:41
fi-hsw-i7-4770k failed to connect after reboot
fi-skl-i7-6700k failed to connect after reboot
Results at /archive/results/CI_IGT_test/RO_Patchwork_1643/
cb7629d drm-intel-nightly: 2016y-07m-28d-11h-02m-33s UTC integration manifest 8bbaa8b drm/i915: Add encoder .sync_state() hook1b7b5401 drm/i915: Don't try to ack sink irqs when there are none d2da7a5 drm/i915: Allow rate_to_index() to return non-exact matches 489af04 drm/i915: Remove useless rate_to_index() usage
8a3de80 drm/i915: Skip dpcd/edid read unless there was a long hpd 27363d5 drm/i915: Move DP link retraining into intel_dp_detect() 1c8a5ee drm/i915: Allow MST sinks to work even if drm_probe_ddc() fails 4cb73b1 drm/i915: Track active streams also for DP SST
0d76448 drm/i915: Reject mixing MST and SST/HDMI on the same digital port 3c6377c drm/i915: Avoid mixing up SST and MST in DDI setup 1f1993f drm/i915: Read PSR caps/intermediate freqs/etc. only once on eDP 4512a10 drm/i915: Ignore initial lid state for eDP
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: ✗ Ro.CI.BAT: failure for drm/i915: Move DP link retraining to hotplug work etc. (rev3)
Quoted 11 lines · Patchwork
== Series Details ==
Series: drm/i915: Move DP link retraining to hotplug work etc. (rev3)
URL : https://patchwork.freedesktop.org/series/10354/
State : failure== Summary ==
Series 10354v3 drm/i915: Move DP link retraining to hotplug work etc.
http://patchwork.freedesktop.org/api/1.0/series/10354/revisions/3/mbox
Quoted 6 lines
Test
drv_module_reload_basic:skip -> PASS (ro-ivb-i7-3770) skip -> PASS (ro-skl3-i5-6260u) Test kms_cursor_legacy: Subgroup basic-cursor-vs-flip-varying-size: pass -> FAIL (ro-ilk1-i5-650)
(kms_cursor_legacy:7989) DEBUG: Using a target of 32 cursor updates per half-vblank (kms_cursor_legacy:7989) WARNING: page flip 35 was delayed, missed 1 frames (kms_cursor_legacy:7989) CRITICAL: Test assertion failure function basic_cursor_vs_flip, file kms_cursor_legacy.c:670:
(kms_cursor_legacy:7989) CRITICAL: Failed assertion: vbl.sequence == vblank_start + 60 (kms_cursor_legacy:7989) CRITICAL: error: 11257 != 11256
https://bugs.freedesktop.org/show_bug.cgi?id=96701
Quoted 2 lines
Subgroup basic-flip-vs-cursor-legacy:
pass -> FAIL (ro-bdw-i5-5250u)(kms_cursor_legacy:8659) DEBUG: Test requirement passed: target > 1
(kms_cursor_legacy:8659) DEBUG: Using a target of 64 cursor updates per half-vblank (kms_cursor_legacy:8659) CRITICAL: Test assertion failure function basic_flip_vs_cursor, file kms_cursor_legacy.c:514:
(kms_cursor_legacy:8659) CRITICAL: Failed assertion: get_vblank(display->drm_fd, pipe, 0) == vblank_start (kms_cursor_legacy:8659) CRITICAL: error: 11057 != 11056
https://bugs.freedesktop.org/show_bug.cgi?id=97188
Quoted 4 lines
Subgroup basic-flip-vs-cursor-varying-size:
fail -> PASS (ro-skl3-i5-6260u)
fail -> PASS (ro-snb-i7-2620M)
pass -> FAIL (ro-bdw-i5-5250u)same as the other one
Quoted 34 lines
fi-kbl-qkkr total:239 pass:180 dwarn:29 dfail:0 fail:3 skip:27 fi-skl-i5-6260u total:239 pass:223 dwarn:0 dfail:0 fail:2 skip:14 fi-snb-i7-2600 total:239 pass:197 dwarn:0 dfail:0 fail:0 skip:42 ro-bdw-i5-5250u total:239 pass:217 dwarn:4 dfail:0 fail:2 skip:16 ro-bdw-i7-5557U total:239 pass:222 dwarn:0 dfail:0 fail:1 skip:16 ro-bdw-i7-5600u total:239 pass:206 dwarn:0 dfail:0 fail:1 skip:32 ro-bsw-n3050 total:239 pass:193 dwarn:0 dfail:0 fail:4 skip:42 ro-hsw-i3-4010u total:239 pass:213 dwarn:0 dfail:0 fail:0 skip:26 ro-hsw-i7-4770r total:239 pass:213 dwarn:0 dfail:0 fail:0 skip:26 ro-ilk-i7-620lm total:239 pass:171 dwarn:1 dfail:0 fail:2 skip:65 ro-ilk1-i5-650 total:234 pass:171 dwarn:0 dfail:0 fail:3 skip:60 ro-ivb-i7-3770 total:239 pass:204 dwarn:0 dfail:0 fail:0 skip:35 ro-ivb2-i7-3770 total:239 pass:208 dwarn:0 dfail:0 fail:0 skip:31 ro-skl3-i5-6260u total:239 pass:222 dwarn:0 dfail:0 fail:3 skip:14 ro-snb-i7-2620M total:239 pass:197 dwarn:0 dfail:0 fail:1 skip:41fi-hsw-i7-4770k failed to connect after reboot
fi-skl-i7-6700k failed to connect after rebootResults at /archive/results/CI_IGT_test/RO_Patchwork_1643/
cb7629d drm-intel-nightly: 2016y-07m-28d-11h-02m-33s UTC integration manifest 8bbaa8b drm/i915: Add encoder .sync_state() hook
1b7b5401drm/i915: Don't try to ack sink irqs when there are none d2da7a5 drm/i915: Allowrate_to_index()to return non-exact matches 489af04 drm/i915: Remove uselessrate_to_index()usage
8a3de80 drm/i915: Skip dpcd/edid read unless there was a long hpd 27363d5 drm/i915: Move DP link retraining intointel_dp_detect()1c8a5ee drm/i915: Allow MST sinks to work even ifdrm_probe_ddc()fails 4cb73b1 drm/i915: Track active streams also for DP SST
0d76448 drm/i915: Reject mixing MST and SST/HDMI on the same digital port 3c6377c drm/i915: Avoid mixing up SST and MST in DDI setup 1f1993f drm/i915: Read PSR caps/intermediate freqs/etc. only once on eDP 4512a10 drm/i915: Ignore initial lid state for eDP
Signature · 6 lines
Ville Syrjälä Intel OTC _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Quoted 16 lines · On Thu, Jul 28, 2016 at 05:50:36PM +0300, [email protected] wrote:
From: Ville Syrjälä <[email protected]>
Ok, so while looking at the upfront link training stuff, it became obvious that we needs to do something about the link training stuff that we have in
hpd_pulsecurrently. The thing is, you can't grab any modeset locks from that work since it could lead to a deadlock with MST sideband stuff. So here's a quick attempt at moving the stuff over to the hotplug work.I've included a few other things at the start just to make the surroundings a little less broken (some of that I've posted before). And there are a few potentially helpful snippets at the end too. The main meat is in the middle.
Entire series avaialable here:
git://github.com/vsyrjala/linux.gitdp_retrain_fixes
Quoted 8 lines
Ville Syrjälä (12):
drm/i915: Read PSR caps/intermediate freqs/etc. only once on eDP drm/i915: Avoid mixing up SST and MST in DDI setup drm/i915: Reject mixing MST and SST/HDMI on the same digital port drm/i915: Track active streams also for DP SST drm/i915: Allow MST sinks to work even ifdrm_probe_ddc()fails drm/i915: Remove uselessrate_to_index()usage drm/i915: Don't try to ack sink irqs when there are none
I've pushed these to dinq. Thanks for the reviews.
Quoted 5 lines
drm/i915: Ignore initial lid state for eDP drm/i915: Move DP link retraining into
intel_dp_detect()drm/i915: Skip dpcd/edid read unless there was a long hpd drm/i915: Allowrate_to_index()to return non-exact matches drm/i915: Add encoder .sync_state() hook
These are left over. Probably most of them need some rework/rethinking anyway.
Quoted 15 lines
drivers/gpu/drm/i915/intel_ddi.c | 35 ++-- drivers/gpu/drm/i915/intel_display.c | 14 ++ drivers/gpu/drm/i915/intel_dp.c | 390 ++++++++++++++++++----------------- drivers/gpu/drm/i915/intel_dp_mst.c | 16 +- drivers/gpu/drm/i915/intel_drv.h | 12 +- 5 files changed, 255 insertions(+), 212 deletions(-)Cc Ander Conselvan de Oliveira <[email protected]>Cc Jim Bride <[email protected]>Cc Manasi D Navare <[email protected]>Cc Durgadoss R <[email protected]>Cc Maarten Lankhorst <[email protected]>Signature · 1 line
2.7.4
Signature · 6 lines
Ville Syrjälä Intel OTC _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx