From patchwork Tue Oct 17 12:43:30 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Szwichtenberg, Radoslaw" X-Patchwork-Id: 10011881 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 36E3460235 for ; Tue, 17 Oct 2017 12:43:55 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 28B6628897 for ; Tue, 17 Oct 2017 12:43:55 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 1D13D2889A; Tue, 17 Oct 2017 12:43:55 +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 A1F7628897 for ; Tue, 17 Oct 2017 12:43:54 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 5856D6E677; Tue, 17 Oct 2017 12:43:54 +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 2F66A6E677 for ; Tue, 17 Oct 2017 12:43:53 +0000 (UTC) Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by orsmga105.jf.intel.com with ESMTP; 17 Oct 2017 05:43:42 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos; i="5.43,390,1503385200"; d="scan'208"; a="1231713792" Received: from rszwicht-desk.igk.intel.com ([172.28.171.52]) by fmsmga002.fm.intel.com with ESMTP; 17 Oct 2017 05:43:40 -0700 From: Radoslaw Szwichtenberg To: intel-gfx@lists.freedesktop.org Date: Tue, 17 Oct 2017 14:43:30 +0200 Message-Id: <20171017124330.13273-1-radoslaw.szwichtenberg@intel.com> X-Mailer: git-send-email 2.13.5 Subject: [Intel-gfx] [PATCH i-g-t] 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 Cc: Sagar Arun Kamble --- tests/pm_rps.c | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/tests/pm_rps.c b/tests/pm_rps.c index 89f3e31c..dad87646 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) @@ -656,6 +656,7 @@ static void pm_rps_exit_handler(int sig) writeval(sysfs_files[MAX].filp, origfreqs[MAX]); } + writeval(sysfs_files[BOOST].filp, origfreqs[BOOST]); load_helper_deinit(); close(drm_fd); }