[PATCH 04/17] drm/xe/oa/uapi: Add OA data formats

Dixit, Ashutosh ashutosh.dixit at intel.com
Tue Dec 19 01:17:54 UTC 2023


On Mon, 18 Dec 2023 17:11:37 -0800, Umesh Nerlige Ramappa wrote:
>

Hi Umesh,

> > +enum xe_oa_format_name {
> > +	XE_OA_FORMAT_C4_B8 = 7,
>
> 7? Leaving room for old formats? Not sure if it adds any value. Do you
> anticipate this driver being supported on pre-gen12? If not, IMO, we should
> just start with 0 OR 1 (if you want to use 0 for some special case.
>
> rest of it, lgtm,
> Reviewed-by: Umesh Nerlige Ramappa <umesh.nerlige.ramappa at intel.com>

Yes good point, I'll fix this up. The OA format uapi does need review but
that's a later patch.

Thanks.
--
Ashutosh


>
> Umesh
>
> > +
> > +	/* Gen8+ */
> > +	XE_OA_FORMAT_A12,
> > +	XE_OA_FORMAT_A12_B8_C8,
> > +	XE_OA_FORMAT_A32u40_A4u32_B8_C8,
> > +
> > +	/* DG2 */
> > +	XE_OAR_FORMAT_A32u40_A4u32_B8_C8,
> > +	XE_OA_FORMAT_A24u40_A14u32_B8_C8,
> > +
> > +	/* DG2/MTL OAC */
> > +	XE_OAC_FORMAT_A24u64_B8_C8,
> > +	XE_OAC_FORMAT_A22u32_R2u32_B8_C8,
> > +
> > +	/* MTL OAM */
> > +	XE_OAM_FORMAT_MPEC8u64_B8_C8,
> > +	XE_OAM_FORMAT_MPEC8u32_B8_C8,
> > +
> > +	/* Xe2+ */
> > +	XE_OA_FORMAT_PEC64u64,
> > +	XE_OA_FORMAT_PEC64u64_B8_C8,
> > +	XE_OA_FORMAT_PEC64u32,
> > +	XE_OA_FORMAT_PEC32u64_G1,
> > +	XE_OA_FORMAT_PEC32u32_G1,
> > +	XE_OA_FORMAT_PEC32u64_G2,
> > +	XE_OA_FORMAT_PEC32u32_G2,
> > +	XE_OA_FORMAT_PEC36u64_G1_32_G2_4,
> > +	XE_OA_FORMAT_PEC36u64_G1_4_G2_32,
> > +
> > +	XE_OA_FORMAT_MAX,
> > +};
> > +
> > +/**
> > + * struct xe_oa_format - Format fields for supported OA formats
> > + */
> > +struct xe_oa_format {
> > +	u32 counter_select;
> > +	int size;
> > +	int type;
> > +	enum xe_oa_report_header header;
> > +	u16 counter_size;
> > +	u16 bc_report;
> > +};
> > +
> > +/**
> > + * struct xe_oa - OA device level information
> > + */
> > +struct xe_oa {
> > +	/** @xe: back pointer to xe device */
> > +	struct xe_device *xe;
> > +
> > +	/** @oa_formats: tracks all OA formats across platforms */
> > +	const struct xe_oa_format *oa_formats;
> > +
> > +#define FORMAT_MASK_SIZE DIV_ROUND_UP(XE_OA_FORMAT_MAX - 1, BITS_PER_LONG)
> > +
> > +	/** @format_mask: tracks valid OA formats for a platform */
> > +	unsigned long format_mask[FORMAT_MASK_SIZE];
> > +};
> > +#endif
> > diff --git a/include/uapi/drm/xe_drm.h b/include/uapi/drm/xe_drm.h
> > index 3539e0781d700..5bfb2d5aba12a 100644
> > --- a/include/uapi/drm/xe_drm.h
> > +++ b/include/uapi/drm/xe_drm.h
> > @@ -1175,6 +1175,16 @@ enum drm_xe_perf_ioctls {
> >	DRM_XE_PERF_IOCTL_CONFIG = _IO('i', 0x2),
> > };
> >
> > +/** enum drm_xe_oa_format_type - OA format types */
> > +enum drm_xe_oa_format_type {
> > +	DRM_XE_OA_FMT_TYPE_OAG,
> > +	DRM_XE_OA_FMT_TYPE_OAR,
> > +	DRM_XE_OA_FMT_TYPE_OAM,
> > +	DRM_XE_OA_FMT_TYPE_OAC,
> > +	DRM_XE_OA_FMT_TYPE_OAM_MPEC,
> > +	DRM_XE_OA_FMT_TYPE_PEC,
> > +};
> > +
> > #if defined(__cplusplus)
> > }
> > #endif
> > -- 2.41.0
> >


More information about the Intel-xe mailing list