From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga06.intel.com (mga06b.intel.com [134.134.136.31]) by gabe.freedesktop.org (Postfix) with ESMTPS id 5D2DEAB3FF for ; Mon, 18 Jul 2022 07:09:46 +0000 (UTC) Date: Mon, 18 Jul 2022 12:39:30 +0530 From: Anshuman Gupta To: Rodrigo Vivi Message-ID: <20220718070923.GD32110@intel.com> References: <20220713155233.1155128-1-rodrigo.vivi@intel.com> <20220713155233.1155128-4-rodrigo.vivi@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20220713155233.1155128-4-rodrigo.vivi@intel.com> Subject: Re: [igt-dev] [PATCH i-g-t 4/4] test/i915/i915_suspend: Use SUSPEND_STATE_S3 to enforce S3. List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: igt-dev@lists.freedesktop.org Errors-To: igt-dev-bounces@lists.freedesktop.org Sender: "igt-dev" List-ID: On 2022-07-13 at 11:52:33 -0400, Rodrigo Vivi wrote: > Now that we have the ability to enforce the S3, let's use it > and avoid the extra check in the test. > > Cc: Riana Tauro > Cc: Anshuman Gupta > Signed-off-by: Rodrigo Vivi LGTM. Reviewed-by: Anshuman Gupta > --- > lib/igt_aux.c | 14 +++----------- > lib/igt_aux.h | 2 -- > tests/i915/i915_suspend.c | 5 +---- > 3 files changed, 4 insertions(+), 17 deletions(-) > > diff --git a/lib/igt_aux.c b/lib/igt_aux.c > index 69ae9b58..268bad7c 100644 > --- a/lib/igt_aux.c > +++ b/lib/igt_aux.c > @@ -841,15 +841,7 @@ static uint32_t get_supported_suspend_states(int power_dir) > return state_mask; > } > > -/** > - * igt_get_memsleep_state > - * > - * Reads the value of /sys/power/mem_sleep and > - * returns the current suspend state associated with 'mem'. > - * > - * Returns : an #igt_mem_sleep state, current suspend state associated with 'mem'. > - */ > -int igt_get_memsleep_state(void) > +static int get_mem_sleep(void) > { > char *mem_sleep_states; > char *mem_sleep_state; > @@ -938,9 +930,9 @@ void igt_system_suspend_autoresume(enum igt_suspend_state state, > orig_test = get_suspend_test(power_dir); > > if (state == SUSPEND_STATE_S3) { > - orig_mem_sleep = igt_get_memsleep_state(); > + orig_mem_sleep = get_mem_sleep(); > set_mem_sleep(power_dir, MEM_SLEEP_DEEP); > - igt_skip_on_f(igt_get_memsleep_state() != MEM_SLEEP_DEEP, > + igt_skip_on_f(get_mem_sleep() != MEM_SLEEP_DEEP, > "S3 not possible in this system.\n"); > } > > diff --git a/lib/igt_aux.h b/lib/igt_aux.h > index b1e48b0f..89437a90 100644 > --- a/lib/igt_aux.h > +++ b/lib/igt_aux.h > @@ -216,8 +216,6 @@ void igt_system_suspend_autoresume(enum igt_suspend_state state, > void igt_set_autoresume_delay(int delay_secs); > int igt_get_autoresume_delay(enum igt_suspend_state state); > > -int igt_get_memsleep_state(void); > - > /* dropping priviledges */ > void igt_drop_root(void); > > diff --git a/tests/i915/i915_suspend.c b/tests/i915/i915_suspend.c > index 222a8e4a..94935595 100644 > --- a/tests/i915/i915_suspend.c > +++ b/tests/i915/i915_suspend.c > @@ -209,9 +209,6 @@ test_suspend_without_i915(int state) > igt_kmsg(KMSG_INFO "Unloading i915\n"); > igt_assert_eq(igt_i915_driver_unload(),0); > > - igt_skip_on_f(igt_get_memsleep_state() == MEM_SLEEP_S2IDLE && > - state == SUSPEND_STATE_MEM, > - "S3 not possible: platform default mem_sleep state is s2idle\n"); > igt_system_suspend_autoresume(state, SUSPEND_TEST_NONE); > > igt_kmsg(KMSG_INFO "Re-loading i915 \n"); > @@ -228,7 +225,7 @@ igt_main > > igt_describe("Validate S3 without i915 module"); > igt_subtest("basic-s3-without-i915") > - test_suspend_without_i915(SUSPEND_STATE_MEM); > + test_suspend_without_i915(SUSPEND_STATE_S3); > > igt_fixture > fd = drm_open_driver(DRIVER_INTEL); > -- > 2.35.3 >