From: Paulo Zanoni <przanoni@gmail.com>
To: intel-gfx@lists.freedesktop.org
Cc: Paulo Zanoni <paulo.r.zanoni@intel.com>
Subject: [PATCH 22/23] drm/i915: update the PC8 and runtime PM documentation
Date: Thu, 27 Feb 2014 19:26:49 -0300 [thread overview]
Message-ID: <1393540010-1582-23-git-send-email-przanoni@gmail.com> (raw)
In-Reply-To: <1393540010-1582-1-git-send-email-przanoni@gmail.com>
From: Paulo Zanoni <paulo.r.zanoni@intel.com>
Now that PC8 got much simpler, there are less things to document.
Also, runtime PM already has a nice documentation, so we don't need to
re-explain it on our driver.
Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
---
drivers/gpu/drm/i915/i915_drv.h | 52 +++++++++---------------------------
drivers/gpu/drm/i915/intel_display.c | 23 ++++++++++++++++
2 files changed, 35 insertions(+), 40 deletions(-)
diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h
index 08b22e3..a7aeb38 100644
--- a/drivers/gpu/drm/i915/i915_drv.h
+++ b/drivers/gpu/drm/i915/i915_drv.h
@@ -1297,47 +1297,19 @@ struct ilk_wm_values {
};
/*
- * This struct tracks the state needed for the Package C8+ feature.
+ * This struct helps tracking the state needed for runtime PM, which puts the
+ * device in PCI D3 state. Notice that when this happens, nothing on the
+ * graphics device works, even register access, so we don't get interrupts nor
+ * anything else.
*
- * TODO: we're merging the Package C8+ feature with the runtime PM support. To
- * avoid having to update the documentation at each patch of the series, we'll
- * do a final update at the end.
+ * Every piece of our code that needs to actually touch the hardware needs to
+ * either call intel_runtime_pm_get or call intel_display_power_get with the
+ * appropriate power domain.
*
- * Package states C8 and deeper are really deep PC states that can only be
- * reached when all the devices on the system allow it, so even if the graphics
- * device allows PC8+, it doesn't mean the system will actually get to these
- * states.
- *
- * Our driver only allows PC8+ when all the outputs are disabled, the power well
- * is disabled and the GPU is idle. When these conditions are met, we manually
- * do the other conditions: disable the interrupts, clocks and switch LCPLL
- * refclk to Fclk.
- *
- * When we really reach PC8 or deeper states (not just when we allow it) we lose
- * the state of some registers, so when we come back from PC8+ we need to
- * restore this state. We don't get into PC8+ if we're not in RC6, so we don't
- * need to take care of the registers kept by RC6.
- *
- * The interrupt disabling is part of the requirements. We can only leave the
- * PCH HPD interrupts enabled. If we're in PC8+ and we get another interrupt we
- * can lock the machine.
- *
- * Ideally every piece of our code that needs PC8+ disabled would call
- * hsw_disable_package_c8, which would increment disable_count and prevent the
- * system from reaching PC8+. But we don't have a symmetric way to do this for
- * everything, so we have the requirements_met variable. When we switch
- * requirements_met to true we decrease disable_count, and increase it in the
- * opposite case. The requirements_met variable is true when all the CRTCs,
- * encoders and the power well are disabled.
- *
- * In addition to everything, we only actually enable PC8+ if disable_count
- * stays at zero for at least some seconds. This is implemented with the
- * enable_work variable. We do this so we don't enable/disable PC8 dozens of
- * consecutive times when all screens are disabled and some background app
- * queries the state of our connectors, or we have some application constantly
- * waking up to use the GPU. Only after the enable_work function actually
- * enables PC8+ the "enable" variable will become true, which means that it can
- * be false even if disable_count is 0.
+ * Our driver uses the autosuspend delay feature, which means we'll only really
+ * suspend if we stay with zero refcount for a certain amount of time. The
+ * default value is currently very conservative (see intel_init_runtime_pm), but
+ * it can be changed with the standard runtime PM files frmo sysfs.
*
* The irqs_disabled variable becomes true exactly after we disable the IRQs and
* goes back to false exactly before we reenable the IRQs. We use this variable
@@ -1347,7 +1319,7 @@ struct ilk_wm_values {
* inside struct regsave so when we restore the IRQs they will contain the
* latest expected values.
*
- * For more, read "Display Sequences for Package C8" on our documentation.
+ * For more, read the Documentation/power/runtime_pm.txt.
*/
struct i915_runtime_pm {
bool suspended;
diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
index c981e63..4354946 100644
--- a/drivers/gpu/drm/i915/intel_display.c
+++ b/drivers/gpu/drm/i915/intel_display.c
@@ -6651,6 +6651,29 @@ static void hsw_restore_lcpll(struct drm_i915_private *dev_priv)
gen6_gt_force_wake_put_no_rpm(dev_priv, FORCEWAKE_ALL);
}
+/*
+ * Package states C8 and deeper are really deep PC states that can only be
+ * reached when all the devices on the system allow it, so even if the graphics
+ * device allows PC8+, it doesn't mean the system will actually get to these
+ * states. Our driver only allows PC8+ when going into runtime PM.
+ *
+ * The requirements for PC8+ are that all the outputs are disabled, the power
+ * well is disabled and most interrupts are disabled, and these are also
+ * requirements for runtime PM. When these conditions are met, we manually do
+ * the other conditions: disable the interrupts, clocks and switch LCPLL refclk
+ * to Fclk. If we're in PC8+ and we get an non-hotplug interrupt, we can hard
+ * hang the machine.
+ *
+ * When we really reach PC8 or deeper states (not just when we allow it) we lose
+ * the state of some registers, so when we come back from PC8+ we need to
+ * restore this state. We don't get into PC8+ if we're not in RC6, so we don't
+ * need to take care of the registers kept by RC6. Notice that this happens even
+ * if we don't put the device in PCI D3 state (which is what currently happens
+ * because of the runtime PM support).
+ *
+ * For more, read "Display Sequences for Package C8" on the hardware
+ * documentation.
+ */
void hsw_enable_pc8(struct drm_i915_private *dev_priv)
{
struct drm_device *dev = dev_priv->dev;
--
1.8.5.3
next prev parent reply other threads:[~2014-02-27 22:27 UTC|newest]
Thread overview: 55+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-02-27 22:26 [PATCH 00/23] Merge PC8 with runtime PM, v2 Paulo Zanoni
2014-02-27 22:26 ` [PATCH 01/23] drm/i915: Accurately track when we mark the hardware as idle/busy Paulo Zanoni
2014-02-27 22:26 ` [PATCH 02/23] drm/i915: put runtime PM only at the end of intel_mark_idle Paulo Zanoni
2014-02-27 22:26 ` [PATCH 03/23] drm/i915: put runtime PM only when we actually release force_wake Paulo Zanoni
2014-02-27 22:26 ` [PATCH 04/23] drm/i915: kill dev_priv->pc8.gpu_idle Paulo Zanoni
2014-02-28 15:23 ` Imre Deak
2014-02-27 22:26 ` [PATCH 05/23] drm/i915: rename modeset_update_power_wells Paulo Zanoni
2014-02-27 22:26 ` [PATCH 06/23] drm/i915: get/put runtime PM without holding rps.hw_lock Paulo Zanoni
2014-02-27 22:26 ` [PATCH 07/23] drm/i915: add forcewake functions that don't touch runtime PM Paulo Zanoni
2014-02-28 8:44 ` Chris Wilson
2014-02-28 19:38 ` Paulo Zanoni
2014-02-28 19:46 ` Chris Wilson
2014-03-05 16:56 ` Daniel Vetter
2014-02-27 22:26 ` [PATCH 08/23] drm/i915: extract __hsw_do_{en, dis}able_package_c8 Paulo Zanoni
2014-02-27 22:26 ` [PATCH 09/23] drm/i915: make PC8 be part of runtime PM suspend/resume Paulo Zanoni
2014-02-28 9:42 ` Chris Wilson
2014-03-06 22:48 ` Daniel Vetter
2014-02-27 22:26 ` [PATCH 10/23] drm/i915: get/put runtime PM when we get/put a power domain Paulo Zanoni
2014-02-28 15:45 ` Imre Deak
2014-02-28 19:54 ` Paulo Zanoni
2014-02-27 22:26 ` [PATCH 11/23] drm/i915: remove dev_priv->pc8.requirements_met Paulo Zanoni
2014-02-27 22:26 ` [PATCH 12/23] drm/i915: get runtime PM references when the GPU is idle/busy Paulo Zanoni
2014-02-28 17:08 ` Jesse Barnes
2014-02-27 22:26 ` [PATCH 13/23] drm/i915: kill pc8.disable_count Paulo Zanoni
2014-02-28 17:10 ` Jesse Barnes
2014-02-27 22:26 ` [PATCH 14/23] drm/i915: remove an indirection level on PC8 functions Paulo Zanoni
2014-02-28 17:11 ` Jesse Barnes
2014-02-27 22:26 ` [PATCH 15/23] drm/i915: don't get/put PC8 reference on freeze/thaw Paulo Zanoni
2014-02-28 17:11 ` Jesse Barnes
2014-02-27 22:26 ` [PATCH 16/23] drm/i915: get/put runtime PM references for GMBUS and DP AUX Paulo Zanoni
2014-02-28 17:13 ` Jesse Barnes
2014-02-28 17:38 ` Imre Deak
2014-02-28 17:55 ` Jesse Barnes
2014-02-28 18:20 ` Imre Deak
2014-02-28 19:07 ` Paulo Zanoni
2014-03-05 17:04 ` Daniel Vetter
2014-02-27 22:26 ` [PATCH 17/23] drm/i915: don't get/put PC8 when getting/putting power wells Paulo Zanoni
2014-02-28 17:13 ` Jesse Barnes
2014-02-27 22:26 ` [PATCH 18/23] drm/i915: remove dev_priv->pc8.enabled Paulo Zanoni
2014-02-28 17:14 ` Jesse Barnes
2014-02-27 22:26 ` [PATCH 19/23] drm/i915: move pc8.irqs_disabled to pm.irqs_disabled Paulo Zanoni
2014-02-28 17:15 ` Jesse Barnes
2014-02-28 18:17 ` Paulo Zanoni
2014-02-27 22:26 ` [PATCH 20/23] drm/i915: kill struct i915_package_c8 Paulo Zanoni
2014-02-28 17:16 ` Jesse Barnes
2014-02-27 22:26 ` [PATCH 21/23] drm/i915: rename __hsw_do_{en, dis}able_pc8 Paulo Zanoni
2014-02-28 17:17 ` Jesse Barnes
2014-02-27 22:26 ` Paulo Zanoni [this message]
2014-02-28 17:19 ` [PATCH 22/23] drm/i915: update the PC8 and runtime PM documentation Jesse Barnes
2014-02-27 22:26 ` [PATCH 23/23] drm/i915: init pm.suspended earlier Paulo Zanoni
2014-02-28 17:20 ` Jesse Barnes
2014-03-05 17:09 ` [PATCH 00/23] Merge PC8 with runtime PM, v2 Daniel Vetter
2014-03-06 22:23 ` Paulo Zanoni
2014-03-06 22:45 ` Daniel Vetter
2014-03-07 8:51 ` 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=1393540010-1582-23-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