public inbox for intel-gfx@lists.freedesktop.org
 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>, stable@vger.kernel.org
Subject: [PATCH 1/3] drm/i915: fix cursor handling when runtime suspended
Date: Mon, 28 Jul 2014 15:37:12 -0300	[thread overview]
Message-ID: <1406572636-1809-2-git-send-email-przanoni@gmail.com> (raw)
In-Reply-To: <1406572636-1809-1-git-send-email-przanoni@gmail.com>

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

If we're runtime suspended and try to use the cursor interfaces, we
will get a lot of WARNs saying we did the wrong thing.

For intel_crtc_update_cursor(), all we need to do is return if the
CRTC is not active, since writing the registers won't really have any
effect if the screen is not visible, and we will write the registers
later when enabling the screen.

For intel_crtc_cursor_set_obj(), we just need to wake up the hardware
then pinning the display plane.

v2: - Narrow the put/get calls on intel_crtc_cursor_set_obj() (Daniel)

Testcase: igt/pm_rpm/cursor
Testcase: igt/pm_rpm/cursor-dpms
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=81645
Cc: stable@vger.kernel.org
Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
---
 drivers/gpu/drm/i915/intel_display.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
index 1edfd1a..f1a9b5c 100644
--- a/drivers/gpu/drm/i915/intel_display.c
+++ b/drivers/gpu/drm/i915/intel_display.c
@@ -8144,6 +8144,9 @@ static void intel_crtc_update_cursor(struct drm_crtc *crtc,
 	if (base == 0 && intel_crtc->cursor_base == 0)
 		return;
 
+	if (!intel_crtc->active)
+		return;
+
 	I915_WRITE(CURPOS(pipe), pos);
 
 	if (IS_IVYBRIDGE(dev) || IS_HASWELL(dev) || IS_BROADWELL(dev))
@@ -8217,7 +8220,9 @@ static int intel_crtc_cursor_set_obj(struct drm_crtc *crtc,
 		if (need_vtd_wa(dev))
 			alignment = 64*1024;
 
+		intel_runtime_pm_get(dev_priv);
 		ret = i915_gem_object_pin_to_display_plane(obj, alignment, NULL);
+		intel_runtime_pm_put(dev_priv);
 		if (ret) {
 			DRM_DEBUG_KMS("failed to move cursor bo into the GTT\n");
 			goto fail_locked;
-- 
2.0.1

  reply	other threads:[~2014-07-28 18:37 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-07-28 18:37 [PATCH 0/3] Fixes for runtime PM on planes APIs Paulo Zanoni
2014-07-28 18:37 ` Paulo Zanoni [this message]
2014-07-29 10:22   ` [PATCH 1/3] drm/i915: fix cursor handling when runtime suspended Ville Syrjälä
2014-07-29 14:25     ` Paulo Zanoni
2014-07-28 18:37 ` [PATCH 1/2] tests/pm_rpm: add cursor subtests Paulo Zanoni
2014-07-28 18:37 ` [PATCH 2/3] drm/i915: get runtime PM when pinning sprite objects Paulo Zanoni
2014-07-28 18:37 ` [PATCH 2/2] tests/pm_rpm: add planes subtests Paulo Zanoni
2014-07-28 23:47   ` Matt Roper
2014-08-05 21:34     ` Paulo Zanoni
2014-08-05 21:51       ` Matt Roper
2014-08-06 14:11         ` Paulo Zanoni
2014-08-06 14:23           ` Daniel Vetter
2014-07-28 18:37 ` [PATCH 3/3] drm/i915: get runtime PM when pinning primary plane objects Paulo Zanoni
2014-07-28 23:25 ` [PATCH 0/3] Fixes for runtime PM on planes APIs Matt Roper
2014-07-29  8:01   ` 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=1406572636-1809-2-git-send-email-przanoni@gmail.com \
    --to=przanoni@gmail.com \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=paulo.r.zanoni@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox