All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/1] Xe OA Consolidated Diffs
@ 2024-03-05  5:21 Ashutosh Dixit
  2024-03-05  5:21 ` [PATCH 1/1] drm/xe/oa: Combined diff of changes between v10 and v11 Ashutosh Dixit
  2024-03-05  5:26 ` ✗ CI.Patch_applied: failure for Xe OA Consolidated Diffs Patchwork
  0 siblings, 2 replies; 4+ messages in thread
From: Ashutosh Dixit @ 2024-03-05  5:21 UTC (permalink / raw)
  To: intel-xe; +Cc: Umesh Nerlige Ramappa

Because Xe OA changes between successive revisions are distributed across
multiple patches, I am providing a combined diff of all changes in a single
patch to help with the code review.

These changes pertain to: https://patchwork.freedesktop.org/series/121084/

Ashutosh Dixit (1):
  drm/xe/oa: Combined diff of changes between v10 and v11

 drivers/gpu/drm/xe/xe_oa.c       | 21 +++++++++++++++------
 drivers/gpu/drm/xe/xe_oa_types.h |  2 +-
 include/uapi/drm/xe_drm.h        | 19 +++++++++++++++++--
 3 files changed, 33 insertions(+), 9 deletions(-)

-- 
2.41.0


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH 1/1] drm/xe/oa: Combined diff of changes between v10 and v11
  2024-03-05  5:21 [PATCH 0/1] Xe OA Consolidated Diffs Ashutosh Dixit
