From patchwork Fri Sep 7 00:12:41 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: kai.chen@intel.com X-Patchwork-Id: 10591309 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id DF5EC139B for ; Fri, 7 Sep 2018 00:20:35 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id CDAF72AF30 for ; Fri, 7 Sep 2018 00:20:35 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C1E782B171; Fri, 7 Sep 2018 00:20:35 +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=-5.2 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED 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 64EC22AF30 for ; Fri, 7 Sep 2018 00:20:35 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 31E846E7C4; Fri, 7 Sep 2018 00:20:34 +0000 (UTC) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by gabe.freedesktop.org (Postfix) with ESMTPS id 980296E7C4 for ; Fri, 7 Sep 2018 00:20:32 +0000 (UTC) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga002.jf.intel.com ([10.7.209.21]) by fmsmga101.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 06 Sep 2018 17:20:31 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.53,340,1531810800"; d="scan'208";a="89656298" Received: from kai-fedora.fm.intel.com ([10.1.23.156]) by orsmga002.jf.intel.com with ESMTP; 06 Sep 2018 17:20:21 -0700 From: kai.chen@intel.com To: intel-gfx@lists.freedesktop.org Date: Thu, 6 Sep 2018 17:12:41 -0700 Message-Id: <20180907001241.27857-1-kai.chen@intel.com> X-Mailer: git-send-email 2.17.1 Subject: [Intel-gfx] [PATCH] drm/i915: Raise RPS FUp Interrupt Limiter for GEN9LP above softmax (v2) X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.23 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 From: Kai Chen On GEN9LP, raise the RPS FUp Interrupt Limiter above softmax so that the HW won't miss interrupt when requested max_freq is set back to RP0 value. The (v2) is to explain a bit more detail background about the change in the code. Signed-off-by: Kai Chen --- drivers/gpu/drm/i915/intel_pm.c | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/i915/intel_pm.c b/drivers/gpu/drm/i915/intel_pm.c index d99e5fabe93c..6574696b83cb 100644 --- a/drivers/gpu/drm/i915/intel_pm.c +++ b/drivers/gpu/drm/i915/intel_pm.c @@ -6276,7 +6276,27 @@ static u32 intel_rps_limits(struct drm_i915_private *dev_priv, u8 val) * frequency, if the down threshold expires in that window we will not * receive a down interrupt. */ if (INTEL_GEN(dev_priv) >= 9) { - limits = (rps->max_freq_softlimit) << 23; + int max_freq = rps->max_freq_softlimit; + int rp0_freq = rps->rp0_freq; + + if (IS_GEN9_LP(dev_priv) && (max_freq == rp0_freq)) + /* For GEN9_LP, the HW seems insensitive to the RP FUp + * interrupt limiter threshold by design. This symptom + * is experienced in the IGT test (pm_rps): when the + * test sets the max_freq back to RP0, the interrupt + * limits register is also programmed to the max_freq + * per design. But as a result, the actual freq is not + * the max_freq detected. It is suggested (based on the + * best test/tuning practice) to increase the upper + * interrupt limiter just by 1 (16.6MHz) so that the HW + * will generate an interrupt when we are near or just + * below the upper limit. + */ + + limits = (rps->max_freq_softlimit + 1) << 23; + else + limits = (rps->max_freq_softlimit) << 23; + if (val <= rps->min_freq_softlimit) limits |= (rps->min_freq_softlimit) << 14; } else {