[Intel-gfx] [RFC 03/31] drm/i915: Move intel_gt initialization to a separate file
Chris Wilson
chris at chris-wilson.co.uk
Fri Jun 14 16:16:41 UTC 2019
Quoting Chris Wilson (2019-06-14 17:14:08)
> Quoting Chris Wilson (2019-06-14 17:13:03)
> > Quoting Tvrtko Ursulin (2019-06-14 16:17:03)
> > > From: Tvrtko Ursulin <tvrtko.ursulin at intel.com>
> > >
> > > As it will grow in a following patch make a new home for it.
> > >
> > > v2:
> > > * Convert mock_gem_device as well. (Chris)
> > >
> > > Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin at intel.com>
> > > ---
> > > drivers/gpu/drm/i915/Makefile | 1 +
> > > drivers/gpu/drm/i915/gt/intel_gt.c | 15 +++++++++++++++
> > > drivers/gpu/drm/i915/gt/intel_gt.h | 14 ++++++++++++++
> > > drivers/gpu/drm/i915/i915_gem.c | 6 ++----
> > > drivers/gpu/drm/i915/selftests/mock_gem_device.c | 5 ++---
> > > 5 files changed, 34 insertions(+), 7 deletions(-)
> > > create mode 100644 drivers/gpu/drm/i915/gt/intel_gt.c
> > > create mode 100644 drivers/gpu/drm/i915/gt/intel_gt.h
> > >
> > > diff --git a/drivers/gpu/drm/i915/Makefile b/drivers/gpu/drm/i915/Makefile
> > > index c0a7b2994077..8df1bf2855d0 100644
> > > --- a/drivers/gpu/drm/i915/Makefile
> > > +++ b/drivers/gpu/drm/i915/Makefile
> > > @@ -73,6 +73,7 @@ gt-y += \
> > > gt/intel_context.o \
> > > gt/intel_engine_cs.o \
> > > gt/intel_engine_pm.o \
> > > + gt/intel_gt.o \
> > > gt/intel_gt_pm.o \
> > > gt/intel_hangcheck.o \
> > > gt/intel_lrc.o \
> > > diff --git a/drivers/gpu/drm/i915/gt/intel_gt.c b/drivers/gpu/drm/i915/gt/intel_gt.c
> > > new file mode 100644
> > > index 000000000000..807c5f746110
> > > --- /dev/null
> > > +++ b/drivers/gpu/drm/i915/gt/intel_gt.c
> > > @@ -0,0 +1,15 @@
> > > +/*
> > > + * SPDX-License-Identifier: MIT
> > > + *
> > > + * Copyright © 2019 Intel Corporation
> > > + */
> > > +
> > > +#include "intel_gt.h"
> > > +
> > > +void intel_gt_init(struct intel_gt *gt)
> >
> > Please use intel_gt_init_early() to keep the phase known.
>
> (And yes, I know I violated my own rule, it's easier to spot in review
> :)
Oh, and I would promote it to being called directly by i915_drv.c and
start pulling the HW setup out from under i915_gem.c. I would also like
to push intel_gt_pm_init() into intel_gt_init(), and do want to split
out ips/rps and rc6 out of intel_pm.c into gt/
-Chris
More information about the Intel-gfx
mailing list