* [PATCH v2] drm/i915: intel_hpd_init(): Fix suspend/resume reprobing [not found] <20160105200951.GT8076@phenom.ffwll.local> @ 2016-01-05 21:15 ` Lyude 2016-01-06 7:27 ` [Intel-gfx] " Daniel Vetter 0 siblings, 1 reply; 4+ messages in thread From: Lyude @ 2016-01-05 21:15 UTC (permalink / raw) To: Daniel Vetter, Jani Nikula, David Airlie, intel-gfx, dri-devel, linux-kernel Cc: Benjamin Tissoires, stable, Lyude This fixes reprobing of display connectors on resume. After some talking with danvet on IRC, I learned that calling drm_helper_hpd_irq_event() does actually trigger a full reprobe of each connector's status. It turns out this is the actual reason reprobing on resume hasn't been working (this was observed on a T440s): - We call hpd_init() - We check each connector for a couple of things before marking connector->polled with DRM_CONNECTOR_POLL_HPD, one of which is an active encoder. Of course, a disconnected port won't have an active encoder, so we don't add the flag to any of the connectors. - We call drm_helper_hpd_irq_event() - drm_helper_irq_event() checks each connector for the DRM_CONNECTOR_POLL_HPD flag. The only one that has it is eDP-1, so we skip reprobing each connector except for that one. In addition, we now avoid setting connector->polled to DRM_CONNECTOR_POLL_HPD for MST connectors, since their reprobing is handled by the mst helpers. This is probably what was originally intended to happen here anyway. Fixes: 0e32b39ceed6 ("drm/i915: add DP 1.2 MST support (v0.7)") Cc: stable@vger.kernel.org Signed-off-by: Lyude <cpaul@redhat.com> --- Changes * Use the explanation of the issue as the commit message instead * Change the title of the commit, since this does more then just stop a check for an encoder now * Add "Fixes" line for the patch that introduced this regression * Don't enable DRM_CONNECTOR_POLL_HPD for mst connectors drivers/gpu/drm/i915/intel_hotplug.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/i915/intel_hotplug.c b/drivers/gpu/drm/i915/intel_hotplug.c index b177857..51ecf0b4 100644 --- a/drivers/gpu/drm/i915/intel_hotplug.c +++ b/drivers/gpu/drm/i915/intel_hotplug.c @@ -468,9 +468,9 @@ void intel_hpd_init(struct drm_i915_private *dev_priv) list_for_each_entry(connector, &mode_config->connector_list, head) { struct intel_connector *intel_connector = to_intel_connector(connector); connector->polled = intel_connector->polled; - if (connector->encoder && !connector->polled && I915_HAS_HOTPLUG(dev) && intel_connector->encoder->hpd_pin > HPD_NONE) - connector->polled = DRM_CONNECTOR_POLL_HPD; - if (intel_connector->mst_port) + if (!connector->polled && !intel_connector->mst_port && + I915_HAS_HOTPLUG(dev) && + intel_connector->encoder->hpd_pin > HPD_NONE) connector->polled = DRM_CONNECTOR_POLL_HPD; } -- 2.5.0 ^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [Intel-gfx] [PATCH v2] drm/i915: intel_hpd_init(): Fix suspend/resume reprobing 2016-01-05 21:15 ` [PATCH v2] drm/i915: intel_hpd_init(): Fix suspend/resume reprobing Lyude @ 2016-01-06 7:27 ` Daniel Vetter 2016-01-07 15:43 ` [PATCH v3] " Lyude 0 siblings, 1 reply; 4+ messages in thread From: Daniel Vetter @ 2016-01-06 7:27 UTC (permalink / raw) To: Lyude Cc: Daniel Vetter, Jani Nikula, David Airlie, intel-gfx, dri-devel, linux-kernel, Benjamin Tissoires, stable On Tue, Jan 05, 2016 at 04:15:30PM -0500, Lyude wrote: > This fixes reprobing of display connectors on resume. After some talking > with danvet on IRC, I learned that calling drm_helper_hpd_irq_event() does > actually trigger a full reprobe of each connector's status. It turns out > this is the actual reason reprobing on resume hasn't been working (this was > observed on a T440s): > > - We call hpd_init() > - We check each connector for a couple of things before marking > connector->polled with DRM_CONNECTOR_POLL_HPD, one of which is an > active encoder. Of course, a disconnected port won't have an > active encoder, so we don't add the flag to any of the > connectors. > - We call drm_helper_hpd_irq_event() > - drm_helper_irq_event() checks each connector for the > DRM_CONNECTOR_POLL_HPD flag. The only one that has it is eDP-1, > so we skip reprobing each connector except for that one. > > In addition, we now avoid setting connector->polled to > DRM_CONNECTOR_POLL_HPD for MST connectors, since their reprobing is handled > by the mst helpers. This is probably what was originally intended to happen > here anyway. > > Fixes: 0e32b39ceed6 ("drm/i915: add DP 1.2 MST support (v0.7)") > Cc: stable@vger.kernel.org > Signed-off-by: Lyude <cpaul@redhat.com> > --- > Changes > * Use the explanation of the issue as the commit message instead > * Change the title of the commit, since this does more then just stop a check > for an encoder now > * Add "Fixes" line for the patch that introduced this regression > * Don't enable DRM_CONNECTOR_POLL_HPD for mst connectors For drm/i915 I prefer when the patch changelog is above the s-o-b section, with v2: v3: ... headings. > > drivers/gpu/drm/i915/intel_hotplug.c | 6 +++--- > 1 file changed, 3 insertions(+), 3 deletions(-) > > diff --git a/drivers/gpu/drm/i915/intel_hotplug.c b/drivers/gpu/drm/i915/intel_hotplug.c > index b177857..51ecf0b4 100644 > --- a/drivers/gpu/drm/i915/intel_hotplug.c > +++ b/drivers/gpu/drm/i915/intel_hotplug.c > @@ -468,9 +468,9 @@ void intel_hpd_init(struct drm_i915_private *dev_priv) > list_for_each_entry(connector, &mode_config->connector_list, head) { > struct intel_connector *intel_connector = to_intel_connector(connector); > connector->polled = intel_connector->polled; > - if (connector->encoder && !connector->polled && I915_HAS_HOTPLUG(dev) && intel_connector->encoder->hpd_pin > HPD_NONE) > - connector->polled = DRM_CONNECTOR_POLL_HPD; > - if (intel_connector->mst_port) > + if (!connector->polled && !intel_connector->mst_port && > + I915_HAS_HOTPLUG(dev) && > + intel_connector->encoder->hpd_pin > HPD_NONE) > connector->polled = DRM_CONNECTOR_POLL_HPD; Hm, on 2nd thought we could clarify this further like this: list_for_each_entry(...) { ... /* MST has a dynamic intel_connector->encoder and it's * reprobing is all handled by the MST helpers. */ if (intel_connector->mst_port) continue; if (!connector->polled && I915_HAS_HOTPLUG(dev) && intel_connector->encoder->hpd_pin > HPD_NONE) connector->polled = DRM_CONNECTOR_POLL_HPD; } That yields even tidier code and gives us a place for a comment. Can you pls respin once more? Thanks, Daniel > } > > -- > 2.5.0 > > _______________________________________________ > Intel-gfx mailing list > Intel-gfx@lists.freedesktop.org > http://lists.freedesktop.org/mailman/listinfo/intel-gfx -- Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch ^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH v3] drm/i915: intel_hpd_init(): Fix suspend/resume reprobing 2016-01-06 7:27 ` [Intel-gfx] " Daniel Vetter @ 2016-01-07 15:43 ` Lyude 2016-01-07 16:10 ` [Intel-gfx] " Daniel Vetter 0 siblings, 1 reply; 4+ messages in thread From: Lyude @ 2016-01-07 15:43 UTC (permalink / raw) To: Daniel Vetter, Jani Nikula, David Airlie, intel-gfx, dri-devel, linux-kernel Cc: Benjamin Tissoires, stable, Lyude This fixes reprobing of display connectors on resume. After some talking with danvet on IRC, I learned that calling drm_helper_hpd_irq_event() does actually trigger a full reprobe of each connector's status. It turns out this is the actual reason reprobing on resume hasn't been working (this was observed on a T440s): - We call hpd_init() - We check each connector for a couple of things before marking connector->polled with DRM_CONNECTOR_POLL_HPD, one of which is an active encoder. Of course, a disconnected port won't have an active encoder, so we don't add the flag to any of the connectors. - We call drm_helper_hpd_irq_event() - drm_helper_irq_event() checks each connector for the DRM_CONNECTOR_POLL_HPD flag. The only one that has it is eDP-1, so we skip reprobing each connector except that one. In addition, we also now avoid setting connector->polled to DRM_CONNECTOR_POLL_HPD for MST connectors, since their reprobing is handled by the mst helpers. This is probably what was originally intended to happen here. Changes since V1: * Use the explanation of the issue as the commit message instead * Change the title of the commit, since this does more then just stop a check for an encoder now * Add "Fixes" line for the patch that introduced this regression * Don't enable DRM_CONNECTOR_POLL_HPD for mst connectors Changes since V2: * Put patch changelog above Signed-off-by * Follow Daniel Vetter's suggestion for making the code here a bit more legible Fixes: 0e32b39ceed6 ("drm/i915: add DP 1.2 MST support (v0.7)") Cc: stable@vger.kernel.org Signed-off-by: Lyude <cpaul@redhat.com> --- drivers/gpu/drm/i915/intel_hotplug.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/i915/intel_hotplug.c b/drivers/gpu/drm/i915/intel_hotplug.c index b177857..d7a6437 100644 --- a/drivers/gpu/drm/i915/intel_hotplug.c +++ b/drivers/gpu/drm/i915/intel_hotplug.c @@ -468,9 +468,14 @@ void intel_hpd_init(struct drm_i915_private *dev_priv) list_for_each_entry(connector, &mode_config->connector_list, head) { struct intel_connector *intel_connector = to_intel_connector(connector); connector->polled = intel_connector->polled; - if (connector->encoder && !connector->polled && I915_HAS_HOTPLUG(dev) && intel_connector->encoder->hpd_pin > HPD_NONE) - connector->polled = DRM_CONNECTOR_POLL_HPD; + + /* MST has a dynamic intel_connector->encoder and it's reprobing + * is all handled by the MST helpers. */ if (intel_connector->mst_port) + continue; + + if (!connector->polled && I915_HAS_HOTPLUG(dev) && + intel_connector->encoder->hpd_pin > HPD_NONE) connector->polled = DRM_CONNECTOR_POLL_HPD; } -- 2.5.0 ^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [Intel-gfx] [PATCH v3] drm/i915: intel_hpd_init(): Fix suspend/resume reprobing 2016-01-07 15:43 ` [PATCH v3] " Lyude @ 2016-01-07 16:10 ` Daniel Vetter 0 siblings, 0 replies; 4+ messages in thread From: Daniel Vetter @ 2016-01-07 16:10 UTC (permalink / raw) To: Lyude Cc: Daniel Vetter, Jani Nikula, David Airlie, intel-gfx, dri-devel, linux-kernel, Benjamin Tissoires, stable On Thu, Jan 07, 2016 at 10:43:28AM -0500, Lyude wrote: > This fixes reprobing of display connectors on resume. After some > talking with danvet on IRC, I learned that calling > drm_helper_hpd_irq_event() does actually trigger a full reprobe of each > connector's status. It turns out this is the actual reason reprobing on > resume hasn't been working (this was observed on a T440s): > > - We call hpd_init() > - We check each connector for a couple of things before marking > connector->polled with DRM_CONNECTOR_POLL_HPD, one of which is an > active encoder. Of course, a disconnected port won't have an > active encoder, so we don't add the flag to any of the > connectors. > - We call drm_helper_hpd_irq_event() > - drm_helper_irq_event() checks each connector for the > DRM_CONNECTOR_POLL_HPD flag. The only one that has it is eDP-1, > so we skip reprobing each connector except that one. > > In addition, we also now avoid setting connector->polled to > DRM_CONNECTOR_POLL_HPD for MST connectors, since their reprobing is > handled by the mst helpers. This is probably what was originally > intended to happen here. > > Changes since V1: > * Use the explanation of the issue as the commit message instead > * Change the title of the commit, since this does more then just stop a > check for an encoder now > * Add "Fixes" line for the patch that introduced this regression > * Don't enable DRM_CONNECTOR_POLL_HPD for mst connectors > > Changes since V2: > * Put patch changelog above Signed-off-by > * Follow Daniel Vetter's suggestion for making the code here a bit more > legible > > Fixes: 0e32b39ceed6 ("drm/i915: add DP 1.2 MST support (v0.7)") > Cc: stable@vger.kernel.org > Signed-off-by: Lyude <cpaul@redhat.com> Awesome, and merged to drm-intel. Thanks, Daniel > --- > drivers/gpu/drm/i915/intel_hotplug.c | 9 +++++++-- > 1 file changed, 7 insertions(+), 2 deletions(-) > > diff --git a/drivers/gpu/drm/i915/intel_hotplug.c b/drivers/gpu/drm/i915/intel_hotplug.c > index b177857..d7a6437 100644 > --- a/drivers/gpu/drm/i915/intel_hotplug.c > +++ b/drivers/gpu/drm/i915/intel_hotplug.c > @@ -468,9 +468,14 @@ void intel_hpd_init(struct drm_i915_private *dev_priv) > list_for_each_entry(connector, &mode_config->connector_list, head) { > struct intel_connector *intel_connector = to_intel_connector(connector); > connector->polled = intel_connector->polled; > - if (connector->encoder && !connector->polled && I915_HAS_HOTPLUG(dev) && intel_connector->encoder->hpd_pin > HPD_NONE) > - connector->polled = DRM_CONNECTOR_POLL_HPD; > + > + /* MST has a dynamic intel_connector->encoder and it's reprobing > + * is all handled by the MST helpers. */ > if (intel_connector->mst_port) > + continue; > + > + if (!connector->polled && I915_HAS_HOTPLUG(dev) && > + intel_connector->encoder->hpd_pin > HPD_NONE) > connector->polled = DRM_CONNECTOR_POLL_HPD; > } > > -- > 2.5.0 > > _______________________________________________ > Intel-gfx mailing list > Intel-gfx@lists.freedesktop.org > http://lists.freedesktop.org/mailman/listinfo/intel-gfx -- Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch ^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2016-01-07 16:11 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <20160105200951.GT8076@phenom.ffwll.local>
2016-01-05 21:15 ` [PATCH v2] drm/i915: intel_hpd_init(): Fix suspend/resume reprobing Lyude
2016-01-06 7:27 ` [Intel-gfx] " Daniel Vetter
2016-01-07 15:43 ` [PATCH v3] " Lyude
2016-01-07 16:10 ` [Intel-gfx] " Daniel Vetter
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for NNTP newsgroup(s).