All of lore.kernel.org
 help / color / mirror / Atom feed
From: Rodrigo Vivi <rodrigo.vivi@intel.com>
To: "Gupta, Anshuman" <anshuman.gupta@intel.com>
Cc: "igt-dev@lists.freedesktop.org" <igt-dev@lists.freedesktop.org>
Subject: Re: [igt-dev] [PATCH i-g-t 1/1] lib/igt_aux : Skip SUSPEND_STATE_S3 if mem_sleep deep state is not supported
Date: Mon, 15 Aug 2022 12:39:21 -0400	[thread overview]
Message-ID: <Yvp2ueIpesR83wOv@intel.com> (raw)
In-Reply-To: <CY5PR11MB62111399D88E1DED67C4D3A395659@CY5PR11MB6211.namprd11.prod.outlook.com>

On Wed, Aug 10, 2022 at 07:51:07AM -0400, Gupta, Anshuman wrote:
> 
> 
> > -----Original Message-----
> > From: Tauro, Riana <riana.tauro@intel.com>
> > Sent: Wednesday, August 10, 2022 3:10 PM
> > To: igt-dev@lists.freedesktop.org
> > Cc: Tauro, Riana <riana.tauro@intel.com>; Gupta, Anshuman
> > <anshuman.gupta@intel.com>; Vivi, Rodrigo <rodrigo.vivi@intel.com>
> > Subject: [PATCH i-g-t 1/1] lib/igt_aux : Skip SUSPEND_STATE_S3 if mem_sleep
> > deep state is not supported
> > 
> > Forcing s3 by setting mem_sleep to deep fails if s3 is not supported by platform
> > 
> > Skip the test by checking if s3 is not one of the supported mem_sleep states
> > 
> > Closes: https://gitlab.freedesktop.org/drm/intel/-/issues/6531
> > Signed-off-by: Riana Tauro <riana.tauro@intel.com>
> > ---
> >  lib/igt_aux.c | 19 +++++++++++++++++++
> >  1 file changed, 19 insertions(+)
> > 
> > diff --git a/lib/igt_aux.c b/lib/igt_aux.c index d80a1935..edb53425 100644
> > --- a/lib/igt_aux.c
> > +++ b/lib/igt_aux.c
> > @@ -882,6 +882,23 @@ static void set_mem_sleep(int power_dir, enum
> > igt_mem_sleep sleep)
> >  				 mem_sleep_name[sleep]));
> >  }
> > 
> > +static bool is_mem_sleep_state_supported(int power_dir, enum
> > +igt_mem_sleep state) {
> > +	const char *str;
> > +	char *mem_sleep_states;
> > +
> > +	igt_assert((mem_sleep_states = igt_sysfs_get(power_dir,
> > +"mem_sleep")));
> > +
> > +	str = strstr(mem_sleep_states, mem_sleep_name[state]);
> > +
> > +	if (!str)
> > +		igt_info("mem_sleep state %s not supported.\nSupported
> > mem_sleep states: %s\n",
> > +			 mem_sleep_name[state], mem_sleep_states);
> Nitpicking 
> With this It may print with []: 
> mem_sleep state deep not supported
> Supported mem_sleep states: [s2idle] shallow
> But as this could be an extra piece of information of current mem_sleep state as well.
> Reviewed-by: Anshuman Gupta <anshuman.gupta@intel.com>

pushed. thanks for fixing this.

> 
> > +
> > +	free(mem_sleep_states);
> > +	return str;
> > +}
> > +
> >  /**
> >   * igt_system_suspend_autoresume:
> >   * @state: an #igt_suspend_state, the target suspend state @@ -923,6 +940,8
> > @@ void igt_system_suspend_autoresume(enum igt_suspend_state state,
> > 
> >  	if (state == SUSPEND_STATE_S3) {
> >  		orig_mem_sleep = get_mem_sleep();
> > +		igt_skip_on_f(!is_mem_sleep_state_supported(power_dir,
> > MEM_SLEEP_DEEP),
> > +			      "S3 not supported in this system.\n");
> >  		set_mem_sleep(power_dir, MEM_SLEEP_DEEP);
> >  		igt_skip_on_f(get_mem_sleep() != MEM_SLEEP_DEEP,
> >  			      "S3 not possible in this system.\n");
> > --
> > 2.25.1
> 

  reply	other threads:[~2022-08-15 16:39 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-08-10  9:40 [igt-dev] [PATCH i-g-t 0/1] Skip enforce S3 based on mem_sleep state Riana Tauro
2022-08-10  9:40 ` [igt-dev] [PATCH i-g-t 1/1] lib/igt_aux : Skip SUSPEND_STATE_S3 if mem_sleep deep state is not supported Riana Tauro
2022-08-10 11:51   ` Gupta, Anshuman
2022-08-15 16:39     ` Rodrigo Vivi [this message]
2022-08-10 12:59 ` [igt-dev] ✓ Fi.CI.BAT: success for Skip enforce S3 based on mem_sleep state Patchwork
2022-08-10 20:13 ` [igt-dev] ✓ Fi.CI.IGT: " 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=Yvp2ueIpesR83wOv@intel.com \
    --to=rodrigo.vivi@intel.com \
    --cc=anshuman.gupta@intel.com \
    --cc=igt-dev@lists.freedesktop.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.