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] drm/i915: Acquire RPM wakeref for KMS atomic commit
Date: Sat, 19 Dec 2015 09:58:43 +0000	[thread overview]
Message-ID: <1450519123-28206-1-git-send-email-chris@chris-wilson.co.uk> (raw)

Once all the preparations are complete, we are ready to write the
modesetting to the hardware. During this phase, we will be making lots
of HW register access, so take a top level wakeref to prevent an
unwarranted rpm suspend cycle mid-commit. Lower level functions should
be waking the individual power wells as required.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=93439
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Imre Deak <imre.deak@intel.com>
---
 drivers/gpu/drm/i915/intel_display.c | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
index abd2d2944022..60451c3932db 100644
--- a/drivers/gpu/drm/i915/intel_display.c
+++ b/drivers/gpu/drm/i915/intel_display.c
@@ -13470,6 +13470,13 @@ static int intel_atomic_commit(struct drm_device *dev,
 	drm_atomic_helper_swap_state(dev, state);
 	dev_priv->wm.config = to_intel_atomic_state(state)->wm_config;
 
+	/* Take a rpm wakeref for the duration of the commit. Lower level
+	 * functions should be acquiring the power wells for their own use,
+	 * we take this toplevel reference to prevent rpm suspend cycles
+	 * mid-commit.
+	 */
+	intel_runtime_pm_get(dev_priv);
+
 	for_each_crtc_in_state(state, crtc, crtc_state, i) {
 		struct intel_crtc *intel_crtc = to_intel_crtc(crtc);
 
@@ -13558,6 +13565,8 @@ static int intel_atomic_commit(struct drm_device *dev,
 	if (any_ms)
 		intel_modeset_check_state(dev, state);
 
+	intel_runtime_pm_put(dev_priv);
+
 	drm_atomic_state_free(state);
 
 	return 0;
-- 
2.6.4

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

             reply	other threads:[~2015-12-19  9:58 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-12-19  9:58 Chris Wilson [this message]
2015-12-19 10:49 ` ✗ warning: Fi.CI.BAT Patchwork
2015-12-21 10:37 ` Patchwork
2015-12-21 16:02 ` [PATCH] drm/i915: Acquire RPM wakeref for KMS atomic commit Daniel Vetter
2015-12-21 16:14   ` Chris Wilson
2015-12-21 16:28     ` Daniel Vetter
2015-12-21 16:37       ` Chris Wilson
2015-12-21 18:21         ` Daniel Vetter
2015-12-22 20:46           ` Chris Wilson
2016-01-14 16:50 ` Imre Deak
2016-01-21 11:52   ` Joonas Lahtinen
2016-01-22  9:21     ` Imre Deak

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=1450519123-28206-1-git-send-email-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.