public inbox for igt-dev@lists.freedesktop.org
 help / color / mirror / Atom feed
* [igt-dev] [PATCH i-g-t 1/2] i915/i915_power: Sanity check power measurement
  2023-01-21  5:41 [igt-dev] [PATCH i-g-t 0/2] " Ashutosh Dixit
@ 2023-01-21  5:41 ` Ashutosh Dixit
  2023-01-24 12:59   ` Tauro, Riana
  2023-01-24 17:00   ` Kamil Konieczny
  0 siblings, 2 replies; 19+ messages in thread
From: Ashutosh Dixit @ 2023-01-21  5:41 UTC (permalink / raw)
  To: igt-dev; +Cc: Badal Nilawar

Add a test to sanity check power measurement on integrated/discrete by
requiring power under load to be > 0 and >= idle power.

Signed-off-by: Ashutosh Dixit <ashutosh.dixit@intel.com>
---
 tests/i915/i915_power.c | 73 +++++++++++++++++++++++++++++++++++++++++
 tests/meson.build       |  1 +
 2 files changed, 74 insertions(+)
 create mode 100644 tests/i915/i915_power.c

diff --git a/tests/i915/i915_power.c b/tests/i915/i915_power.c
new file mode 100644
index 00000000000..e7d5c32f1af
--- /dev/null
+++ b/tests/i915/i915_power.c
@@ -0,0 +1,73 @@
+// SPDX-License-Identifier: MIT
+/*
+ * Copyright © 2022 Intel Corporation
+ */
+
+#include "igt.h"
+#include "i915/gem.h"
+#include "igt_power.h"
+
+IGT_TEST_DESCRIPTION("i915 power measurement tests");
+
+static double power(int i915, const char *domain, bool load)
+{
+	const intel_ctx_t *ctx = intel_ctx_create_all_physical(i915);
+	uint64_t ahnd = get_reloc_ahnd(i915, ctx->id);
+	struct power_sample sample[2];
+	int sleep_duration_sec = 2;
+	struct igt_power pwr;
+	igt_spin_t *spin;
+	double mW;
+
+	gem_quiescent_gpu(i915);
+	if (load) {
+		spin = igt_spin_new(i915, .ahnd = ahnd, .ctx = ctx,
+				    .engine = ALL_ENGINES,
+				    .flags = IGT_SPIN_POLL_RUN);
+		/* Wait till at least one spinner starts */
+		igt_spin_busywait_until_started(spin);
+	}
+
+	igt_require(!igt_power_open(i915, &pwr, domain));
+	igt_power_get_energy(&pwr, &sample[0]);
+	usleep(sleep_duration_sec * USEC_PER_SEC);
+	igt_power_get_energy(&pwr, &sample[1]);
+
+	mW = igt_power_get_mW(&pwr, &sample[0], &sample[1]);
+	igt_info("Domain: %s, Load: %d, Measured power: %g mW\n", domain, load, mW);
+
+	igt_power_close(&pwr);
+	igt_free_spins(i915);
+	put_ahnd(ahnd);
+	intel_ctx_destroy(i915, ctx);
+
+	return mW;
+}
+
+static void sanity(int i915, const char *domain)
+{
+	double idle, busy;
+
+	idle = power(i915, domain, false);
+	busy = power(i915, domain, true);
+
+	igt_assert(busy > 0 && busy >= idle);
+}
+
+igt_main
+{
+	int i915;
+
+	igt_fixture {
+		i915 = drm_open_driver_master(DRIVER_INTEL);
+	}
+
+	igt_describe("Sanity check power measurement");
+	igt_subtest("sanity") {
+		sanity(i915, "gpu");
+	}
+
+	igt_fixture {
+		close(i915);
+	}
+}
diff --git a/tests/meson.build b/tests/meson.build
index e20a864035b..e0f41e9e6a1 100644
--- a/tests/meson.build
+++ b/tests/meson.build
@@ -212,6 +212,7 @@ i915_progs = [
 	'i915_pm_dc',
 	'i915_pm_rps',
 	'i915_pm_sseu',
+	'i915_power',
 	'i915_query',
 	'i915_selftest',
 	'i915_suspend',
-- 
2.38.0

^ permalink raw reply related	[flat|nested] 19+ messages in thread

* Re: [igt-dev] [PATCH i-g-t 1/2] i915/i915_power: Sanity check power measurement
  2023-01-21  5:41 ` [igt-dev] [PATCH i-g-t 1/2] " Ashutosh Dixit
@ 2023-01-24 12:59   ` Tauro, Riana
  2023-01-24 17:00   ` Kamil Konieczny
  1 sibling, 0 replies; 19+ messages in thread
From: Tauro, Riana @ 2023-01-24 12:59 UTC (permalink / raw)
  To: Ashutosh Dixit, igt-dev, Anshuman Gupta; +Cc: Badal Nilawar

Hi Ashutosh,

On 1/21/2023 11:11 AM, Ashutosh Dixit wrote:
> Add a test to sanity check power measurement on integrated/discrete by
> requiring power under load to be > 0 and >= idle power.
> 
> Signed-off-by: Ashutosh Dixit <ashutosh.dixit@intel.com>
> ---
>   tests/i915/i915_power.c | 73 +++++++++++++++++++++++++++++++++++++++++
>   tests/meson.build       |  1 +
>   2 files changed, 74 insertions(+)
>   create mode 100644 tests/i915/i915_power.c
> 
> diff --git a/tests/i915/i915_power.c b/tests/i915/i915_power.c
> new file mode 100644
> index 00000000000..e7d5c32f1af
> --- /dev/null
> +++ b/tests/i915/i915_power.c
> @@ -0,0 +1,73 @@
> +// SPDX-License-Identifier: MIT
> +/*
> + * Copyright © 2022 Intel Corporation
> + */
Year 2023

