From patchwork Mon May 18 15:35:39 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Imre Deak X-Patchwork-Id: 6430061 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.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id E5B57C0432 for ; Mon, 18 May 2015 15:36:11 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 2AF31205C1 for ; Mon, 18 May 2015 15:36:11 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 560F320592 for ; Mon, 18 May 2015 15:36:10 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id AB4816E4F1; Mon, 18 May 2015 08:36:09 -0700 (PDT) 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 ESMTP id A6E046E4F1 for ; Mon, 18 May 2015 08:36:07 -0700 (PDT) Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by orsmga102.jf.intel.com with ESMTP; 18 May 2015 08:35:52 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.13,453,1427785200"; d="scan'208";a="495100171" Received: from ideak-desk.fi.intel.com ([10.237.72.74]) by FMSMGA003.fm.intel.com with ESMTP; 18 May 2015 08:35:52 -0700 From: Imre Deak To: intel-gfx@lists.freedesktop.org Date: Mon, 18 May 2015 18:35:39 +0300 Message-Id: <1431963339-23914-7-git-send-email-imre.deak@intel.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1431963339-23914-1-git-send-email-imre.deak@intel.com> References: <1431963339-23914-1-git-send-email-imre.deak@intel.com> Subject: [Intel-gfx] [PATCH 7/7] tests/pm_rc6_residency: fix check if RC6P or RC6PP is enabled 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-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, T_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 The test checks the residency in a given RC6 state or any deeper states that are also enabled. For example the RC6 subtest checks the combined residency in RC6/RC6P/RC6PP. Since the kernel reported value for the RC6 residency doesn't include the RC6P or RC6PP residency we need to adjust the RC6 value accordingly. A similar adjustment is needed for the RC6P subtest. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=90369 Signed-off-by: Imre Deak --- tests/pm_rc6_residency.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/tests/pm_rc6_residency.c b/tests/pm_rc6_residency.c index 54a6b10..9203d2f 100644 --- a/tests/pm_rc6_residency.c +++ b/tests/pm_rc6_residency.c @@ -162,6 +162,17 @@ static void measure_residencies(int devid, unsigned int rc6_mask, res->rc6p = end.rc6p - start.rc6p; res->rc6pp = end.rc6pp - start.rc6pp; res->media_rc6 = end.media_rc6 - start.media_rc6; + + /* + * For the purposes of this test case we want a given residency value + * to include the time spent in the corresponding RC state _and_ also + * the time spent in any enabled deeper states. So for example if any + * of RC6P or RC6PP is enabled we want the time spent in these states + * to be also included in the RC6 residency value. The kernel reported + * residency values are exclusive, so add up things here. + */ + res->rc6p += res->rc6pp; + res->rc6 += res->rc6p; } igt_main