Intel-XE Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: "José Roberto de Souza" <jose.souza@intel.com>
To: intel-xe@lists.freedesktop.org
Cc: "Ashutosh Dixit" <ashutosh.dixit@intel.com>,
	"José Roberto de Souza" <jose.souza@intel.com>
Subject: [PATCH] drm/xe/oa: Call xe_oa_emit_oa_config() with new config when updating config
Date: Wed, 19 Jun 2024 12:28:54 -0700	[thread overview]
Message-ID: <20240619192854.199289-1-jose.souza@intel.com> (raw)

When UMD ask config to be updated, xe_oa_config_locked() was calling
xe_oa_emit_oa_config() that would use stream->oa_config but that is
only changed to the next oa_config after xe_oa_emit_oa_config() finish.
So it was setting the same config for all DRM_XE_PERF_IOCTL_CONFIG
calls.

Cc: Ashutosh Dixit <ashutosh.dixit@intel.com>
Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
---
 drivers/gpu/drm/xe/xe_oa.c | 11 +++++------
 1 file changed, 5 insertions(+), 6 deletions(-)

diff --git a/drivers/gpu/drm/xe/xe_oa.c b/drivers/gpu/drm/xe/xe_oa.c
index 34206e0b6a08e..a2da54d49f1ce 100644
--- a/drivers/gpu/drm/xe/xe_oa.c
+++ b/drivers/gpu/drm/xe/xe_oa.c
@@ -887,9 +887,8 @@ __xe_oa_alloc_config_buffer(struct xe_oa_stream *stream, struct xe_oa_config *oa
 	return ERR_CAST(bb);
 }
 
-static struct xe_oa_config_bo *xe_oa_alloc_config_buffer(struct xe_oa_stream *stream)
+static struct xe_oa_config_bo *xe_oa_alloc_config_buffer(struct xe_oa_stream *stream, struct xe_oa_config *oa_config)
 {
-	struct xe_oa_config *oa_config = stream->oa_config;
 	struct xe_oa_config_bo *oa_bo;
 
 	/* Look for the buffer in the already allocated BOs attached to the stream */
@@ -905,13 +904,13 @@ static struct xe_oa_config_bo *xe_oa_alloc_config_buffer(struct xe_oa_stream *st
 	return oa_bo;
 }
 
-static int xe_oa_emit_oa_config(struct xe_oa_stream *stream)
+static int xe_oa_emit_oa_config(struct xe_oa_stream *stream, struct xe_oa_config *config)
 {
 #define NOA_PROGRAM_ADDITIONAL_DELAY_US 500
 	struct xe_oa_config_bo *oa_bo;
 	int err, us = NOA_PROGRAM_ADDITIONAL_DELAY_US;
 
-	oa_bo = xe_oa_alloc_config_buffer(stream);
+	oa_bo = xe_oa_alloc_config_buffer(stream, config);
 	if (IS_ERR(oa_bo)) {
 		err = PTR_ERR(oa_bo);
 		goto exit;
@@ -989,7 +988,7 @@ static int xe_oa_enable_metric_set(struct xe_oa_stream *stream)
 			return ret;
 	}
 
-	return xe_oa_emit_oa_config(stream);
+	return xe_oa_emit_oa_config(stream, stream->oa_config);
 }
 
 static void xe_oa_stream_enable(struct xe_oa_stream *stream)
@@ -1054,7 +1053,7 @@ static long xe_oa_config_locked(struct xe_oa_stream *stream, u64 arg)
 		return -ENODEV;
 
 	if (config != stream->oa_config) {
-		err = xe_oa_emit_oa_config(stream);
+		err = xe_oa_emit_oa_config(stream, config);
 		if (!err)
 			config = xchg(&stream->oa_config, config);
 		else
-- 
2.45.2


             reply	other threads:[~2024-06-19 19:29 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-06-19 19:28 José Roberto de Souza [this message]
2024-06-19 20:12 ` ✓ CI.Patch_applied: success for drm/xe/oa: Call xe_oa_emit_oa_config() with new config when updating config Patchwork
2024-06-19 20:12 ` ✗ CI.checkpatch: warning " Patchwork
2024-06-19 20:13 ` ✓ CI.KUnit: success " Patchwork
2024-06-19 20:25 ` ✓ CI.Build: " Patchwork
2024-06-19 20:27 ` ✗ CI.Hooks: failure " Patchwork
2024-06-19 20:29 ` ✓ CI.checksparse: success " Patchwork
2024-06-19 20:51 ` ✓ CI.BAT: " Patchwork
2024-06-19 22:22 ` [PATCH] " Dixit, Ashutosh
2024-06-20 16:16   ` Dixit, Ashutosh
2024-06-20  5:28 ` ✗ CI.FULL: failure for " 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=20240619192854.199289-1-jose.souza@intel.com \
    --to=jose.souza@intel.com \
    --cc=ashutosh.dixit@intel.com \
    --cc=intel-xe@lists.freedesktop.org \
    /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