[Intel-xe] [PATCH 04/26] drm/xe: Add for_each_tile iterator
Matt Roper
matthew.d.roper at intel.com
Fri May 12 16:28:34 UTC 2023
On Fri, May 12, 2023 at 11:15:08AM +0530, Iddamsetty, Aravind wrote:
>
>
> On 11-05-2023 09:17, Matt Roper wrote:
> > As we start splitting tile handling out from GT handling, we'll need to
> > be able to iterate over tiles separately from GTs. This iterator will
> > be used in upcoming patches.
> >
> > Signed-off-by: Matt Roper <matthew.d.roper at intel.com>
> > ---
> > drivers/gpu/drm/xe/xe_device.h | 4 ++++
> > drivers/gpu/drm/xe/xe_pci.c | 3 +--
> > 2 files changed, 5 insertions(+), 2 deletions(-)
> >
> > diff --git a/drivers/gpu/drm/xe/xe_device.h b/drivers/gpu/drm/xe/xe_device.h
> > index f7acaf51a1fc..745dbb16d417 100644
> > --- a/drivers/gpu/drm/xe/xe_device.h
> > +++ b/drivers/gpu/drm/xe/xe_device.h
> > @@ -83,6 +83,10 @@ static inline void xe_device_guc_submission_disable(struct xe_device *xe)
> > xe->info.enable_guc = false;
> > }
> >
> > +#define for_each_tile(tile__, xe__, id__) \
> > + for ((id__) = 0; (id__) < (xe__)->info.tile_count; (id__++)) \
> > + for_each_if ((tile__) = &(xe__)->tiles[(id__)])
> > +
> > #define for_each_gt(gt__, xe__, id__) \
> > for ((id__) = 0; (id__) < (xe__)->info.tile_count; (id__++)) \
> > for_each_if ((gt__) = xe_device_get_gt((xe__), (id__)))
>
> as mentioned in earlier patch, this looks to always return primary gt only
Correct; primary GT is the only GT that exists at this point in the
series. Patch #23 of the series updates this code to prepare for the
return of media GTs, and patch #25 finally re-adds the media GT support.
Matt
>
> Thanks,
> Aravind.
> > diff --git a/drivers/gpu/drm/xe/xe_pci.c b/drivers/gpu/drm/xe/xe_pci.c
> > index 87c328106aca..bef65d3a440e 100644
> > --- a/drivers/gpu/drm/xe/xe_pci.c
> > +++ b/drivers/gpu/drm/xe/xe_pci.c
> > @@ -525,8 +525,7 @@ static int xe_info_init(struct xe_device *xe,
> > subplatform_desc->subplatform : XE_SUBPLATFORM_NONE;
> > xe->info.step = xe_step_get(xe);
> >
> > - for (id = 0; id < xe->info.tile_count; ++id) {
> > - tile = &xe->tiles[id];
> > + for_each_tile(tile, xe, id) {
> > tile->xe = xe;
> > tile->id = id;
> >
--
Matt Roper
Graphics Software Engineer
Linux GPU Platform Enablement
Intel Corporation
More information about the Intel-xe
mailing list