From mboxrd@z Thu Jan 1 00:00:00 1970 From: Paulo Zanoni Subject: [PATCH 1/3] drm/i915: fix cursor handling when runtime suspended Date: Mon, 28 Jul 2014 15:37:12 -0300 Message-ID: <1406572636-1809-2-git-send-email-przanoni@gmail.com> References: <1406572636-1809-1-git-send-email-przanoni@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail-vc0-f178.google.com (mail-vc0-f178.google.com [209.85.220.178]) by gabe.freedesktop.org (Postfix) with ESMTP id E962A6E20F for ; Mon, 28 Jul 2014 11:37:39 -0700 (PDT) Received: by mail-vc0-f178.google.com with SMTP id la4so11731712vcb.23 for ; Mon, 28 Jul 2014 11:37:39 -0700 (PDT) In-Reply-To: <1406572636-1809-1-git-send-email-przanoni@gmail.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" To: intel-gfx@lists.freedesktop.org Cc: Paulo Zanoni , stable@vger.kernel.org List-Id: intel-gfx@lists.freedesktop.org From: Paulo Zanoni 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 --- 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