[igt-dev] [PATCH i-g-t v7 2/7] lib/xe: Introduce Xe library
Mauro Carvalho Chehab
mauro.chehab at linux.intel.com
Fri Mar 10 06:41:35 UTC 2023
On Thu, 09 Mar 2023 20:38:03 -0800
"Dixit, Ashutosh" <ashutosh.dixit at intel.com> wrote:
> On Thu, 09 Mar 2023 20:30:39 -0800, Dixit, Ashutosh wrote:
> >
> > On Tue, 07 Mar 2023 14:12:31 -0800, Zbigniew Kempczyński wrote:
> > >
> >
> > Hi Zbyzsek,
> >
> > > +#define for_each_gt(__fd, __gt) \
> > > + for (__gt = 0; __gt < xe_number_gt(__fd); ++__gt)
> >
> > This for_each_gt conflicts with for_each_gt in our internal i915 tree
> > (which were planning to post upstream soon). How do you want to resolve
> > this?
>
> Can we can just do this?
>
> diff --git a/lib/xe/xe_query.h b/lib/xe/xe_query.h
> index fe1343f6161..72ee6c9478b 100644
> --- a/lib/xe/xe_query.h
> +++ b/lib/xe/xe_query.h
> @@ -66,6 +66,7 @@ struct xe_device {
> #define for_each_hw_engine_class(__class) \
> for (__class = 0; __class < DRM_XE_ENGINE_CLASS_COMPUTE + 1; \
> ++__class)
> +#undef for_each_gt
> #define for_each_gt(__fd, __gt) \
> for (__gt = 0; __gt < xe_number_gt(__fd); ++__gt)
>
>
My two cents there: this works, but it is painful if the i915-specific
version is placed on a header used by both Xe and i915 drivers.
I can see two possible solutions:
1. ensure that the i915-specific version is placed on a lib/i915*
header;
2. name such kind of macros after the name of the driver, e. g.:
sed s,for_each_gt,xe_for_each_gt, -i lib/xe/* tests/xe/*
sed s,for_each_gt,i915_for_each_gt, -i lib/i915/* tests/i915/*
They're not mutually exclusive.
Regards,
Mauro
More information about the igt-dev
mailing list