public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Daniel Almeida <daniel.almeida@collabora.com>
To: liviu.dudau@arm.com, steven.price@arm.com,
	carsten.haitzler@arm.com, boris.brezillon@collabora.com,
	robh@kernel.org, faith.ekstrand@collabora.com
Cc: Daniel Almeida <daniel.almeida@collabora.com>,
	linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org
Subject: [PATCH v2 RESEND 1/5] drm: panthor: expose some fw information through the query ioctl
Date: Wed, 21 Aug 2024 11:37:27 -0300	[thread overview]
Message-ID: <20240821143826.3720-2-daniel.almeida@collabora.com> (raw)
In-Reply-To: <20240821143826.3720-1-daniel.almeida@collabora.com>

This is of interest to userspace, and similar in nature to the GPU
and CSIF information we already return in the query ioctl.

Signed-off-by: Daniel Almeida <daniel.almeida@collabora.com>
---
 drivers/gpu/drm/panthor/panthor_device.h |  3 +++
 drivers/gpu/drm/panthor/panthor_drv.c    |  8 ++++++++
 drivers/gpu/drm/panthor/panthor_sched.c  |  5 +++++
 include/uapi/drm/panthor_drm.h           | 19 +++++++++++++++++++
 4 files changed, 35 insertions(+)

