From patchwork Mon Apr 10 15:49:10 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chris Wilson X-Patchwork-Id: 9672983 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 18B4960244 for ; Mon, 10 Apr 2017 15:49:16 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D55921FF27 for ; Mon, 10 Apr 2017 15:49:15 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id CA09126E64; Mon, 10 Apr 2017 15:49:15 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.1 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 62D531FF27 for ; Mon, 10 Apr 2017 15:49:15 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id C5B996E0CE; Mon, 10 Apr 2017 15:49:14 +0000 (UTC) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mail-wm0-x241.google.com (mail-wm0-x241.google.com [IPv6:2a00:1450:400c:c09::241]) by gabe.freedesktop.org (Postfix) with ESMTPS id 8FA116E0CE for ; Mon, 10 Apr 2017 15:49:13 +0000 (UTC) Received: by mail-wm0-x241.google.com with SMTP id d79so10374431wmi.2 for ; Mon, 10 Apr 2017 08:49:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id; bh=4AivppAOStiZPeGX9nYdVJGokJWCjbbSLkhzhBdtMdA=; b=mFb3h05R52q1AiXF9haVruUg2FyZpfhlCx2VlHsuvtGTObPkYrVd3YeX5QSjZBuC7p Gd51w0liJlAfITMrE437uT/oBFyc7IfTL0XqAsLT3Mg48eQydXtQSFBIvV0pW+Wl5zWO pObE2m0mpBR6PxjtdNO06ImxPxvhAGndE5vJJ5YR+cHaH4jbDjfPli0pC4z/YkNwiA1Q xlYlZe4m44vp3G+KsjDCqd9C0KA8f5vRLyDYrlk27UTLQYst6FmIetCK2PrVgaNOH+1H wmQwPmkFrrs4MU5q8eGup05bmzje8LpQH85awBcLYF8P/Ma5d1ZE/V6nSSd6S2ram2dK b0CQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id; bh=4AivppAOStiZPeGX9nYdVJGokJWCjbbSLkhzhBdtMdA=; b=ooTgYSPWCvIuOKqbjCLWjxRfqQbLrcP1Z0XYcPQoSDZ3xeD5QsXTR2FiMtLZFzmGL+ Zs+7tmVb0S3FkMwh6MEw/m2fgMVUVN4jPQwATpijAqPvaOtIbBIZ9p4F72SB4RftIvLm +KMRERFdmGxVQbA27jc095xmUKa+sO4ZeqMN5xR6v4xk97nkpldfuIkUZSg341RTULCK eGGkOk5t3y/40fMDkDuwepFuyUPNX/yf7CFsMvdTWQ1+FQFYtqQifeqPKcnuBmDkg//f g1S7idbVU0VPmk4dyN8VHn6YkcfwLJh7XOKZuB5cS8Z0AmHSFAkQxfkBtxIXp86uIU2h Shhw== X-Gm-Message-State: AN3rC/4rAdJkGCAJ/b97Roe/K3w7pvBWEozg6d+D6KASjWj4KPU4GbdOporxcHGNM5fyfQ== X-Received: by 10.28.37.3 with SMTP id l3mr10595744wml.100.1491839352243; Mon, 10 Apr 2017 08:49:12 -0700 (PDT) Received: from haswell.alporthouse.com ([78.156.65.138]) by smtp.gmail.com with ESMTPSA id p185sm10769759wme.20.2017.04.10.08.49.11 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 10 Apr 2017 08:49:11 -0700 (PDT) From: Chris Wilson To: intel-gfx@lists.freedesktop.org Date: Mon, 10 Apr 2017 16:49:10 +0100 Message-Id: <20170410154910.27936-1-chris@chris-wilson.co.uk> X-Mailer: git-send-email 2.11.0 Subject: [Intel-gfx] [PATCH] drm/i915/execlists: Document runtime pm for intel_lrc_irq_handler() X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.18 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-Virus-Scanned: ClamAV using ClamSMTP We indirectly hold the runtime-pm for the intel_lrc_irq_handler() by virtue of dev_priv->gt.awake keeping a wakeref whilst the requests are busy. As this is not obvious from the code, add a comment. Signed-off-by: Chris Wilson Cc: Tvrtko Ursulin --- drivers/gpu/drm/i915/intel_lrc.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/drivers/gpu/drm/i915/intel_lrc.c b/drivers/gpu/drm/i915/intel_lrc.c index 0dc1cc4ad6e7..e16cc28dc783 100644 --- a/drivers/gpu/drm/i915/intel_lrc.c +++ b/drivers/gpu/drm/i915/intel_lrc.c @@ -515,6 +515,15 @@ static void intel_lrc_irq_handler(unsigned long data) struct execlist_port *port = engine->execlist_port; struct drm_i915_private *dev_priv = engine->i915; + /* We can skip acquiring intel_runtime_pm_get() here as it was taken + * on our behalf by the request (see i915_gem_mark_busy ()) and it will + * not be relinquished until the device is idle (see + * i915_gem_idle_work_handler()). As a precaution, we make sure + * that all ELSP are drained i.e. we have processed the CSB, + * before allowing ourselves to idle and calling intel_runtime_pm_put(). + */ + GEM_BUG_ON(!dev_priv->gt.awake); + intel_uncore_forcewake_get(dev_priv, engine->fw_domains); /* Prefer doing test_and_clear_bit() as a two stage operation to avoid