All of lore.kernel.org
 help / color / mirror / Atom feed
From: Chris Wilson <chris@chris-wilson.co.uk>
To: intel-gfx@lists.freedesktop.org
Subject: [PATCH 16/19] drm/i915: Combined gt.awake/gt.power wakerefs
Date: Wed, 12 Dec 2018 13:41:46 +0000	[thread overview]
Message-ID: <20181212134149.26981-17-chris@chris-wilson.co.uk> (raw)
In-Reply-To: <20181212134149.26981-1-chris@chris-wilson.co.uk>

As the GT_IRQ power domain implies a wakeref, we can use it inplace of
our existing redundant rpm grab.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
---
 drivers/gpu/drm/i915/i915_drv.h                  |  1 -
 drivers/gpu/drm/i915/i915_gem.c                  | 11 ++++-------
 drivers/gpu/drm/i915/selftests/mock_gem_device.c |  1 +
 3 files changed, 5 insertions(+), 8 deletions(-)

diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h
index 2ed3c56a6381..7429b4f78d45 100644
--- a/drivers/gpu/drm/i915/i915_drv.h
+++ b/drivers/gpu/drm/i915/i915_drv.h
@@ -1970,7 +1970,6 @@ struct drm_i915_private {
 		 * is a slight delay before we do so.
 		 */
 		intel_wakeref_t awake;
-		intel_wakeref_t power;
 
 		/**
 		 * The number of times we have woken up.
diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c
index d481580f09c1..490b149ce9ab 100644
--- a/drivers/gpu/drm/i915/i915_gem.c
+++ b/drivers/gpu/drm/i915/i915_gem.c
@@ -177,9 +177,7 @@ static u32 __i915_gem_park(struct drm_i915_private *i915)
 	if (INTEL_GEN(i915) >= 6)
 		gen6_rps_idle(i915);
 
-	intel_display_power_put(i915, POWER_DOMAIN_GT_IRQ, i915->gt.power);
-
-	intel_runtime_pm_put(i915, wakeref);
+	intel_display_power_put(i915, POWER_DOMAIN_GT_IRQ, wakeref);
 
 	return i915->gt.epoch;
 }
@@ -204,13 +202,11 @@ void i915_gem_unpark(struct drm_i915_private *i915)
 
 	lockdep_assert_held(&i915->drm.struct_mutex);
 	GEM_BUG_ON(!i915->gt.active_requests);
+	assert_rpm_wakelock_held(i915);
 
 	if (i915->gt.awake)
 		return;
 
-	i915->gt.awake = intel_runtime_pm_get_noresume(i915);
-	GEM_BUG_ON(!i915->gt.awake);
-
 	/*
 	 * It seems that the DMC likes to transition between the DC states a lot
 	 * when there are no connected displays (no active power domains) during
@@ -222,7 +218,8 @@ void i915_gem_unpark(struct drm_i915_private *i915)
 	 * Work around it by grabbing a GT IRQ power domain whilst there is any
 	 * GT activity, preventing any DC state transitions.
 	 */
-	i915->gt.power = intel_display_power_get(i915, POWER_DOMAIN_GT_IRQ);
+	i915->gt.awake = intel_display_power_get(i915, POWER_DOMAIN_GT_IRQ);
+	GEM_BUG_ON(!i915->gt.awake);
 
 	if (unlikely(++i915->gt.epoch == 0)) /* keep 0 as invalid */
 		i915->gt.epoch = 1;
diff --git a/drivers/gpu/drm/i915/selftests/mock_gem_device.c b/drivers/gpu/drm/i915/selftests/mock_gem_device.c
index 0eb283e7fc96..aa4ddae94aca 100644
--- a/drivers/gpu/drm/i915/selftests/mock_gem_device.c
+++ b/drivers/gpu/drm/i915/selftests/mock_gem_device.c
@@ -164,6 +164,7 @@ struct drm_i915_private *mock_gem_device(void)
 	pm_runtime_dont_use_autosuspend(&pdev->dev);
 	if (pm_runtime_enabled(&pdev->dev))
 		WARN_ON(pm_runtime_get_sync(&pdev->dev));
+	disable_rpm_wakeref_asserts(i915);
 
 	err = drm_dev_init(&i915->drm, &mock_driver, &pdev->dev);
 	if (err) {
-- 
2.20.0.rc2

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

  parent reply	other threads:[~2018-12-12 13:42 UTC|newest]

Thread overview: 37+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-12-12 13:41 A collection of pending bug [fixes] Chris Wilson
2018-12-12 13:41 ` [PATCH 01/19] drm/i915: Return immediately if trylock fails for direct-reclaim Chris Wilson
2018-12-12 13:41 ` [PATCH 02/19] drm/i915/userptr: Avoid struct_mutex recursion for mmu_invalidate_range_start Chris Wilson
2018-12-12 13:41 ` [PATCH 03/19] drm/i915/userptr: Probe vma range before gup Chris Wilson
2018-12-12 13:41 ` [PATCH 04/19] drm/i915/selftests: Check we can recover a wedged device Chris Wilson
2018-12-13  8:22   ` Tvrtko Ursulin
2018-12-13  8:28   ` Tvrtko Ursulin
2018-12-13  8:39     ` Chris Wilson
2018-12-12 13:41 ` [PATCH 05/19] drm/i915/selftests: Verify we can perform resets from atomic context Chris Wilson
2018-12-13  8:28   ` Tvrtko Ursulin
2018-12-13  8:42     ` Chris Wilson
2018-12-12 13:41 ` [PATCH 06/19] drm/i915/icl: Record the valid VDBoxes with SFC capability Chris Wilson
2018-12-12 14:17   ` Tvrtko Ursulin
2018-12-12 13:41 ` [PATCH 07/19] drm/i915/icl: Mind the SFC units when resetting VD or VEBox engines Chris Wilson
2018-12-12 14:36   ` Tvrtko Ursulin
2018-12-13  8:20     ` Tvrtko Ursulin
2018-12-13  8:47       ` Chris Wilson
2018-12-13  9:24         ` Tvrtko Ursulin
2018-12-13  9:13     ` Chris Wilson
2018-12-12 13:41 ` [PATCH 08/19] drm/i915: Always try to reset the GPU on takeover Chris Wilson
2018-12-12 13:41 ` [PATCH 09/19] drm/i915: Report the number of closed vma held by each context in debugfs Chris Wilson
2018-12-12 13:41 ` [PATCH 10/19] drm/i915: Remove debugfs/i915_ppgtt_info Chris Wilson
2018-12-21 12:49   ` Tvrtko Ursulin
2018-12-12 13:41 ` [PATCH 11/19] drm/i915: Track all held rpm wakerefs Chris Wilson
2018-12-19  9:23   ` Chris Wilson
2018-12-12 13:41 ` [PATCH 12/19] drm/i915: Markup paired operations on wakerefs Chris Wilson
2018-12-12 13:41 ` [PATCH 13/19] drm/i915: Syntatic sugar for using intel_runtime_pm Chris Wilson
2018-12-12 13:41 ` [PATCH 14/19] drm/i915: Markup paired operations on display power domains Chris Wilson
2018-12-12 13:41 ` [PATCH 15/19] drm/i915: Track the wakeref used to initialise " Chris Wilson
2018-12-12 13:41 ` Chris Wilson [this message]
2018-12-12 13:41 ` [PATCH 17/19] drm/i915/dp: Markup pps lock power well Chris Wilson
2018-12-12 13:41 ` [PATCH 18/19] drm/i915: Complain if hsw_get_pipe_config acquires the same power well twice Chris Wilson
2018-12-12 13:41 ` [PATCH 19/19] drm/i915: Mark up Ironlake ips with rpm wakerefs Chris Wilson
2018-12-12 13:52 ` ✗ Fi.CI.CHECKPATCH: warning for series starting with [01/19] drm/i915: Return immediately if trylock fails for direct-reclaim Patchwork
2018-12-12 14:00 ` ✗ Fi.CI.SPARSE: " Patchwork
2018-12-12 14:07 ` ✓ Fi.CI.BAT: success " Patchwork
2018-12-12 16:09 ` ✓ Fi.CI.IGT: " Patchwork

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=20181212134149.26981-17-chris@chris-wilson.co.uk \
    --to=chris@chris-wilson.co.uk \
    --cc=intel-gfx@lists.freedesktop.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.