Re: [PATCH] lib/xe/xe_query: Add xe_for_each_gt_with_type iterator
Kamil Konieczny <[email protected]>
| Newsgroups | org.freedesktop.lists.igt-dev |
|---|---|
| Message-ID | <[email protected]> |
Hi Lukasz, On 2026-06-02 at 18:01:49 +0200, Lukasz Laguna wrote: > Add xe_for_each_gt_with_type() to iterate only over GTs of selected > type. > > Signed-off-by: Lukasz Laguna <[email protected]> > --- > lib/xe/xe_query.h | 3 +++ > 1 file changed, 3 insertions(+) > > diff --git a/lib/xe/xe_query.h b/lib/xe/xe_query.h > index 8815c6c66..a11dd623d 100644 > --- a/lib/xe/xe_query.h > +++ b/lib/xe/xe_query.h > @@ -103,6 +103,9 @@ struct xe_device { > for (uint64_t igt_unique(__mask) = xe_device_get(__fd)->gt_mask; \ > __gt = ffsll(igt_unique(__mask)) - 1, igt_unique(__mask) != 0; \ > igt_unique(__mask) &= ~(1ull << __gt)) > +#define xe_for_each_gt_with_type(__fd, __gt, __typemask) \ > + xe_for_each_gt(__fd, __gt) \ > + for_if((__typemask) & BIT(xe_gt_type(__fd, __gt))) Please add newlines before and after this new define. With this fixed LGTM Reviewed-by: Kamil Konieczny <[email protected]> Regards, Kamil > #define xe_for_each_tile(__fd, __tile) \ > for (uint64_t igt_unique(__mask) = xe_device_get(__fd)->tile_mask; \ > __tile = ffsll(igt_unique(__mask)) - 1, igt_unique(__mask) != 0; \ > -- > 2.43.0 >