* [Intel-gfx] [PATCH i-g-t] tests/i915_pm_rps: Fix test after silent conflict harder
@ 2023-07-18 8:40 Tvrtko Ursulin
2023-07-18 18:37 ` Dixit, Ashutosh
2023-07-18 18:41 ` [Intel-gfx] [igt-dev] " Rodrigo Vivi
0 siblings, 2 replies; 4+ messages in thread
From: Tvrtko Ursulin @ 2023-07-18 8:40 UTC (permalink / raw)
To: igt-dev, Intel-gfx; +Cc: Rodrigo Vivi
From: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Feature test also needs adjusting after sysfs helper API changes...
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")
Reference: 1dfa7a007a8e ("tests/i915_pm_rps: Fix test after silent conflict")
Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>
Cc: Lukasz Laguna <lukasz.laguna@intel.com>
Cc: Kamil Konieczny <kamil.konieczny@linux.intel.com>
Cc: Ashutosh Dixit <ashutosh.dixit@intel.com>
---
tests/i915/i915_pm_rps.c | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)
diff --git a/tests/i915/i915_pm_rps.c b/tests/i915/i915_pm_rps.c
index 15c74cc703c2..3ef5842dd7f8 100644
--- a/tests/i915/i915_pm_rps.c
+++ b/tests/i915/i915_pm_rps.c
@@ -1015,20 +1015,23 @@ static void sysfs_set_u32(int dir, const char *attr, uint32_t set)
static void test_thresholds(int i915, unsigned int gt, unsigned int flags)
{
uint64_t ahnd = get_reloc_ahnd(i915, 0);
+ unsigned int def_up = 0, def_down = 0;
const unsigned int points = 10;
- unsigned int def_up, def_down;
igt_spin_t *spin = NULL;
const intel_ctx_t *ctx;
unsigned int *ta, *tb;
unsigned int i;
int sysfs;
+ bool ret;
sysfs = igt_sysfs_gt_open(i915, gt);
igt_require(sysfs >= 0);
/* Feature test */
- def_up = igt_sysfs_get_u32(sysfs, "rps_up_threshold_pct");
- def_down = igt_sysfs_get_u32(sysfs, "rps_down_threshold_pct");
+ ret = __igt_sysfs_get_u32(sysfs, "rps_up_threshold_pct", &def_up);
+ igt_require(ret);
+ ret = __igt_sysfs_get_u32(sysfs, "rps_down_threshold_pct", &def_down);
+ igt_require(ret);
igt_require(def_up && def_down);
/* Check invalid percentages are rejected */
--
2.39.2
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [Intel-gfx] [PATCH i-g-t] tests/i915_pm_rps: Fix test after silent conflict harder
2023-07-18 8:40 [Intel-gfx] [PATCH i-g-t] tests/i915_pm_rps: Fix test after silent conflict harder Tvrtko Ursulin
@ 2023-07-18 18:37 ` Dixit, Ashutosh
2023-07-19 8:07 ` Tvrtko Ursulin
2023-07-18 18:41 ` [Intel-gfx] [igt-dev] " Rodrigo Vivi
1 sibling, 1 reply; 4+ messages in thread
From: Dixit, Ashutosh @ 2023-07-18 18:37 UTC (permalink / raw)
To: Tvrtko Ursulin; +Cc: Intel-gfx, igt-dev, Rodrigo Vivi
On Tue, 18 Jul 2023 01:40:41 -0700, Tvrtko Ursulin wrote:
>
> From: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
>
> Feature test also needs adjusting after sysfs helper API changes...
>
> 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")
> Reference: 1dfa7a007a8e ("tests/i915_pm_rps: Fix test after silent conflict")
> Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>
> Cc: Lukasz Laguna <lukasz.laguna@intel.com>
> Cc: Kamil Konieczny <kamil.konieczny@linux.intel.com>
> Cc: Ashutosh Dixit <ashutosh.dixit@intel.com>
> ---
> tests/i915/i915_pm_rps.c | 9 ++++++---
> 1 file changed, 6 insertions(+), 3 deletions(-)
>
> diff --git a/tests/i915/i915_pm_rps.c b/tests/i915/i915_pm_rps.c
> index 15c74cc703c2..3ef5842dd7f8 100644
> --- a/tests/i915/i915_pm_rps.c
> +++ b/tests/i915/i915_pm_rps.c
> @@ -1015,20 +1015,23 @@ static void sysfs_set_u32(int dir, const char *attr, uint32_t set)
> static void test_thresholds(int i915, unsigned int gt, unsigned int flags)
> {
> uint64_t ahnd = get_reloc_ahnd(i915, 0);
> + unsigned int def_up = 0, def_down = 0;
> const unsigned int points = 10;
> - unsigned int def_up, def_down;
> igt_spin_t *spin = NULL;
> const intel_ctx_t *ctx;
> unsigned int *ta, *tb;
> unsigned int i;
> int sysfs;
> + bool ret;
>
> sysfs = igt_sysfs_gt_open(i915, gt);
> igt_require(sysfs >= 0);
>
> /* Feature test */
> - def_up = igt_sysfs_get_u32(sysfs, "rps_up_threshold_pct");
> - def_down = igt_sysfs_get_u32(sysfs, "rps_down_threshold_pct");
> + ret = __igt_sysfs_get_u32(sysfs, "rps_up_threshold_pct", &def_up);
> + igt_require(ret);
> + ret = __igt_sysfs_get_u32(sysfs, "rps_down_threshold_pct", &def_down);
> + igt_require(ret);
Could also use igt_sysfs_has_attr(). Ok as is too.
Reviewed-by: Ashutosh Dixit <ashutosh.dixit@intel.com>
> igt_require(def_up && def_down);
>
> /* Check invalid percentages are rejected */
> --
> 2.39.2
>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [Intel-gfx] [igt-dev] [PATCH i-g-t] tests/i915_pm_rps: Fix test after silent conflict harder
2023-07-18 8:40 [Intel-gfx] [PATCH i-g-t] tests/i915_pm_rps: Fix test after silent conflict harder Tvrtko Ursulin
2023-07-18 18:37 ` Dixit, Ashutosh
@ 2023-07-18 18:41 ` Rodrigo Vivi
1 sibling, 0 replies; 4+ messages in thread
From: Rodrigo Vivi @ 2023-07-18 18:41 UTC (permalink / raw)
To: Tvrtko Ursulin; +Cc: igt-dev, Intel-gfx
On Tue, Jul 18, 2023 at 09:40:41AM +0100, Tvrtko Ursulin wrote:
> From: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
>
> Feature test also needs adjusting after sysfs helper API changes...
>
> 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")
> Reference: 1dfa7a007a8e ("tests/i915_pm_rps: Fix test after silent conflict")
> Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>
> Cc: Lukasz Laguna <lukasz.laguna@intel.com>
> Cc: Kamil Konieczny <kamil.konieczny@linux.intel.com>
> Cc: Ashutosh Dixit <ashutosh.dixit@intel.com>
Reviewed-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
> ---
> tests/i915/i915_pm_rps.c | 9 ++++++---
> 1 file changed, 6 insertions(+), 3 deletions(-)
>
> diff --git a/tests/i915/i915_pm_rps.c b/tests/i915/i915_pm_rps.c
> index 15c74cc703c2..3ef5842dd7f8 100644
> --- a/tests/i915/i915_pm_rps.c
> +++ b/tests/i915/i915_pm_rps.c
> @@ -1015,20 +1015,23 @@ static void sysfs_set_u32(int dir, const char *attr, uint32_t set)
> static void test_thresholds(int i915, unsigned int gt, unsigned int flags)
> {
> uint64_t ahnd = get_reloc_ahnd(i915, 0);
> + unsigned int def_up = 0, def_down = 0;
> const unsigned int points = 10;
> - unsigned int def_up, def_down;
> igt_spin_t *spin = NULL;
> const intel_ctx_t *ctx;
> unsigned int *ta, *tb;
> unsigned int i;
> int sysfs;
> + bool ret;
>
> sysfs = igt_sysfs_gt_open(i915, gt);
> igt_require(sysfs >= 0);
>
> /* Feature test */
> - def_up = igt_sysfs_get_u32(sysfs, "rps_up_threshold_pct");
> - def_down = igt_sysfs_get_u32(sysfs, "rps_down_threshold_pct");
> + ret = __igt_sysfs_get_u32(sysfs, "rps_up_threshold_pct", &def_up);
> + igt_require(ret);
> + ret = __igt_sysfs_get_u32(sysfs, "rps_down_threshold_pct", &def_down);
> + igt_require(ret);
> igt_require(def_up && def_down);
>
> /* Check invalid percentages are rejected */
> --
> 2.39.2
>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [Intel-gfx] [PATCH i-g-t] tests/i915_pm_rps: Fix test after silent conflict harder
2023-07-18 18:37 ` Dixit, Ashutosh
@ 2023-07-19 8:07 ` Tvrtko Ursulin
0 siblings, 0 replies; 4+ messages in thread
From: Tvrtko Ursulin @ 2023-07-19 8:07 UTC (permalink / raw)
To: Dixit, Ashutosh; +Cc: Intel-gfx, igt-dev, Rodrigo Vivi
On 18/07/2023 19:37, Dixit, Ashutosh wrote:
> On Tue, 18 Jul 2023 01:40:41 -0700, Tvrtko Ursulin wrote:
>>
>> From: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
>>
>> Feature test also needs adjusting after sysfs helper API changes...
>>
>> 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")
>> Reference: 1dfa7a007a8e ("tests/i915_pm_rps: Fix test after silent conflict")
>> Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>
>> Cc: Lukasz Laguna <lukasz.laguna@intel.com>
>> Cc: Kamil Konieczny <kamil.konieczny@linux.intel.com>
>> Cc: Ashutosh Dixit <ashutosh.dixit@intel.com>
>> ---
>> tests/i915/i915_pm_rps.c | 9 ++++++---
>> 1 file changed, 6 insertions(+), 3 deletions(-)
>>
>> diff --git a/tests/i915/i915_pm_rps.c b/tests/i915/i915_pm_rps.c
>> index 15c74cc703c2..3ef5842dd7f8 100644
>> --- a/tests/i915/i915_pm_rps.c
>> +++ b/tests/i915/i915_pm_rps.c
>> @@ -1015,20 +1015,23 @@ static void sysfs_set_u32(int dir, const char *attr, uint32_t set)
>> static void test_thresholds(int i915, unsigned int gt, unsigned int flags)
>> {
>> uint64_t ahnd = get_reloc_ahnd(i915, 0);
>> + unsigned int def_up = 0, def_down = 0;
>> const unsigned int points = 10;
>> - unsigned int def_up, def_down;
>> igt_spin_t *spin = NULL;
>> const intel_ctx_t *ctx;
>> unsigned int *ta, *tb;
>> unsigned int i;
>> int sysfs;
>> + bool ret;
>>
>> sysfs = igt_sysfs_gt_open(i915, gt);
>> igt_require(sysfs >= 0);
>>
>> /* Feature test */
>> - def_up = igt_sysfs_get_u32(sysfs, "rps_up_threshold_pct");
>> - def_down = igt_sysfs_get_u32(sysfs, "rps_down_threshold_pct");
>> + ret = __igt_sysfs_get_u32(sysfs, "rps_up_threshold_pct", &def_up);
>> + igt_require(ret);
>> + ret = __igt_sysfs_get_u32(sysfs, "rps_down_threshold_pct", &def_down);
>> + igt_require(ret);
>
> Could also use igt_sysfs_has_attr(). Ok as is too.
Getting hard to stay on top of the API richness! :)
> Reviewed-by: Ashutosh Dixit <ashutosh.dixit@intel.com>
Thanks for the reviews - pushed to fix the failures.
Regards,
Tvrtko
>
>> igt_require(def_up && def_down);
>>
>> /* Check invalid percentages are rejected */
>> --
>> 2.39.2
>>
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2023-07-19 8:07 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-07-18 8:40 [Intel-gfx] [PATCH i-g-t] tests/i915_pm_rps: Fix test after silent conflict harder Tvrtko Ursulin
2023-07-18 18:37 ` Dixit, Ashutosh
2023-07-19 8:07 ` Tvrtko Ursulin
2023-07-18 18:41 ` [Intel-gfx] [igt-dev] " Rodrigo Vivi
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox