From patchwork Wed Jan 29 00:25:03 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: 3549271 Return-Path: X-Original-To: patchwork-intel-gfx@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 4E1959F382 for ; Wed, 29 Jan 2014 00:18:09 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 88BA720107 for ; Wed, 29 Jan 2014 00:18:08 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id A9E772015A for ; Wed, 29 Jan 2014 00:18:07 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id AEEEB106304; Tue, 28 Jan 2014 16:18:04 -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 0D28B106301 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:56 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.95,739,1384329600"; d="scan'208";a="446104747" Received: from jeffdesk.fso.intel.com ([10.5.53.1]) by orsmga001.jf.intel.com with ESMTP; 28 Jan 2014 16:17:56 -0800 From: jeff.mcgee@intel.com To: intel-gfx@lists.freedesktop.org Date: Tue, 28 Jan 2014 18:25:03 -0600 Message-Id: <1390955106-29853-2-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 1/4] pm_rps: New subtest min-max-config-idle 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 settling to the configured minimum within reasonable time since we are idle. Signed-off-by: Jeff McGee --- tests/pm_rps.c | 31 ++++++++++++++++++++++++++++++- 1 file changed, 30 insertions(+), 1 deletion(-) diff --git a/tests/pm_rps.c b/tests/pm_rps.c index 7d9069a..dabc2ba 100644 --- a/tests/pm_rps.c +++ b/tests/pm_rps.c @@ -204,9 +204,12 @@ static void min_max_config(void (*check)(void)) log("\nIncrease max above RP0 (invalid)...\n"); writeval_inval(stuff[MAX].filp, origfreqs[RP0] + 1000); check(); + + writeval(stuff[MIN].filp, origfreqs[MIN]); + writeval(stuff[MAX].filp, origfreqs[MAX]); } -static void idle_check(void) +static void basic_check(void) { int freqs[NUMFREQ]; @@ -215,6 +218,29 @@ static void idle_check(void) checkit(freqs); } +#define IDLE_WAIT_TIMESTEP_MSEC 100 +#define IDLE_WAIT_TIMEOUT_MSEC 3000 +static void idle_check(void) +{ + int freqs[NUMFREQ]; + int wait = 0; + + /* Monitor frequencies until cur settles down to min, which should + * happen within the allotted time */ + do { + read_freqs(freqs); + dump(freqs); + checkit(freqs); + if (freqs[CUR] == freqs[MIN]) + break; + usleep(1000 * IDLE_WAIT_TIMESTEP_MSEC); + wait += IDLE_WAIT_TIMESTEP_MSEC; + } while (wait < IDLE_WAIT_TIMEOUT_MSEC); + + igt_assert(freqs[CUR] == freqs[MIN]); + log("Required %d msec to reach cur=min\n", wait); +} + static void pm_rps_exit_handler(int sig) { if (origfreqs[MIN] > readval(stuff[MAX].filp)) { @@ -291,6 +317,9 @@ int main(int argc, char **argv) } igt_subtest("basic-api") + min_max_config(basic_check); + + igt_subtest("min-max-config-idle") min_max_config(idle_check); igt_exit();