From patchwork Wed Jan 29 00:25:06 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: jeff.mcgee@intel.com X-Patchwork-Id: 3549291 Return-Path: X-Original-To: patchwork-intel-gfx@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 42338C02DC for ; Wed, 29 Jan 2014 00:18:11 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 82FCE20107 for ; Wed, 29 Jan 2014 00:18:10 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id C283D2015A for ; Wed, 29 Jan 2014 00:18:09 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id C4D7B10631A; Tue, 28 Jan 2014 16:18:05 -0800 (PST) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by gabe.freedesktop.org (Postfix) with ESMTP id CBD3A106304 for ; Tue, 28 Jan 2014 16:17:57 -0800 (PST) Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga101.jf.intel.com with ESMTP; 28 Jan 2014 16:17:57 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.95,739,1384329600"; d="scan'208";a="446104755" Received: from jeffdesk.fso.intel.com ([10.5.53.1]) by orsmga001.jf.intel.com with ESMTP; 28 Jan 2014 16:17:57 -0800 From: jeff.mcgee@intel.com To: intel-gfx@lists.freedesktop.org Date: Tue, 28 Jan 2014 18:25:06 -0600 Message-Id: <1390955106-29853-5-git-send-email-jeff.mcgee@intel.com> X-Mailer: git-send-email 1.8.5.2 In-Reply-To: <1390955106-29853-1-git-send-email-jeff.mcgee@intel.com> References: <1390955106-29853-1-git-send-email-jeff.mcgee@intel.com> Subject: [Intel-gfx] [PATCH 4/4] pm_rps: New subtest min-max-config-loaded X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: intel-gfx-bounces@lists.freedesktop.org Errors-To: intel-gfx-bounces@lists.freedesktop.org X-Spam-Status: No, score=-4.7 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Jeff McGee Like subtest basic-api, but additionally requires that current frequency is increasing to the configured maximum within reasonable time since we are loaded. Signed-off-by: Jeff McGee --- tests/pm_rps.c | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/tests/pm_rps.c b/tests/pm_rps.c index 555bb7c..709e341 100644 --- a/tests/pm_rps.c +++ b/tests/pm_rps.c @@ -371,6 +371,29 @@ static void idle_check(void) log("Required %d msec to reach cur=min\n", wait); } +#define LOADED_WAIT_TIMESTEP_MSEC 100 +#define LOADED_WAIT_TIMEOUT_MSEC 3000 +static void loaded_check(void) +{ + int freqs[NUMFREQ]; + int wait = 0; + + /* Monitor frequencies until cur increases to max, which should + * happen within the allotted time */ + do { + read_freqs(freqs); + dump(freqs); + checkit(freqs); + if (freqs[CUR] == freqs[MAX]) + break; + usleep(1000 * LOADED_WAIT_TIMESTEP_MSEC); + wait += LOADED_WAIT_TIMESTEP_MSEC; + } while (wait < LOADED_WAIT_TIMEOUT_MSEC); + + igt_assert(freqs[CUR] == freqs[MAX]); + log("Required %d msec to reach cur=max\n", wait); +} + static void pm_rps_exit_handler(int sig) { if (origfreqs[MIN] > readval(stuff[MAX].filp)) { @@ -456,5 +479,11 @@ int main(int argc, char **argv) igt_subtest("min-max-config-idle") min_max_config(idle_check); + igt_subtest("min-max-config-loaded") { + load_helper_run(); + min_max_config(loaded_check); + load_helper_stop(); + } + igt_exit(); }