diff --git a/drivers/gpu/drm/panthor/panthor_device.h b/drivers/gpu/drm/panthor/panthor_device.h
index e388c0472ba7..224c53dcfe6d 100644
--- a/drivers/gpu/drm/panthor/panthor_device.h
+++ b/drivers/gpu/drm/panthor/panthor_device.h
@@ -100,6 +100,9 @@ struct panthor_device {
 	/** @csif_info: Command stream interface information. */
 	struct drm_panthor_csif_info csif_info;
 
+	/** @fw_info: Firmware info for the global interface */
+	struct drm_panthor_fw_info fw_info;
+
 	/** @gpu: GPU management data. */
 	struct panthor_gpu *gpu;
 
diff --git a/drivers/gpu/drm/panthor/panthor_drv.c b/drivers/gpu/drm/panthor/panthor_drv.c
index b8a84f26b3ef..fb30e119d9bf 100644
--- a/drivers/gpu/drm/panthor/panthor_drv.c
+++ b/drivers/gpu/drm/panthor/panthor_drv.c
@@ -164,6 +164,7 @@ panthor_get_uobj_array(const struct drm_panthor_obj_array *in, u32 min_stride,
 	_Generic(_obj_name, \
 		 PANTHOR_UOBJ_DECL(struct drm_panthor_gpu_info, tiler_present), \
 		 PANTHOR_UOBJ_DECL(struct drm_panthor_csif_info, pad), \
+		 PANTHOR_UOBJ_DECL(struct drm_panthor_fw_info, instr_features), \
 		 PANTHOR_UOBJ_DECL(struct drm_panthor_sync_op, timeline_value), \
 		 PANTHOR_UOBJ_DECL(struct drm_panthor_queue_submit, syncs), \
 		 PANTHOR_UOBJ_DECL(struct drm_panthor_queue_create, ringbuf_size), \
@@ -765,6 +766,10 @@ static int panthor_ioctl_dev_query(struct drm_device *ddev, void *data, struct d
 			args->size = sizeof(ptdev->csif_info);
 			return 0;
 
+		case DRM_PANTHOR_DEV_QUERY_FW_INFO:
+			args->size = sizeof(ptdev->fw_info);
+			return 0;
+
 		default:
 			return -EINVAL;
 		}
@@ -777,6 +782,9 @@ static int panthor_ioctl_dev_query(struct drm_device *ddev, void *data, struct d
 	case DRM_PANTHOR_DEV_QUERY_CSIF_INFO:
 		return PANTHOR_UOBJ_SET(args->pointer, args->size, ptdev->csif_info);
 
+	case DRM_PANTHOR_DEV_QUERY_FW_INFO:
+		return PANTHOR_UOBJ_SET(args->pointer, args->size, ptdev->fw_info);
+
 	default:
 		return -EINVAL;
 	}
diff --git a/drivers/gpu/drm/panthor/panthor_sched.c b/drivers/gpu/drm/panthor/panthor_sched.c
index 79ffcbc41d78..e0ecc8bcfaae 100644
--- a/drivers/gpu/drm/panthor/panthor_sched.c
+++ b/drivers/gpu/drm/panthor/panthor_sched.c
@@ -3495,6 +3495,11 @@ int panthor_sched_init(struct panthor_device *ptdev)
 	ptdev->csif_info.cs_slot_count = sched->cs_slot_count;
 	ptdev->csif_info.scoreboard_slot_count = sched->sb_slot_count;
 
+	ptdev->fw_info.version = glb_iface->control->version;
+	ptdev->fw_info.features = glb_iface->control->features;
+	ptdev->fw_info.group_num = glb_iface->control->group_num;
+	ptdev->fw_info.instr_features = glb_iface->control->instr_features;
+
 	sched->last_tick = 0;
 	sched->resched_target = U64_MAX;
 	sched->tick_period = msecs_to_jiffies(10);
diff --git a/include/uapi/drm/panthor_drm.h b/include/uapi/drm/panthor_drm.h
index aaed8e12ad0b..e235cf452460 100644
--- a/include/uapi/drm/panthor_drm.h
+++ b/include/uapi/drm/panthor_drm.h
@@ -260,6 +260,9 @@ enum drm_panthor_dev_query_type {
 
 	/** @DRM_PANTHOR_DEV_QUERY_CSIF_INFO: Query command-stream interface information. */
 	DRM_PANTHOR_DEV_QUERY_CSIF_INFO,
+
+	/** @DRM_PANTHOR_DEV_QUERY_FW_INFO: Query firmware information */
+	DRM_PANTHOR_DEV_QUERY_FW_INFO,
 };
 
 /**
@@ -377,6 +380,22 @@ struct drm_panthor_csif_info {
 	__u32 pad;
 };
 
+/** struct drm_panthor_fw_info - FW information
+ *
+ * Structure grouping all queryable information relating to the global FW interface.
+ */
+
+struct drm_panthor_fw_info {
+	/** @version: Global interface version */
+	__u32 version;
+	/** @features: Global interface features */
+	__u32 features;
+	/** @group_num: Number of CSG interfaces */
+	__u32 group_num;
+	/** @instr_features: Instrumentation features */
+	__u32 instr_features;
+};
+
 /**
  * struct drm_panthor_dev_query - Arguments passed to DRM_PANTHOR_IOCTL_DEV_QUERY
  */
-- 
2.45.2


  reply	other threads:[~2024-08-21 14:39 UTC|newest]

Thread overview: 56+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-07-10 22:50 [RFC PATCH] drm: panthor: add dev_coredumpv support Daniel Almeida
2024-07-11  0:01 ` Danilo Krummrich
2024-07-15  9:03   ` Daniel Vetter
2024-07-15 17:05     ` Daniel Almeida
2024-07-16  9:25       ` Daniel Vetter
2024-07-25 19:35         ` Lyude Paul
2024-07-26 13:40           ` Daniel Vetter
2024-07-29 18:34             ` Lyude Paul
2024-07-30  8:29               ` Daniel Vetter
2024-07-11 16:57 ` Liviu Dudau
2024-07-11 18:40   ` Daniel Almeida
2024-07-12  9:46 ` Steven Price
2024-07-12 14:35   ` Daniel Almeida
2024-07-12 14:53     ` Danilo Krummrich
2024-07-12 15:13       ` Daniel Almeida
2024-07-12 15:32         ` Danilo Krummrich
2024-07-13  0:48           ` Dave Airlie
2024-07-13  1:00             ` Daniel Almeida
2024-07-13  8:17             ` Miguel Ojeda
2024-07-15  9:12     ` Steven Price
2024-07-23  9:44       ` Alice Ryhl
2024-07-23 16:06       ` Boris Brezillon
2024-07-23 17:23         ` Daniel Almeida
2024-07-24  8:59         ` Steven Price
2024-07-24 10:44           ` Boris Brezillon
2024-07-24 12:37             ` Steven Price
2024-07-24 13:15           ` Rob Herring
2024-07-24 13:54             ` Steven Price
2024-07-24 14:27               ` Daniel Almeida
2024-07-24 14:35                 ` Steven Price
2024-07-24 14:38               ` Miguel Ojeda
2024-07-25 11:42               ` Carsten Haitzler
2024-07-25 11:45         ` Carsten Haitzler
2024-07-23  9:53 ` Alice Ryhl
2024-07-23 13:41   ` Daniel Almeida
2024-07-23 13:45     ` Alice Ryhl
2024-08-13 21:05 ` [PATCH v2 0/5] Panthor devcoredump support Daniel Almeida
2024-08-13 21:05   ` [PATCH v2 1/5] drm: panthor: expose some fw information through the query ioctl Daniel Almeida
2024-08-14 13:44     ` Boris Brezillon
2024-08-13 21:05   ` [PATCH v2 2/5] drm: panthor: add devcoredump support Daniel Almeida
2024-08-15  6:01     ` kernel test robot
2024-08-13 21:05   ` [PATCH v2 3/5] drm: panthor: add debugfs support in panthor_sched Daniel Almeida
2024-08-13 21:05   ` [PATCH v2 4/5] drm: panthor: add debugfs knob to dump successful jobs Daniel Almeida
2024-08-13 21:05   ` [PATCH v2 5/5] drm: panthor: allow dumping multiple jobs Daniel Almeida
2024-08-21 14:37 ` [PATCH v2 RESEND 0/5] Panthor devcoredump support Daniel Almeida
2024-08-21 14:37   ` Daniel Almeida [this message]
2024-08-22 12:26     ` [PATCH v2 RESEND 1/5] drm: panthor: expose some fw information through the query ioctl Adrian Larumbe
2024-08-23 13:15     ` Boris Brezillon
2024-09-20 12:57     ` Mihail Atanassov
2024-08-21 14:37   ` [PATCH v2 RESEND 2/5] drm: panthor: add devcoredump support Daniel Almeida
2024-08-22 12:27     ` Adrian Larumbe
2024-08-23 14:46     ` Boris Brezillon
2024-08-21 14:37   ` [PATCH v2 RESEND 3/5] drm: panthor: add debugfs support in panthor_sched Daniel Almeida
2024-08-21 14:37   ` [PATCH v2 RESEND 4/5] drm: panthor: add debugfs knob to dump successful jobs Daniel Almeida
2024-08-22 12:36     ` Adrian Larumbe
2024-08-21 14:37   ` [PATCH v2 RESEND 5/5] drm: panthor: allow dumping multiple jobs Daniel Almeida

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=20240821143826.3720-2-daniel.almeida@collabora.com \
    --to=daniel.almeida@collabora.com \
    --cc=boris.brezillon@collabora.com \
    --cc=carsten.haitzler@arm.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=faith.ekstrand@collabora.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=liviu.dudau@arm.com \
    --cc=robh@kernel.org \
    --cc=steven.price@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox