[PATCH] drm/xe/oa: Allow oa_exponent value of 0

Dixit, Ashutosh ashutosh.dixit at intel.com
Wed Feb 12 02:12:50 UTC 2025


On Tue, 11 Feb 2025 17:07:36 -0800, Umesh Nerlige Ramappa wrote:
>

Hi Umesh,

> OA exponent value of 0 is a valid value for periodic reports. Allow user
> to pass 0 for the OA sampling interval since it gets converted to 2 gt
> clock ticks.
>
> Signed-off-by: Umesh Nerlige Ramappa <umesh.nerlige.ramappa at intel.com>
> ---
>  drivers/gpu/drm/xe/xe_oa.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/xe/xe_oa.c b/drivers/gpu/drm/xe/xe_oa.c
> index a692dffcb638..268403b9b527 100644
> --- a/drivers/gpu/drm/xe/xe_oa.c
> +++ b/drivers/gpu/drm/xe/xe_oa.c
> @@ -2025,7 +2025,7 @@ int xe_oa_stream_open_ioctl(struct drm_device *dev, u64 data, struct drm_file *f
>		goto err_exec_q;
>	}
>
> -	if (param.period_exponent > 0) {
> +	if (param.period_exponent >= 0) {
>		u64 oa_period, oa_freq_hz;
>
>		/* Requesting samples from OAG buffer is a privileged operation */
> --
> 2.34.1
>

I think this also would need to be changed:

static int xe_oa_stream_init(struct xe_oa_stream *stream,
			     struct xe_oa_open_param *param)
{
	...
	stream->periodic = param->period_exponent > 0;

Ashutosh


More information about the Intel-xe mailing list