igt-dev.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
From: Imre Deak <imre.deak@intel.com>
To: Jyoti Yadav <jyoti.r.yadav@intel.com>
Cc: igt-dev@lists.freedesktop.org, anusha.srivatsa@intel.com,
	intel-gfx@lists.freedektop.org
Subject: Re: [igt-dev] [PATCH i-g-t v1 1/6] [intel-gfx] lib/igt_pm : Moves Dmc_loaded() function into library. Because it will be used by new test pm_dc.c which will validate Display C States.
Date: Tue, 2 Oct 2018 16:11:37 +0300	[thread overview]
Message-ID: <20181002131137.GD20560@ideak-desk.fi.intel.com> (raw)
In-Reply-To: <1537977563-18878-2-git-send-email-jyoti.r.yadav@intel.com>

On Wed, Sep 26, 2018 at 11:59:18AM -0400, Jyoti Yadav wrote:

Please use a tag format for the one line description like
lib/igt_pm:
(so no space before :), and always provide a longer description
in the message body. I guess it got mangled into your message
subject due to a missing new line.

Any reason you sent this to the intel-gfx list too? For IGT patches I'd
use only the IGT ML.

> Signed-off-by: Jyoti Yadav <jyoti.r.yadav@intel.com>
> ---
>  lib/igt_pm.c   | 29 +++++++++++++++++++++++++++++
>  lib/igt_pm.h   |  1 +
>  tests/pm_rpm.c | 17 +----------------
>  3 files changed, 31 insertions(+), 16 deletions(-)
> 
> diff --git a/lib/igt_pm.c b/lib/igt_pm.c
> index 4902723..ae87ab4 100644
> --- a/lib/igt_pm.c
> +++ b/lib/igt_pm.c
> @@ -38,6 +38,7 @@
>  #include "drmtest.h"
>  #include "igt_pm.h"
>  #include "igt_aux.h"
> +#include "igt_sysfs.h"
>  
>  /**
>   * SECTION:igt_pm
> @@ -620,3 +621,31 @@ bool igt_wait_for_pm_status(enum igt_runtime_pm_status status)
>  {
>  	return igt_wait(igt_get_runtime_pm_status() == status, 10000, 100);
>  }
> +
> +/**
> + * dmc_loaded:
> + * @debugfs : indicator that debugfs dir /sys/kerenl/debug/dri/0/i915 is
> + * available or not.

It's an fd to the debugfs dir.

> +
> + * Check whether DMC FW is loaded or not. DMC FW is require for few Display C
> + * states like DC5 and DC6. FW does the Context Save and Restore during Display
> + * C States entry and exit.
> + *
> + * Returns:
> + * True if DMC FW is loaded otherwise false.
> + */
> +bool dmc_loaded(int debugfs)

Missing igt_pm_ prefix.

