From: Robert Mazur <robert.mazur@imgtec.com>
To: <igt-dev@lists.freedesktop.org>
Cc: Alessio Belle <alessio.belle@imgtec.com>,
Luigi Santivetti <luigi.santivetti@imgtec.com>,
Brajesh Gupta <brajesh.gupta@imgtec.com>,
Robert Mazur <robert.mazur@imgtec.com>,
Frank Binns <frank.binns@imgtec.com>,
Donald Robson <donald.robson@imgtec.com>
Subject: [PATCH i-g-t v3 04/10] tests/imagination: Add GPU ID test
Date: Fri, 17 Jul 2026 16:21:36 +0200 [thread overview]
Message-ID: <20260717-test-imagination-add-support-v3-4-ce69f9ad330c@imgtec.com> (raw)
In-Reply-To: <20260717-test-imagination-add-support-v3-0-ce69f9ad330c@imgtec.com>
From: Frank Binns <frank.binns@imgtec.com>
Add a basic GPU ID validation subtest.
Signed-off-by: Frank Binns <frank.binns@imgtec.com>
Signed-off-by: Donald Robson <donald.robson@imgtec.com>
Signed-off-by: Robert Mazur <robert.mazur@imgtec.com>
---
tests/imagination/meson.build | 1 +
tests/imagination/pvr_gpu_info.c | 54 ++++++++++++++++++++++++++++++++++++++++
2 files changed, 55 insertions(+)
diff --git a/tests/imagination/meson.build b/tests/imagination/meson.build
index 62930da2b..c5899972b 100644
--- a/tests/imagination/meson.build
+++ b/tests/imagination/meson.build
@@ -1,5 +1,6 @@
pvr_progs = [ 'pvr_dev_query',
'pvr_gem',
+ 'pvr_gpu_info',
]
pvr_deps = test_deps
diff --git a/tests/imagination/pvr_gpu_info.c b/tests/imagination/pvr_gpu_info.c
new file mode 100644
index 000000000..24ab18491
--- /dev/null
+++ b/tests/imagination/pvr_gpu_info.c
@@ -0,0 +1,54 @@
+// SPDX-License-Identifier: GPL-2.0 or MIT
+/* Copyright (c) 2026 Imagination Technologies Ltd. All Rights Reserved */
+
+#include <errno.h>
+#include <stdbool.h>
+#include <stdint.h>
+
+#include "igt.h"
+#include "igt_pvr.h"
+
+#include "pvr_drm.h"
+
+IGT_TEST_DESCRIPTION("Check that igt/imagination knows about this GPU ID");
+
+static bool
+has_known_gpu_id(int fd, const struct drm_pvr_dev_query_gpu_info *gpu_info)
+{
+#define PVR_BVNC_ID(b, v, n, c) \
+ (((uint64_t)(b) << 48) | \
+ ((uint64_t)(v) << 32) | \
+ ((uint64_t)(n) << 16) | \
+ ((uint64_t)(c)))
+
+ switch (gpu_info->gpu_id) {
+ case PVR_BVNC_ID(4, 40, 2, 51):
+ case PVR_BVNC_ID(33, 15, 11, 3):
+ case PVR_BVNC_ID(36, 53, 104, 796):
+ break;
+ default:
+ igt_warn("Unknown GPU ID: 0x%016llx\n", gpu_info->gpu_id);
+ return false;
+ }
+#undef PVR_BVNC_ID
+
+ igt_info("GPU BVNC: %u.%u.%u.%u\n",
+ (unsigned int)(gpu_info->gpu_id >> 48 & 0xffff),
+ (unsigned int)(gpu_info->gpu_id >> 32 & 0xffff),
+ (unsigned int)(gpu_info->gpu_id >> 16 & 0xffff),
+ (unsigned int)(gpu_info->gpu_id & 0xffff));
+
+ return true;
+}
+
+int igt_simple_main()
+{
+ int fd = drm_open_driver(DRIVER_POWERVR);
+ struct drm_pvr_dev_query_gpu_info gpu_info = {0};
+
+ igt_pvr_ioctl_dev_query(fd, DRM_PVR_DEV_QUERY_GPU_INFO_GET,
+ sizeof(gpu_info), &gpu_info, 0);
+
+ igt_assert(has_known_gpu_id(fd, &gpu_info));
+ igt_assert_neq(gpu_info.num_phantoms, 0);
+}
--
2.43.0
next prev parent reply other threads:[~2026-07-17 14:24 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-17 14:21 [PATCH i-g-t v3 00/10] tests/imagination: Add initial test coverage for Imagination DRM driver Robert Mazur
2026-07-17 14:21 ` [PATCH i-g-t v3 01/10] tests/imagination: Add framework for Imagination tests Robert Mazur
2026-07-22 13:44 ` Kamil Konieczny
[not found] ` <3a08b2b97b01954f2e6afef9244c05680d33e98d.camel@imgtec.com>
2026-07-27 18:18 ` [EXTERNAL] " Kamil Konieczny
2026-07-17 14:21 ` [PATCH i-g-t v3 02/10] tests/imagination: Add GEM mmap tests Robert Mazur
2026-07-22 13:46 ` Kamil Konieczny
2026-07-17 14:21 ` [PATCH i-g-t v3 03/10] tests/imagination: Add DEV_QUERY tests Robert Mazur
2026-07-22 14:12 ` Kamil Konieczny
2026-07-17 14:21 ` Robert Mazur [this message]
2026-07-22 14:13 ` [PATCH i-g-t v3 04/10] tests/imagination: Add GPU ID test Kamil Konieczny
2026-07-17 14:21 ` [PATCH i-g-t v3 05/10] tests/imagination: Add DEV_QUERY heap info tests Robert Mazur
2026-07-22 14:14 ` Kamil Konieczny
2026-07-17 14:21 ` [PATCH i-g-t v3 06/10] tests/imagination: Add DEV_QUERY static data area tests Robert Mazur
2026-07-22 14:21 ` Kamil Konieczny
2026-07-17 14:21 ` [PATCH i-g-t v3 07/10] tests/imagination: Add VM_CONTEXT tests Robert Mazur
2026-07-22 14:22 ` Kamil Konieczny
2026-07-17 14:21 ` [PATCH i-g-t v3 08/10] tests/imagination: Add tests for free list and hwrt creation ioctls Robert Mazur
2026-07-22 14:41 ` Kamil Konieczny
2026-07-17 14:21 ` [PATCH i-g-t v3 09/10] tests/imagination: Add DEV_QUERY quirks and enhancements tests Robert Mazur
2026-07-22 14:43 ` Kamil Konieczny
2026-07-17 14:21 ` [PATCH i-g-t v3 10/10] tests/imagination: Add DEV_QUERY runtime_info tests Robert Mazur
2026-07-22 14:45 ` Kamil Konieczny
2026-07-17 21:16 ` ✓ i915.CI.BAT: success for tests/imagination: Add initial test coverage for Imagination DRM driver (rev3) Patchwork
2026-07-17 21:20 ` ✓ Xe.CI.BAT: " Patchwork
2026-07-18 4:13 ` ✓ Xe.CI.FULL: " Patchwork
2026-07-18 10:57 ` ✓ i915.CI.Full: " 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=20260717-test-imagination-add-support-v3-4-ce69f9ad330c@imgtec.com \
--to=robert.mazur@imgtec.com \
--cc=alessio.belle@imgtec.com \
--cc=brajesh.gupta@imgtec.com \
--cc=donald.robson@imgtec.com \
--cc=frank.binns@imgtec.com \
--cc=igt-dev@lists.freedesktop.org \
--cc=luigi.santivetti@imgtec.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