From patchwork Wed Oct 18 15:20:47 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Szwichtenberg, Radoslaw" X-Patchwork-Id: 10014905 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 578B460211 for ; Wed, 18 Oct 2017 15:20:56 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 494542932F for ; Wed, 18 Oct 2017 15:20:56 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 47BDB2943F; Wed, 18 Oct 2017 15:20:56 +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.2 required=2.0 tests=BAYES_00, 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 56C22293FA for ; Wed, 18 Oct 2017 15:20:54 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 4403F6E0AD; Wed, 18 Oct 2017 15:20:53 +0000 (UTC) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by gabe.freedesktop.org (Postfix) with ESMTPS id 28DAD6E0AD for ; Wed, 18 Oct 2017 15:20:52 +0000 (UTC) Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by orsmga102.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 18 Oct 2017 08:20:51 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.43,397,1503385200"; d="scan'208";a="911155517" Received: from rszwicht-desk.igk.intel.com ([172.28.171.52]) by FMSMGA003.fm.intel.com with ESMTP; 18 Oct 2017 08:20:50 -0700 From: Radoslaw Szwichtenberg To: intel-gfx@lists.freedesktop.org Date: Wed, 18 Oct 2017 17:20:47 +0200 Message-Id: <20171018152047.2968-1-radoslaw.szwichtenberg@intel.com> X-Mailer: git-send-email 2.13.5 In-Reply-To: <20171017124330.13273-1-radoslaw.szwichtenberg@intel.com> References: <20171017124330.13273-1-radoslaw.szwichtenberg@intel.com> Subject: [Intel-gfx] [PATCH i-g-t v2] tests/pm_rps: Move some test logic out of boost function 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 Moving code out of the boost function will allow its usage in other/new test scenarios. Signed-off-by: Radoslaw Szwichtenberg Reviewed-by: Sagar Arun Kamble --- tests/pm_rps.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/tests/pm_rps.c b/tests/pm_rps.c index 89f3e31c..fa548260 100644 --- a/tests/pm_rps.c +++ b/tests/pm_rps.c @@ -583,11 +583,6 @@ static void boost_freq(int fd, int *boost_freqs) int64_t timeout = 1; igt_spin_t *load; unsigned int engine; - int fmid = (origfreqs[RPn] + origfreqs[RP0]) / 2; - - fmid = get_hw_rounded_freq(fmid); - /* Set max freq to less then boost freq */ - writeval(sysfs_files[MAX].filp, fmid); /* Put boost on the same engine as low load */ engine = I915_EXEC_RENDER; @@ -604,9 +599,6 @@ static void boost_freq(int fd, int *boost_freqs) igt_spin_batch_end(load); gem_sync(fd, load->handle); igt_spin_batch_free(fd, load); - - /* Set max freq to original softmax */ - writeval(sysfs_files[MAX].filp, origfreqs[MAX]); } static void waitboost(int fd, bool reset) @@ -615,6 +607,9 @@ static void waitboost(int fd, bool reset) int boost_freqs[NUMFREQ]; int post_freqs[NUMFREQ]; + int fmid = (origfreqs[RPn] + origfreqs[RP0]) / 2; + fmid = get_hw_rounded_freq(fmid); + load_helper_run(LOW); igt_debug("Apply low load...\n"); @@ -627,11 +622,17 @@ static void waitboost(int fd, bool reset) sleep(1); } + /* Set max freq to less than boost freq */ + writeval(sysfs_files[MAX].filp, fmid); + /* When we wait upon the GPU, we want to temporarily boost it * to maximum. */ boost_freq(fd, boost_freqs); + /* Set max freq to original softmax */ + writeval(sysfs_files[MAX].filp, origfreqs[MAX]); + igt_debug("Apply low load again...\n"); sleep(1); stabilize_check(post_freqs); @@ -643,7 +644,6 @@ static void waitboost(int fd, bool reset) igt_assert_lt(pre_freqs[CUR], pre_freqs[MAX]); igt_assert_eq(boost_freqs[CUR], boost_freqs[BOOST]); igt_assert_lt(post_freqs[CUR], post_freqs[MAX]); - } static void pm_rps_exit_handler(int sig)