From patchwork Mon Jul 28 18:37:12 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paulo Zanoni X-Patchwork-Id: 4636221 Return-Path: X-Original-To: patchwork-intel-gfx@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 7B8BCC0338 for ; Mon, 28 Jul 2014 18:37:43 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 99C602020E for ; Mon, 28 Jul 2014 18:37:42 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id C05D3201B4 for ; Mon, 28 Jul 2014 18:37:41 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 5D1D96E20F; Mon, 28 Jul 2014 11:37:41 -0700 (PDT) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org 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) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=bMDnJsqj7FpzdlFt1fJjhpzMScDL003BPfSBuBKLeDI=; b=pCrplAEWdFDAoXGz79z39wCEwsM1gz0Lfx6Ahe3v2Buial0Xxq12MFBpVU5jsk6N46 s5i6jj6TYV2Dee4MLqZ/GWyrowuoulm+ekyhtB0Y20q2Vkw2Z8uaXnrZBYPS5FzaJ0Hk mAFMovGFAZr4m0sY1d47B4vBvnBfp0Y014SzVQmRfcJDng2KTeJToM/y2hulSGCJ8uMC ks7VmHTWvnNIR+cAxPpZJNYPS9mPb+M6+NCBVrisRfHRRK+qi2WNSp9cNGOFXPrVBVvW 6s0NhqnYNlRWi+72mk1t+QN060MH9eb8GCF1vwxnhn4ZLEm2h0gURHyQkuPgcfzDSbHW /tLw== X-Received: by 10.52.227.72 with SMTP id ry8mr5015553vdc.64.1406572659423; Mon, 28 Jul 2014 11:37:39 -0700 (PDT) Received: from localhost.localdomain ([177.132.4.36]) by mx.google.com with ESMTPSA id oa3sm21542055vdb.3.2014.07.28.11.37.37 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 28 Jul 2014 11:37:38 -0700 (PDT) From: Paulo Zanoni To: intel-gfx@lists.freedesktop.org Date: Mon, 28 Jul 2014 15:37:12 -0300 Message-Id: <1406572636-1809-2-git-send-email-przanoni@gmail.com> X-Mailer: git-send-email 2.0.1 In-Reply-To: <1406572636-1809-1-git-send-email-przanoni@gmail.com> References: <1406572636-1809-1-git-send-email-przanoni@gmail.com> Cc: Paulo Zanoni , stable@vger.kernel.org Subject: [Intel-gfx] [PATCH 1/3] drm/i915: fix cursor handling when runtime suspended X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" X-Spam-Status: No, score=-4.8 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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;