Skip to content

Commit 3516b29

Browse files
zehortigozaashutoshx
authored andcommitted
drm/xe/oa: Call xe_oa_emit_oa_config() with new config when updating config
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> Reviewed-by: Ashutosh Dixit <ashutosh.dixit@intel.com> Signed-off-by: Ashutosh Dixit <ashutosh.dixit@intel.com> Link: https://patchwork.freedesktop.org/patch/msgid/20240619192854.199289-1-jose.souza@intel.com
1 parent cb925d3 commit 3516b29

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

drivers/gpu/drm/xe/xe_oa.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -887,9 +887,9 @@ __xe_oa_alloc_config_buffer(struct xe_oa_stream *stream, struct xe_oa_config *oa
887887
return ERR_CAST(bb);
888888
}
889889

890-
static struct xe_oa_config_bo *xe_oa_alloc_config_buffer(struct xe_oa_stream *stream)
890+
static struct xe_oa_config_bo *
891+
xe_oa_alloc_config_buffer(struct xe_oa_stream *stream, struct xe_oa_config *oa_config)
891892
{
892-
struct xe_oa_config *oa_config = stream->oa_config;
893893
struct xe_oa_config_bo *oa_bo;
894894

895895
/* Look for the buffer in the already allocated BOs attached to the stream */
@@ -905,13 +905,13 @@ static struct xe_oa_config_bo *xe_oa_alloc_config_buffer(struct xe_oa_stream *st
905905
return oa_bo;
906906
}
907907

908-
static int xe_oa_emit_oa_config(struct xe_oa_stream *stream)
908+
static int xe_oa_emit_oa_config(struct xe_oa_stream *stream, struct xe_oa_config *config)
909909
{
910910
#define NOA_PROGRAM_ADDITIONAL_DELAY_US 500
911911
struct xe_oa_config_bo *oa_bo;
912912
int err, us = NOA_PROGRAM_ADDITIONAL_DELAY_US;
913913

914-
oa_bo = xe_oa_alloc_config_buffer(stream);
914+
oa_bo = xe_oa_alloc_config_buffer(stream, config);
915915
if (IS_ERR(oa_bo)) {
916916
err = PTR_ERR(oa_bo);
917917
goto exit;
@@ -989,7 +989,7 @@ static int xe_oa_enable_metric_set(struct xe_oa_stream *stream)
989989
return ret;
990990
}
991991

992-
return xe_oa_emit_oa_config(stream);
992+
return xe_oa_emit_oa_config(stream, stream->oa_config);
993993
}
994994

995995
static void xe_oa_stream_enable(struct xe_oa_stream *stream)
@@ -1054,7 +1054,7 @@ static long xe_oa_config_locked(struct xe_oa_stream *stream, u64 arg)
10541054
return -ENODEV;
10551055

10561056
if (config != stream->oa_config) {
1057-
err = xe_oa_emit_oa_config(stream);
1057+
err = xe_oa_emit_oa_config(stream, config);
10581058
if (!err)
10591059
config = xchg(&stream->oa_config, config);
10601060
else

0 commit comments

Comments
 (0)