All of lore.kernel.org
 help / color / mirror / Atom feed
From: Daniel Stone <daniels@collabora.com>
To: igt-dev@lists.freedesktop.org
Cc: boris.brezillon@collabora.com, laura.nao@collabora.com,
	adrian.larumbe@collabora.com, daniel.almeida@collabora.com,
	liviu.dudau@arm.com
Subject: [PATCH 2/4] panthor: Add igt_panthor_get_arch() helper
Date: Thu, 15 Oct 2026 14:05:47 +0100	[thread overview]
Message-ID: <20261015130837.710795-3-daniels@collabora.com> (raw)
In-Reply-To: <20261015130837.710795-1-daniels@collabora.com>

This will identify the major architecture revision.

Signed-off-by: Daniel Stone <daniels@collabora.com>
---
 lib/igt_panthor.c | 17 +++++++++++++++++
 lib/igt_panthor.h |  1 +
 2 files changed, 18 insertions(+)

diff --git a/lib/igt_panthor.c b/lib/igt_panthor.c
index cd6b6b7fd..f5c6859e2 100644
--- a/lib/igt_panthor.c
+++ b/lib/igt_panthor.c
@@ -370,3 +370,20 @@ void igt_panthor_free_bo(int fd, struct panthor_bo *bo)
 
 	gem_close(fd, bo->handle);
 }
+
+/**
+ * igt_panthor_get_arch:
+ * @fd: panthor device file descriptor
+ *
+ * Get the architecture major version for this device.
+ *
+ * Returns: The Mali architecture major version
+ */
+int igt_panthor_get_arch(int fd)
+{
+	struct drm_panthor_gpu_info gpu_info = { 0 };
+
+	igt_panthor_query(fd, DRM_PANTHOR_DEV_QUERY_GPU_INFO,
+			  &gpu_info, sizeof(gpu_info), 0);
+	return DRM_PANTHOR_ARCH_MAJOR(gpu_info.gpu_id);
+}
diff --git a/lib/igt_panthor.h b/lib/igt_panthor.h
index 63c4f2bf4..3056ebd75 100644
--- a/lib/igt_panthor.h
+++ b/lib/igt_panthor.h
@@ -36,6 +36,7 @@ void igt_panthor_group_submit_simple(int fd, uint32_t group_handle,
 				     uint32_t queue_index, uint64_t stream_addr,
 				     uint32_t stream_size, uint32_t syncobj_handle,
 				     int err);
+int igt_panthor_get_arch(int fd);
 
 static inline void igt_panthor_vm_bind(int fd, uint32_t vm_id, uint32_t bo_handle,
 				       uint64_t va, uint64_t size, uint32_t flags, int err)
-- 
2.47.3


  parent reply	other threads:[~2026-10-15 13:12 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-15 13:05 [PATCH 0/4] Add Panthor compute-shader test Daniel Stone
2026-10-15 13:05 ` [PATCH 1/4] panthor: Use all available GPU cores Daniel Stone
2026-10-15 15:50   ` Kamil Konieczny
2026-10-15 13:05 ` Daniel Stone [this message]
2026-10-15 15:52   ` [PATCH 2/4] panthor: Add igt_panthor_get_arch() helper Kamil Konieczny
2026-10-15 13:05 ` [PATCH 3/4] panthor: Add more CSF instructions Daniel Stone
2026-10-15 15:55   ` Kamil Konieczny
2026-10-15 13:05 ` [PATCH 4/4] panthor: Add simple compute-shader test Daniel Stone
2026-10-15 16:06   ` Kamil Konieczny

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=20261015130837.710795-3-daniels@collabora.com \
    --to=daniels@collabora.com \
    --cc=adrian.larumbe@collabora.com \
    --cc=boris.brezillon@collabora.com \
    --cc=daniel.almeida@collabora.com \
    --cc=igt-dev@lists.freedesktop.org \
    --cc=laura.nao@collabora.com \
    --cc=liviu.dudau@arm.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 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.