@ 2024-03-05  5:21 ` Ashutosh Dixit
  2024-03-05  5:43   ` Dixit, Ashutosh
  2024-03-05  5:26 ` ✗ CI.Patch_applied: failure for Xe OA Consolidated Diffs Patchwork
  1 sibling, 1 reply; 4+ messages in thread
From: Ashutosh Dixit @ 2024-03-05  5:21 UTC (permalink / raw)
  To: intel-xe; +Cc: Umesh Nerlige Ramappa

Because Xe OA changes between successive revisions are distributed across
multiple patches, provide a combined diff of all changes in a single patch
to help with the code review.

These changes pertain to: https://patchwork.freedesktop.org/series/121084/

This patch will not compile, it's purpose is to just provide the diff.

The diff between v10 and v11 consists of the following uapi changes:
* Use a chain of drm_xe_ext_set_property struct's also for stream
  reconfiguration (using DRM_XE_PERF_IOCTL_CONFIG perf fd ioctl). This
  will enable additional properties such as syncobj's during stream
  reconfiguration.
* Add extensions also to output structs from the kernel so they can also be
  extended if needed in the future
* Change DRM_XE_PERF ioctl number to 0x0b

Signed-off-by: Ashutosh Dixit <ashutosh.dixit@intel.com>
---
 drivers/gpu/drm/xe/xe_oa.c       | 21 +++++++++++++++------
 drivers/gpu/drm/xe/xe_oa_types.h |  2 +-
 include/uapi/drm/xe_drm.h        | 19 +++++++++++++++++--
 3 files changed, 33 insertions(+), 9 deletions(-)

diff --git a/drivers/gpu/drm/xe/xe_oa.c b/drivers/gpu/drm/xe/xe_oa.c
index c26bbed1940e..0f961ce4fb98 100644
--- a/drivers/gpu/drm/xe/xe_oa.c
+++ b/drivers/gpu/drm/xe/xe_oa.c
@@ -1004,19 +1004,28 @@ static void xe_oa_disable_locked(struct xe_oa_stream *stream)
 	xe_oa_stream_disable(stream);
 }
 
-static long xe_oa_config_locked(struct xe_oa_stream *stream,
-				unsigned long metrics_set)
+static long xe_oa_config_locked(struct xe_oa_stream *stream, u64 arg)
 {
-	struct xe_oa_config *config;
+	struct drm_xe_ext_set_property ext;
 	long ret = stream->oa_config->id;
+	struct xe_oa_config *config;
+	int err;
 
-	config = xe_oa_get_oa_config(stream->oa, metrics_set);
+	err = __copy_from_user(&ext, u64_to_user_ptr(arg), sizeof(ext));
+	if (XE_IOCTL_DBG(stream->oa->xe, err))
+		return -EFAULT;
+
+	if (XE_IOCTL_DBG(stream->oa->xe, ext.pad) ||
+	    XE_IOCTL_DBG(stream->oa->xe, ext.base.name != DRM_XE_OA_EXTENSION_SET_PROPERTY) ||
+	    XE_IOCTL_DBG(stream->oa->xe, ext.base.next_extension) ||
+	    XE_IOCTL_DBG(stream->oa->xe, ext.property != DRM_XE_OA_PROPERTY_OA_METRIC_SET))
+		return -EINVAL;
+
+	config = xe_oa_get_oa_config(stream->oa, ext.value);
 	if (!config)
 		return -ENODEV;
 
 	if (config != stream->oa_config) {
-		int err;
-
 		err = xe_oa_emit_oa_config(stream);
 		if (!err)
 			config = xchg(&stream->oa_config, config);
diff --git a/drivers/gpu/drm/xe/xe_oa_types.h b/drivers/gpu/drm/xe/xe_oa_types.h
index ce20c03bbc28..fd8e42c9bee1 100644
--- a/drivers/gpu/drm/xe/xe_oa_types.h
+++ b/drivers/gpu/drm/xe/xe_oa_types.h
@@ -4,7 +4,7 @@
  */
 
 #ifndef _XE_OA_TYPES_H_
-#define _XE_OA_TYPES_H__
+#define _XE_OA_TYPES_H_
 
 #include <linux/idr.h>
 #include <linux/math.h>
diff --git a/include/uapi/drm/xe_drm.h b/include/uapi/drm/xe_drm.h
index bdd7b78f47ba..96a7b0bbbe57 100644
--- a/include/uapi/drm/xe_drm.h
+++ b/include/uapi/drm/xe_drm.h
@@ -100,7 +100,7 @@ extern "C" {
 #define DRM_XE_EXEC_QUEUE_GET_PROPERTY	0x08
 #define DRM_XE_EXEC			0x09
 #define DRM_XE_WAIT_USER_FENCE		0x0a
-#define DRM_XE_PERF			0x0e
+#define DRM_XE_PERF			0x0b
 
 /* Must be kept compact -- no holes */
 
@@ -1377,7 +1377,7 @@ enum drm_xe_perf_op {
 };
 
 /**
- * struct drm_xe_perf_param - Perf layer param
+ * struct drm_xe_perf_param - Input of &DRM_XE_PERF
  *
  * The perf layer enables multiplexing perf counter streams of multiple
  * types. The actual params for a particular stream operation are supplied
@@ -1433,6 +1433,9 @@ enum drm_xe_oa_unit_type {
  * struct drm_xe_oa_unit - describe OA unit
  */
 struct drm_xe_oa_unit {
+	/** @extensions: Pointer to the first extension struct, if any */
+	__u64 extensions;
+
 	/** @oa_unit_id: OA unit ID */
 	__u32 oa_unit_id;
 
@@ -1481,6 +1484,8 @@ struct drm_xe_oa_unit {
  *	}
  */
 struct drm_xe_query_oa_units {
+	/** @extensions: Pointer to the first extension struct, if any */
+	__u64 extensions;
 	/** @num_oa_units: number of OA units returned in oau[] */
 	__u32 num_oa_units;
 	/** @pad: MBZ */
@@ -1507,6 +1512,10 @@ enum drm_xe_oa_format_type {
  * @drm_xe_user_extension base.name set to @DRM_XE_OA_EXTENSION_SET_PROPERTY.
  * @param field in struct @drm_xe_perf_param points to the first
  * @drm_xe_ext_set_property struct.
+ *
+ * Exactly the same mechanism is also used for stream reconfiguration using
+ * the @DRM_XE_PERF_IOCTL_CONFIG perf fd ioctl, though only a subset of
+ * properties below can be specified for stream reconfiguration.
  */
 enum drm_xe_oa_property_id {
 #define DRM_XE_OA_EXTENSION_SET_PROPERTY	0
@@ -1600,6 +1609,9 @@ struct drm_xe_oa_config {
  * @DRM_XE_PERF_IOCTL_STATUS perf fd ioctl
  */
 struct drm_xe_oa_stream_status {
+	/** @extensions: Pointer to the first extension struct, if any */
+	__u64 extensions;
+
 	/** @oa_status: OA status register as specified in PRM/Bspec 46717/61226 */
 	__u64 oa_status;
 #define DRM_XE_OASTATUS_MMIO_TRG_Q_FULL		(1 << 6)
@@ -1616,6 +1628,9 @@ struct drm_xe_oa_stream_status {
  * @DRM_XE_PERF_IOCTL_INFO perf fd ioctl
  */
 struct drm_xe_oa_stream_info {
+	/** @extensions: Pointer to the first extension struct, if any */
+	__u64 extensions;
+
 	/** @oa_buf_size: OA buffer size */
 	__u64 oa_buf_size;
 
-- 
2.41.0


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* ✗ CI.Patch_applied: failure for Xe OA Consolidated Diffs
  2024-03-05  5:21 [PATCH 0/1] Xe OA Consolidated Diffs Ashutosh Dixit
  2024-03-05  5:21 ` [PATCH 1/1] drm/xe/oa: Combined diff of changes between v10 and v11 Ashutosh Dixit
