Igt-dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Anshuman Gupta <anshuman.gupta@intel.com>
To: Rodrigo Vivi <rodrigo.vivi@intel.com>
Cc: igt-dev@lists.freedesktop.org
Subject: Re: [igt-dev] [PATCH i-g-t 4/4] test/i915/i915_suspend: Use SUSPEND_STATE_S3 to enforce S3.
Date: Mon, 18 Jul 2022 12:39:30 +0530	[thread overview]
Message-ID: <20220718070923.GD32110@intel.com> (raw)
In-Reply-To: <20220713155233.1155128-4-rodrigo.vivi@intel.com>

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 <riana.tauro@intel.com>
> Cc: Anshuman Gupta <anshuman.gupta@intel.com>
> Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
LGTM.
Reviewed-by: Anshuman Gupta <anshuman.gupta@intel.com>
> ---
>  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
> 

  reply	other threads:[~2022-07-18  7:09 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-07-13 15:52 [igt-dev] [PATCH i-g-t 1/4] lib/igt_aux: Let's use the official mem_sleep names Rodrigo Vivi
2022-07-13 15:52 ` [igt-dev] [PATCH i-g-t 2/4] tests/i915/i915_suspend: Be more specific on the S3 mem_sleep requirement Rodrigo Vivi
2022-07-18  6:24   ` Anshuman Gupta
2022-07-13 15:52 ` [igt-dev] [PATCH i-g-t 3/4] lib/igt_aux: Introduce the ability to force S3 suspend state Rodrigo Vivi
2022-07-18  6:47   ` Anshuman Gupta
2022-07-18 21:42     ` Rodrigo Vivi
2022-07-19  5:20       ` Gupta, Anshuman
2022-07-13 15:52 ` [igt-dev] [PATCH i-g-t 4/4] test/i915/i915_suspend: Use SUSPEND_STATE_S3 to enforce S3 Rodrigo Vivi
2022-07-18  7:09   ` Anshuman Gupta [this message]
2022-07-13 18:58 ` [igt-dev] ✗ Fi.CI.BAT: failure for series starting with [i-g-t,1/4] lib/igt_aux: Let's use the official mem_sleep names Patchwork
2022-07-18  5:54 ` [igt-dev] [PATCH i-g-t 1/4] " Anshuman Gupta
2022-07-19 13:17 ` [igt-dev] ✗ Fi.CI.BAT: failure for series starting with [i-g-t,1/4] lib/igt_aux: Let's use the official mem_sleep names (rev2) Patchwork
2022-07-21 10:26 ` [igt-dev] ✗ Fi.CI.BAT: failure for series starting with [i-g-t,1/4] lib/igt_aux: Let's use the official mem_sleep names (rev3) Patchwork

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220718070923.GD32110@intel.com \
    --to=anshuman.gupta@intel.com \
    --cc=igt-dev@lists.freedesktop.org \
    --cc=rodrigo.vivi@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox