diff options
author | José Roberto de Souza <jose.souza@intel.com> | 2024-06-19 12:28:54 -0700 |
---|---|---|
committer | Ashutosh Dixit <ashutosh.dixit@intel.com> | 2024-06-20 09:18:17 -0700 |
commit | 3516b2913ead50c5649cafcd1fe97b9c9dc41e59 (patch) | |
tree | 2fe19ff01cf9cabae57be76589927b6fd29592e4 /drivers/gpu/drm/xe | |
parent | cb925d31f091467dee09dd49eab8bcd2c9b3e73e (diff) |
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
Diffstat (limited to 'drivers/gpu/drm/xe')
-rw-r--r-- | drivers/gpu/drm/xe/xe_oa.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/drivers/gpu/drm/xe/xe_oa.c b/drivers/gpu/drm/xe/xe_oa.c index 2277af816a34..36b2e89b78b6 100644 --- a/drivers/gpu/drm/xe/xe_oa.c +++ b/drivers/gpu/drm/xe/xe_oa.c @@ -887,9 +887,9 @@ err_free: 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 +905,13 @@ out: 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 +989,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 +1054,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 |