From patchwork Fri Mar 15 10:58:31 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Gupta, Anshuman" X-Patchwork-Id: 10854521 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 B352913B5 for ; Fri, 15 Mar 2019 11:02:21 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9BC512A938 for ; Fri, 15 Mar 2019 11:02:21 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 8AC3F2A948; Fri, 15 Mar 2019 11:02:21 +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 40D552A938 for ; Fri, 15 Mar 2019 11:02:21 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id A1BCA6E3A4; Fri, 15 Mar 2019 11:02:20 +0000 (UTC) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by gabe.freedesktop.org (Postfix) with ESMTPS id 1228C6E3A4; Fri, 15 Mar 2019 11:02:20 +0000 (UTC) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga007.fm.intel.com ([10.253.24.52]) by orsmga105.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 15 Mar 2019 04:02:19 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.58,481,1544515200"; d="scan'208";a="134595192" Received: from genxfsim-desktop.iind.intel.com ([10.223.34.158]) by fmsmga007.fm.intel.com with ESMTP; 15 Mar 2019 04:02:17 -0700 From: Anshuman Gupta To: intel-gfx@lists.freedesktop.org, igt-dev@lists.freedesktop.org Date: Fri, 15 Mar 2019 16:28:31 +0530 Message-Id: <1552647511-26013-1-git-send-email-anshuman.gupta@intel.com> X-Mailer: git-send-email 2.7.4 Subject: [Intel-gfx] [PATCH i-g-t] igt/i915/i915_pm_lpsp enable pm_lpsp for platforms till Gen11. 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 Enabling pm_lpsp igt tests for Gen11 as well as for all platforms at least gen9, earlier these test were enabled only haswell and broadwell platforms. Signed-off-by: Anshuman Gupta --- tests/i915/i915_pm_lpsp.c | 29 +++++++++++++++++++++++++++-- 1 file changed, 27 insertions(+), 2 deletions(-) diff --git a/tests/i915/i915_pm_lpsp.c b/tests/i915/i915_pm_lpsp.c index b319dbe..f7037ce 100644 --- a/tests/i915/i915_pm_lpsp.c +++ b/tests/i915/i915_pm_lpsp.c @@ -30,18 +30,42 @@ #include #include +#define HSW_PW_CTL_IDX_GLOBAL 15 +#define SKL_PW_CTL_IDX_PW_2 15 +#define ICL_PW_CTL_IDX_PW_3 2 + +#define HSW_PWR_WELL_CTL_REQ(pw_idx) (0x2 << ((pw_idx) * 2)) +#define HSW_PWR_WELL_CTL_STATE(pw_idx) (0x1 << ((pw_idx) * 2)) + +int no_lpsp_pw_idx; static bool supports_lpsp(uint32_t devid) { - return IS_HASWELL(devid) || IS_BROADWELL(devid); + return IS_HASWELL(devid) || IS_BROADWELL(devid) || AT_LEAST_GEN(devid, 9); +} + +static bool get_no_lpsp_pw_idx(uint32_t devid) +{ + if (IS_HASWELL(devid) || IS_BROADWELL(devid)) + no_lpsp_pw_idx = HSW_PW_CTL_IDX_GLOBAL; + else if (IS_GEN(devid, 11)) + no_lpsp_pw_idx = ICL_PW_CTL_IDX_PW_3; + else if (AT_LEAST_GEN(devid, 9)) + no_lpsp_pw_idx = SKL_PW_CTL_IDX_PW_2; + else + return false; + + return true; } static bool lpsp_is_enabled(int drm_fd) { uint32_t val; + uint32_t mask = HSW_PWR_WELL_CTL_REQ(no_lpsp_pw_idx) | + HSW_PWR_WELL_CTL_STATE(no_lpsp_pw_idx); val = INREG(HSW_PWR_WELL_CTL2); - return !(val & HSW_PWR_WELL_STATE_ENABLED); + return !((val & mask) == mask); } /* The LPSP mode is all about an enabled pipe, but we expect to also be in the @@ -212,6 +236,7 @@ igt_main intel_register_access_init(intel_get_pci_device(), 0, drm_fd); + igt_require(get_no_lpsp_pw_idx(devid)); kmstest_set_vt_graphics_mode(); }