@ 2024-03-05  5:26 ` Patchwork
  1 sibling, 0 replies; 4+ messages in thread
From: Patchwork @ 2024-03-05  5:26 UTC (permalink / raw)
  To: Ashutosh Dixit; +Cc: intel-xe

== Series Details ==

Series: Xe OA Consolidated Diffs
URL   : https://patchwork.freedesktop.org/series/130705/
State : failure

== Summary ==

=== Applying kernel patches on branch 'drm-tip' with base: ===
Base commit: e90b5046fce6 drm-tip: 2024y-03m-04d-23h-59m-21s UTC integration manifest
=== git am output follows ===
error: drivers/gpu/drm/xe/xe_oa.c: does not exist in index
error: drivers/gpu/drm/xe/xe_oa_types.h: does not exist in index
error: patch failed: include/uapi/drm/xe_drm.h:100
error: include/uapi/drm/xe_drm.h: patch does not apply
hint: Use 'git am --show-current-patch=diff' to see the failed patch
Applying: drm/xe/oa: Combined diff of changes between v10 and v11
Patch failed at 0001 drm/xe/oa: Combined diff of changes between v10 and v11
When you have resolved this problem, run "git am --continue".
If you prefer to skip this patch, run "git am --skip" instead.
To restore the original branch and stop patching, run "git am --abort".



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH 1/1] drm/xe/oa: Combined diff of changes between v10 and v11
  2024-03-05  5:21 ` [PATCH 1/1] drm/xe/oa: Combined diff of changes between v10 and v11 Ashutosh Dixit
@ 2024-03-05  5:43   ` Dixit, Ashutosh
  0 siblings, 0 replies; 4+ messages in thread
From: Dixit, Ashutosh @ 2024-03-05  5:43 UTC (permalink / raw)
  To: intel-xe, Umesh Nerlige Ramappa

On Mon, 04 Mar 2024 21:21:36 -0800, Ashutosh Dixit wrote:
>

Hi Umesh,

> The diff between v10 and v11 consists of the following uapi changes:
> * Use a chain of drm_xe_ext_set_property struct's also for stream
>   reconfiguration (using DRM_XE_PERF_IOCTL_CONFIG perf fd ioctl). This
>   will enable additional properties such as syncobj's during stream
>   reconfiguration.
> * Add extensions also to output structs from the kernel so they can also be
>   extended if needed in the future
> * Change DRM_XE_PERF ioctl number to 0x0b

Just wanted to propose a few minor tweaks to the Perf/OA uapi with this
patch. I have sent the new series with these changes here:

https://patchwork.freedesktop.org/series/121084/#rev11

But didn't copy you on the series itself (just this combined diff) so as
not to spam you. I have also retained your previous R-b's on the patches.

So please just take a look at this combined diff and let me know if there's
anything here you don't agree with or want done differently.

Thanks.
--
Ashutosh

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2024-03-05  5:44 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-03-05  5:21 [PATCH 0/1] Xe OA Consolidated Diffs Ashutosh Dixit
2024-03-05  5:21 ` [PATCH 1/1] drm/xe/oa: Combined diff of changes between v10 and v11 Ashutosh Dixit
2024-03-05  5:43   ` Dixit, Ashutosh
2024-03-05  5:26 ` ✗ CI.Patch_applied: failure for Xe OA Consolidated Diffs Patchwork

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.