> +{
> +	igt_require(debugfs != -1);
> +	char buf[15];
> +	int len;
> +
> +	len = igt_sysfs_read(debugfs, "i915_dmc_info", buf, sizeof(buf) - 1);
> +	if (len < 0)
> +		return true; /* no CSR support, no DMC requirement */
> +
> +	buf[len] = '\0';
> +
> +	igt_info("DMC: %s\n", buf);

igt_debug() seems more proper for a lib function.

> +	return strstr(buf, "fw loaded: yes");
> +}
> diff --git a/lib/igt_pm.h b/lib/igt_pm.h
> index 10cc679..b4a98aa 100644
> --- a/lib/igt_pm.h
> +++ b/lib/igt_pm.h
> @@ -50,5 +50,6 @@ bool igt_setup_runtime_pm(void);
>  void igt_restore_runtime_pm(void);
>  enum igt_runtime_pm_status igt_get_runtime_pm_status(void);
>  bool igt_wait_for_pm_status(enum igt_runtime_pm_status status);
> +bool dmc_loaded(int debugfs);
>  
>  #endif /* IGT_PM_H */
> diff --git a/tests/pm_rpm.c b/tests/pm_rpm.c
> index c24fd95..ebb624b 100644
> --- a/tests/pm_rpm.c
> +++ b/tests/pm_rpm.c
> @@ -693,21 +693,6 @@ static void setup_pc8(void)
>  	has_pc8 = true;
>  }
>  
> -static bool dmc_loaded(void)
> -{
> -	char buf[15];
> -	int len;
> -
> -	len = igt_sysfs_read(debugfs, "i915_dmc_info", buf, sizeof(buf) - 1);
> -	if (len < 0)
> -	    return true; /* no CSR support, no DMC requirement */
> -
> -	buf[len] = '\0';
> -
> -	igt_info("DMC: %s\n", buf);
> -	return strstr(buf, "fw loaded: yes");
> -}
> -
>  static bool setup_environment(void)
>  {
>  	if (has_runtime_pm)
> @@ -730,7 +715,7 @@ static bool setup_environment(void)
>  	igt_info("Runtime PM support: %d\n", has_runtime_pm);
>  	igt_info("PC8 residency support: %d\n", has_pc8);
>  	igt_require(has_runtime_pm);
> -	igt_require(dmc_loaded());
> +	igt_require(dmc_loaded(debugfs));
>  
>  out:
>  	disable_all_screens(&ms_data);
> -- 
> 2.7.4
> 
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

  reply	other threads:[~2018-10-02 13:13 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-09-26 15:59 [igt-dev] [PATCH i-g-t v1 0/6] Added new test file pm_dc.c Jyoti Yadav
2018-09-26 15:59 ` [igt-dev] [PATCH i-g-t v1 1/6] [intel-gfx] lib/igt_pm : Moves Dmc_loaded() function into library. Because it will be used by new test pm_dc.c which will validate Display C States Jyoti Yadav
2018-10-02 13:11   ` Imre Deak [this message]
2018-09-26 15:59 ` [igt-dev] [PATCH i-g-t v1 2/6] [intel-gfx] tests/pm_dc : Added new test to verify Display C States. Currently this test validate DC5 upon PSR entry for Icelake, Skylake and Broxton platform Jyoti Yadav
2018-10-02 13:25   ` Imre Deak
2018-10-03 23:59     ` Dhinakaran Pandiyan
2018-10-04  0:13     ` Dhinakaran Pandiyan
2018-10-03 10:24   ` Petri Latvala
2018-09-26 15:59 ` [igt-dev] [PATCH i-g-t v1 3/6] [intel-gfx] tests/pm_dc : Added test to validate DC6 state on Gen11 platform. On Gen11 Platform, DC6 is achieved with PSR entry Jyoti Yadav
2018-10-02 13:31   ` Imre Deak
2018-09-26 15:59 ` [igt-dev] [PATCH i-g-t v1 4/6] [intel-gfx][intel-dev] tests/pm_dc : This patch adds test to validate DC6 on SKL. DC6 on SKL is achieved with RPM enabled and DPMS OFF sequence Jyoti Yadav
2018-10-02 13:36   ` Imre Deak
2018-10-03  4:37     ` Yadav, Jyoti R
2018-10-03  9:50       ` Imre Deak
2018-10-04  0:15       ` Dhinakaran Pandiyan
2018-09-26 15:59 ` [igt-dev] [PATCH i-g-t v1 5/6] [intel-gfx] lib/intel_reg : This patch adds Display C States related residency counters Jyoti Yadav
2018-09-26 15:59 ` [igt-dev] [PATCH i-g-t v1 6/6] [intel-gfx] tests/Makefile : Added new file tests/pm_dc.c for compilation Jyoti Yadav
2018-10-02 13:38   ` Imre Deak
2018-10-03 10:25     ` Petri Latvala
2018-09-26 16:50 ` [igt-dev] ✓ Fi.CI.BAT: success for Added new test file pm_dc.c Patchwork
2018-09-26 22:22 ` [igt-dev] ✓ Fi.CI.IGT: " Patchwork
2018-10-04  0:22 ` [igt-dev] [PATCH i-g-t v1 0/6] " Dhinakaran Pandiyan

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=20181002131137.GD20560@ideak-desk.fi.intel.com \
    --to=imre.deak@intel.com \
    --cc=anusha.srivatsa@intel.com \
    --cc=igt-dev@lists.freedesktop.org \
    --cc=intel-gfx@lists.freedektop.org \
    --cc=jyoti.r.yadav@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;
as well as URLs for NNTP newsgroup(s).