Igt-dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: "Maíra Canal" <mcanal@igalia.com>
To: Iago Toral <itoral@igalia.com>, Melissa Wen <mwen@igalia.com>,
	Kamil Konieczny <kamil.konieczny@linux.intel.com>,
	Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>,
	Bhanuprakash Modem <bhanuprakash.modem@gmail.com>,
	Ashutosh Dixit <ashutosh.dixit@intel.com>,
	Karthik B S <karthik.b.s@intel.com>
Cc: igt-dev@lists.freedesktop.org, kernel-dev@igalia.com,
	"Maíra Canal" <mcanal@igalia.com>
Subject: [PATCH i-g-t 1/5] tests/v3d_perfmon: Don't use the deprecated V3D_PERFCNT_NUM
Date: Fri,  8 May 2026 09:42:50 -0300	[thread overview]
Message-ID: <20260508124446.1260672-3-mcanal@igalia.com> (raw)
In-Reply-To: <20260508124446.1260672-2-mcanal@igalia.com>

As described in the UAPI, one shouldn't use V3D_PERFCNT_NUM to retrieve
the maximum number of performance counters, as this value is only valid
for V3D 4.2. One should retrieve this parameter from the kernel using
DRM_V3D_PARAM_MAX_PERF_COUNTERS.

Due to this inconsistency, the test "create-perfmon-invalid-counters" is
currently failing in V3D 7.1 (Raspberry Pi 5).

Update the "create-perfmon-invalid-counters" test to the UAPI guideline
by replacing V3D_PERFCNT_NUM with the value retrieved from
DRM_IOCTL_V3D_GET_PARAM.

Signed-off-by: Maíra Canal <mcanal@igalia.com>
---
 tests/v3d/v3d_perfmon.c | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)

diff --git a/tests/v3d/v3d_perfmon.c b/tests/v3d/v3d_perfmon.c
index ac6f094c3..5045e8c81 100644
--- a/tests/v3d/v3d_perfmon.c
+++ b/tests/v3d/v3d_perfmon.c
@@ -37,8 +37,18 @@ int igt_main()
 	igt_subtest("create-perfmon-invalid-counters") {
 		struct drm_v3d_perfmon_create create = {
 			.ncounters = 1,
-			.counters = { V3D_PERFCNT_NUM },
 		};
+		uint32_t total_perfcnt_num;
+
+		total_perfcnt_num = igt_v3d_get_param(fd, DRM_V3D_PARAM_MAX_PERF_COUNTERS);
+		igt_assert(total_perfcnt_num || errno != EINVAL);
+
+		/* Fallback if kernel < v6.11 */
+		if (!total_perfcnt_num)
+			total_perfcnt_num = V3D_PERFCNT_NUM;
+
+		create.counters[0] = total_perfcnt_num;
+
 		do_ioctl_err(fd, DRM_IOCTL_V3D_PERFMON_CREATE, &create, EINVAL);
 	}
 
-- 
2.54.0


  reply	other threads:[~2026-05-08 12:46 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-08 12:42 [PATCH i-g-t 0/5] tests/v3d_perfmon: Fix V3D 7.1 regression and extend perfmon testing Maíra Canal
2026-05-08 12:42 ` Maíra Canal [this message]
2026-05-08 12:42 ` [PATCH i-g-t 2/5] drm-uapi/v3d: Sync v3d UAPI Maíra Canal
2026-05-08 12:42 ` [PATCH i-g-t 3/5] lib/v3d: Allow callers to retrieve perfmon counter values Maíra Canal
2026-05-08 12:42 ` [PATCH i-g-t 4/5] lib/v3d: Add helper to query the V3D hardware version Maíra Canal
2026-05-08 12:42 ` [PATCH i-g-t 5/5] tests/v3d_perfmon: Add global perfmon and counter isolation tests Maíra Canal
2026-05-12  6:50   ` Iago Toral
2026-05-09  0:21 ` ✓ i915.CI.BAT: success for tests/v3d_perfmon: Fix V3D 7.1 regression and extend perfmon testing Patchwork
2026-05-09  0:28 ` ✓ Xe.CI.BAT: " Patchwork
2026-05-09 13:32 ` ✗ Xe.CI.FULL: failure " Patchwork
2026-05-10  1:38 ` ✓ i915.CI.Full: success " Patchwork

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260508124446.1260672-3-mcanal@igalia.com \
    --to=mcanal@igalia.com \
    --cc=ashutosh.dixit@intel.com \
    --cc=bhanuprakash.modem@gmail.com \
    --cc=igt-dev@lists.freedesktop.org \
    --cc=itoral@igalia.com \
    --cc=juhapekka.heikkila@gmail.com \
    --cc=kamil.konieczny@linux.intel.com \
    --cc=karthik.b.s@intel.com \
    --cc=kernel-dev@igalia.com \
    --cc=mwen@igalia.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox