* [igt-dev] [PATCH i-g-t] tests/i915_pm_rps: Fix test after silent conflict
@ 2023-07-17 16:53 ` Tvrtko Ursulin
0 siblings, 0 replies; 12+ messages in thread
From: Tvrtko Ursulin @ 2023-07-17 16:53 UTC (permalink / raw)
To: igt-dev, Intel-gfx; +Cc: Rodrigo Vivi, Tvrtko Ursulin
From: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
A silent conflict sneaked in as I was merging
d86ca7e17b58 ("tests/i915_pm_rps: Exercise sysfs thresholds") in a way
that igt_sysfs_set_u32 has became a function returning void.
Assert is now built-in so drop it from the test.
Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Fixes: d86ca7e17b58 ("tests/i915_pm_rps: Exercise sysfs thresholds")
Reference: 54dc25efaf10 ("lib/igt_sysfs: add asserting helpers for read/write operations")
Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>
Cc: Lukasz Laguna <lukasz.laguna@intel.com>
Cc: Kamil Konieczny <kamil.konieczny@linux.intel.com>
---
tests/i915/i915_pm_rps.c | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/tests/i915/i915_pm_rps.c b/tests/i915/i915_pm_rps.c
index 68bb99d62c19..6bebecb6bf59 100644
--- a/tests/i915/i915_pm_rps.c
+++ b/tests/i915/i915_pm_rps.c
@@ -1010,8 +1010,8 @@ static void test_thresholds(int i915, unsigned int gt, unsigned int flags)
igt_require(def_up && def_down);
/* Check invalid percentages are rejected */
- igt_assert_eq(igt_sysfs_set_u32(sysfs, "rps_up_threshold_pct", 101), false);
- igt_assert_eq(igt_sysfs_set_u32(sysfs, "rps_down_threshold_pct", 101), false);
+ igt_sysfs_set_u32(sysfs, "rps_up_threshold_pct", 101);
+ igt_sysfs_set_u32(sysfs, "rps_down_threshold_pct", 101);
/*
* Invent some random up-down thresholds, but always include 0 and 100
@@ -1034,8 +1034,8 @@ static void test_thresholds(int i915, unsigned int gt, unsigned int flags)
/* Exercise the thresholds with a GPU load to trigger park/unpark etc */
for (i = 0; i < points; i++) {
igt_info("Testing thresholds up %u%% and down %u%%...\n", ta[i], tb[i]);
- igt_assert_eq(igt_sysfs_set_u32(sysfs, "rps_up_threshold_pct", ta[i]), true);
- igt_assert_eq(igt_sysfs_set_u32(sysfs, "rps_down_threshold_pct", tb[i]), true);
+ igt_sysfs_set_u32(sysfs, "rps_up_threshold_pct", ta[i]);
+ igt_sysfs_set_u32(sysfs, "rps_down_threshold_pct", tb[i]);
if (flags & TEST_IDLE) {
gem_quiescent_gpu(i915);
@@ -1069,8 +1069,8 @@ static void test_thresholds(int i915, unsigned int gt, unsigned int flags)
gem_quiescent_gpu(i915);
/* Restore defaults */
- igt_assert_eq(igt_sysfs_set_u32(sysfs, "rps_up_threshold_pct", def_up), true);
- igt_assert_eq(igt_sysfs_set_u32(sysfs, "rps_down_threshold_pct", def_down), true);
+ igt_sysfs_set_u32(sysfs, "rps_up_threshold_pct", def_up);
+ igt_sysfs_set_u32(sysfs, "rps_down_threshold_pct", def_down);
free(ta);
free(tb);
--
2.39.2
^ permalink raw reply related [flat|nested] 12+ messages in thread* [Intel-gfx] [PATCH i-g-t] tests/i915_pm_rps: Fix test after silent conflict @ 2023-07-17 16:53 ` Tvrtko Ursulin 0 siblings, 0 replies; 12+ messages in thread From: Tvrtko Ursulin @ 2023-07-17 16:53 UTC (permalink / raw) To: igt-dev, Intel-gfx; +Cc: Rodrigo Vivi From: Tvrtko Ursulin <tvrtko.ursulin@intel.com> A silent conflict sneaked in as I was merging d86ca7e17b58 ("tests/i915_pm_rps: Exercise sysfs thresholds") in a way that igt_sysfs_set_u32 has became a function returning void. Assert is now built-in so drop it from the test. Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com> Fixes: d86ca7e17b58 ("tests/i915_pm_rps: Exercise sysfs thresholds") Reference: 54dc25efaf10 ("lib/igt_sysfs: add asserting helpers for read/write operations") Cc: Rodrigo Vivi <rodrigo.vivi@intel.com> Cc: Lukasz Laguna <lukasz.laguna@intel.com> Cc: Kamil Konieczny <kamil.konieczny@linux.intel.com> --- tests/i915/i915_pm_rps.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/tests/i915/i915_pm_rps.c b/tests/i915/i915_pm_rps.c index 68bb99d62c19..6bebecb6bf59 100644 --- a/tests/i915/i915_pm_rps.c +++ b/tests/i915/i915_pm_rps.c @@ -1010,8 +1010,8 @@ static void test_thresholds(int i915, unsigned int gt, unsigned int flags) igt_require(def_up && def_down); /* Check invalid percentages are rejected */ - igt_assert_eq(igt_sysfs_set_u32(sysfs, "rps_up_threshold_pct", 101), false); - igt_assert_eq(igt_sysfs_set_u32(sysfs, "rps_down_threshold_pct", 101), false); + igt_sysfs_set_u32(sysfs, "rps_up_threshold_pct", 101); + igt_sysfs_set_u32(sysfs, "rps_down_threshold_pct", 101); /* * Invent some random up-down thresholds, but always include 0 and 100 @@ -1034,8 +1034,8 @@ static void test_thresholds(int i915, unsigned int gt, unsigned int flags) /* Exercise the thresholds with a GPU load to trigger park/unpark etc */ for (i = 0; i < points; i++) { igt_info("Testing thresholds up %u%% and down %u%%...\n", ta[i], tb[i]); - igt_assert_eq(igt_sysfs_set_u32(sysfs, "rps_up_threshold_pct", ta[i]), true); - igt_assert_eq(igt_sysfs_set_u32(sysfs, "rps_down_threshold_pct", tb[i]), true); + igt_sysfs_set_u32(sysfs, "rps_up_threshold_pct", ta[i]); + igt_sysfs_set_u32(sysfs, "rps_down_threshold_pct", tb[i]); if (flags & TEST_IDLE) { gem_quiescent_gpu(i915); @@ -1069,8 +1069,8 @@ static void test_thresholds(int i915, unsigned int gt, unsigned int flags) gem_quiescent_gpu(i915); /* Restore defaults */ - igt_assert_eq(igt_sysfs_set_u32(sysfs, "rps_up_threshold_pct", def_up), true); - igt_assert_eq(igt_sysfs_set_u32(sysfs, "rps_down_threshold_pct", def_down), true); + igt_sysfs_set_u32(sysfs, "rps_up_threshold_pct", def_up); + igt_sysfs_set_u32(sysfs, "rps_down_threshold_pct", def_down); free(ta); free(tb); -- 2.39.2 ^ permalink raw reply related [flat|nested] 12+ messages in thread
* [igt-dev] ✗ Fi.CI.BUILD: failure for tests/i915_pm_rps: Fix test after silent conflict 2023-07-17 16:53 ` [Intel-gfx] " Tvrtko Ursulin (?) @ 2023-07-17 17:05 ` Patchwork -1 siblings, 0 replies; 12+ messages in thread From: Patchwork @ 2023-07-17 17:05 UTC (permalink / raw) To: Tvrtko Ursulin; +Cc: igt-dev == Series Details == Series: tests/i915_pm_rps: Fix test after silent conflict URL : https://patchwork.freedesktop.org/series/120859/ State : failure == Summary == Applying: tests/i915_pm_rps: Fix test after silent conflict Using index info to reconstruct a base tree... M tests/i915/i915_pm_rps.c Falling back to patching base and 3-way merge... Auto-merging tests/i915/i915_pm_rps.c CONFLICT (content): Merge conflict in tests/i915/i915_pm_rps.c Patch failed at 0001 tests/i915_pm_rps: Fix test after silent conflict When you have resolved this problem, run "git am --continue". If you prefer to skip this patch, run "git am --skip" instead. To restore the original branch and stop patching, run "git am --abort". ^ permalink raw reply [flat|nested] 12+ messages in thread
* [igt-dev] [PATCH i-g-t v2] tests/i915_pm_rps: Fix test after silent conflict 2023-07-17 16:53 ` [Intel-gfx] " Tvrtko Ursulin @ 2023-07-17 17:12 ` Tvrtko Ursulin -1 siblings, 0 replies; 12+ messages in thread From: Tvrtko Ursulin @ 2023-07-17 17:12 UTC (permalink / raw) To: igt-dev, Intel-gfx; +Cc: Rodrigo Vivi, Tvrtko Ursulin From: Tvrtko Ursulin <tvrtko.ursulin@intel.com> A silent conflict sneaked in as I was merging d86ca7e17b58 ("tests/i915_pm_rps: Exercise sysfs thresholds") in a way that igt_sysfs_set_u32 has became a function returning void. Assert is now built-in so drop it from the test. v2: * Fix invalid value test. * Assert new values after write while at it. Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com> Fixes: d86ca7e17b58 ("tests/i915_pm_rps: Exercise sysfs thresholds") Reference: 54dc25efaf10 ("lib/igt_sysfs: add asserting helpers for read/write operations") Cc: Rodrigo Vivi <rodrigo.vivi@intel.com> Cc: Lukasz Laguna <lukasz.laguna@intel.com> Cc: Kamil Konieczny <kamil.konieczny@linux.intel.com> --- tests/i915/i915_pm_rps.c | 34 ++++++++++++++++++++++++++++------ 1 file changed, 28 insertions(+), 6 deletions(-) diff --git a/tests/i915/i915_pm_rps.c b/tests/i915/i915_pm_rps.c index 68bb99d62c19..15c74cc703c2 100644 --- a/tests/i915/i915_pm_rps.c +++ b/tests/i915/i915_pm_rps.c @@ -988,6 +988,28 @@ static igt_spin_t *spin_sync_gt(int i915, uint64_t ahnd, unsigned int gt, return __igt_sync_spin(i915, ahnd, *ctx, &e); } +static void sysfs_fail_set_u32(int dir, const char *attr, uint32_t set) +{ + u32 old, new; + bool ret; + + old = igt_sysfs_get_u32(dir, attr); + ret = __igt_sysfs_set_u32(dir, attr, set); + igt_assert_eq(ret, false); + new = igt_sysfs_get_u32(dir, attr); + igt_assert_eq(old, new); +} + +static void sysfs_set_u32(int dir, const char *attr, uint32_t set) +{ + u32 new; + + igt_sysfs_set_u32(dir, attr, set); + + new = igt_sysfs_get_u32(dir, attr); + igt_assert_eq(set, new); +} + #define TEST_IDLE 0x1 #define TEST_PARK 0x2 static void test_thresholds(int i915, unsigned int gt, unsigned int flags) @@ -1010,8 +1032,8 @@ static void test_thresholds(int i915, unsigned int gt, unsigned int flags) igt_require(def_up && def_down); /* Check invalid percentages are rejected */ - igt_assert_eq(igt_sysfs_set_u32(sysfs, "rps_up_threshold_pct", 101), false); - igt_assert_eq(igt_sysfs_set_u32(sysfs, "rps_down_threshold_pct", 101), false); + sysfs_fail_set_u32(sysfs, "rps_up_threshold_pct", 101); + sysfs_fail_set_u32(sysfs, "rps_down_threshold_pct", 101); /* * Invent some random up-down thresholds, but always include 0 and 100 @@ -1034,8 +1056,8 @@ static void test_thresholds(int i915, unsigned int gt, unsigned int flags) /* Exercise the thresholds with a GPU load to trigger park/unpark etc */ for (i = 0; i < points; i++) { igt_info("Testing thresholds up %u%% and down %u%%...\n", ta[i], tb[i]); - igt_assert_eq(igt_sysfs_set_u32(sysfs, "rps_up_threshold_pct", ta[i]), true); - igt_assert_eq(igt_sysfs_set_u32(sysfs, "rps_down_threshold_pct", tb[i]), true); + sysfs_set_u32(sysfs, "rps_up_threshold_pct", ta[i]); + sysfs_set_u32(sysfs, "rps_down_threshold_pct", tb[i]); if (flags & TEST_IDLE) { gem_quiescent_gpu(i915); @@ -1069,8 +1091,8 @@ static void test_thresholds(int i915, unsigned int gt, unsigned int flags) gem_quiescent_gpu(i915); /* Restore defaults */ - igt_assert_eq(igt_sysfs_set_u32(sysfs, "rps_up_threshold_pct", def_up), true); - igt_assert_eq(igt_sysfs_set_u32(sysfs, "rps_down_threshold_pct", def_down), true); + sysfs_set_u32(sysfs, "rps_up_threshold_pct", def_up); + sysfs_set_u32(sysfs, "rps_down_threshold_pct", def_down); free(ta); free(tb); -- 2.39.2 ^ permalink raw reply related [flat|nested] 12+ messages in thread
* [Intel-gfx] [PATCH i-g-t v2] tests/i915_pm_rps: Fix test after silent conflict @ 2023-07-17 17:12 ` Tvrtko Ursulin 0 siblings, 0 replies; 12+ messages in thread From: Tvrtko Ursulin @ 2023-07-17 17:12 UTC (permalink / raw) To: igt-dev, Intel-gfx; +Cc: Rodrigo Vivi From: Tvrtko Ursulin <tvrtko.ursulin@intel.com> A silent conflict sneaked in as I was merging d86ca7e17b58 ("tests/i915_pm_rps: Exercise sysfs thresholds") in a way that igt_sysfs_set_u32 has became a function returning void. Assert is now built-in so drop it from the test. v2: * Fix invalid value test. * Assert new values after write while at it. Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com> Fixes: d86ca7e17b58 ("tests/i915_pm_rps: Exercise sysfs thresholds") Reference: 54dc25efaf10 ("lib/igt_sysfs: add asserting helpers for read/write operations") Cc: Rodrigo Vivi <rodrigo.vivi@intel.com> Cc: Lukasz Laguna <lukasz.laguna@intel.com> Cc: Kamil Konieczny <kamil.konieczny@linux.intel.com> --- tests/i915/i915_pm_rps.c | 34 ++++++++++++++++++++++++++++------ 1 file changed, 28 insertions(+), 6 deletions(-) diff --git a/tests/i915/i915_pm_rps.c b/tests/i915/i915_pm_rps.c index 68bb99d62c19..15c74cc703c2 100644 --- a/tests/i915/i915_pm_rps.c +++ b/tests/i915/i915_pm_rps.c @@ -988,6 +988,28 @@ static igt_spin_t *spin_sync_gt(int i915, uint64_t ahnd, unsigned int gt, return __igt_sync_spin(i915, ahnd, *ctx, &e); } +static void sysfs_fail_set_u32(int dir, const char *attr, uint32_t set) +{ + u32 old, new; + bool ret; + + old = igt_sysfs_get_u32(dir, attr); + ret = __igt_sysfs_set_u32(dir, attr, set); + igt_assert_eq(ret, false); + new = igt_sysfs_get_u32(dir, attr); + igt_assert_eq(old, new); +} + +static void sysfs_set_u32(int dir, const char *attr, uint32_t set) +{ + u32 new; + + igt_sysfs_set_u32(dir, attr, set); + + new = igt_sysfs_get_u32(dir, attr); + igt_assert_eq(set, new); +} + #define TEST_IDLE 0x1 #define TEST_PARK 0x2 static void test_thresholds(int i915, unsigned int gt, unsigned int flags) @@ -1010,8 +1032,8 @@ static void test_thresholds(int i915, unsigned int gt, unsigned int flags) igt_require(def_up && def_down); /* Check invalid percentages are rejected */ - igt_assert_eq(igt_sysfs_set_u32(sysfs, "rps_up_threshold_pct", 101), false); - igt_assert_eq(igt_sysfs_set_u32(sysfs, "rps_down_threshold_pct", 101), false); + sysfs_fail_set_u32(sysfs, "rps_up_threshold_pct", 101); + sysfs_fail_set_u32(sysfs, "rps_down_threshold_pct", 101); /* * Invent some random up-down thresholds, but always include 0 and 100 @@ -1034,8 +1056,8 @@ static void test_thresholds(int i915, unsigned int gt, unsigned int flags) /* Exercise the thresholds with a GPU load to trigger park/unpark etc */ for (i = 0; i < points; i++) { igt_info("Testing thresholds up %u%% and down %u%%...\n", ta[i], tb[i]); - igt_assert_eq(igt_sysfs_set_u32(sysfs, "rps_up_threshold_pct", ta[i]), true); - igt_assert_eq(igt_sysfs_set_u32(sysfs, "rps_down_threshold_pct", tb[i]), true); + sysfs_set_u32(sysfs, "rps_up_threshold_pct", ta[i]); + sysfs_set_u32(sysfs, "rps_down_threshold_pct", tb[i]); if (flags & TEST_IDLE) { gem_quiescent_gpu(i915); @@ -1069,8 +1091,8 @@ static void test_thresholds(int i915, unsigned int gt, unsigned int flags) gem_quiescent_gpu(i915); /* Restore defaults */ - igt_assert_eq(igt_sysfs_set_u32(sysfs, "rps_up_threshold_pct", def_up), true); - igt_assert_eq(igt_sysfs_set_u32(sysfs, "rps_down_threshold_pct", def_down), true); + sysfs_set_u32(sysfs, "rps_up_threshold_pct", def_up); + sysfs_set_u32(sysfs, "rps_down_threshold_pct", def_down); free(ta); free(tb); -- 2.39.2 ^ permalink raw reply related [flat|nested] 12+ messages in thread
* Re: [igt-dev] [PATCH i-g-t v2] tests/i915_pm_rps: Fix test after silent conflict 2023-07-17 17:12 ` [Intel-gfx] " Tvrtko Ursulin @ 2023-07-17 18:53 ` Rodrigo Vivi -1 siblings, 0 replies; 12+ messages in thread From: Rodrigo Vivi @ 2023-07-17 18:53 UTC (permalink / raw) To: Tvrtko Ursulin; +Cc: igt-dev, Intel-gfx, Tvrtko Ursulin On Mon, Jul 17, 2023 at 06:12:19PM +0100, Tvrtko Ursulin wrote: > From: Tvrtko Ursulin <tvrtko.ursulin@intel.com> > > A silent conflict sneaked in as I was merging > d86ca7e17b58 ("tests/i915_pm_rps: Exercise sysfs thresholds") in a way > that igt_sysfs_set_u32 has became a function returning void. > > Assert is now built-in so drop it from the test. > > v2: > * Fix invalid value test. > * Assert new values after write while at it. Reviewed-by: Rodrigo Vivi <rodrigo.vivi@intel.com> > > Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com> > Fixes: d86ca7e17b58 ("tests/i915_pm_rps: Exercise sysfs thresholds") > Reference: 54dc25efaf10 ("lib/igt_sysfs: add asserting helpers for read/write operations") > Cc: Rodrigo Vivi <rodrigo.vivi@intel.com> > Cc: Lukasz Laguna <lukasz.laguna@intel.com> > Cc: Kamil Konieczny <kamil.konieczny@linux.intel.com> > --- > tests/i915/i915_pm_rps.c | 34 ++++++++++++++++++++++++++++------ > 1 file changed, 28 insertions(+), 6 deletions(-) > > diff --git a/tests/i915/i915_pm_rps.c b/tests/i915/i915_pm_rps.c > index 68bb99d62c19..15c74cc703c2 100644 > --- a/tests/i915/i915_pm_rps.c > +++ b/tests/i915/i915_pm_rps.c > @@ -988,6 +988,28 @@ static igt_spin_t *spin_sync_gt(int i915, uint64_t ahnd, unsigned int gt, > return __igt_sync_spin(i915, ahnd, *ctx, &e); > } > > +static void sysfs_fail_set_u32(int dir, const char *attr, uint32_t set) > +{ > + u32 old, new; > + bool ret; > + > + old = igt_sysfs_get_u32(dir, attr); > + ret = __igt_sysfs_set_u32(dir, attr, set); > + igt_assert_eq(ret, false); > + new = igt_sysfs_get_u32(dir, attr); > + igt_assert_eq(old, new); > +} > + > +static void sysfs_set_u32(int dir, const char *attr, uint32_t set) > +{ > + u32 new; > + > + igt_sysfs_set_u32(dir, attr, set); > + > + new = igt_sysfs_get_u32(dir, attr); > + igt_assert_eq(set, new); > +} > + > #define TEST_IDLE 0x1 > #define TEST_PARK 0x2 > static void test_thresholds(int i915, unsigned int gt, unsigned int flags) > @@ -1010,8 +1032,8 @@ static void test_thresholds(int i915, unsigned int gt, unsigned int flags) > igt_require(def_up && def_down); > > /* Check invalid percentages are rejected */ > - igt_assert_eq(igt_sysfs_set_u32(sysfs, "rps_up_threshold_pct", 101), false); > - igt_assert_eq(igt_sysfs_set_u32(sysfs, "rps_down_threshold_pct", 101), false); > + sysfs_fail_set_u32(sysfs, "rps_up_threshold_pct", 101); > + sysfs_fail_set_u32(sysfs, "rps_down_threshold_pct", 101); > > /* > * Invent some random up-down thresholds, but always include 0 and 100 > @@ -1034,8 +1056,8 @@ static void test_thresholds(int i915, unsigned int gt, unsigned int flags) > /* Exercise the thresholds with a GPU load to trigger park/unpark etc */ > for (i = 0; i < points; i++) { > igt_info("Testing thresholds up %u%% and down %u%%...\n", ta[i], tb[i]); > - igt_assert_eq(igt_sysfs_set_u32(sysfs, "rps_up_threshold_pct", ta[i]), true); > - igt_assert_eq(igt_sysfs_set_u32(sysfs, "rps_down_threshold_pct", tb[i]), true); > + sysfs_set_u32(sysfs, "rps_up_threshold_pct", ta[i]); > + sysfs_set_u32(sysfs, "rps_down_threshold_pct", tb[i]); > > if (flags & TEST_IDLE) { > gem_quiescent_gpu(i915); > @@ -1069,8 +1091,8 @@ static void test_thresholds(int i915, unsigned int gt, unsigned int flags) > gem_quiescent_gpu(i915); > > /* Restore defaults */ > - igt_assert_eq(igt_sysfs_set_u32(sysfs, "rps_up_threshold_pct", def_up), true); > - igt_assert_eq(igt_sysfs_set_u32(sysfs, "rps_down_threshold_pct", def_down), true); > + sysfs_set_u32(sysfs, "rps_up_threshold_pct", def_up); > + sysfs_set_u32(sysfs, "rps_down_threshold_pct", def_down); > > free(ta); > free(tb); > -- > 2.39.2 > ^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [Intel-gfx] [PATCH i-g-t v2] tests/i915_pm_rps: Fix test after silent conflict @ 2023-07-17 18:53 ` Rodrigo Vivi 0 siblings, 0 replies; 12+ messages in thread From: Rodrigo Vivi @ 2023-07-17 18:53 UTC (permalink / raw) To: Tvrtko Ursulin; +Cc: igt-dev, Intel-gfx On Mon, Jul 17, 2023 at 06:12:19PM +0100, Tvrtko Ursulin wrote: > From: Tvrtko Ursulin <tvrtko.ursulin@intel.com> > > A silent conflict sneaked in as I was merging > d86ca7e17b58 ("tests/i915_pm_rps: Exercise sysfs thresholds") in a way > that igt_sysfs_set_u32 has became a function returning void. > > Assert is now built-in so drop it from the test. > > v2: > * Fix invalid value test. > * Assert new values after write while at it. Reviewed-by: Rodrigo Vivi <rodrigo.vivi@intel.com> > > Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com> > Fixes: d86ca7e17b58 ("tests/i915_pm_rps: Exercise sysfs thresholds") > Reference: 54dc25efaf10 ("lib/igt_sysfs: add asserting helpers for read/write operations") > Cc: Rodrigo Vivi <rodrigo.vivi@intel.com> > Cc: Lukasz Laguna <lukasz.laguna@intel.com> > Cc: Kamil Konieczny <kamil.konieczny@linux.intel.com> > --- > tests/i915/i915_pm_rps.c | 34 ++++++++++++++++++++++++++++------ > 1 file changed, 28 insertions(+), 6 deletions(-) > > diff --git a/tests/i915/i915_pm_rps.c b/tests/i915/i915_pm_rps.c > index 68bb99d62c19..15c74cc703c2 100644 > --- a/tests/i915/i915_pm_rps.c > +++ b/tests/i915/i915_pm_rps.c > @@ -988,6 +988,28 @@ static igt_spin_t *spin_sync_gt(int i915, uint64_t ahnd, unsigned int gt, > return __igt_sync_spin(i915, ahnd, *ctx, &e); > } > > +static void sysfs_fail_set_u32(int dir, const char *attr, uint32_t set) > +{ > + u32 old, new; > + bool ret; > + > + old = igt_sysfs_get_u32(dir, attr); > + ret = __igt_sysfs_set_u32(dir, attr, set); > + igt_assert_eq(ret, false); > + new = igt_sysfs_get_u32(dir, attr); > + igt_assert_eq(old, new); > +} > + > +static void sysfs_set_u32(int dir, const char *attr, uint32_t set) > +{ > + u32 new; > + > + igt_sysfs_set_u32(dir, attr, set); > + > + new = igt_sysfs_get_u32(dir, attr); > + igt_assert_eq(set, new); > +} > + > #define TEST_IDLE 0x1 > #define TEST_PARK 0x2 > static void test_thresholds(int i915, unsigned int gt, unsigned int flags) > @@ -1010,8 +1032,8 @@ static void test_thresholds(int i915, unsigned int gt, unsigned int flags) > igt_require(def_up && def_down); > > /* Check invalid percentages are rejected */ > - igt_assert_eq(igt_sysfs_set_u32(sysfs, "rps_up_threshold_pct", 101), false); > - igt_assert_eq(igt_sysfs_set_u32(sysfs, "rps_down_threshold_pct", 101), false); > + sysfs_fail_set_u32(sysfs, "rps_up_threshold_pct", 101); > + sysfs_fail_set_u32(sysfs, "rps_down_threshold_pct", 101); > > /* > * Invent some random up-down thresholds, but always include 0 and 100 > @@ -1034,8 +1056,8 @@ static void test_thresholds(int i915, unsigned int gt, unsigned int flags) > /* Exercise the thresholds with a GPU load to trigger park/unpark etc */ > for (i = 0; i < points; i++) { > igt_info("Testing thresholds up %u%% and down %u%%...\n", ta[i], tb[i]); > - igt_assert_eq(igt_sysfs_set_u32(sysfs, "rps_up_threshold_pct", ta[i]), true); > - igt_assert_eq(igt_sysfs_set_u32(sysfs, "rps_down_threshold_pct", tb[i]), true); > + sysfs_set_u32(sysfs, "rps_up_threshold_pct", ta[i]); > + sysfs_set_u32(sysfs, "rps_down_threshold_pct", tb[i]); > > if (flags & TEST_IDLE) { > gem_quiescent_gpu(i915); > @@ -1069,8 +1091,8 @@ static void test_thresholds(int i915, unsigned int gt, unsigned int flags) > gem_quiescent_gpu(i915); > > /* Restore defaults */ > - igt_assert_eq(igt_sysfs_set_u32(sysfs, "rps_up_threshold_pct", def_up), true); > - igt_assert_eq(igt_sysfs_set_u32(sysfs, "rps_down_threshold_pct", def_down), true); > + sysfs_set_u32(sysfs, "rps_up_threshold_pct", def_up); > + sysfs_set_u32(sysfs, "rps_down_threshold_pct", def_down); > > free(ta); > free(tb); > -- > 2.39.2 > ^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [igt-dev] [PATCH i-g-t v2] tests/i915_pm_rps: Fix test after silent conflict 2023-07-17 18:53 ` [Intel-gfx] " Rodrigo Vivi @ 2023-07-17 19:33 ` Dixit, Ashutosh -1 siblings, 0 replies; 12+ messages in thread From: Dixit, Ashutosh @ 2023-07-17 19:33 UTC (permalink / raw) To: Rodrigo Vivi; +Cc: igt-dev, Intel-gfx, Tvrtko Ursulin On Mon, 17 Jul 2023 11:53:27 -0700, Rodrigo Vivi wrote: > > On Mon, Jul 17, 2023 at 06:12:19PM +0100, Tvrtko Ursulin wrote: > > From: Tvrtko Ursulin <tvrtko.ursulin@intel.com> > > > > A silent conflict sneaked in as I was merging > > d86ca7e17b58 ("tests/i915_pm_rps: Exercise sysfs thresholds") in a way > > that igt_sysfs_set_u32 has became a function returning void. > > > > Assert is now built-in so drop it from the test. > > > > v2: > > * Fix invalid value test. > > * Assert new values after write while at it. > > Reviewed-by: Rodrigo Vivi <rodrigo.vivi@intel.com> Merged to fix the IGT build. ^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [Intel-gfx] [igt-dev] [PATCH i-g-t v2] tests/i915_pm_rps: Fix test after silent conflict @ 2023-07-17 19:33 ` Dixit, Ashutosh 0 siblings, 0 replies; 12+ messages in thread From: Dixit, Ashutosh @ 2023-07-17 19:33 UTC (permalink / raw) To: Rodrigo Vivi; +Cc: igt-dev, Intel-gfx On Mon, 17 Jul 2023 11:53:27 -0700, Rodrigo Vivi wrote: > > On Mon, Jul 17, 2023 at 06:12:19PM +0100, Tvrtko Ursulin wrote: > > From: Tvrtko Ursulin <tvrtko.ursulin@intel.com> > > > > A silent conflict sneaked in as I was merging > > d86ca7e17b58 ("tests/i915_pm_rps: Exercise sysfs thresholds") in a way > > that igt_sysfs_set_u32 has became a function returning void. > > > > Assert is now built-in so drop it from the test. > > > > v2: > > * Fix invalid value test. > > * Assert new values after write while at it. > > Reviewed-by: Rodrigo Vivi <rodrigo.vivi@intel.com> Merged to fix the IGT build. ^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [igt-dev] [PATCH i-g-t v2] tests/i915_pm_rps: Fix test after silent conflict 2023-07-17 19:33 ` [Intel-gfx] " Dixit, Ashutosh @ 2023-07-18 7:35 ` Tvrtko Ursulin -1 siblings, 0 replies; 12+ messages in thread From: Tvrtko Ursulin @ 2023-07-18 7:35 UTC (permalink / raw) To: Dixit, Ashutosh, Rodrigo Vivi; +Cc: igt-dev, Intel-gfx, Tvrtko Ursulin On 17/07/2023 20:33, Dixit, Ashutosh wrote: > On Mon, 17 Jul 2023 11:53:27 -0700, Rodrigo Vivi wrote: >> >> On Mon, Jul 17, 2023 at 06:12:19PM +0100, Tvrtko Ursulin wrote: >>> From: Tvrtko Ursulin <tvrtko.ursulin@intel.com> >>> >>> A silent conflict sneaked in as I was merging >>> d86ca7e17b58 ("tests/i915_pm_rps: Exercise sysfs thresholds") in a way >>> that igt_sysfs_set_u32 has became a function returning void. >>> >>> Assert is now built-in so drop it from the test. >>> >>> v2: >>> * Fix invalid value test. >>> * Assert new values after write while at it. >> >> Reviewed-by: Rodrigo Vivi <rodrigo.vivi@intel.com> > > Merged to fix the IGT build. Ah thank you, didn't realize it was broken, I thought it was only warnings. Regards, Tvrtko ^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [Intel-gfx] [igt-dev] [PATCH i-g-t v2] tests/i915_pm_rps: Fix test after silent conflict @ 2023-07-18 7:35 ` Tvrtko Ursulin 0 siblings, 0 replies; 12+ messages in thread From: Tvrtko Ursulin @ 2023-07-18 7:35 UTC (permalink / raw) To: Dixit, Ashutosh, Rodrigo Vivi; +Cc: igt-dev, Intel-gfx On 17/07/2023 20:33, Dixit, Ashutosh wrote: > On Mon, 17 Jul 2023 11:53:27 -0700, Rodrigo Vivi wrote: >> >> On Mon, Jul 17, 2023 at 06:12:19PM +0100, Tvrtko Ursulin wrote: >>> From: Tvrtko Ursulin <tvrtko.ursulin@intel.com> >>> >>> A silent conflict sneaked in as I was merging >>> d86ca7e17b58 ("tests/i915_pm_rps: Exercise sysfs thresholds") in a way >>> that igt_sysfs_set_u32 has became a function returning void. >>> >>> Assert is now built-in so drop it from the test. >>> >>> v2: >>> * Fix invalid value test. >>> * Assert new values after write while at it. >> >> Reviewed-by: Rodrigo Vivi <rodrigo.vivi@intel.com> > > Merged to fix the IGT build. Ah thank you, didn't realize it was broken, I thought it was only warnings. Regards, Tvrtko ^ permalink raw reply [flat|nested] 12+ messages in thread
* [igt-dev] ✗ Fi.CI.BUILD: failure for tests/i915_pm_rps: Fix test after silent conflict (rev2) 2023-07-17 16:53 ` [Intel-gfx] " Tvrtko Ursulin ` (2 preceding siblings ...) (?) @ 2023-07-17 17:37 ` Patchwork -1 siblings, 0 replies; 12+ messages in thread From: Patchwork @ 2023-07-17 17:37 UTC (permalink / raw) To: Tvrtko Ursulin; +Cc: igt-dev == Series Details == Series: tests/i915_pm_rps: Fix test after silent conflict (rev2) URL : https://patchwork.freedesktop.org/series/120859/ State : failure == Summary == Applying: tests/i915_pm_rps: Fix test after silent conflict Using index info to reconstruct a base tree... M tests/i915/i915_pm_rps.c Falling back to patching base and 3-way merge... Auto-merging tests/i915/i915_pm_rps.c CONFLICT (content): Merge conflict in tests/i915/i915_pm_rps.c Patch failed at 0001 tests/i915_pm_rps: Fix test after silent conflict When you have resolved this problem, run "git am --continue". If you prefer to skip this patch, run "git am --skip" instead. To restore the original branch and stop patching, run "git am --abort". ^ permalink raw reply [flat|nested] 12+ messages in thread
end of thread, other threads:[~2023-07-18 7:36 UTC | newest] Thread overview: 12+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2023-07-17 16:53 [igt-dev] [PATCH i-g-t] tests/i915_pm_rps: Fix test after silent conflict Tvrtko Ursulin 2023-07-17 16:53 ` [Intel-gfx] " Tvrtko Ursulin 2023-07-17 17:05 ` [igt-dev] ✗ Fi.CI.BUILD: failure for " Patchwork 2023-07-17 17:12 ` [igt-dev] [PATCH i-g-t v2] " Tvrtko Ursulin 2023-07-17 17:12 ` [Intel-gfx] " Tvrtko Ursulin 2023-07-17 18:53 ` [igt-dev] " Rodrigo Vivi 2023-07-17 18:53 ` [Intel-gfx] " Rodrigo Vivi 2023-07-17 19:33 ` [igt-dev] " Dixit, Ashutosh 2023-07-17 19:33 ` [Intel-gfx] " Dixit, Ashutosh 2023-07-18 7:35 ` Tvrtko Ursulin 2023-07-18 7:35 ` [Intel-gfx] " Tvrtko Ursulin 2023-07-17 17:37 ` [igt-dev] ✗ Fi.CI.BUILD: failure for tests/i915_pm_rps: Fix test after silent conflict (rev2) Patchwork
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.