[PATCH 06/16] drm/xe/oa/uapi: Define and parse OA stream properties

Dixit, Ashutosh ashutosh.dixit at intel.com
Tue Feb 6 22:58:21 UTC 2024


On Tue, 06 Feb 2024 14:25:21 -0800, Umesh Nerlige Ramappa wrote:
>
> On Fri, Jan 19, 2024 at 06:00:16PM -0800, Ashutosh Dixit wrote:
> > Properties for OA streams are specified by user space, when the stream is
> > opened, as a chain of drm_xe_ext_set_property struct's. Parse and validate
> > these stream properties.
> >
> > v2: Remove struct drm_xe_oa_open_param (Harish Chegondi)
> >    Drop DRM_XE_OA_PROPERTY_POLL_OA_PERIOD_US (Umesh)
> >    Eliminate comparison with xe_oa_max_sample_rate (Umesh)
> >    Drop 'struct drm_xe_oa_record_header' (Umesh)
> >
> > Signed-off-by: Ashutosh Dixit <ashutosh.dixit at intel.com>
> > ---
> > drivers/gpu/drm/xe/xe_oa.c   | 344 +++++++++++++++++++++++++++++++++++
> > drivers/gpu/drm/xe/xe_oa.h   |   6 +
> > drivers/gpu/drm/xe/xe_perf.c |   2 +
> > include/uapi/drm/xe_drm.h    |  69 +++++++
> > 4 files changed, 421 insertions(+)
> >
> ...
> > +
> > +static int xe_oa_user_extensions(struct xe_oa *oa, u64 extension, int ext_number,
> > +				 struct xe_oa_open_param *param)
> > +{
> > +	u64 __user *address = u64_to_user_ptr(extension);
> > +	struct drm_xe_user_extension ext;
> > +	int err;
> > +	u32 idx;
> > +
> > +	if (XE_IOCTL_DBG(oa->xe, ext_number >= DRM_XE_OA_PROPERTY_MAX))
> > +		return -E2BIG;
>
> If we want to pass multiple exec_q id params (like discussed offline), this
> check will limit it. I think, for now, we can leave it as is until such a
> use case arises.

Correct, there are other limitations in the code today e.g. there is a
single hwe associated with a stream. So if say we want to have both a
render and a compute exec_q associated with a stream, other changes in the
code are needed to make it work.

I am tracking this task but it will need to be discussed and done after we
merge the initial code. The uapi supports this use case today (except for
the check above) but the implementation doesn't.

> rest lgtm,
>
> Reviewed-by: Umesh Nerlige Ramappa <umesh.nerlige.ramappa at intel.com>

Thanks.
--
Ashutosh



More information about the Intel-xe mailing list