[Intel-gfx] [PATCH 07/10] drm/i915/gt: Extract busy-stats for ring-scheduler

Chris Wilson chris at chris-wilson.co.uk
Thu Jan 14 11:58:07 UTC 2021


Quoting Andi Shyti (2021-01-14 03:02:25)
> Hi Chris,
> 
> On Wed, Jan 13, 2021 at 12:45:57PM +0000, Chris Wilson wrote:
> > Lift the busy-stats context-in/out implementation out of intel_lrc, so
> > that we can reuse it for other scheduler implementations.
> > 
> > Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>
> > ---
> >  drivers/gpu/drm/i915/gt/intel_engine_stats.h  | 49 +++++++++++++++++++
> >  .../drm/i915/gt/intel_execlists_submission.c  | 34 +------------
> >  2 files changed, 50 insertions(+), 33 deletions(-)
> >  create mode 100644 drivers/gpu/drm/i915/gt/intel_engine_stats.h
> 
> this looks like just a copy paste...

It's closer now indeed. It's not quite identical yet, as in one case we
have boolean, the other an uint counter. (There's a third case for class
runtime stats where it would be an atomic_t.) So not quite hitting the
rule of 3 for adequate generalisation, though maybe with some magic
macro constructors...
-Chris


More information about the Intel-gfx mailing list