From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 70574C7EE23 for ; Wed, 7 Jun 2023 21:12:59 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id A641810E54C; Wed, 7 Jun 2023 21:12:58 +0000 (UTC) Received: from mga12.intel.com (mga12.intel.com [192.55.52.136]) by gabe.freedesktop.org (Postfix) with ESMTPS id 5E83510E54C; Wed, 7 Jun 2023 21:12:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1686172376; x=1717708376; h=date:message-id:from:to:cc:subject:in-reply-to: references:mime-version; bh=v841QXrWU8gBrf8DQcSSB7Kkvrw8zZ2/atPjDAW9AFs=; b=Q+45iXJaQA7svWna7+AFX9XkUuG95NBF4rVZ7PE+En2ufmlHLHMpGS30 AHLTYZLsuWU58P79ZsLm0eXxNZPBIOaw+wGp9MeV6Ke/U/SVmVySzKrL8 x9puDlhQTvw9rn8Xym+y5WJIhZWgGBJ9UHfqgUr8o+yoKtEnbXFAd+lff ItqlFi34L3me4YJ6SYv6+/qZDOjMvKhXVpQvL1M9+6WK/oPENIZscQPAF 8UdbD+aexP2cB8oFfQ6tqJwBZC6hStfIOOXhSN524o+7OChUzpat/EQ5Z gT+jV1y9K+eXT5ZxgUz8zP1EI3SZijM4W1Q5RBiZPyoqkQ3klHqbACuZm g==; X-IronPort-AV: E=McAfee;i="6600,9927,10734"; a="336737833" X-IronPort-AV: E=Sophos;i="6.00,225,1681196400"; d="scan'208";a="336737833" Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Jun 2023 14:12:55 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10734"; a="799537310" X-IronPort-AV: E=Sophos;i="6.00,225,1681196400"; d="scan'208";a="799537310" Received: from adixit-mobl.amr.corp.intel.com (HELO adixit-arch.intel.com) ([10.209.85.43]) by fmsmga003-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Jun 2023 14:12:55 -0700 Date: Wed, 07 Jun 2023 14:12:39 -0700 Message-ID: <87bkhrm0xk.wl-ashutosh.dixit@intel.com> From: "Dixit, Ashutosh" To: Vinay Belgaumkar In-Reply-To: <20230606203535.292739-1-vinay.belgaumkar@intel.com> References: <20230606203535.292739-1-vinay.belgaumkar@intel.com> User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI-EPG/1.14.7 (Harue) FLIM-LB/1.14.9 (=?ISO-8859-4?Q?Goj=F2?=) APEL-LB/10.8 EasyPG/1.0.0 Emacs/28.2 (x86_64-pc-linux-gnu) MULE/6.0 (HANACHIRUSATO) MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Content-Type: text/plain; charset=US-ASCII Subject: Re: [Intel-gfx] [igt-dev] [PATCH i-g-t] tests/i915_pm_freq_api: Add a suspend subtest X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: igt-dev@lists.freedesktop.org, intel-gfx@lists.freedesktop.org Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" On Tue, 06 Jun 2023 13:35:35 -0700, Vinay Belgaumkar wrote: > Hi Vinay, > Verify that SLPC API works as expected after a suspend. > > Signed-off-by: Vinay Belgaumkar > --- > tests/i915/i915_pm_freq_api.c | 30 ++++++++++++++++++++++++++++++ > 1 file changed, 30 insertions(+) > > diff --git a/tests/i915/i915_pm_freq_api.c b/tests/i915/i915_pm_freq_api.c > index 9005cd220..f35f1f8e0 100644 > --- a/tests/i915/i915_pm_freq_api.c > +++ b/tests/i915/i915_pm_freq_api.c > @@ -18,6 +18,9 @@ > * > * SUBTEST: freq-reset > * Description: Test basic freq API works after a reset > + * > + * SUBTEST: freq-suspend > + * Description: Test basic freq API works after a runtime suspend > */ > > IGT_TEST_DESCRIPTION("Test SLPC freq API"); > @@ -99,6 +102,24 @@ static void test_reset(int i915, int dirfd, int gt) > igt_assert(get_freq(dirfd, RPS_MAX_FREQ_MHZ) == rpn); > } > > +static void test_suspend(int i915, int dirfd, int gt) > +{ > + uint32_t rpn = get_freq(dirfd, RPS_RPn_FREQ_MHZ); > + > + igt_assert(set_freq(dirfd, RPS_MIN_FREQ_MHZ, rpn) > 0); > + igt_assert(set_freq(dirfd, RPS_MAX_FREQ_MHZ, rpn) > 0); > + usleep(ACT_FREQ_LATENCY_US); > + igt_assert(get_freq(dirfd, RPS_MIN_FREQ_MHZ) == rpn); > + igt_assert(get_freq(dirfd, RPS_MAX_FREQ_MHZ) == rpn); > + > + /* Manually trigger a suspend */ > + igt_system_suspend_autoresume(SUSPEND_STATE_S3, > + SUSPEND_TEST_NONE); > + > + igt_assert(get_freq(dirfd, RPS_MIN_FREQ_MHZ) == rpn); > + igt_assert(get_freq(dirfd, RPS_MAX_FREQ_MHZ) == rpn); I am wondering what the purpose/value of this test (and also "freq-reset") is? How can the "set" min/max set freq (which are just input settings) change whether or not there is a suspend/resume or a reset? Especially when we just return cached min/max values from i915? Thanks. -- Ashutosh > +} > + > igt_main > { > int i915 = -1; > @@ -143,6 +164,15 @@ igt_main > test_reset(i915, dirfd, gt); > } > > + igt_describe("Test basic freq API works after suspend"); > + igt_subtest_with_dynamic_f("freq-suspend") { > + int dirfd, gt; > + > + for_each_sysfs_gt_dirfd(i915, dirfd, gt) > + igt_dynamic_f("gt%u", gt) > + test_suspend(i915, dirfd, gt); > + } > + > igt_fixture { > int dirfd, gt; > /* Restore frequencies */ > -- > 2.38.1 >