From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by gabe.freedesktop.org (Postfix) with ESMTPS id 4A6996EC1F for ; Wed, 26 May 2021 07:36:36 +0000 (UTC) From: Anshuman Gupta Date: Wed, 26 May 2021 12:50:39 +0530 Message-Id: <20210526072040.2286-5-anshuman.gupta@intel.com> In-Reply-To: <20210526072040.2286-1-anshuman.gupta@intel.com> References: <20210526072040.2286-1-anshuman.gupta@intel.com> MIME-Version: 1.0 Subject: [igt-dev] [PATCH i-g-t v4 4/5] i915/i915_pm_rpm: Add PC10 display off test List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: igt-dev-bounces@lists.freedesktop.org Sender: "igt-dev" To: igt-dev@lists.freedesktop.org List-ID: Add a test to validate PC10 residencies while all output's display is off. v2: used optimum pc10 timeout value. Reviewed-by: Uma Shankar Signed-off-by: Anshuman Gupta --- tests/i915/i915_pm_rpm.c | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/tests/i915/i915_pm_rpm.c b/tests/i915/i915_pm_rpm.c index 2d6cdf05..b7b6938c 100644 --- a/tests/i915/i915_pm_rpm.c +++ b/tests/i915/i915_pm_rpm.c @@ -93,6 +93,7 @@ enum plane_type { * Let's keep 3 seconds timeout for PC8 and 5 seconds for PC10. */ #define PC8_TIMEOUT 3 +#define PC10_TIMEOUT 5 int drm_fd, msr_fd, pc8_status_fd; int debugfs; @@ -178,6 +179,16 @@ static bool pc8_plus_residency_changed(unsigned int timeout_sec) timeout_sec * 1000, 100); } +static bool pc10_residency_changed(unsigned int timeout_sec) +{ + uint64_t res_pc10; + + res_pc10 = get_residency(MSR_PC10_RES); + + return igt_wait(res_pc10 != get_residency(MSR_PC10_RES), + timeout_sec * 1000, 100); +} + static enum pc8_status get_pc8_status(void) { ssize_t n_read; @@ -855,6 +866,19 @@ static void pc8_residency_subtest(bool display_on) } } +static void pc10_residency_subtest(bool display_on) +{ + igt_require(has_pc8); + igt_require(AT_LEAST_GEN(ms_data.devid, 9)); + + if (!display_on) { + /* Make sure PC10 residencies move! */ + disable_all_screens_and_wait(&ms_data); + igt_assert_f(pc10_residency_changed(PC10_TIMEOUT), + "Machine is not reaching PC10 state with all screens disabled.\n"); + } +} + static void modeset_subtest(enum screen_type type, int rounds, int wait_flags) { int i; @@ -2089,6 +2113,8 @@ igt_main_args("", long_options, help_str, opt_handler, NULL) pc8_residency_subtest(true); igt_subtest("pc8-residency-display-off") pc8_residency_subtest(false); + igt_subtest("pc10-residency-display-off") + pc10_residency_subtest(false); igt_subtest("debugfs-read") debugfs_read_subtest(); igt_subtest("debugfs-forcewake-user") -- 2.26.2 _______________________________________________ igt-dev mailing list igt-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/igt-dev