From patchwork Fri Feb 24 10:58:53 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Szwichtenberg, Radoslaw" X-Patchwork-Id: 9589915 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 87BC060471 for ; Fri, 24 Feb 2017 10:59:08 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8354728949 for ; Fri, 24 Feb 2017 10:59:08 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 783782894F; Fri, 24 Feb 2017 10:59:08 +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 853A528949 for ; Fri, 24 Feb 2017 10:59:07 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id D358F6EC00; Fri, 24 Feb 2017 10:59:06 +0000 (UTC) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by gabe.freedesktop.org (Postfix) with ESMTPS id 0DAF16EC10 for ; Fri, 24 Feb 2017 10:59:06 +0000 (UTC) Received: from orsmga003.jf.intel.com ([10.7.209.27]) by orsmga103.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 24 Feb 2017 02:59:01 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.35,200,1484035200"; d="scan'208";a="937651252" Received: from rszwicht-desk.ger.corp.intel.com (HELO rszwicht-desk.igk.intel.com) ([172.28.171.52]) by orsmga003.jf.intel.com with ESMTP; 24 Feb 2017 02:59:00 -0800 From: Radoslaw Szwichtenberg To: intel-gfx@lists.freedesktop.org Date: Fri, 24 Feb 2017 11:58:53 +0100 Message-Id: <20170224105853.5717-2-radoslaw.szwichtenberg@intel.com> X-Mailer: git-send-email 2.9.3 In-Reply-To: <20170224105853.5717-1-radoslaw.szwichtenberg@intel.com> References: <20170224105853.5717-1-radoslaw.szwichtenberg@intel.com> Subject: [Intel-gfx] [PATCH i-g-t 2/2] tests/pm_rps: Add waitboost-softlimit test 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 Test verifies that frequency gets boosted to gt_boost_freq_mhz even though gt_max_freq_mhz is lower than gt_boost_freq_mhz. Cc: Arkadiusz Hiler Cc: Michal Winiarski Signed-off-by: Radoslaw Szwichtenberg --- tests/pm_rps.c | 33 ++++++++++++++++++++++++++++++++- 1 file changed, 32 insertions(+), 1 deletion(-) diff --git a/tests/pm_rps.c b/tests/pm_rps.c index 7aa66a8..3cbbeeb 100644 --- a/tests/pm_rps.c +++ b/tests/pm_rps.c @@ -50,6 +50,7 @@ enum { RP0, RP1, RPn, + BOOST, NUMFREQ }; @@ -60,7 +61,14 @@ struct junk { const char *mode; FILE *filp; } stuff[] = { - { "cur", "r", NULL }, { "min", "rb+", NULL }, { "max", "rb+", NULL }, { "RP0", "r", NULL }, { "RP1", "r", NULL }, { "RPn", "r", NULL }, { NULL, NULL, NULL } + { "cur", "r", NULL }, + { "min", "rb+", NULL }, + { "max", "rb+", NULL }, + { "RP0", "r", NULL }, + { "RP1", "r", NULL }, + { "RPn", "r", NULL }, + {"boost", "rb+", NULL }, + { NULL, NULL, NULL } }; static int readval(FILE *filp) @@ -614,6 +622,27 @@ static void waitboost(bool reset) close(fd); } +static void waitboost_softlimit(void) +{ + int boost_freqs[NUMFREQ]; + int fmid = (origfreqs[RPn] + origfreqs[RP0]) / 2; + int fd = drm_open_driver(DRIVER_INTEL); + fmid = get_hw_rounded_freq(fmid); + + igt_debug("Set min and max to midpoint\n"); + writeval(stuff[MIN].filp, fmid); + writeval(stuff[MAX].filp, fmid); + + /* When we wait upon the GPU, we want to temporarily boost it + * to maximum. + */ + boost_freq(fd, boost_freqs); + + igt_assert_eq(boost_freqs[CUR], boost_freqs[BOOST]); + + close(fd); +} + static void pm_rps_exit_handler(int sig) { if (origfreqs[MIN] > readval(stuff[MAX].filp)) { @@ -679,4 +708,6 @@ igt_main igt_subtest("reset") waitboost(true); + igt_subtest("waitboost-softlimit") + waitboost_softlimit(); }