All of lore.kernel.org
 help / color / mirror / Atom feed
From: Lyude <cpaul@redhat.com>
To: intel-gfx@lists.freedesktop.org
Cc: Lyude <cpaul@redhat.com>,
	stable@vger.kernel.org, Daniel Vetter <daniel.vetter@intel.com>,
	Jani Nikula <jani.nikula@linux.intel.com>,
	David Airlie <airlied@linux.ie>,
	dri-devel@lists.freedesktop.org (open list:INTEL DRM DRIVERS
	(excluding Poulsbo, Moorestow...),
	linux-kernel@vger.kernel.org (open list))
Subject: [PATCH] drm/i915/vlv: Enable polling when we shut off all power domains
Date: Thu, 21 Apr 2016 11:44:48 -0400	[thread overview]
Message-ID: <1461253488-18043-1-git-send-email-cpaul@redhat.com> (raw)

Unfortunately HPD isn't functional once we shut off all of the power
domains. Unfortunately we can end up shutting off all of the power
domains in any situation where we don't have any monitors connected,
essentially breaking hpd for the user unless they reboot with one of
their monitors connected.

In addition, enabling polling has to be done in it's own seperate
worker. The reason for this is that vlv_display_power_well_init/deinit()
will get called during the DRM polling process and try to grab the locks
required for turning on polling and cause a deadlock.

This breaks runtime PM due to the constant wakeups, so this is more of a
temporary workaround then a solution.

Signed-off-by: Lyude <cpaul@redhat.com>
Cc: stable@vger.kernel.org
---
 drivers/gpu/drm/i915/intel_display.c | 17 ++++++++++++++++-
 1 file changed, 16 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
index 551541b303..f644814 100644
--- a/drivers/gpu/drm/i915/intel_display.c
+++ b/drivers/gpu/drm/i915/intel_display.c
@@ -14531,7 +14531,22 @@ static void intel_setup_outputs(struct drm_device *dev)
 		    intel_dp_is_edp(dev, PORT_C))
 			intel_dp_init(dev, VLV_DP_C, PORT_C);
 
-		if (IS_CHERRYVIEW(dev)) {
+		if (IS_VALLEYVIEW(dev)) {
+			struct intel_connector *connector;
+
+			/*
+			 * On vlv, turning off all of the power domains results
+			 * in a loss of hpd, enable polling on all of the
+			 * connectors so that drm polls them when this happens
+			 */
+			drm_modeset_lock(&dev->mode_config.connection_mutex,
+					 NULL);
+			for_each_intel_connector(dev, connector) {
+				connector->polled = DRM_CONNECTOR_POLL_CONNECT |
+					DRM_CONNECTOR_POLL_DISCONNECT;
+			}
+			drm_modeset_unlock(&dev->mode_config.connection_mutex);
+		} else if (IS_CHERRYVIEW(dev)) {
 			/* eDP not supported on port D, so don't check VBT */
 			if (I915_READ(CHV_HDMID) & SDVO_DETECTED)
 				intel_hdmi_init(dev, CHV_HDMID, PORT_D);
-- 
2.5.5

WARNING: multiple messages have this Message-ID (diff)
From: Lyude <cpaul@redhat.com>
To: intel-gfx@lists.freedesktop.org
Cc: stable@vger.kernel.org,
	"open list:INTEL DRM DRIVERS excluding Poulsbo, Moorestow...,
	linux-kernel@vger.kernel.org open list"
	<dri-devel@lists.freedesktop.org>,
	Daniel Vetter <daniel.vetter@intel.com>, Lyude <cpaul@redhat.com>
Subject: [PATCH] drm/i915/vlv: Enable polling when we shut off all power domains
Date: Thu, 21 Apr 2016 11:44:48 -0400	[thread overview]
Message-ID: <1461253488-18043-1-git-send-email-cpaul@redhat.com> (raw)

Unfortunately HPD isn't functional once we shut off all of the power
domains. Unfortunately we can end up shutting off all of the power
domains in any situation where we don't have any monitors connected,
essentially breaking hpd for the user unless they reboot with one of
their monitors connected.

In addition, enabling polling has to be done in it's own seperate
worker. The reason for this is that vlv_display_power_well_init/deinit()
will get called during the DRM polling process and try to grab the locks
required for turning on polling and cause a deadlock.

This breaks runtime PM due to the constant wakeups, so this is more of a
temporary workaround then a solution.

Signed-off-by: Lyude <cpaul@redhat.com>
Cc: stable@vger.kernel.org
---
 drivers/gpu/drm/i915/intel_display.c | 17 ++++++++++++++++-
 1 file changed, 16 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
index 551541b303..f644814 100644
--- a/drivers/gpu/drm/i915/intel_display.c
+++ b/drivers/gpu/drm/i915/intel_display.c
@@ -14531,7 +14531,22 @@ static void intel_setup_outputs(struct drm_device *dev)
 		    intel_dp_is_edp(dev, PORT_C))
 			intel_dp_init(dev, VLV_DP_C, PORT_C);
 
-		if (IS_CHERRYVIEW(dev)) {
+		if (IS_VALLEYVIEW(dev)) {
+			struct intel_connector *connector;
+
+			/*
+			 * On vlv, turning off all of the power domains results
+			 * in a loss of hpd, enable polling on all of the
+			 * connectors so that drm polls them when this happens
+			 */
+			drm_modeset_lock(&dev->mode_config.connection_mutex,
+					 NULL);
+			for_each_intel_connector(dev, connector) {
+				connector->polled = DRM_CONNECTOR_POLL_CONNECT |
+					DRM_CONNECTOR_POLL_DISCONNECT;
+			}
+			drm_modeset_unlock(&dev->mode_config.connection_mutex);
+		} else if (IS_CHERRYVIEW(dev)) {
 			/* eDP not supported on port D, so don't check VBT */
 			if (I915_READ(CHV_HDMID) & SDVO_DETECTED)
 				intel_hdmi_init(dev, CHV_HDMID, PORT_D);
-- 
2.5.5

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

             reply	other threads:[~2016-04-21 15:46 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-04-21 15:44 Lyude [this message]
2016-04-21 15:44 ` [PATCH] drm/i915/vlv: Enable polling when we shut off all power domains Lyude
2016-04-22  6:57 ` ✗ Fi.CI.BAT: warning for " Patchwork
2016-04-23 17:36 ` ✓ Fi.CI.BAT: success " Patchwork
2016-06-16 22:05 ` [Intel-gfx] [PATCH] " Daniel Vetter
2016-06-16 22:05   ` Daniel Vetter

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1461253488-18043-1-git-send-email-cpaul@redhat.com \
    --to=cpaul@redhat.com \
    --cc=airlied@linux.ie \
    --cc=daniel.vetter@intel.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=jani.nikula@linux.intel.com \
    --cc=stable@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.