From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by gabe.freedesktop.org (Postfix) with ESMTPS id CAFA210E085 for ; Sat, 11 Mar 2023 04:09:09 +0000 (UTC) Date: Fri, 10 Mar 2023 20:09:08 -0800 Message-ID: <87wn3okjyz.wl-ashutosh.dixit@intel.com> From: "Dixit, Ashutosh" In-Reply-To: <20230310074135.5609c2a8@maurocar-mobl2> References: <20230307221236.913429-1-zbigniew.kempczynski@intel.com> <20230307221236.913429-3-zbigniew.kempczynski@intel.com> <875yb9mdn4.wl-ashutosh.dixit@intel.com> <874jqtmdas.wl-ashutosh.dixit@intel.com> <20230310074135.5609c2a8@maurocar-mobl2> MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Content-Type: text/plain; charset=ISO-8859-2 Content-Transfer-Encoding: quoted-printable Subject: Re: [igt-dev] [PATCH i-g-t v7 2/7] lib/xe: Introduce Xe library List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: igt-dev-bounces@lists.freedesktop.org Sender: "igt-dev" To: Mauro Carvalho Chehab Cc: igt-dev@lists.freedesktop.org List-ID: On Thu, 09 Mar 2023 22:41:35 -0800, Mauro Carvalho Chehab wrote: > > On Thu, 09 Mar 2023 20:38:03 -0800 > "Dixit, Ashutosh" wrote: > > > On Thu, 09 Mar 2023 20:30:39 -0800, Dixit, Ashutosh wrote: > > > > > > On Tue, 07 Mar 2023 14:12:31 -0800, Zbigniew Kempczy=F1ski wrote: > > > > > > > > > > Hi Zbyzsek, > > > > > > > +#define for_each_gt(__fd, __gt) \ > > > > + for (__gt =3D 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 resol= ve > > > 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 =3D 0; __class < DRM_XE_ENGINE_CLASS_COMPUTE + 1; \ > > ++__class) > > +#undef for_each_gt > > #define for_each_gt(__fd, __gt) \ > > for (__gt =3D 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. Thanks Mauro, yes we'll have to do something like the two options above.