From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: From: Tvrtko Ursulin To: igt-dev@lists.freedesktop.org, Intel-gfx@lists.freedesktop.org Date: Tue, 18 Jul 2023 09:40:41 +0100 Message-Id: <20230718084041.871888-1-tvrtko.ursulin@linux.intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [igt-dev] [PATCH i-g-t] tests/i915_pm_rps: Fix test after silent conflict harder List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Rodrigo Vivi , Tvrtko Ursulin Errors-To: igt-dev-bounces@lists.freedesktop.org Sender: "igt-dev" List-ID: From: Tvrtko Ursulin Feature test also needs adjusting after sysfs helper API changes... Signed-off-by: Tvrtko Ursulin 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 Cc: Lukasz Laguna Cc: Kamil Konieczny Cc: Ashutosh Dixit --- 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