intel-gfx.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
From: Paulo Zanoni <przanoni@gmail.com>
To: intel-gfx@lists.freedesktop.org
Cc: Paulo Zanoni <paulo.r.zanoni@intel.com>
Subject: [PATCH 4/8] drm/i915: avoid waking up from PC8 on DP AUX operations
Date: Mon, 29 Jul 2013 17:48:23 -0300	[thread overview]
Message-ID: <1375130907-4054-5-git-send-email-przanoni@gmail.com> (raw)
In-Reply-To: <1375130907-4054-1-git-send-email-przanoni@gmail.com>

From: Paulo Zanoni <paulo.r.zanoni@intel.com>

If we're already allowing PC8, just don't use the IRQs, so we won't
need to wake from PC8. Waking up from PC8 is a slow thing, so avoid it
when we can.

Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
---
 drivers/gpu/drm/i915/intel_dp.c | 26 +++++++++++++++++++++++---
 1 file changed, 23 insertions(+), 3 deletions(-)

diff --git a/drivers/gpu/drm/i915/intel_dp.c b/drivers/gpu/drm/i915/intel_dp.c
index a531912..88ccbd5 100644
--- a/drivers/gpu/drm/i915/intel_dp.c
+++ b/drivers/gpu/drm/i915/intel_dp.c
@@ -315,6 +315,24 @@ static uint32_t get_aux_clock_divider(struct intel_dp *intel_dp,
 	}
 }
 
+static bool intel_dp_use_aux_irq(struct drm_device *dev)
+{
+	struct drm_i915_private *dev_priv = dev->dev_private;
+	bool ret;
+
+	if (INTEL_INFO(dev)->gen <= 4 || IS_VALLEYVIEW(dev))
+		return false;
+
+	/* In case we're already allowing PC8, just don't use IRQs, so we won't
+	 * need to call intel_aux_display_runtime_get and then we won't wake up
+	 * from PC8. */
+	mutex_lock(&dev_priv->pc8.lock);
+	ret = (dev_priv->pc8.forbid_refcnt != 0);
+	mutex_unlock(&dev_priv->pc8.lock);
+
+	return ret;
+}
+
 static int
 intel_dp_aux_ch(struct intel_dp *intel_dp,
 		uint8_t *send, int send_bytes,
@@ -329,7 +347,7 @@ intel_dp_aux_ch(struct intel_dp *intel_dp,
 	int i, ret, recv_bytes;
 	uint32_t status;
 	int try, precharge, clock = 0;
-	bool has_aux_irq = INTEL_INFO(dev)->gen >= 5 && !IS_VALLEYVIEW(dev);
+	bool has_aux_irq = intel_dp_use_aux_irq(dev);
 
 	/* dp aux is extremely sensitive to irq latency, hence request the
 	 * lowest possible wakeup latency and so prevent the cpu from going into
@@ -344,7 +362,8 @@ intel_dp_aux_ch(struct intel_dp *intel_dp,
 	else
 		precharge = 5;
 
-	intel_aux_display_runtime_get(dev_priv);
+	if (has_aux_irq)
+		intel_aux_display_runtime_get(dev_priv);
 
 	/* Try to wait for any previous AUX channel activity */
 	for (try = 0; try < 3; try++) {
@@ -436,7 +455,8 @@ intel_dp_aux_ch(struct intel_dp *intel_dp,
 	ret = recv_bytes;
 out:
 	pm_qos_update_request(&dev_priv->pm_qos, PM_QOS_DEFAULT_VALUE);
-	intel_aux_display_runtime_put(dev_priv);
+	if (has_aux_irq)
+		intel_aux_display_runtime_put(dev_priv);
 
 	return ret;
 }
-- 
1.8.1.2

  parent reply	other threads:[~2013-07-29 20:48 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-07-29 20:48 [PATCH 0/8] Allow Package C8+ Paulo Zanoni
2013-07-29 20:48 ` [PATCH 1/8] drm/i915: add the FCLK case to intel_ddi_get_cdclk_freq Paulo Zanoni
2013-07-29 20:48 ` [PATCH 2/8] drm/i915: don't disable/reenable IVB error interrupts when not needed Paulo Zanoni
2013-07-30  9:46   ` Chris Wilson
2013-08-01 17:16     ` Paulo Zanoni
2013-07-29 20:48 ` [PATCH 3/8] drm/i915: allow package C8+ states on Haswell (disabled) Paulo Zanoni
2013-07-29 21:42   ` Chris Wilson
2013-07-31 14:24     ` Paulo Zanoni
2013-07-31 15:01       ` Chris Wilson
2013-07-31 16:47         ` Paulo Zanoni
2013-07-29 23:11   ` Chris Wilson
2013-07-29 20:48 ` Paulo Zanoni [this message]
2013-07-30  9:40   ` [PATCH 4/8] drm/i915: avoid waking up from PC8 on DP AUX operations Chris Wilson
2013-07-31 14:31     ` Paulo Zanoni
2013-07-31 14:45       ` Chris Wilson
2013-07-29 20:48 ` [PATCH 5/8] drm/i915: avoid waking up from PC8 on GMBUS operations Paulo Zanoni
2013-07-30  9:30   ` Chris Wilson
2013-08-05  6:07     ` Daniel Vetter
2013-08-05 13:17       ` Paulo Zanoni
2013-07-29 20:48 ` [PATCH 6/8] drm/i915: silence message about the DDI buffers Paulo Zanoni
2013-07-29 20:48 ` [PATCH 7/8] drm/i915: add i915_pc8_status debugfs file Paulo Zanoni
2013-07-29 20:48 ` [PATCH 8/8] drm/i915: allow Package C8+ by default Paulo Zanoni
2013-07-30  9:25   ` Chris Wilson
2013-07-29 20:53 ` [PATCH i-g-t] tests: add pc8 Paulo Zanoni
2013-08-05  6:05   ` Daniel Vetter
2013-08-05 13:42     ` Paulo Zanoni
2013-08-05 15:35       ` Daniel Vetter
2013-08-06 19:33         ` Paulo Zanoni
2013-08-06 20:11           ` Daniel Vetter
2013-08-06 20:18             ` Daniel Vetter
2013-08-06 20:43             ` Paulo Zanoni
2013-08-13 21:48               ` 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=1375130907-4054-5-git-send-email-przanoni@gmail.com \
    --to=przanoni@gmail.com \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=paulo.r.zanoni@intel.com \
    /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 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).