With the above change
Looks good to me
Reviewed-by: Riana Tauro <riana.tauro@intel.com>
> +
> +#include "igt.h"
> +#include "i915/gem.h"
> +#include "igt_power.h"
> +
> +IGT_TEST_DESCRIPTION("i915 power measurement tests");
> +
> +static double power(int i915, const char *domain, bool load)
measure_power instead of power?
> +{
> +	const intel_ctx_t *ctx = intel_ctx_create_all_physical(i915);
> +	uint64_t ahnd = get_reloc_ahnd(i915, ctx->id);
> +	struct power_sample sample[2];
> +	int sleep_duration_sec = 2;
> +	struct igt_power pwr;
> +	igt_spin_t *spin;
> +	double mW;
> +
> +	gem_quiescent_gpu(i915);
> +	if (load) {
> +		spin = igt_spin_new(i915, .ahnd = ahnd, .ctx = ctx,
> +				    .engine = ALL_ENGINES,
> +				    .flags = IGT_SPIN_POLL_RUN);
> +		/* Wait till at least one spinner starts */
> +		igt_spin_busywait_until_started(spin);
> +	}
> +
> +	igt_require(!igt_power_open(i915, &pwr, domain));
> +	igt_power_get_energy(&pwr, &sample[0]);
> +	usleep(sleep_duration_sec * USEC_PER_SEC);
> +	igt_power_get_energy(&pwr, &sample[1]);
> +
> +	mW = igt_power_get_mW(&pwr, &sample[0], &sample[1]);
> +	igt_info("Domain: %s, Load: %d, Measured power: %g mW\n", domain, load, mW);
> +
> +	igt_power_close(&pwr);
> +	igt_free_spins(i915);
> +	put_ahnd(ahnd);
> +	intel_ctx_destroy(i915, ctx);
> +
> +	return mW;
> +}
> +
> +static void sanity(int i915, const char *domain)
> +{
> +	double idle, busy;
> +
> +	idle = power(i915, domain, false);
> +	busy = power(i915, domain, true);
> +
> +	igt_assert(busy > 0 && busy >= idle);
> +}
> +
> +igt_main
> +{
> +	int i915;
> +
> +	igt_fixture {
> +		i915 = drm_open_driver_master(DRIVER_INTEL);
> +	}
> +
> +	igt_describe("Sanity check power measurement");
> +	igt_subtest("sanity") {
> +		sanity(i915, "gpu");
> +	}
> +
> +	igt_fixture {
> +		close(i915);
> +	}
> +}
> diff --git a/tests/meson.build b/tests/meson.build
> index e20a864035b..e0f41e9e6a1 100644
> --- a/tests/meson.build
> +++ b/tests/meson.build
> @@ -212,6 +212,7 @@ i915_progs = [
>   	'i915_pm_dc',
>   	'i915_pm_rps',
>   	'i915_pm_sseu',
> +	'i915_power',
>   	'i915_query',
>   	'i915_selftest',
>   	'i915_suspend',

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [igt-dev] [PATCH i-g-t 1/2] i915/i915_power: Sanity check power measurement
  2023-01-21  5:41 ` [igt-dev] [PATCH i-g-t 1/2] " Ashutosh Dixit
  2023-01-24 12:59   ` Tauro, Riana
@ 2023-01-24 17:00   ` Kamil Konieczny
  2023-01-24 18:01     ` Dixit, Ashutosh
  1 sibling, 1 reply; 19+ messages in thread
From: Kamil Konieczny @ 2023-01-24 17:00 UTC (permalink / raw)
  To: igt-dev; +Cc: Badal Nilawar

Hi Ashutosh,

one nit, see below.

On 2023-01-20 at 21:41:52 -0800, Ashutosh Dixit wrote:
> Add a test to sanity check power measurement on integrated/discrete by
> requiring power under load to be > 0 and >= idle power.
> 
> Signed-off-by: Ashutosh Dixit <ashutosh.dixit@intel.com>
> ---
>  tests/i915/i915_power.c | 73 +++++++++++++++++++++++++++++++++++++++++
>  tests/meson.build       |  1 +
>  2 files changed, 74 insertions(+)
>  create mode 100644 tests/i915/i915_power.c
> 
> diff --git a/tests/i915/i915_power.c b/tests/i915/i915_power.c
> new file mode 100644
> index 00000000000..e7d5c32f1af
> --- /dev/null
> +++ b/tests/i915/i915_power.c
> @@ -0,0 +1,73 @@
> +// SPDX-License-Identifier: MIT
> +/*
> + * Copyright © 2022 Intel Corporation
> + */
> +
> +#include "igt.h"
> +#include "i915/gem.h"
> +#include "igt_power.h"
> +
> +IGT_TEST_DESCRIPTION("i915 power measurement tests");
> +
> +static double power(int i915, const char *domain, bool load)
> +{
> +	const intel_ctx_t *ctx = intel_ctx_create_all_physical(i915);
> +	uint64_t ahnd = get_reloc_ahnd(i915, ctx->id);
> +	struct power_sample sample[2];
> +	int sleep_duration_sec = 2;
> +	struct igt_power pwr;
> +	igt_spin_t *spin;
> +	double mW;
> +
> +	gem_quiescent_gpu(i915);
> +	if (load) {
> +		spin = igt_spin_new(i915, .ahnd = ahnd, .ctx = ctx,
> +				    .engine = ALL_ENGINES,
> +				    .flags = IGT_SPIN_POLL_RUN);
> +		/* Wait till at least one spinner starts */
> +		igt_spin_busywait_until_started(spin);
> +	}
> +
> +	igt_require(!igt_power_open(i915, &pwr, domain));

Please move this before igt_spin_new, also rewrite this so
you will free context before, or move context creation to
igt_fixture and give it as param for this function.

Regards,
Kamil

> +	igt_power_get_energy(&pwr, &sample[0]);
> +	usleep(sleep_duration_sec * USEC_PER_SEC);
> +	igt_power_get_energy(&pwr, &sample[1]);
> +
> +	mW = igt_power_get_mW(&pwr, &sample[0], &sample[1]);
> +	igt_info("Domain: %s, Load: %d, Measured power: %g mW\n", domain, load, mW);
> +
> +	igt_power_close(&pwr);
> +	igt_free_spins(i915);
> +	put_ahnd(ahnd);
> +	intel_ctx_destroy(i915, ctx);
> +
> +	return mW;
> +}
> +
> +static void sanity(int i915, const char *domain)
> +{
> +	double idle, busy;
> +
> +	idle = power(i915, domain, false);
> +	busy = power(i915, domain, true);
> +
> +	igt_assert(busy > 0 && busy >= idle);
> +}
> +
> +igt_main
> +{
> +	int i915;
> +
> +	igt_fixture {
> +		i915 = drm_open_driver_master(DRIVER_INTEL);
> +	}
> +
> +	igt_describe("Sanity check power measurement");
> +	igt_subtest("sanity") {
> +		sanity(i915, "gpu");
> +	}
> +
> +	igt_fixture {
> +		close(i915);
> +	}
> +}
> diff --git a/tests/meson.build b/tests/meson.build
> index e20a864035b..e0f41e9e6a1 100644
> --- a/tests/meson.build
> +++ b/tests/meson.build
> @@ -212,6 +212,7 @@ i915_progs = [
>  	'i915_pm_dc',
>  	'i915_pm_rps',
>  	'i915_pm_sseu',
> +	'i915_power',
>  	'i915_query',
>  	'i915_selftest',
>  	'i915_suspend',
> -- 
> 2.38.0
> 

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [igt-dev] [PATCH i-g-t 1/2] i915/i915_power: Sanity check power measurement
  2023-01-24 17:00   ` Kamil Konieczny
@ 2023-01-24 18:01     ` Dixit, Ashutosh
  2023-01-25  9:40       ` Kamil Konieczny
  0 siblings, 1 reply; 19+ messages in thread
From: Dixit, Ashutosh @ 2023-01-24 18:01 UTC (permalink / raw)
  To: Kamil Konieczny, igt-dev, Ashutosh Dixit, Badal Nilawar,
	Riana Tauro, Anshuman Gupta

On Tue, 24 Jan 2023 09:00:23 -0800, Kamil Konieczny wrote:
>
> Hi Ashutosh,
>
> one nit, see below.

Hi Kamil,

>
> On 2023-01-20 at 21:41:52 -0800, Ashutosh Dixit wrote:
> > Add a test to sanity check power measurement on integrated/discrete by
> > requiring power under load to be > 0 and >= idle power.
> >
> > Signed-off-by: Ashutosh Dixit <ashutosh.dixit@intel.com>
> > ---
> >  tests/i915/i915_power.c | 73 +++++++++++++++++++++++++++++++++++++++++
> >  tests/meson.build       |  1 +
> >  2 files changed, 74 insertions(+)
> >  create mode 100644 tests/i915/i915_power.c
> >
> > diff --git a/tests/i915/i915_power.c b/tests/i915/i915_power.c
> > new file mode 100644
> > index 00000000000..e7d5c32f1af
> > --- /dev/null
> > +++ b/tests/i915/i915_power.c
> > @@ -0,0 +1,73 @@
> > +// SPDX-License-Identifier: MIT
> > +/*
> > + * Copyright © 2022 Intel Corporation
> > + */
> > +
> > +#include "igt.h"
> > +#include "i915/gem.h"
> > +#include "igt_power.h"
> > +
> > +IGT_TEST_DESCRIPTION("i915 power measurement tests");
> > +
> > +static double power(int i915, const char *domain, bool load)
> > +{
> > +	const intel_ctx_t *ctx = intel_ctx_create_all_physical(i915);
> > +	uint64_t ahnd = get_reloc_ahnd(i915, ctx->id);
> > +	struct power_sample sample[2];
> > +	int sleep_duration_sec = 2;
> > +	struct igt_power pwr;
> > +	igt_spin_t *spin;
> > +	double mW;
> > +
> > +	gem_quiescent_gpu(i915);
> > +	if (load) {
> > +		spin = igt_spin_new(i915, .ahnd = ahnd, .ctx = ctx,
> > +				    .engine = ALL_ENGINES,
> > +				    .flags = IGT_SPIN_POLL_RUN);
> > +		/* Wait till at least one spinner starts */
> > +		igt_spin_busywait_until_started(spin);
> > +	}
> > +
> > +	igt_require(!igt_power_open(i915, &pwr, domain));
>
> Please move this before igt_spin_new,

Sure, I can move this to the top of the function.

> also rewrite this so you will free context before

Sorry, before what? I don't want to free the context before igt_free_spins
because that requires context persistence which is not fully supported on
GuC based systems.

> or move context creation to igt_fixture and give it as param for this
> function.

Here I consider the context internal to the power measurement so I prefer
to keep it in this function.

But if you explain the reason why you are asking for these changes maybe I
can figure out what to do.

Do you just want to create the context after igt_require?

Thanks.
--
Ashutosh


>
> Regards,
> Kamil
>
> > +	igt_power_get_energy(&pwr, &sample[0]);
> > +	usleep(sleep_duration_sec * USEC_PER_SEC);
> > +	igt_power_get_energy(&pwr, &sample[1]);
> > +
> > +	mW = igt_power_get_mW(&pwr, &sample[0], &sample[1]);
> > +	igt_info("Domain: %s, Load: %d, Measured power: %g mW\n", domain, load, mW);
> > +
> > +	igt_power_close(&pwr);
> > +	igt_free_spins(i915);
> > +	put_ahnd(ahnd);
> > +	intel_ctx_destroy(i915, ctx);
> > +
> > +	return mW;
> > +}
> > +
> > +static void sanity(int i915, const char *domain)
> > +{
> > +	double idle, busy;
> > +
> > +	idle = power(i915, domain, false);
> > +	busy = power(i915, domain, true);
> > +
> > +	igt_assert(busy > 0 && busy >= idle);
> > +}
> > +
> > +igt_main
> > +{
> > +	int i915;
> > +
> > +	igt_fixture {
> > +		i915 = drm_open_driver_master(DRIVER_INTEL);
> > +	}
> > +
> > +	igt_describe("Sanity check power measurement");
> > +	igt_subtest("sanity") {
> > +		sanity(i915, "gpu");
> > +	}
> > +
> > +	igt_fixture {
> > +		close(i915);
> > +	}
> > +}
> > diff --git a/tests/meson.build b/tests/meson.build
> > index e20a864035b..e0f41e9e6a1 100644
> > --- a/tests/meson.build
> > +++ b/tests/meson.build
> > @@ -212,6 +212,7 @@ i915_progs = [
> >	'i915_pm_dc',
> >	'i915_pm_rps',
> >	'i915_pm_sseu',
> > +	'i915_power',
> >	'i915_query',
> >	'i915_selftest',
> >	'i915_suspend',
> > --
> > 2.38.0
> >

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [igt-dev] [PATCH i-g-t 1/2] i915/i915_power: Sanity check power measurement
  2023-01-24 18:01     ` Dixit, Ashutosh
@ 2023-01-25  9:40       ` Kamil Konieczny
  2023-01-27  6:28         ` Dixit, Ashutosh
  0 siblings, 1 reply; 19+ messages in thread
From: Kamil Konieczny @ 2023-01-25  9:40 UTC (permalink / raw)
  To: igt-dev; +Cc: Badal Nilawar

Hi,

On 2023-01-24 at 10:01:35 -0800, Dixit, Ashutosh wrote:
> On Tue, 24 Jan 2023 09:00:23 -0800, Kamil Konieczny wrote:
> >
> > Hi Ashutosh,
> >
> > one nit, see below.
> 
> Hi Kamil,
> 
> >
> > On 2023-01-20 at 21:41:52 -0800, Ashutosh Dixit wrote:
> > > Add a test to sanity check power measurement on integrated/discrete by
> > > requiring power under load to be > 0 and >= idle power.
> > >
> > > Signed-off-by: Ashutosh Dixit <ashutosh.dixit@intel.com>
> > > ---
> > >  tests/i915/i915_power.c | 73 +++++++++++++++++++++++++++++++++++++++++
> > >  tests/meson.build       |  1 +
> > >  2 files changed, 74 insertions(+)
> > >  create mode 100644 tests/i915/i915_power.c
> > >
> > > diff --git a/tests/i915/i915_power.c b/tests/i915/i915_power.c
> > > new file mode 100644
> > > index 00000000000..e7d5c32f1af
> > > --- /dev/null
> > > +++ b/tests/i915/i915_power.c
> > > @@ -0,0 +1,73 @@
> > > +// SPDX-License-Identifier: MIT
> > > +/*
> > > + * Copyright © 2022 Intel Corporation
> > > + */
> > > +
> > > +#include "igt.h"
> > > +#include "i915/gem.h"
> > > +#include "igt_power.h"
> > > +
> > > +IGT_TEST_DESCRIPTION("i915 power measurement tests");
> > > +
> > > +static double power(int i915, const char *domain, bool load)
-------------------------------------------------------- ^
Maybe re-organize you test code and put this into sanity() function
along with igt_require, context and spinner creation ?

imho this function should be simple and it should return only
power consumed.

> > > +{
> > > +	const intel_ctx_t *ctx = intel_ctx_create_all_physical(i915);
> > > +	uint64_t ahnd = get_reloc_ahnd(i915, ctx->id);
> > > +	struct power_sample sample[2];
> > > +	int sleep_duration_sec = 2;
-------------------------------- ^
imho make it define or const

> > > +	struct igt_power pwr;
> > > +	igt_spin_t *spin;
> > > +	double mW;
> > > +
> > > +	gem_quiescent_gpu(i915);
> > > +	if (load) {
> > > +		spin = igt_spin_new(i915, .ahnd = ahnd, .ctx = ctx,
> > > +				    .engine = ALL_ENGINES,
> > > +				    .flags = IGT_SPIN_POLL_RUN);
> > > +		/* Wait till at least one spinner starts */
> > > +		igt_spin_busywait_until_started(spin);
> > > +	}
> > > +
> > > +	igt_require(!igt_power_open(i915, &pwr, domain));
> >
> > Please move this before igt_spin_new,
> 
> Sure, I can move this to the top of the function.
> 
> > also rewrite this so you will free context before
> 
> Sorry, before what? I don't want to free the context before igt_free_spins
> because that requires context persistence which is not fully supported on
> GuC based systems.
> 
> > or move context creation to igt_fixture and give it as param for this
> > function.
> 
> Here I consider the context internal to the power measurement so I prefer
> to keep it in this function.
> 
> But if you explain the reason why you are asking for these changes maybe I
> can figure out what to do.
> 
> Do you just want to create the context after igt_require?

Yes this is what I mean, context and spinner should be created
after check(s) for skip.

> > > +	igt_power_get_energy(&pwr, &sample[0]);
> > > +	usleep(sleep_duration_sec * USEC_PER_SEC);
> > > +	igt_power_get_energy(&pwr, &sample[1]);
> > > +
> > > +	mW = igt_power_get_mW(&pwr, &sample[0], &sample[1]);
> > > +	igt_info("Domain: %s, Load: %d, Measured power: %g mW\n", domain, load, mW);

This print will be better placed in sanity() function.

Regards,
Kamil

> > > +
> > > +	igt_power_close(&pwr);
> > > +	igt_free_spins(i915);
> > > +	put_ahnd(ahnd);
> > > +	intel_ctx_destroy(i915, ctx);
> > > +
> > > +	return mW;
> > > +}
> > > +
> > > +static void sanity(int i915, const char *domain)
> > > +{
> > > +	double idle, busy;
> > > +
> > > +	idle = power(i915, domain, false);
> > > +	busy = power(i915, domain, true);
> > > +
> > > +	igt_assert(busy > 0 && busy >= idle);
> > > +}
> > > +
> > > +igt_main
> > > +{
> > > +	int i915;
> > > +
> > > +	igt_fixture {
> > > +		i915 = drm_open_driver_master(DRIVER_INTEL);
> > > +	}
> > > +
> > > +	igt_describe("Sanity check power measurement");
> > > +	igt_subtest("sanity") {
> > > +		sanity(i915, "gpu");
> > > +	}
> > > +
> > > +	igt_fixture {
> > > +		close(i915);
> > > +	}
> > > +}
> > > diff --git a/tests/meson.build b/tests/meson.build
> > > index e20a864035b..e0f41e9e6a1 100644
> > > --- a/tests/meson.build
> > > +++ b/tests/meson.build
> > > @@ -212,6 +212,7 @@ i915_progs = [
> > >	'i915_pm_dc',
> > >	'i915_pm_rps',
> > >	'i915_pm_sseu',
> > > +	'i915_power',
> > >	'i915_query',
> > >	'i915_selftest',
> > >	'i915_suspend',
> > > --
> > > 2.38.0
> > >

^ permalink raw reply	[flat|nested] 19+ messages in thread

* [igt-dev] [PATCH i-g-t 1/2] i915/i915_power: Sanity check power measurement
  2023-01-27  6:25 [igt-dev] [PATCH i-g-t 0/2] " Ashutosh Dixit
@ 2023-01-27  6:25 ` Ashutosh Dixit
  2023-01-27 12:29   ` Kamil Konieczny
  0 siblings, 1 reply; 19+ messages in thread
From: Ashutosh Dixit @ 2023-01-27  6:25 UTC (permalink / raw)
  To: igt-dev

Add a test to sanity check power measurement on integrated/discrete by
requiring power under load to be > 0 and >= idle power.

v2: Code reorganization (Kamil K)

Signed-off-by: Ashutosh Dixit <ashutosh.dixit@intel.com>
Reviewed-by: Riana Tauro <riana.tauro@intel.com>
---
 tests/i915/i915_power.c | 80 +++++++++++++++++++++++++++++++++++++++++
 tests/meson.build       |  1 +
 2 files changed, 81 insertions(+)
 create mode 100644 tests/i915/i915_power.c

diff --git a/tests/i915/i915_power.c b/tests/i915/i915_power.c
new file mode 100644
index 00000000000..00993cdc846
--- /dev/null
+++ b/tests/i915/i915_power.c
@@ -0,0 +1,80 @@
+// SPDX-License-Identifier: MIT
+/*
+ * Copyright © 2023 Intel Corporation
+ */
+
+#include "igt.h"
+#include "i915/gem.h"
+#include "igt_power.h"
+
+IGT_TEST_DESCRIPTION("i915 power measurement tests");
+
+static double get_power(struct igt_power *pwr, const char *domain)
+{
+	const int sleep_duration_sec = 2;
+	struct power_sample sample[2];
+
+	igt_power_get_energy(pwr, &sample[0]);
+	usleep(sleep_duration_sec * USEC_PER_SEC);
+	igt_power_get_energy(pwr, &sample[1]);
+
+	return igt_power_get_mW(pwr, &sample[0], &sample[1]);
+}
+
+static double measure_power(int i915, struct igt_power *pwr,
+			    const char *domain, bool load)
+{
+	const intel_ctx_t *ctx = intel_ctx_create_all_physical(i915);
+	uint64_t ahnd = get_reloc_ahnd(i915, ctx->id);
+	igt_spin_t *spin;
+	double mW;
+
+	gem_quiescent_gpu(i915);
+	if (load) {
+		spin = igt_spin_new(i915, .ahnd = ahnd, .ctx = ctx,
+				    .engine = ALL_ENGINES,
+				    .flags = IGT_SPIN_POLL_RUN);
+		/* Wait till at least one spinner starts */
+		igt_spin_busywait_until_started(spin);
+	}
+
+	mW = get_power(pwr, domain);
+	igt_info("Domain: %s, Load: %d, Measured power: %g mW\n", domain, load, mW);
+
+	igt_free_spins(i915);
+	put_ahnd(ahnd);
+	intel_ctx_destroy(i915, ctx);
+
+	return mW;
+}
+
+static void sanity(int i915, const char *domain)
+{
+	struct igt_power pwr;
+	double idle, busy;
+
+	igt_require(!igt_power_open(i915, &pwr, domain));
+	idle = measure_power(i915, &pwr, domain, false);
+	busy = measure_power(i915, &pwr, domain, true);
+	igt_power_close(&pwr);
+
+	igt_assert(idle >= 0 && busy > 0 && busy >= idle);
+}
+
+igt_main
+{
+	int i915;
+
+	igt_fixture {
+		i915 = drm_open_driver_master(DRIVER_INTEL);
+	}
+
+	igt_describe("Sanity check power measurement");
+	igt_subtest("sanity") {
+		sanity(i915, "gpu");
+	}
+
+	igt_fixture {
+		close(i915);
+	}
+}
diff --git a/tests/meson.build b/tests/meson.build
index cce9d89e1c8..d93a07c9ed6 100644
--- a/tests/meson.build
+++ b/tests/meson.build
@@ -213,6 +213,7 @@ i915_progs = [
 	'i915_pm_dc',
 	'i915_pm_rps',
 	'i915_pm_sseu',
+	'i915_power',
 	'i915_query',
 	'i915_selftest',
 	'i915_suspend',
-- 
2.38.0

^ permalink raw reply related	[flat|nested] 19+ messages in thread

* Re: [igt-dev] [PATCH i-g-t 1/2] i915/i915_power: Sanity check power measurement
  2023-01-25  9:40       ` Kamil Konieczny
@ 2023-01-27  6:28         ` Dixit, Ashutosh
  0 siblings, 0 replies; 19+ messages in thread
From: Dixit, Ashutosh @ 2023-01-27  6:28 UTC (permalink / raw)
  To: Kamil Konieczny, igt-dev, Riana Tauro

On Wed, 25 Jan 2023 01:40:18 -0800, Kamil Konieczny wrote:
>
> Hi,
>

Hi Kamil,

Not exactly what you said but pretty close. Please take a look at the
latest version:

https://patchwork.freedesktop.org/series/113412/

Thanks.
--
Ashutosh


> On 2023-01-24 at 10:01:35 -0800, Dixit, Ashutosh wrote:
> > On Tue, 24 Jan 2023 09:00:23 -0800, Kamil Konieczny wrote:
> > >
> > > Hi Ashutosh,
> > >
> > > one nit, see below.
> >
> > Hi Kamil,
> >
> > >
> > > On 2023-01-20 at 21:41:52 -0800, Ashutosh Dixit wrote:
> > > > Add a test to sanity check power measurement on integrated/discrete by
> > > > requiring power under load to be > 0 and >= idle power.
> > > >
> > > > Signed-off-by: Ashutosh Dixit <ashutosh.dixit@intel.com>
> > > > ---
> > > >  tests/i915/i915_power.c | 73 +++++++++++++++++++++++++++++++++++++++++
> > > >  tests/meson.build       |  1 +
> > > >  2 files changed, 74 insertions(+)
> > > >  create mode 100644 tests/i915/i915_power.c
> > > >
> > > > diff --git a/tests/i915/i915_power.c b/tests/i915/i915_power.c
> > > > new file mode 100644
> > > > index 00000000000..e7d5c32f1af
> > > > --- /dev/null
> > > > +++ b/tests/i915/i915_power.c
> > > > @@ -0,0 +1,73 @@
> > > > +// SPDX-License-Identifier: MIT
> > > > +/*
> > > > + * Copyright © 2022 Intel Corporation
> > > > + */
> > > > +
> > > > +#include "igt.h"
> > > > +#include "i915/gem.h"
> > > > +#include "igt_power.h"
> > > > +
> > > > +IGT_TEST_DESCRIPTION("i915 power measurement tests");
> > > > +
> > > > +static double power(int i915, const char *domain, bool load)
> -------------------------------------------------------- ^
> Maybe re-organize you test code and put this into sanity() function
> along with igt_require, context and spinner creation ?
>
> imho this function should be simple and it should return only
> power consumed.
>
> > > > +{
> > > > +	const intel_ctx_t *ctx = intel_ctx_create_all_physical(i915);
> > > > +	uint64_t ahnd = get_reloc_ahnd(i915, ctx->id);
> > > > +	struct power_sample sample[2];
> > > > +	int sleep_duration_sec = 2;
> -------------------------------- ^
> imho make it define or const
>
> > > > +	struct igt_power pwr;
> > > > +	igt_spin_t *spin;
> > > > +	double mW;
> > > > +
> > > > +	gem_quiescent_gpu(i915);
> > > > +	if (load) {
> > > > +		spin = igt_spin_new(i915, .ahnd = ahnd, .ctx = ctx,
> > > > +				    .engine = ALL_ENGINES,
> > > > +				    .flags = IGT_SPIN_POLL_RUN);
> > > > +		/* Wait till at least one spinner starts */
> > > > +		igt_spin_busywait_until_started(spin);
> > > > +	}
> > > > +
> > > > +	igt_require(!igt_power_open(i915, &pwr, domain));
> > >
> > > Please move this before igt_spin_new,
> >
> > Sure, I can move this to the top of the function.
> >
> > > also rewrite this so you will free context before
> >
> > Sorry, before what? I don't want to free the context before igt_free_spins
> > because that requires context persistence which is not fully supported on
> > GuC based systems.
> >
> > > or move context creation to igt_fixture and give it as param for this
> > > function.
> >
> > Here I consider the context internal to the power measurement so I prefer
> > to keep it in this function.
> >
> > But if you explain the reason why you are asking for these changes maybe I
> > can figure out what to do.
> >
> > Do you just want to create the context after igt_require?
>
> Yes this is what I mean, context and spinner should be created
> after check(s) for skip.
>
> > > > +	igt_power_get_energy(&pwr, &sample[0]);
> > > > +	usleep(sleep_duration_sec * USEC_PER_SEC);
> > > > +	igt_power_get_energy(&pwr, &sample[1]);
> > > > +
> > > > +	mW = igt_power_get_mW(&pwr, &sample[0], &sample[1]);
> > > > +	igt_info("Domain: %s, Load: %d, Measured power: %g mW\n", domain, load, mW);
>
> This print will be better placed in sanity() function.
>
> Regards,
> Kamil
>
> > > > +
> > > > +	igt_power_close(&pwr);
> > > > +	igt_free_spins(i915);
> > > > +	put_ahnd(ahnd);
> > > > +	intel_ctx_destroy(i915, ctx);
> > > > +
> > > > +	return mW;
> > > > +}
> > > > +
> > > > +static void sanity(int i915, const char *domain)
> > > > +{
> > > > +	double idle, busy;
> > > > +
> > > > +	idle = power(i915, domain, false);
> > > > +	busy = power(i915, domain, true);
> > > > +
> > > > +	igt_assert(busy > 0 && busy >= idle);
> > > > +}
> > > > +
> > > > +igt_main
> > > > +{
> > > > +	int i915;
> > > > +
> > > > +	igt_fixture {
> > > > +		i915 = drm_open_driver_master(DRIVER_INTEL);
> > > > +	}
> > > > +
> > > > +	igt_describe("Sanity check power measurement");
> > > > +	igt_subtest("sanity") {
> > > > +		sanity(i915, "gpu");
> > > > +	}
> > > > +
> > > > +	igt_fixture {
> > > > +		close(i915);
> > > > +	}
> > > > +}
> > > > diff --git a/tests/meson.build b/tests/meson.build
> > > > index e20a864035b..e0f41e9e6a1 100644
> > > > --- a/tests/meson.build
> > > > +++ b/tests/meson.build
> > > > @@ -212,6 +212,7 @@ i915_progs = [
> > > >	'i915_pm_dc',
> > > >	'i915_pm_rps',
> > > >	'i915_pm_sseu',
> > > > +	'i915_power',
> > > >	'i915_query',
> > > >	'i915_selftest',
> > > >	'i915_suspend',
> > > > --
> > > > 2.38.0
> > > >

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [igt-dev] [PATCH i-g-t 1/2] i915/i915_power: Sanity check power measurement
  2023-01-27  6:25 ` [igt-dev] [PATCH i-g-t 1/2] " Ashutosh Dixit
@ 2023-01-27 12:29   ` Kamil Konieczny
  2023-01-27 16:13     ` Dixit, Ashutosh
  0 siblings, 1 reply; 19+ messages in thread
From: Kamil Konieczny @ 2023-01-27 12:29 UTC (permalink / raw)
  To: igt-dev

Hi Ashutosh,

On 2023-01-26 at 22:25:01 -0800, Ashutosh Dixit wrote:
> Add a test to sanity check power measurement on integrated/discrete by
> requiring power under load to be > 0 and >= idle power.
> 
> v2: Code reorganization (Kamil K)
> 
> Signed-off-by: Ashutosh Dixit <ashutosh.dixit@intel.com>
> Reviewed-by: Riana Tauro <riana.tauro@intel.com>
> ---
>  tests/i915/i915_power.c | 80 +++++++++++++++++++++++++++++++++++++++++
>  tests/meson.build       |  1 +
>  2 files changed, 81 insertions(+)
>  create mode 100644 tests/i915/i915_power.c
> 
> diff --git a/tests/i915/i915_power.c b/tests/i915/i915_power.c
> new file mode 100644
> index 00000000000..00993cdc846
> --- /dev/null
> +++ b/tests/i915/i915_power.c
> @@ -0,0 +1,80 @@
> +// SPDX-License-Identifier: MIT
> +/*
> + * Copyright © 2023 Intel Corporation
> + */
> +
> +#include "igt.h"
> +#include "i915/gem.h"
> +#include "igt_power.h"
> +
> +IGT_TEST_DESCRIPTION("i915 power measurement tests");
> +
> +static double get_power(struct igt_power *pwr, const char *domain)
------------------------------------------------------------- ^
You are not using this so delete it.

> +{
> +	const int sleep_duration_sec = 2;
----------------- ^
Make this a parameter for function.

> +	struct power_sample sample[2];
> +
> +	igt_power_get_energy(pwr, &sample[0]);
> +	usleep(sleep_duration_sec * USEC_PER_SEC);
> +	igt_power_get_energy(pwr, &sample[1]);
> +
> +	return igt_power_get_mW(pwr, &sample[0], &sample[1]);
> +}
> +
> +static double measure_power(int i915, struct igt_power *pwr,
> +			    const char *domain, bool load)
----------------------------------------------- ^
This is confusing, delete this. Please avoid creating functions
with boolean parameter, just do its work in place you will use
true or false.

> +{
> +	const intel_ctx_t *ctx = intel_ctx_create_all_physical(i915);
> +	uint64_t ahnd = get_reloc_ahnd(i915, ctx->id);
> +	igt_spin_t *spin;
> +	double mW;
> +
> +	gem_quiescent_gpu(i915);
> +	if (load) {
------- ^
Delete this if() and move spin creation after idle see below.

> +		spin = igt_spin_new(i915, .ahnd = ahnd, .ctx = ctx,
> +				    .engine = ALL_ENGINES,
> +				    .flags = IGT_SPIN_POLL_RUN);
> +		/* Wait till at least one spinner starts */
> +		igt_spin_busywait_until_started(spin);
> +	}
> +
> +	mW = get_power(pwr, domain);
> +	igt_info("Domain: %s, Load: %d, Measured power: %g mW\n", domain, load, mW);
> +
> +	igt_free_spins(i915);
> +	put_ahnd(ahnd);
> +	intel_ctx_destroy(i915, ctx);
> +
> +	return mW;
> +}
> +
> +static void sanity(int i915, const char *domain)
> +{
> +	struct igt_power pwr;
> +	double idle, busy;
> +
> +	igt_require(!igt_power_open(i915, &pwr, domain));
> +	idle = measure_power(i915, &pwr, domain, false);
> +	busy = measure_power(i915, &pwr, domain, true);
> +	igt_power_close(&pwr);
> +
> +	igt_assert(idle >= 0 && busy > 0 && busy >= idle);
------------------------------------------------ ^
imho this should be "busy > idle" ?

Merge sanity() with measure_power() so it will be simple.
This should look like:
	// check require
	// prepare ctx and other
	idle = get_power(pwr, 2 * USEC_PER_SEC); /* 2 seconds */
	// create spin and wait until it will run
	busy = get_power(pwr, 2 * USEC_PER_SEC); /* 2 seconds */
	// cleanup after spin, ctx, and other
	// print info what was measured, domain, power and time used
	// assert

> +}
> +
> +igt_main
> +{
> +	int i915;
> +
> +	igt_fixture {
> +		i915 = drm_open_driver_master(DRIVER_INTEL);
> +	}
> +
> +	igt_describe("Sanity check power measurement");
> +	igt_subtest("sanity") {
> +		sanity(i915, "gpu");
----------------------------- ^
Do you plan other domains, maybe multi-gpu like gpu-#number ?

Regards,
Kamil

> +	}
> +
> +	igt_fixture {
> +		close(i915);
> +	}
> +}
> diff --git a/tests/meson.build b/tests/meson.build
> index cce9d89e1c8..d93a07c9ed6 100644
> --- a/tests/meson.build
> +++ b/tests/meson.build
> @@ -213,6 +213,7 @@ i915_progs = [
>  	'i915_pm_dc',
>  	'i915_pm_rps',
>  	'i915_pm_sseu',
> +	'i915_power',
>  	'i915_query',
>  	'i915_selftest',
>  	'i915_suspend',
> -- 
> 2.38.0
> 

^ permalink raw reply	[flat|nested] 19+ messages in thread

* [igt-dev] [PATCH i-g-t 0/2] i915/i915_power: Sanity check power measurement
@ 2023-01-27 16:08 Ashutosh Dixit
  2023-01-27 16:08 ` [igt-dev] [PATCH i-g-t 1/2] " Ashutosh Dixit
                   ` (3 more replies)
  0 siblings, 4 replies; 19+ messages in thread
From: Ashutosh Dixit @ 2023-01-27 16:08 UTC (permalink / raw)
  To: igt-dev

Ashutosh Dixit (2):
  i915/i915_power: Sanity check power measurement
  HAX: Add i915_power@sanity to fast-feedback.testlist

 tests/i915/i915_power.c               | 70 +++++++++++++++++++++++++++
 tests/intel-ci/fast-feedback.testlist |  1 +
 tests/meson.build                     |  1 +
 3 files changed, 72 insertions(+)
 create mode 100644 tests/i915/i915_power.c

-- 
2.38.0

^ permalink raw reply	[flat|nested] 19+ messages in thread

* [igt-dev] [PATCH i-g-t 1/2] i915/i915_power: Sanity check power measurement
  2023-01-27 16:08 [igt-dev] [PATCH i-g-t 0/2] i915/i915_power: Sanity check power measurement Ashutosh Dixit
@ 2023-01-27 16:08 ` Ashutosh Dixit
  2023-01-27 16:46   ` Kamil Konieczny
  2023-01-27 16:08 ` [igt-dev] [PATCH i-g-t 2/2] HAX: Add i915_power@sanity to fast-feedback.testlist Ashutosh Dixit
                   ` (2 subsequent siblings)
  3 siblings, 1 reply; 19+ messages in thread
From: Ashutosh Dixit @ 2023-01-27 16:08 UTC (permalink / raw)
  To: igt-dev

Add a test to sanity check power measurement on integrated/discrete by
requiring power under load to be > 0 and >= idle power.

v2: Code reorganization (Kamil K)
v3: More code reorganization (Kamil K)

Signed-off-by: Ashutosh Dixit <ashutosh.dixit@intel.com>
Reviewed-by: Riana Tauro <riana.tauro@intel.com>
---
 tests/i915/i915_power.c | 70 +++++++++++++++++++++++++++++++++++++++++
 tests/meson.build       |  1 +
 2 files changed, 71 insertions(+)
 create mode 100644 tests/i915/i915_power.c

diff --git a/tests/i915/i915_power.c b/tests/i915/i915_power.c
new file mode 100644
index 00000000000..533cf769b54
--- /dev/null
+++ b/tests/i915/i915_power.c
@@ -0,0 +1,70 @@
+// SPDX-License-Identifier: MIT
+/*
+ * Copyright © 2023 Intel Corporation
+ */
+
+#include "igt.h"
+#include "i915/gem.h"
+#include "igt_power.h"
+
+IGT_TEST_DESCRIPTION("i915 power measurement tests");
+
+static double measure_power(struct igt_power *pwr, int sleep_duration_sec)
+{
+	struct power_sample sample[2];
+
+	igt_power_get_energy(pwr, &sample[0]);
+	usleep(sleep_duration_sec * USEC_PER_SEC);
+	igt_power_get_energy(pwr, &sample[1]);
+
+	return igt_power_get_mW(pwr, &sample[0], &sample[1]);
+}
+
+static void sanity(int i915)
+{
+	const intel_ctx_t *ctx;
+	struct igt_power pwr;
+	double idle, busy;
+	igt_spin_t *spin;
+	uint64_t ahnd;
+
+	/* Idle power */
+	igt_require(!igt_power_open(i915, &pwr, "gpu"));
+	gem_quiescent_gpu(i915);
+	idle = measure_power(&pwr, 2);
+
+	/* Busy power */
+	ctx = intel_ctx_create_all_physical(i915);
+	ahnd = get_reloc_ahnd(i915, ctx->id);
+	spin = igt_spin_new(i915, .ahnd = ahnd, .ctx = ctx,
+			    .engine = ALL_ENGINES,
+			    .flags = IGT_SPIN_POLL_RUN);
+	/* Wait till at least one spinner starts */
+	igt_spin_busywait_until_started(spin);
+	busy = measure_power(&pwr, 2);
+	igt_free_spins(i915);
+	put_ahnd(ahnd);
+	intel_ctx_destroy(i915, ctx);
+	igt_power_close(&pwr);
+
+	igt_info("Measured power: idle: %g mW, busy: %g mW\n", idle, busy);
+	igt_assert(idle >= 0 && busy > 0 && busy > idle);
+}
+
+igt_main
+{
+	int i915;
+
+	igt_fixture {
+		i915 = drm_open_driver_master(DRIVER_INTEL);
+	}
+
+	igt_describe("Sanity check gpu power measurement");
+	igt_subtest("sanity") {
+		sanity(i915);
+	}
+
+	igt_fixture {
+		close(i915);
+	}
+}
diff --git a/tests/meson.build b/tests/meson.build
index cce9d89e1c8..d93a07c9ed6 100644
--- a/tests/meson.build
+++ b/tests/meson.build
@@ -213,6 +213,7 @@ i915_progs = [
 	'i915_pm_dc',
 	'i915_pm_rps',
 	'i915_pm_sseu',
+	'i915_power',
 	'i915_query',
 	'i915_selftest',
 	'i915_suspend',
-- 
2.38.0

^ permalink raw reply related	[flat|nested] 19+ messages in thread

* [igt-dev] [PATCH i-g-t 2/2] HAX: Add i915_power@sanity to fast-feedback.testlist
  2023-01-27 16:08 [igt-dev] [PATCH i-g-t 0/2] i915/i915_power: Sanity check power measurement Ashutosh Dixit
  2023-01-27 16:08 ` [igt-dev] [PATCH i-g-t 1/2] " Ashutosh Dixit
@ 2023-01-27 16:08 ` Ashutosh Dixit
  2023-01-27 16:53 ` [igt-dev] ✓ Fi.CI.BAT: success for i915/i915_power: Sanity check power measurement Patchwork
  2023-01-27 20:03 ` [igt-dev] ✓ Fi.CI.IGT: " Patchwork
  3 siblings, 0 replies; 19+ messages in thread
From: Ashutosh Dixit @ 2023-01-27 16:08 UTC (permalink / raw)
  To: igt-dev

CI.

Signed-off-by: Ashutosh Dixit <ashutosh.dixit@intel.com>
---
 tests/intel-ci/fast-feedback.testlist | 1 +
 1 file changed, 1 insertion(+)

diff --git a/tests/intel-ci/fast-feedback.testlist b/tests/intel-ci/fast-feedback.testlist
index 4188e97375d..a266c316db9 100644
--- a/tests/intel-ci/fast-feedback.testlist
+++ b/tests/intel-ci/fast-feedback.testlist
@@ -128,6 +128,7 @@ igt@i915_pm_backlight@basic-brightness
 igt@i915_pm_rpm@basic-pci-d3-state
 igt@i915_pm_rpm@basic-rte
 igt@i915_pm_rps@basic-api
+igt@i915_power@sanity
 igt@prime_self_import@basic-llseek-bad
 igt@prime_self_import@basic-llseek-size
 igt@prime_self_import@basic-with_fd_dup
-- 
2.38.0

^ permalink raw reply related	[flat|nested] 19+ messages in thread

* Re: [igt-dev] [PATCH i-g-t 1/2] i915/i915_power: Sanity check power measurement
  2023-01-27 12:29   ` Kamil Konieczny
@ 2023-01-27 16:13     ` Dixit, Ashutosh
  0 siblings, 0 replies; 19+ messages in thread
From: Dixit, Ashutosh @ 2023-01-27 16:13 UTC (permalink / raw)
  To: Kamil Konieczny, igt-dev, Ashutosh Dixit, Riana Tauro

On Fri, 27 Jan 2023 04:29:45 -0800, Kamil Konieczny wrote:
>
> Hi Ashutosh,

Hi Kamil,

I have addressed all comments. Please take a look at the latest
version:

https://patchwork.freedesktop.org/series/113436/

(not sure why Patchwork is creating new series each time).

Thanks.
--
Ashutosh

>
> On 2023-01-26 at 22:25:01 -0800, Ashutosh Dixit wrote:
> > Add a test to sanity check power measurement on integrated/discrete by
> > requiring power under load to be > 0 and >= idle power.
> >
> > v2: Code reorganization (Kamil K)
> >
> > Signed-off-by: Ashutosh Dixit <ashutosh.dixit@intel.com>
> > Reviewed-by: Riana Tauro <riana.tauro@intel.com>
> > ---
> >  tests/i915/i915_power.c | 80 +++++++++++++++++++++++++++++++++++++++++
> >  tests/meson.build       |  1 +
> >  2 files changed, 81 insertions(+)
> >  create mode 100644 tests/i915/i915_power.c
> >
> > diff --git a/tests/i915/i915_power.c b/tests/i915/i915_power.c
> > new file mode 100644
> > index 00000000000..00993cdc846
> > --- /dev/null
> > +++ b/tests/i915/i915_power.c
> > @@ -0,0 +1,80 @@
> > +// SPDX-License-Identifier: MIT
> > +/*
> > + * Copyright © 2023 Intel Corporation
> > + */
> > +
> > +#include "igt.h"
> > +#include "i915/gem.h"
> > +#include "igt_power.h"
> > +
> > +IGT_TEST_DESCRIPTION("i915 power measurement tests");
> > +
> > +static double get_power(struct igt_power *pwr, const char *domain)
> ------------------------------------------------------------- ^
> You are not using this so delete it.

Done.

>
> > +{
> > +	const int sleep_duration_sec = 2;
> ----------------- ^
> Make this a parameter for function.

Done.

>
> > +	struct power_sample sample[2];
> > +
> > +	igt_power_get_energy(pwr, &sample[0]);
> > +	usleep(sleep_duration_sec * USEC_PER_SEC);
> > +	igt_power_get_energy(pwr, &sample[1]);
> > +
> > +	return igt_power_get_mW(pwr, &sample[0], &sample[1]);
> > +}
> > +
> > +static double measure_power(int i915, struct igt_power *pwr,
> > +			    const char *domain, bool load)
> ----------------------------------------------- ^
> This is confusing, delete this. Please avoid creating functions
> with boolean parameter, just do its work in place you will use
> true or false.

Done.

>
> > +{
> > +	const intel_ctx_t *ctx = intel_ctx_create_all_physical(i915);
> > +	uint64_t ahnd = get_reloc_ahnd(i915, ctx->id);
> > +	igt_spin_t *spin;
> > +	double mW;
> > +
> > +	gem_quiescent_gpu(i915);
> > +	if (load) {
> ------- ^
> Delete this if() and move spin creation after idle see below.

Done.

>
> > +		spin = igt_spin_new(i915, .ahnd = ahnd, .ctx = ctx,
> > +				    .engine = ALL_ENGINES,
> > +				    .flags = IGT_SPIN_POLL_RUN);
> > +		/* Wait till at least one spinner starts */
> > +		igt_spin_busywait_until_started(spin);
> > +	}
> > +
> > +	mW = get_power(pwr, domain);
> > +	igt_info("Domain: %s, Load: %d, Measured power: %g mW\n", domain, load, mW);
> > +
> > +	igt_free_spins(i915);
> > +	put_ahnd(ahnd);
> > +	intel_ctx_destroy(i915, ctx);
> > +
> > +	return mW;
> > +}
> > +
> > +static void sanity(int i915, const char *domain)
> > +{
> > +	struct igt_power pwr;
> > +	double idle, busy;
> > +
> > +	igt_require(!igt_power_open(i915, &pwr, domain));
> > +	idle = measure_power(i915, &pwr, domain, false);
> > +	busy = measure_power(i915, &pwr, domain, true);
> > +	igt_power_close(&pwr);
> > +
> > +	igt_assert(idle >= 0 && busy > 0 && busy >= idle);
> ------------------------------------------------ ^
> imho this should be "busy > idle" ?

Done.

>
> Merge sanity() with measure_power() so it will be simple.
> This should look like:
>	// check require
>	// prepare ctx and other
>	idle = get_power(pwr, 2 * USEC_PER_SEC); /* 2 seconds */
>	// create spin and wait until it will run
>	busy = get_power(pwr, 2 * USEC_PER_SEC); /* 2 seconds */
>	// cleanup after spin, ctx, and other
>	// print info what was measured, domain, power and time used
>	// assert

Done.

>
> > +}
> > +
> > +igt_main
> > +{
> > +	int i915;
> > +
> > +	igt_fixture {
> > +		i915 = drm_open_driver_master(DRIVER_INTEL);
> > +	}
> > +
> > +	igt_describe("Sanity check power measurement");
> > +	igt_subtest("sanity") {
> > +		sanity(i915, "gpu");
> ----------------------------- ^
> Do you plan other domains, maybe multi-gpu like gpu-#number ?

Future patch.

>
> Regards,
> Kamil
>
> > +	}
> > +
> > +	igt_fixture {
> > +		close(i915);
> > +	}
> > +}
> > diff --git a/tests/meson.build b/tests/meson.build
> > index cce9d89e1c8..d93a07c9ed6 100644
> > --- a/tests/meson.build
> > +++ b/tests/meson.build
> > @@ -213,6 +213,7 @@ i915_progs = [
> >	'i915_pm_dc',
> >	'i915_pm_rps',
> >	'i915_pm_sseu',
> > +	'i915_power',
> >	'i915_query',
> >	'i915_selftest',
> >	'i915_suspend',
> > --
> > 2.38.0
> >

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [igt-dev] [PATCH i-g-t 1/2] i915/i915_power: Sanity check power measurement
  2023-01-27 16:08 ` [igt-dev] [PATCH i-g-t 1/2] " Ashutosh Dixit
@ 2023-01-27 16:46   ` Kamil Konieczny
  2023-01-27 16:55     ` Dixit, Ashutosh
  0 siblings, 1 reply; 19+ messages in thread
From: Kamil Konieczny @ 2023-01-27 16:46 UTC (permalink / raw)
  To: igt-dev

Hi Ashutosh,

looks much better, few small nits left, see below.

On 2023-01-27 at 08:08:12 -0800, Ashutosh Dixit wrote:
> Add a test to sanity check power measurement on integrated/discrete by
> requiring power under load to be > 0 and >= idle power.
> 
> v2: Code reorganization (Kamil K)
> v3: More code reorganization (Kamil K)
> 
> Signed-off-by: Ashutosh Dixit <ashutosh.dixit@intel.com>
> Reviewed-by: Riana Tauro <riana.tauro@intel.com>
> ---
>  tests/i915/i915_power.c | 70 +++++++++++++++++++++++++++++++++++++++++
>  tests/meson.build       |  1 +
>  2 files changed, 71 insertions(+)
>  create mode 100644 tests/i915/i915_power.c
> 
> diff --git a/tests/i915/i915_power.c b/tests/i915/i915_power.c
> new file mode 100644
> index 00000000000..533cf769b54
> --- /dev/null
> +++ b/tests/i915/i915_power.c
> @@ -0,0 +1,70 @@
> +// SPDX-License-Identifier: MIT
> +/*
> + * Copyright © 2023 Intel Corporation
> + */
> +
> +#include "igt.h"
> +#include "i915/gem.h"
> +#include "igt_power.h"
> +
> +IGT_TEST_DESCRIPTION("i915 power measurement tests");
> +
> +static double measure_power(struct igt_power *pwr, int sleep_duration_sec)
----------------------------------------------------- ^
unsigned int

> +{
> +	struct power_sample sample[2];
> +
> +	igt_power_get_energy(pwr, &sample[0]);
> +	usleep(sleep_duration_sec * USEC_PER_SEC);
> +	igt_power_get_energy(pwr, &sample[1]);
> +
> +	return igt_power_get_mW(pwr, &sample[0], &sample[1]);
> +}
> +
> +static void sanity(int i915)
> +{
> +	const intel_ctx_t *ctx;
> +	struct igt_power pwr;
> +	double idle, busy;
> +	igt_spin_t *spin;
> +	uint64_t ahnd;
> +
> +	/* Idle power */
> +	igt_require(!igt_power_open(i915, &pwr, "gpu"));
> +	gem_quiescent_gpu(i915);
> +	idle = measure_power(&pwr, 2);
---------------------------------- ^

> +
> +	/* Busy power */
> +	ctx = intel_ctx_create_all_physical(i915);
> +	ahnd = get_reloc_ahnd(i915, ctx->id);
> +	spin = igt_spin_new(i915, .ahnd = ahnd, .ctx = ctx,
> +			    .engine = ALL_ENGINES,
> +			    .flags = IGT_SPIN_POLL_RUN);
> +	/* Wait till at least one spinner starts */
> +	igt_spin_busywait_until_started(spin);
> +	busy = measure_power(&pwr, 2);
---------------------------------- ^
Make it define or const as you are using it twice and this
should be the same.

With that fixed:
Reviewed-by: Kamil Konieczny <kamil.konieczny@linux.intel.com>

--
Kamil

> +	igt_free_spins(i915);
> +	put_ahnd(ahnd);
> +	intel_ctx_destroy(i915, ctx);
> +	igt_power_close(&pwr);
> +
> +	igt_info("Measured power: idle: %g mW, busy: %g mW\n", idle, busy);
> +	igt_assert(idle >= 0 && busy > 0 && busy > idle);
> +}
> +
> +igt_main
> +{
> +	int i915;
> +
> +	igt_fixture {
> +		i915 = drm_open_driver_master(DRIVER_INTEL);
> +	}
> +
> +	igt_describe("Sanity check gpu power measurement");
> +	igt_subtest("sanity") {
> +		sanity(i915);
> +	}
> +
> +	igt_fixture {
> +		close(i915);
> +	}
> +}
> diff --git a/tests/meson.build b/tests/meson.build
> index cce9d89e1c8..d93a07c9ed6 100644
> --- a/tests/meson.build
> +++ b/tests/meson.build
> @@ -213,6 +213,7 @@ i915_progs = [
>  	'i915_pm_dc',
>  	'i915_pm_rps',
>  	'i915_pm_sseu',
> +	'i915_power',
>  	'i915_query',
>  	'i915_selftest',
>  	'i915_suspend',
> -- 
> 2.38.0
> 

^ permalink raw reply	[flat|nested] 19+ messages in thread

* [igt-dev] ✓ Fi.CI.BAT: success for i915/i915_power: Sanity check power measurement
  2023-01-27 16:08 [igt-dev] [PATCH i-g-t 0/2] i915/i915_power: Sanity check power measurement Ashutosh Dixit
  2023-01-27 16:08 ` [igt-dev] [PATCH i-g-t 1/2] " Ashutosh Dixit
  2023-01-27 16:08 ` [igt-dev] [PATCH i-g-t 2/2] HAX: Add i915_power@sanity to fast-feedback.testlist Ashutosh Dixit
@ 2023-01-27 16:53 ` Patchwork
  2023-01-27 20:03 ` [igt-dev] ✓ Fi.CI.IGT: " Patchwork
  3 siblings, 0 replies; 19+ messages in thread
From: Patchwork @ 2023-01-27 16:53 UTC (permalink / raw)
  To: Dixit, Ashutosh; +Cc: igt-dev

[-- Attachment #1: Type: text/plain, Size: 4929 bytes --]

== Series Details ==

Series: i915/i915_power: Sanity check power measurement
URL   : https://patchwork.freedesktop.org/series/113436/
State : success

== Summary ==

CI Bug Log - changes from IGT_7140 -> IGTPW_8412
====================================================

Summary
-------

  **SUCCESS**

  No regressions found.

  External URL: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8412/index.html

Participating hosts (26 -> 24)
------------------------------

  Missing    (2): fi-kbl-soraka fi-snb-2520m 

Possible new issues
-------------------

  Here are the unknown changes that may have been introduced in IGTPW_8412:

### IGT changes ###

#### Possible regressions ####

  * {igt@i915_power@sanity} (NEW):
    - {bat-jsl-3}:        NOTRUN -> [SKIP][1]
   [1]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8412/bat-jsl-3/igt@i915_power@sanity.html
    - {bat-jsl-1}:        NOTRUN -> [SKIP][2]
   [2]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8412/bat-jsl-1/igt@i915_power@sanity.html

  
#### Suppressed ####

  The following results come from untrusted machines, tests, or statuses.
  They do not affect the overall result.

  * igt@i915_selftest@live@reset:
    - {bat-rpls-1}:       NOTRUN -> [ABORT][3]
   [3]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8412/bat-rpls-1/igt@i915_selftest@live@reset.html

  
New tests
---------

  New tests have been introduced between IGT_7140 and IGTPW_8412:

### New IGT tests (1) ###

  * igt@i915_power@sanity:
    - Statuses : 19 pass(s) 5 skip(s)
    - Exec time: [0.0] s

  

Known issues
------------

  Here are the changes found in IGTPW_8412 that come from known issues:

### IGT changes ###

#### Issues hit ####

  * {igt@i915_power@sanity} (NEW):
    - fi-blb-e6850:       NOTRUN -> [SKIP][4] ([fdo#109271])
   [4]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8412/fi-blb-e6850/igt@i915_power@sanity.html
    - fi-bsw-n3050:       NOTRUN -> [SKIP][5] ([fdo#109271])
   [5]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8412/fi-bsw-n3050/igt@i915_power@sanity.html
    - fi-bsw-nick:        NOTRUN -> [SKIP][6] ([fdo#109271])
   [6]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8412/fi-bsw-nick/igt@i915_power@sanity.html

  * igt@i915_selftest@live@gt_heartbeat:
    - fi-apl-guc:         [PASS][7] -> [DMESG-FAIL][8] ([i915#5334])
   [7]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_7140/fi-apl-guc/igt@i915_selftest@live@gt_heartbeat.html
   [8]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8412/fi-apl-guc/igt@i915_selftest@live@gt_heartbeat.html
    - fi-glk-j4005:       [PASS][9] -> [DMESG-FAIL][10] ([i915#5334])
   [9]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_7140/fi-glk-j4005/igt@i915_selftest@live@gt_heartbeat.html
   [10]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8412/fi-glk-j4005/igt@i915_selftest@live@gt_heartbeat.html

  
#### Possible fixes ####

  * igt@i915_selftest@live@gt_lrc:
    - {bat-adlp-9}:       [INCOMPLETE][11] ([i915#4983]) -> [PASS][12]
   [11]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_7140/bat-adlp-9/igt@i915_selftest@live@gt_lrc.html
   [12]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8412/bat-adlp-9/igt@i915_selftest@live@gt_lrc.html

  * igt@i915_selftest@live@requests:
    - {bat-rpls-1}:       [ABORT][13] ([i915#4983]) -> [PASS][14]
   [13]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_7140/bat-rpls-1/igt@i915_selftest@live@requests.html
   [14]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8412/bat-rpls-1/igt@i915_selftest@live@requests.html

  * igt@i915_selftest@live@reset:
    - {bat-rpls-2}:       [ABORT][15] -> [PASS][16]
   [15]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_7140/bat-rpls-2/igt@i915_selftest@live@reset.html
   [16]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8412/bat-rpls-2/igt@i915_selftest@live@reset.html

  
  {name}: This element is suppressed. This means it is ignored when computing
          the status of the difference (SUCCESS, WARNING, or FAILURE).

  [fdo#109271]: https://bugs.freedesktop.org/show_bug.cgi?id=109271
  [i915#1845]: https://gitlab.freedesktop.org/drm/intel/issues/1845
  [i915#4983]: https://gitlab.freedesktop.org/drm/intel/issues/4983
  [i915#5334]: https://gitlab.freedesktop.org/drm/intel/issues/5334
  [i915#6367]: https://gitlab.freedesktop.org/drm/intel/issues/6367
  [i915#7828]: https://gitlab.freedesktop.org/drm/intel/issues/7828


Build changes
-------------

  * CI: CI-20190529 -> None
  * IGT: IGT_7140 -> IGTPW_8412

  CI-20190529: 20190529
  CI_DRM_12655: d9b0bc4a0e9edfcbf171e09d3743b7186cd801f7 @ git://anongit.freedesktop.org/gfx-ci/linux
  IGTPW_8412: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8412/index.html
  IGT_7140: ec87a6a636b9337ac9c8fec57350812bcb48fc09 @ https://gitlab.freedesktop.org/drm/igt-gpu-tools.git


Testlist changes
----------------

+igt@i915_power@sanity

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8412/index.html

[-- Attachment #2: Type: text/html, Size: 5885 bytes --]

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [igt-dev] [PATCH i-g-t 1/2] i915/i915_power: Sanity check power measurement
  2023-01-27 16:46   ` Kamil Konieczny
@ 2023-01-27 16:55     ` Dixit, Ashutosh
  2023-01-27 17:44       ` Kamil Konieczny
  0 siblings, 1 reply; 19+ messages in thread
From: Dixit, Ashutosh @ 2023-01-27 16:55 UTC (permalink / raw)
  To: Kamil Konieczny, igt-dev, Riana Tauro, Ashutosh Dixit

On Fri, 27 Jan 2023 08:46:03 -0800, Kamil Konieczny wrote:
>
> Hi Ashutosh,
>
> looks much better, few small nits left, see below.
>
> On 2023-01-27 at 08:08:12 -0800, Ashutosh Dixit wrote:
> > Add a test to sanity check power measurement on integrated/discrete by
> > requiring power under load to be > 0 and >= idle power.
> >
> > v2: Code reorganization (Kamil K)
> > v3: More code reorganization (Kamil K)
> >
> > Signed-off-by: Ashutosh Dixit <ashutosh.dixit@intel.com>
> > Reviewed-by: Riana Tauro <riana.tauro@intel.com>
> > ---
> >  tests/i915/i915_power.c | 70 +++++++++++++++++++++++++++++++++++++++++
> >  tests/meson.build       |  1 +
> >  2 files changed, 71 insertions(+)
> >  create mode 100644 tests/i915/i915_power.c
> >
> > diff --git a/tests/i915/i915_power.c b/tests/i915/i915_power.c
> > new file mode 100644
> > index 00000000000..533cf769b54
> > --- /dev/null
> > +++ b/tests/i915/i915_power.c
> > @@ -0,0 +1,70 @@
> > +// SPDX-License-Identifier: MIT
> > +/*
> > + * Copyright © 2023 Intel Corporation
> > + */
> > +
> > +#include "igt.h"
> > +#include "i915/gem.h"
> > +#include "igt_power.h"
> > +
> > +IGT_TEST_DESCRIPTION("i915 power measurement tests");
> > +
> > +static double measure_power(struct igt_power *pwr, int sleep_duration_sec)
> ----------------------------------------------------- ^
> unsigned int

No this is double, see igt_power_get_mW.

>
> > +{
> > +	struct power_sample sample[2];
> > +
> > +	igt_power_get_energy(pwr, &sample[0]);
> > +	usleep(sleep_duration_sec * USEC_PER_SEC);
> > +	igt_power_get_energy(pwr, &sample[1]);
> > +
> > +	return igt_power_get_mW(pwr, &sample[0], &sample[1]);
> > +}
> > +
> > +static void sanity(int i915)
> > +{
> > +	const intel_ctx_t *ctx;
> > +	struct igt_power pwr;
> > +	double idle, busy;
> > +	igt_spin_t *spin;
> > +	uint64_t ahnd;
> > +
> > +	/* Idle power */
> > +	igt_require(!igt_power_open(i915, &pwr, "gpu"));
> > +	gem_quiescent_gpu(i915);
> > +	idle = measure_power(&pwr, 2);
> ---------------------------------- ^
>
> > +
> > +	/* Busy power */
> > +	ctx = intel_ctx_create_all_physical(i915);
> > +	ahnd = get_reloc_ahnd(i915, ctx->id);
> > +	spin = igt_spin_new(i915, .ahnd = ahnd, .ctx = ctx,
> > +			    .engine = ALL_ENGINES,
> > +			    .flags = IGT_SPIN_POLL_RUN);
> > +	/* Wait till at least one spinner starts */
> > +	igt_spin_busywait_until_started(spin);
> > +	busy = measure_power(&pwr, 2);
> ---------------------------------- ^
> Make it define or const as you are using it twice and this
> should be the same.

Will fix this up.

>
> With that fixed:
> Reviewed-by: Kamil Konieczny <kamil.konieczny@linux.intel.com>

Thanks!

>
> --
> Kamil
>
> > +	igt_free_spins(i915);
> > +	put_ahnd(ahnd);
> > +	intel_ctx_destroy(i915, ctx);
> > +	igt_power_close(&pwr);
> > +
> > +	igt_info("Measured power: idle: %g mW, busy: %g mW\n", idle, busy);
> > +	igt_assert(idle >= 0 && busy > 0 && busy > idle);
> > +}
> > +
> > +igt_main
> > +{
> > +	int i915;
> > +
> > +	igt_fixture {
> > +		i915 = drm_open_driver_master(DRIVER_INTEL);
> > +	}
> > +
> > +	igt_describe("Sanity check gpu power measurement");
> > +	igt_subtest("sanity") {
> > +		sanity(i915);
> > +	}
> > +
> > +	igt_fixture {
> > +		close(i915);
> > +	}
> > +}
> > diff --git a/tests/meson.build b/tests/meson.build
> > index cce9d89e1c8..d93a07c9ed6 100644
> > --- a/tests/meson.build
> > +++ b/tests/meson.build
> > @@ -213,6 +213,7 @@ i915_progs = [
> >	'i915_pm_dc',
> >	'i915_pm_rps',
> >	'i915_pm_sseu',
> > +	'i915_power',
> >	'i915_query',
> >	'i915_selftest',
> >	'i915_suspend',
> > --
> > 2.38.0
> >

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [igt-dev] [PATCH i-g-t 1/2] i915/i915_power: Sanity check power measurement
  2023-01-27 16:55     ` Dixit, Ashutosh
@ 2023-01-27 17:44       ` Kamil Konieczny
  2023-01-27 18:12         ` Dixit, Ashutosh
  0 siblings, 1 reply; 19+ messages in thread
From: Kamil Konieczny @ 2023-01-27 17:44 UTC (permalink / raw)
  To: igt-dev

Hi Ashutosh,

On 2023-01-27 at 08:55:48 -0800, Dixit, Ashutosh wrote:
> On Fri, 27 Jan 2023 08:46:03 -0800, Kamil Konieczny wrote:
> >
> > Hi Ashutosh,
> >
> > looks much better, few small nits left, see below.
> >
> > On 2023-01-27 at 08:08:12 -0800, Ashutosh Dixit wrote:
> > > Add a test to sanity check power measurement on integrated/discrete by
> > > requiring power under load to be > 0 and >= idle power.
> > >
> > > v2: Code reorganization (Kamil K)
> > > v3: More code reorganization (Kamil K)
> > >
> > > Signed-off-by: Ashutosh Dixit <ashutosh.dixit@intel.com>
> > > Reviewed-by: Riana Tauro <riana.tauro@intel.com>
> > > ---
> > >  tests/i915/i915_power.c | 70 +++++++++++++++++++++++++++++++++++++++++
> > >  tests/meson.build       |  1 +
> > >  2 files changed, 71 insertions(+)
> > >  create mode 100644 tests/i915/i915_power.c
> > >
> > > diff --git a/tests/i915/i915_power.c b/tests/i915/i915_power.c
> > > new file mode 100644
> > > index 00000000000..533cf769b54
> > > --- /dev/null
> > > +++ b/tests/i915/i915_power.c
> > > @@ -0,0 +1,70 @@
> > > +// SPDX-License-Identifier: MIT
> > > +/*
> > > + * Copyright © 2023 Intel Corporation
> > > + */
> > > +
> > > +#include "igt.h"
> > > +#include "i915/gem.h"
> > > +#include "igt_power.h"
> > > +
> > > +IGT_TEST_DESCRIPTION("i915 power measurement tests");
> > > +
> > > +static double measure_power(struct igt_power *pwr, int sleep_duration_sec)
> > ----------------------------------------------------- ^
> > unsigned int
> 
> No this is double, see igt_power_get_mW.

I mean type of sleep_duration_sec should be unsigned int.

Regards,
Kamil

> 
> >
> > > +{
> > > +	struct power_sample sample[2];
> > > +
> > > +	igt_power_get_energy(pwr, &sample[0]);
> > > +	usleep(sleep_duration_sec * USEC_PER_SEC);
> > > +	igt_power_get_energy(pwr, &sample[1]);
> > > +
> > > +	return igt_power_get_mW(pwr, &sample[0], &sample[1]);
> > > +}
> > > +
> > > +static void sanity(int i915)
> > > +{
> > > +	const intel_ctx_t *ctx;
> > > +	struct igt_power pwr;
> > > +	double idle, busy;
> > > +	igt_spin_t *spin;
> > > +	uint64_t ahnd;
> > > +
> > > +	/* Idle power */
> > > +	igt_require(!igt_power_open(i915, &pwr, "gpu"));
> > > +	gem_quiescent_gpu(i915);
> > > +	idle = measure_power(&pwr, 2);
> > ---------------------------------- ^
> >
> > > +
> > > +	/* Busy power */
> > > +	ctx = intel_ctx_create_all_physical(i915);
> > > +	ahnd = get_reloc_ahnd(i915, ctx->id);
> > > +	spin = igt_spin_new(i915, .ahnd = ahnd, .ctx = ctx,
> > > +			    .engine = ALL_ENGINES,
> > > +			    .flags = IGT_SPIN_POLL_RUN);
> > > +	/* Wait till at least one spinner starts */
> > > +	igt_spin_busywait_until_started(spin);
> > > +	busy = measure_power(&pwr, 2);
> > ---------------------------------- ^
> > Make it define or const as you are using it twice and this
> > should be the same.
> 
> Will fix this up.
> 
> >
> > With that fixed:
> > Reviewed-by: Kamil Konieczny <kamil.konieczny@linux.intel.com>
> 
> Thanks!
> 
> >
> > --
> > Kamil
> >
> > > +	igt_free_spins(i915);
> > > +	put_ahnd(ahnd);
> > > +	intel_ctx_destroy(i915, ctx);
> > > +	igt_power_close(&pwr);
> > > +
> > > +	igt_info("Measured power: idle: %g mW, busy: %g mW\n", idle, busy);
> > > +	igt_assert(idle >= 0 && busy > 0 && busy > idle);
> > > +}
> > > +
> > > +igt_main
> > > +{
> > > +	int i915;
> > > +
> > > +	igt_fixture {
> > > +		i915 = drm_open_driver_master(DRIVER_INTEL);
> > > +	}
> > > +
> > > +	igt_describe("Sanity check gpu power measurement");
> > > +	igt_subtest("sanity") {
> > > +		sanity(i915);
> > > +	}
> > > +
> > > +	igt_fixture {
> > > +		close(i915);
> > > +	}
> > > +}
> > > diff --git a/tests/meson.build b/tests/meson.build
> > > index cce9d89e1c8..d93a07c9ed6 100644
> > > --- a/tests/meson.build
> > > +++ b/tests/meson.build
> > > @@ -213,6 +213,7 @@ i915_progs = [
> > >	'i915_pm_dc',
> > >	'i915_pm_rps',
> > >	'i915_pm_sseu',
> > > +	'i915_power',
> > >	'i915_query',
> > >	'i915_selftest',
> > >	'i915_suspend',
> > > --
> > > 2.38.0
> > >

^ permalink raw reply	[flat|nested] 19+ messages in thread

* [igt-dev] [PATCH i-g-t 1/2] i915/i915_power: Sanity check power measurement
  2023-01-27 18:09 [igt-dev] [PATCH i-g-t 0/2] " Ashutosh Dixit
@ 2023-01-27 18:09 ` Ashutosh Dixit
  0 siblings, 0 replies; 19+ messages in thread
From: Ashutosh Dixit @ 2023-01-27 18:09 UTC (permalink / raw)
  To: igt-dev

Add a test to sanity check power measurement on integrated/discrete by
requiring power under load to be > 0 and >= idle power.

v2: Code reorganization (Kamil K)
v3: More code reorganization (Kamil K)
v4: Make sleep duration uint32_t and use #define (Kamil K)

Signed-off-by: Ashutosh Dixit <ashutosh.dixit@intel.com>
Reviewed-by: Riana Tauro <riana.tauro@intel.com>
Reviewed-by: Kamil Konieczny <kamil.konieczny@linux.intel.com>
---
 tests/i915/i915_power.c | 72 +++++++++++++++++++++++++++++++++++++++++
 tests/meson.build       |  1 +
 2 files changed, 73 insertions(+)
 create mode 100644 tests/i915/i915_power.c

diff --git a/tests/i915/i915_power.c b/tests/i915/i915_power.c
new file mode 100644
index 00000000000..f2fd228698a
--- /dev/null
+++ b/tests/i915/i915_power.c
@@ -0,0 +1,72 @@
+// SPDX-License-Identifier: MIT
+/*
+ * Copyright © 2023 Intel Corporation
+ */
+
+#include "igt.h"
+#include "i915/gem.h"
+#include "igt_power.h"
+
+IGT_TEST_DESCRIPTION("i915 power measurement tests");
+
+static double measure_power(struct igt_power *pwr, uint32_t duration_sec)
+{
+	struct power_sample sample[2];
+
+	igt_power_get_energy(pwr, &sample[0]);
+	usleep(duration_sec * USEC_PER_SEC);
+	igt_power_get_energy(pwr, &sample[1]);
+
+	return igt_power_get_mW(pwr, &sample[0], &sample[1]);
+}
+
+static void sanity(int i915)
+{
+	const intel_ctx_t *ctx;
+	struct igt_power pwr;
+	double idle, busy;
+	igt_spin_t *spin;
+	uint64_t ahnd;
+
+#define DURATION_SEC 2
+
+	/* Idle power */
+	igt_require(!igt_power_open(i915, &pwr, "gpu"));
+	gem_quiescent_gpu(i915);
+	idle = measure_power(&pwr, DURATION_SEC);
+
+	/* Busy power */
+	ctx = intel_ctx_create_all_physical(i915);
+	ahnd = get_reloc_ahnd(i915, ctx->id);
+	spin = igt_spin_new(i915, .ahnd = ahnd, .ctx = ctx,
+			    .engine = ALL_ENGINES,
+			    .flags = IGT_SPIN_POLL_RUN);
+	/* Wait till at least one spinner starts */
+	igt_spin_busywait_until_started(spin);
+	busy = measure_power(&pwr, DURATION_SEC);
+	igt_free_spins(i915);
+	put_ahnd(ahnd);
+	intel_ctx_destroy(i915, ctx);
+	igt_power_close(&pwr);
+
+	igt_info("Measured power: idle: %g mW, busy: %g mW\n", idle, busy);
+	igt_assert(idle >= 0 && busy > 0 && busy > idle);
+}
+
+igt_main
+{
+	int i915;
+
+	igt_fixture {
+		i915 = drm_open_driver_master(DRIVER_INTEL);
+	}
+
+	igt_describe("Sanity check gpu power measurement");
+	igt_subtest("sanity") {
+		sanity(i915);
+	}
+
+	igt_fixture {
+		close(i915);
+	}
+}
diff --git a/tests/meson.build b/tests/meson.build
index cce9d89e1c8..d93a07c9ed6 100644
--- a/tests/meson.build
+++ b/tests/meson.build
@@ -213,6 +213,7 @@ i915_progs = [
 	'i915_pm_dc',
 	'i915_pm_rps',
 	'i915_pm_sseu',
+	'i915_power',
 	'i915_query',
 	'i915_selftest',
 	'i915_suspend',
-- 
2.38.0

^ permalink raw reply related	[flat|nested] 19+ messages in thread

* Re: [igt-dev] [PATCH i-g-t 1/2] i915/i915_power: Sanity check power measurement
  2023-01-27 17:44       ` Kamil Konieczny
@ 2023-01-27 18:12         ` Dixit, Ashutosh
  0 siblings, 0 replies; 19+ messages in thread
From: Dixit, Ashutosh @ 2023-01-27 18:12 UTC (permalink / raw)
  To: Kamil Konieczny, igt-dev, Riana Tauro, Ashutosh Dixit

On Fri, 27 Jan 2023 09:44:00 -0800, Kamil Konieczny wrote:
>
> Hi Ashutosh,
>
> On 2023-01-27 at 08:55:48 -0800, Dixit, Ashutosh wrote:
> > On Fri, 27 Jan 2023 08:46:03 -0800, Kamil Konieczny wrote:
> > >
> > > Hi Ashutosh,
> > >
> > > looks much better, few small nits left, see below.
> > >
> > > On 2023-01-27 at 08:08:12 -0800, Ashutosh Dixit wrote:
> > > > Add a test to sanity check power measurement on integrated/discrete by
> > > > requiring power under load to be > 0 and >= idle power.
> > > >
> > > > v2: Code reorganization (Kamil K)
> > > > v3: More code reorganization (Kamil K)
> > > >
> > > > Signed-off-by: Ashutosh Dixit <ashutosh.dixit@intel.com>
> > > > Reviewed-by: Riana Tauro <riana.tauro@intel.com>
> > > > ---
> > > >  tests/i915/i915_power.c | 70 +++++++++++++++++++++++++++++++++++++++++
> > > >  tests/meson.build       |  1 +
> > > >  2 files changed, 71 insertions(+)
> > > >  create mode 100644 tests/i915/i915_power.c
> > > >
> > > > diff --git a/tests/i915/i915_power.c b/tests/i915/i915_power.c
> > > > new file mode 100644
> > > > index 00000000000..533cf769b54
> > > > --- /dev/null
> > > > +++ b/tests/i915/i915_power.c
> > > > @@ -0,0 +1,70 @@
> > > > +// SPDX-License-Identifier: MIT
> > > > +/*
> > > > + * Copyright © 2023 Intel Corporation
> > > > + */
> > > > +
> > > > +#include "igt.h"
> > > > +#include "i915/gem.h"
> > > > +#include "igt_power.h"
> > > > +
> > > > +IGT_TEST_DESCRIPTION("i915 power measurement tests");
> > > > +
> > > > +static double measure_power(struct igt_power *pwr, int sleep_duration_sec)
> > > ----------------------------------------------------- ^
> > > unsigned int
> >
> > No this is double, see igt_power_get_mW.
>
> I mean type of sleep_duration_sec should be unsigned int.

Oops, got it. Latest version after addressing your comments here:

https://patchwork.freedesktop.org/series/113445/

Thanks.
--
Ashutosh


> > >
> > > > +{
> > > > +	struct power_sample sample[2];
> > > > +
> > > > +	igt_power_get_energy(pwr, &sample[0]);
> > > > +	usleep(sleep_duration_sec * USEC_PER_SEC);
> > > > +	igt_power_get_energy(pwr, &sample[1]);
> > > > +
> > > > +	return igt_power_get_mW(pwr, &sample[0], &sample[1]);
> > > > +}
> > > > +
> > > > +static void sanity(int i915)
> > > > +{
> > > > +	const intel_ctx_t *ctx;
> > > > +	struct igt_power pwr;
> > > > +	double idle, busy;
> > > > +	igt_spin_t *spin;
> > > > +	uint64_t ahnd;
> > > > +
> > > > +	/* Idle power */
> > > > +	igt_require(!igt_power_open(i915, &pwr, "gpu"));
> > > > +	gem_quiescent_gpu(i915);
> > > > +	idle = measure_power(&pwr, 2);
> > > ---------------------------------- ^
> > >
> > > > +
> > > > +	/* Busy power */
> > > > +	ctx = intel_ctx_create_all_physical(i915);
> > > > +	ahnd = get_reloc_ahnd(i915, ctx->id);
> > > > +	spin = igt_spin_new(i915, .ahnd = ahnd, .ctx = ctx,
> > > > +			    .engine = ALL_ENGINES,
> > > > +			    .flags = IGT_SPIN_POLL_RUN);
> > > > +	/* Wait till at least one spinner starts */
> > > > +	igt_spin_busywait_until_started(spin);
> > > > +	busy = measure_power(&pwr, 2);
> > > ---------------------------------- ^
> > > Make it define or const as you are using it twice and this
> > > should be the same.
> >
> > Will fix this up.
> >
> > >
> > > With that fixed:
> > > Reviewed-by: Kamil Konieczny <kamil.konieczny@linux.intel.com>
> >
> > Thanks!
> >
> > >
> > > --
> > > Kamil
> > >
> > > > +	igt_free_spins(i915);
> > > > +	put_ahnd(ahnd);
> > > > +	intel_ctx_destroy(i915, ctx);
> > > > +	igt_power_close(&pwr);
> > > > +
> > > > +	igt_info("Measured power: idle: %g mW, busy: %g mW\n", idle, busy);
> > > > +	igt_assert(idle >= 0 && busy > 0 && busy > idle);
> > > > +}
> > > > +
> > > > +igt_main
> > > > +{
> > > > +	int i915;
> > > > +
> > > > +	igt_fixture {
> > > > +		i915 = drm_open_driver_master(DRIVER_INTEL);
> > > > +	}
> > > > +
> > > > +	igt_describe("Sanity check gpu power measurement");
> > > > +	igt_subtest("sanity") {
> > > > +		sanity(i915);
> > > > +	}
> > > > +
> > > > +	igt_fixture {
> > > > +		close(i915);
> > > > +	}
> > > > +}
> > > > diff --git a/tests/meson.build b/tests/meson.build
> > > > index cce9d89e1c8..d93a07c9ed6 100644
> > > > --- a/tests/meson.build
> > > > +++ b/tests/meson.build
> > > > @@ -213,6 +213,7 @@ i915_progs = [
> > > >	'i915_pm_dc',
> > > >	'i915_pm_rps',
> > > >	'i915_pm_sseu',
> > > > +	'i915_power',
> > > >	'i915_query',
> > > >	'i915_selftest',
> > > >	'i915_suspend',
> > > > --
> > > > 2.38.0
> > > >

^ permalink raw reply	[flat|nested] 19+ messages in thread

* [igt-dev] ✓ Fi.CI.IGT: success for i915/i915_power: Sanity check power measurement
  2023-01-27 16:08 [igt-dev] [PATCH i-g-t 0/2] i915/i915_power: Sanity check power measurement Ashutosh Dixit
                   ` (2 preceding siblings ...)
  2023-01-27 16:53 ` [igt-dev] ✓ Fi.CI.BAT: success for i915/i915_power: Sanity check power measurement Patchwork
@ 2023-01-27 20:03 ` Patchwork
  3 siblings, 0 replies; 19+ messages in thread
From: Patchwork @ 2023-01-27 20:03 UTC (permalink / raw)
  To: Dixit, Ashutosh; +Cc: igt-dev

[-- Attachment #1: Type: text/plain, Size: 21645 bytes --]

== Series Details ==

Series: i915/i915_power: Sanity check power measurement
URL   : https://patchwork.freedesktop.org/series/113436/
State : success

== Summary ==

CI Bug Log - changes from IGT_7140_full -> IGTPW_8412_full
====================================================

Summary
-------

  **SUCCESS**

  No regressions found.

  External URL: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8412/index.html

Participating hosts (9 -> 10)
------------------------------

  Additional (1): shard-tglu-9 

Possible new issues
-------------------

  Here are the unknown changes that may have been introduced in IGTPW_8412_full:

### IGT changes ###

#### Possible regressions ####

  * {igt@i915_power@sanity} (NEW):
    - {shard-rkl}:        NOTRUN -> [SKIP][1]
   [1]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8412/shard-rkl-3/igt@i915_power@sanity.html

  
#### Suppressed ####

  The following results come from untrusted machines, tests, or statuses.
  They do not affect the overall result.

  * igt@kms_cursor_crc@cursor-random-64x21@pipe-a-hdmi-a-1:
    - {shard-tglu-10}:    NOTRUN -> [INCOMPLETE][2]
   [2]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8412/shard-tglu-10/igt@kms_cursor_crc@cursor-random-64x21@pipe-a-hdmi-a-1.html

  
New tests
---------

  New tests have been introduced between IGT_7140_full and IGTPW_8412_full:

### New IGT tests (1) ###

  * igt@i915_power@sanity:
    - Statuses : 3 pass(s) 1 skip(s)
    - Exec time: [0.0] s

  

Known issues
------------

  Here are the changes found in IGTPW_8412_full that come from known issues:

### IGT changes ###

#### Issues hit ####

  * igt@gem_exec_fair@basic-none-share@rcs0:
    - shard-glk:          [PASS][3] -> [FAIL][4] ([i915#2842]) +1 similar issue
   [3]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_7140/shard-glk9/igt@gem_exec_fair@basic-none-share@rcs0.html
   [4]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8412/shard-glk4/igt@gem_exec_fair@basic-none-share@rcs0.html

  
#### Possible fixes ####

  * igt@fbdev@unaligned-read:
    - {shard-rkl}:        [SKIP][5] ([i915#2582]) -> [PASS][6]
   [5]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_7140/shard-rkl-1/igt@fbdev@unaligned-read.html
   [6]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8412/shard-rkl-6/igt@fbdev@unaligned-read.html

  * igt@gem_eio@unwedge-stress:
    - {shard-dg1}:        [FAIL][7] ([i915#5784]) -> [PASS][8]
   [7]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_7140/shard-dg1-14/igt@gem_eio@unwedge-stress.html
   [8]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8412/shard-dg1-18/igt@gem_eio@unwedge-stress.html

  * igt@gem_exec_fair@basic-pace-share@rcs0:
    - shard-glk:          [FAIL][9] ([i915#2842]) -> [PASS][10]
   [9]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_7140/shard-glk6/igt@gem_exec_fair@basic-pace-share@rcs0.html
   [10]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8412/shard-glk4/igt@gem_exec_fair@basic-pace-share@rcs0.html

  * igt@gem_exec_reloc@basic-gtt-read-active:
    - {shard-rkl}:        [SKIP][11] ([i915#3281]) -> [PASS][12] +9 similar issues
   [11]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_7140/shard-rkl-1/igt@gem_exec_reloc@basic-gtt-read-active.html
   [12]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8412/shard-rkl-5/igt@gem_exec_reloc@basic-gtt-read-active.html

  * igt@gem_exec_schedule@wide@rcs0:
    - shard-glk:          [FAIL][13] -> [PASS][14]
   [13]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_7140/shard-glk8/igt@gem_exec_schedule@wide@rcs0.html
   [14]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8412/shard-glk3/igt@gem_exec_schedule@wide@rcs0.html

  * igt@gem_partial_pwrite_pread@write:
    - {shard-rkl}:        [SKIP][15] ([i915#3282]) -> [PASS][16] +3 similar issues
   [15]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_7140/shard-rkl-1/igt@gem_partial_pwrite_pread@write.html
   [16]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8412/shard-rkl-5/igt@gem_partial_pwrite_pread@write.html

  * igt@gem_workarounds@suspend-resume-fd:
    - {shard-rkl}:        [FAIL][17] ([fdo#103375]) -> [PASS][18]
   [17]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_7140/shard-rkl-4/igt@gem_workarounds@suspend-resume-fd.html
   [18]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8412/shard-rkl-3/igt@gem_workarounds@suspend-resume-fd.html

  * igt@gen9_exec_parse@allowed-all:
    - {shard-rkl}:        [SKIP][19] ([i915#2527]) -> [PASS][20]
   [19]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_7140/shard-rkl-1/igt@gen9_exec_parse@allowed-all.html
   [20]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8412/shard-rkl-5/igt@gen9_exec_parse@allowed-all.html

  * igt@i915_pm_rpm@drm-resources-equal:
    - {shard-tglu}:       [SKIP][21] ([i915#3547]) -> [PASS][22]
   [21]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_7140/shard-tglu-6/igt@i915_pm_rpm@drm-resources-equal.html
   [22]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8412/shard-tglu-7/igt@i915_pm_rpm@drm-resources-equal.html

  * igt@kms_atomic@atomic_plane_damage:
    - {shard-rkl}:        [SKIP][23] ([i915#4098]) -> [PASS][24]
   [23]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_7140/shard-rkl-1/igt@kms_atomic@atomic_plane_damage.html
   [24]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8412/shard-rkl-6/igt@kms_atomic@atomic_plane_damage.html

  * igt@kms_big_fb@linear-32bpp-rotate-180:
    - {shard-tglu}:       [SKIP][25] ([i915#1845] / [i915#7651]) -> [PASS][26]
   [25]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_7140/shard-tglu-6/igt@kms_big_fb@linear-32bpp-rotate-180.html
   [26]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8412/shard-tglu-5/igt@kms_big_fb@linear-32bpp-rotate-180.html

  * igt@kms_ccs@pipe-b-bad-aux-stride-y_tiled_gen12_rc_ccs:
    - {shard-rkl}:        [SKIP][27] ([i915#1845] / [i915#4098]) -> [PASS][28] +8 similar issues
   [27]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_7140/shard-rkl-3/igt@kms_ccs@pipe-b-bad-aux-stride-y_tiled_gen12_rc_ccs.html
   [28]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8412/shard-rkl-6/igt@kms_ccs@pipe-b-bad-aux-stride-y_tiled_gen12_rc_ccs.html

  * igt@kms_cursor_legacy@flip-vs-cursor@atomic-transitions:
    - shard-glk:          [FAIL][29] ([i915#2346]) -> [PASS][30]
   [29]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_7140/shard-glk6/igt@kms_cursor_legacy@flip-vs-cursor@atomic-transitions.html
   [30]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8412/shard-glk9/igt@kms_cursor_legacy@flip-vs-cursor@atomic-transitions.html

  * igt@kms_draw_crc@fill-fb:
    - {shard-tglu}:       [SKIP][31] ([i915#1845]) -> [PASS][32]
   [31]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_7140/shard-tglu-6/igt@kms_draw_crc@fill-fb.html
   [32]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8412/shard-tglu-4/igt@kms_draw_crc@fill-fb.html

  * igt@kms_flip@2x-flip-vs-expired-vblank-interruptible@ac-hdmi-a1-hdmi-a2:
    - shard-glk:          [FAIL][33] ([i915#79]) -> [PASS][34]
   [33]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_7140/shard-glk3/igt@kms_flip@2x-flip-vs-expired-vblank-interruptible@ac-hdmi-a1-hdmi-a2.html
   [34]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8412/shard-glk4/igt@kms_flip@2x-flip-vs-expired-vblank-interruptible@ac-hdmi-a1-hdmi-a2.html

  * igt@kms_frontbuffer_tracking@fbc-modesetfrombusy:
    - {shard-tglu}:       [SKIP][35] ([i915#1849]) -> [PASS][36]
   [35]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_7140/shard-tglu-6/igt@kms_frontbuffer_tracking@fbc-modesetfrombusy.html
   [36]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8412/shard-tglu-4/igt@kms_frontbuffer_tracking@fbc-modesetfrombusy.html

  * igt@kms_frontbuffer_tracking@psr-rgb101010-draw-mmap-gtt:
    - {shard-rkl}:        [SKIP][37] ([i915#1849] / [i915#4098]) -> [PASS][38] +7 similar issues
   [37]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_7140/shard-rkl-5/igt@kms_frontbuffer_tracking@psr-rgb101010-draw-mmap-gtt.html
   [38]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8412/shard-rkl-6/igt@kms_frontbuffer_tracking@psr-rgb101010-draw-mmap-gtt.html

  * igt@kms_plane@plane-panning-bottom-right-suspend@pipe-a-planes:
    - {shard-rkl}:        [SKIP][39] ([i915#1849]) -> [PASS][40] +1 similar issue
   [39]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_7140/shard-rkl-4/igt@kms_plane@plane-panning-bottom-right-suspend@pipe-a-planes.html
   [40]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8412/shard-rkl-6/igt@kms_plane@plane-panning-bottom-right-suspend@pipe-a-planes.html

  * igt@kms_psr@cursor_blt:
    - {shard-rkl}:        [SKIP][41] ([i915#1072]) -> [PASS][42]
   [41]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_7140/shard-rkl-1/igt@kms_psr@cursor_blt.html
   [42]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8412/shard-rkl-6/igt@kms_psr@cursor_blt.html

  * igt@kms_rotation_crc@sprite-rotation-270:
    - {shard-tglu}:       [SKIP][43] ([i915#7651]) -> [PASS][44] +3 similar issues
   [43]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_7140/shard-tglu-6/igt@kms_rotation_crc@sprite-rotation-270.html
   [44]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8412/shard-tglu-7/igt@kms_rotation_crc@sprite-rotation-270.html

  * igt@perf@gen12-oa-tlb-invalidate:
    - {shard-rkl}:        [SKIP][45] ([fdo#109289]) -> [PASS][46]
   [45]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_7140/shard-rkl-5/igt@perf@gen12-oa-tlb-invalidate.html
   [46]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8412/shard-rkl-6/igt@perf@gen12-oa-tlb-invalidate.html

  * igt@perf_pmu@idle@rcs0:
    - {shard-rkl}:        [FAIL][47] ([i915#4349]) -> [PASS][48]
   [47]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_7140/shard-rkl-2/igt@perf_pmu@idle@rcs0.html
   [48]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8412/shard-rkl-5/igt@perf_pmu@idle@rcs0.html

  * igt@prime_mmap_kms@buffer-sharing:
    - {shard-tglu}:       [SKIP][49] ([fdo#109274]) -> [PASS][50] +1 similar issue
   [49]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_7140/shard-tglu-6/igt@prime_mmap_kms@buffer-sharing.html
   [50]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8412/shard-tglu-2/igt@prime_mmap_kms@buffer-sharing.html

  * igt@prime_vgem@basic-read:
    - {shard-rkl}:        [SKIP][51] ([fdo#109295] / [i915#3291] / [i915#3708]) -> [PASS][52]
   [51]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_7140/shard-rkl-6/igt@prime_vgem@basic-read.html
   [52]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8412/shard-rkl-5/igt@prime_vgem@basic-read.html

  
  {name}: This element is suppressed. This means it is ignored when computing
          the status of the difference (SUCCESS, WARNING, or FAILURE).

  [fdo#103375]: https://bugs.freedesktop.org/show_bug.cgi?id=103375
  [fdo#109274]: https://bugs.freedesktop.org/show_bug.cgi?id=109274
  [fdo#109279]: https://bugs.freedesktop.org/show_bug.cgi?id=109279
  [fdo#109280]: https://bugs.freedesktop.org/show_bug.cgi?id=109280
  [fdo#109283]: https://bugs.freedesktop.org/show_bug.cgi?id=109283
  [fdo#109285]: https://bugs.freedesktop.org/show_bug.cgi?id=109285
  [fdo#109289]: https://bugs.freedesktop.org/show_bug.cgi?id=109289
  [fdo#109291]: https://bugs.freedesktop.org/show_bug.cgi?id=109291
  [fdo#109295]: https://bugs.freedesktop.org/show_bug.cgi?id=109295
  [fdo#109302]: https://bugs.freedesktop.org/show_bug.cgi?id=109302
  [fdo#109303]: https://bugs.freedesktop.org/show_bug.cgi?id=109303
  [fdo#109307]: https://bugs.freedesktop.org/show_bug.cgi?id=109307
  [fdo#109308]: https://bugs.freedesktop.org/show_bug.cgi?id=109308
  [fdo#109309]: https://bugs.freedesktop.org/show_bug.cgi?id=109309
  [fdo#109312]: https://bugs.freedesktop.org/show_bug.cgi?id=109312
  [fdo#109315]: https://bugs.freedesktop.org/show_bug.cgi?id=109315
  [fdo#109506]: https://bugs.freedesktop.org/show_bug.cgi?id=109506
  [fdo#110189]: https://bugs.freedesktop.org/show_bug.cgi?id=110189
  [fdo#110542]: https://bugs.freedesktop.org/show_bug.cgi?id=110542
  [fdo#110723]: https://bugs.freedesktop.org/show_bug.cgi?id=110723
  [fdo#111068]: https://bugs.freedesktop.org/show_bug.cgi?id=111068
  [fdo#111614]: https://bugs.freedesktop.org/show_bug.cgi?id=111614
  [fdo#111615]: https://bugs.freedesktop.org/show_bug.cgi?id=111615
  [fdo#111644]: https://bugs.freedesktop.org/show_bug.cgi?id=111644
  [fdo#111656]: https://bugs.freedesktop.org/show_bug.cgi?id=111656
  [fdo#111825]: https://bugs.freedesktop.org/show_bug.cgi?id=111825
  [fdo#111827]: https://bugs.freedesktop.org/show_bug.cgi?id=111827
  [fdo#112054]: https://bugs.freedesktop.org/show_bug.cgi?id=112054
  [fdo#112283]: https://bugs.freedesktop.org/show_bug.cgi?id=112283
  [i915#1072]: https://gitlab.freedesktop.org/drm/intel/issues/1072
  [i915#132]: https://gitlab.freedesktop.org/drm/intel/issues/132
  [i915#1397]: https://gitlab.freedesktop.org/drm/intel/issues/1397
  [i915#1755]: https://gitlab.freedesktop.org/drm/intel/issues/1755
  [i915#1825]: https://gitlab.freedesktop.org/drm/intel/issues/1825
  [i915#1839]: https://gitlab.freedesktop.org/drm/intel/issues/1839
  [i915#1845]: https://gitlab.freedesktop.org/drm/intel/issues/1845
  [i915#1849]: https://gitlab.freedesktop.org/drm/intel/issues/1849
  [i915#2346]: https://gitlab.freedesktop.org/drm/intel/issues/2346
  [i915#2433]: https://gitlab.freedesktop.org/drm/intel/issues/2433
  [i915#2434]: https://gitlab.freedesktop.org/drm/intel/issues/2434
  [i915#2437]: https://gitlab.freedesktop.org/drm/intel/issues/2437
  [i915#2527]: https://gitlab.freedesktop.org/drm/intel/issues/2527
  [i915#2575]: https://gitlab.freedesktop.org/drm/intel/issues/2575
  [i915#2582]: https://gitlab.freedesktop.org/drm/intel/issues/2582
  [i915#2587]: https://gitlab.freedesktop.org/drm/intel/issues/2587
  [i915#2672]: https://gitlab.freedesktop.org/drm/intel/issues/2672
  [i915#2681]: https://gitlab.freedesktop.org/drm/intel/issues/2681
  [i915#2705]: https://gitlab.freedesktop.org/drm/intel/issues/2705
  [i915#280]: https://gitlab.freedesktop.org/drm/intel/issues/280
  [i915#2842]: https://gitlab.freedesktop.org/drm/intel/issues/2842
  [i915#2846]: https://gitlab.freedesktop.org/drm/intel/issues/2846
  [i915#2856]: https://gitlab.freedesktop.org/drm/intel/issues/2856
  [i915#2920]: https://gitlab.freedesktop.org/drm/intel/issues/2920
  [i915#3116]: https://gitlab.freedesktop.org/drm/intel/issues/3116
  [i915#315]: https://gitlab.freedesktop.org/drm/intel/issues/315
  [i915#3281]: https://gitlab.freedesktop.org/drm/intel/issues/3281
  [i915#3282]: https://gitlab.freedesktop.org/drm/intel/issues/3282
  [i915#3291]: https://gitlab.freedesktop.org/drm/intel/issues/3291
  [i915#3297]: https://gitlab.freedesktop.org/drm/intel/issues/3297
  [i915#3299]: https://gitlab.freedesktop.org/drm/intel/issues/3299
  [i915#3318]: https://gitlab.freedesktop.org/drm/intel/issues/3318
  [i915#3359]: https://gitlab.freedesktop.org/drm/intel/issues/3359
  [i915#3458]: https://gitlab.freedesktop.org/drm/intel/issues/3458
  [i915#3469]: https://gitlab.freedesktop.org/drm/intel/issues/3469
  [i915#3528]: https://gitlab.freedesktop.org/drm/intel/issues/3528
  [i915#3539]: https://gitlab.freedesktop.org/drm/intel/issues/3539
  [i915#3546]: https://gitlab.freedesktop.org/drm/intel/issues/3546
  [i915#3547]: https://gitlab.freedesktop.org/drm/intel/issues/3547
  [i915#3555]: https://gitlab.freedesktop.org/drm/intel/issues/3555
  [i915#3558]: https://gitlab.freedesktop.org/drm/intel/issues/3558
  [i915#3637]: https://gitlab.freedesktop.org/drm/intel/issues/3637
  [i915#3638]: https://gitlab.freedesktop.org/drm/intel/issues/3638
  [i915#3689]: https://gitlab.freedesktop.org/drm/intel/issues/3689
  [i915#3708]: https://gitlab.freedesktop.org/drm/intel/issues/3708
  [i915#3734]: https://gitlab.freedesktop.org/drm/intel/issues/3734
  [i915#3742]: https://gitlab.freedesktop.org/drm/intel/issues/3742
  [i915#3804]: https://gitlab.freedesktop.org/drm/intel/issues/3804
  [i915#3825]: https://gitlab.freedesktop.org/drm/intel/issues/3825
  [i915#3840]: https://gitlab.freedesktop.org/drm/intel/issues/3840
  [i915#3886]: https://gitlab.freedesktop.org/drm/intel/issues/3886
  [i915#3936]: https://gitlab.freedesktop.org/drm/intel/issues/3936
  [i915#3952]: https://gitlab.freedesktop.org/drm/intel/issues/3952
  [i915#3955]: https://gitlab.freedesktop.org/drm/intel/issues/3955
  [i915#3966]: https://gitlab.freedesktop.org/drm/intel/issues/3966
  [i915#404]: https://gitlab.freedesktop.org/drm/intel/issues/404
  [i915#4070]: https://gitlab.freedesktop.org/drm/intel/issues/4070
  [i915#4077]: https://gitlab.freedesktop.org/drm/intel/issues/4077
  [i915#4079]: https://gitlab.freedesktop.org/drm/intel/issues/4079
  [i915#4083]: https://gitlab.freedesktop.org/drm/intel/issues/4083
  [i915#4098]: https://gitlab.freedesktop.org/drm/intel/issues/4098
  [i915#4103]: https://gitlab.freedesktop.org/drm/intel/issues/4103
  [i915#4212]: https://gitlab.freedesktop.org/drm/intel/issues/4212
  [i915#4213]: https://gitlab.freedesktop.org/drm/intel/issues/4213
  [i915#4215]: https://gitlab.freedesktop.org/drm/intel/issues/4215
  [i915#426]: https://gitlab.freedesktop.org/drm/intel/issues/426
  [i915#4270]: https://gitlab.freedesktop.org/drm/intel/issues/4270
  [i915#4349]: https://gitlab.freedesktop.org/drm/intel/issues/4349
  [i915#4387]: https://gitlab.freedesktop.org/drm/intel/issues/4387
  [i915#4525]: https://gitlab.freedesktop.org/drm/intel/issues/4525
  [i915#4538]: https://gitlab.freedesktop.org/drm/intel/issues/4538
  [i915#4565]: https://gitlab.freedesktop.org/drm/intel/issues/4565
  [i915#4613]: https://gitlab.freedesktop.org/drm/intel/issues/4613
  [i915#4812]: https://gitlab.freedesktop.org/drm/intel/issues/4812
  [i915#4818]: https://gitlab.freedesktop.org/drm/intel/issues/4818
  [i915#4833]: https://gitlab.freedesktop.org/drm/intel/issues/4833
  [i915#4852]: https://gitlab.freedesktop.org/drm/intel/issues/4852
  [i915#4859]: https://gitlab.freedesktop.org/drm/intel/issues/4859
  [i915#4860]: https://gitlab.freedesktop.org/drm/intel/issues/4860
  [i915#4881]: https://gitlab.freedesktop.org/drm/intel/issues/4881
  [i915#4884]: https://gitlab.freedesktop.org/drm/intel/issues/4884
  [i915#4885]: https://gitlab.freedesktop.org/drm/intel/issues/4885
  [i915#5176]: https://gitlab.freedesktop.org/drm/intel/issues/5176
  [i915#5235]: https://gitlab.freedesktop.org/drm/intel/issues/5235
  [i915#5286]: https://gitlab.freedesktop.org/drm/intel/issues/5286
  [i915#5288]: https://gitlab.freedesktop.org/drm/intel/issues/5288
  [i915#5289]: https://gitlab.freedesktop.org/drm/intel/issues/5289
  [i915#5325]: https://gitlab.freedesktop.org/drm/intel/issues/5325
  [i915#533]: https://gitlab.freedesktop.org/drm/intel/issues/533
  [i915#5439]: https://gitlab.freedesktop.org/drm/intel/issues/5439
  [i915#5461]: https://gitlab.freedesktop.org/drm/intel/issues/5461
  [i915#5563]: https://gitlab.freedesktop.org/drm/intel/issues/5563
  [i915#5723]: https://gitlab.freedesktop.org/drm/intel/issues/5723
  [i915#5784]: https://gitlab.freedesktop.org/drm/intel/issues/5784
  [i915#6095]: https://gitlab.freedesktop.org/drm/intel/issues/6095
  [i915#6245]: https://gitlab.freedesktop.org/drm/intel/issues/6245
  [i915#6248]: https://gitlab.freedesktop.org/drm/intel/issues/6248
  [i915#6252]: https://gitlab.freedesktop.org/drm/intel/issues/6252
  [i915#6258]: https://gitlab.freedesktop.org/drm/intel/issues/6258
  [i915#6259]: https://gitlab.freedesktop.org/drm/intel/issues/6259
  [i915#6301]: https://gitlab.freedesktop.org/drm/intel/issues/6301
  [i915#6344]: https://gitlab.freedesktop.org/drm/intel/issues/6344
  [i915#6412]: https://gitlab.freedesktop.org/drm/intel/issues/6412
  [i915#6433]: https://gitlab.freedesktop.org/drm/intel/issues/6433
  [i915#6497]: https://gitlab.freedesktop.org/drm/intel/issues/6497
  [i915#6524]: https://gitlab.freedesktop.org/drm/intel/issues/6524
  [i915#658]: https://gitlab.freedesktop.org/drm/intel/issues/658
  [i915#6590]: https://gitlab.freedesktop.org/drm/intel/issues/6590
  [i915#6768]: https://gitlab.freedesktop.org/drm/intel/issues/6768
  [i915#6944]: https://gitlab.freedesktop.org/drm/intel/issues/6944
  [i915#6946]: https://gitlab.freedesktop.org/drm/intel/issues/6946
  [i915#6953]: https://gitlab.freedesktop.org/drm/intel/issues/6953
  [i915#7037]: https://gitlab.freedesktop.org/drm/intel/issues/7037
  [i915#7116]: https://gitlab.freedesktop.org/drm/intel/issues/7116
  [i915#7118]: https://gitlab.freedesktop.org/drm/intel/issues/7118
  [i915#7128]: https://gitlab.freedesktop.org/drm/intel/issues/7128
  [i915#7294]: https://gitlab.freedesktop.org/drm/intel/issues/7294
  [i915#7561]: https://gitlab.freedesktop.org/drm/intel/issues/7561
  [i915#7582]: https://gitlab.freedesktop.org/drm/intel/issues/7582
  [i915#7651]: https://gitlab.freedesktop.org/drm/intel/issues/7651
  [i915#7697]: https://gitlab.freedesktop.org/drm/intel/issues/7697
  [i915#7701]: https://gitlab.freedesktop.org/drm/intel/issues/7701
  [i915#7707]: https://gitlab.freedesktop.org/drm/intel/issues/7707
  [i915#7711]: https://gitlab.freedesktop.org/drm/intel/issues/7711
  [i915#7742]: https://gitlab.freedesktop.org/drm/intel/issues/7742
  [i915#7828]: https://gitlab.freedesktop.org/drm/intel/issues/7828
  [i915#79]: https://gitlab.freedesktop.org/drm/intel/issues/79


Build changes
-------------

  * CI: CI-20190529 -> None
  * IGT: IGT_7140 -> IGTPW_8412

  CI-20190529: 20190529
  CI_DRM_12655: d9b0bc4a0e9edfcbf171e09d3743b7186cd801f7 @ git://anongit.freedesktop.org/gfx-ci/linux
  IGTPW_8412: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8412/index.html
  IGT_7140: ec87a6a636b9337ac9c8fec57350812bcb48fc09 @ https://gitlab.freedesktop.org/drm/igt-gpu-tools.git

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8412/index.html

[-- Attachment #2: Type: text/html, Size: 14309 bytes --]

^ permalink raw reply	[flat|nested] 19+ messages in thread

end of thread, other threads:[~2023-01-27 20:03 UTC | newest]

Thread overview: 19+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-01-27 16:08 [igt-dev] [PATCH i-g-t 0/2] i915/i915_power: Sanity check power measurement Ashutosh Dixit
2023-01-27 16:08 ` [igt-dev] [PATCH i-g-t 1/2] " Ashutosh Dixit
2023-01-27 16:46   ` Kamil Konieczny
2023-01-27 16:55     ` Dixit, Ashutosh
2023-01-27 17:44       ` Kamil Konieczny
2023-01-27 18:12         ` Dixit, Ashutosh
2023-01-27 16:08 ` [igt-dev] [PATCH i-g-t 2/2] HAX: Add i915_power@sanity to fast-feedback.testlist Ashutosh Dixit
2023-01-27 16:53 ` [igt-dev] ✓ Fi.CI.BAT: success for i915/i915_power: Sanity check power measurement Patchwork
2023-01-27 20:03 ` [igt-dev] ✓ Fi.CI.IGT: " Patchwork
  -- strict thread matches above, loose matches on Subject: below --
2023-01-27 18:09 [igt-dev] [PATCH i-g-t 0/2] " Ashutosh Dixit
2023-01-27 18:09 ` [igt-dev] [PATCH i-g-t 1/2] " Ashutosh Dixit
2023-01-27  6:25 [igt-dev] [PATCH i-g-t 0/2] " Ashutosh Dixit
2023-01-27  6:25 ` [igt-dev] [PATCH i-g-t 1/2] " Ashutosh Dixit
2023-01-27 12:29   ` Kamil Konieczny
2023-01-27 16:13     ` Dixit, Ashutosh
2023-01-21  5:41 [igt-dev] [PATCH i-g-t 0/2] " Ashutosh Dixit
2023-01-21  5:41 ` [igt-dev] [PATCH i-g-t 1/2] " Ashutosh Dixit
2023-01-24 12:59   ` Tauro, Riana
2023-01-24 17:00   ` Kamil Konieczny
2023-01-24 18:01     ` Dixit, Ashutosh
2023-01-25  9:40       ` Kamil Konieczny
2023-01-27  6:28         ` Dixit, Ashutosh

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox