[Intel-gfx] [PATCH 10/19] drm/i915: Rearrange switch_context to load the aliasing ppgtt on first use
Chris Wilson
chris at chris-wilson.co.uk
Thu Apr 21 07:01:37 UTC 2016
On Thu, Apr 21, 2016 at 09:48:36AM +0300, Joonas Lahtinen wrote:
> On ke, 2016-04-20 at 19:42 +0100, Chris Wilson wrote:
> > The code to switch_mm() is already handled by i915_switch_context(), the
> > only difference required to setup the aliasing ppgtt is that we need to
> > emit te switch_mm() on the first context, i.e. when transitioning from
> > engine->last_context == NULL. This allows us to defer the
> > initialisation of the GPU from early device initialisation to first use,
> > which should marginally speed up both. The caveat is that we then defer
> > the context initialisation until first use - i.e. we cannot assume that
> > the GPU engines are initialised. For example, this means that power
> > contexts for rc6 (Ironlake) need to explicitly loaded, as they are.
> >
> > Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>
> > Cc: Mika Kuoppala <mika.kuoppala at intel.com>
>
> Some comments below.
>
> Reviewed-by: Joonas Lahtinen <joonas.lahtinen at linux.intel.com>
>
> > diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c
> > index aafcb4942acf..14c9b29294c5 100644
> > --- a/drivers/gpu/drm/i915/i915_gem.c
> > +++ b/drivers/gpu/drm/i915/i915_gem.c
> > @@ -4910,34 +4910,6 @@ i915_gem_init_hw(struct drm_device *dev)
> > if (ret)
> > goto out;
>
> This whole if (ret) goto out can be removed as out is right after the
> removed code block.
Oh, this piece of code is earmarked to be removed and now I even have a
bugzilla for it!
https://bugs.freedesktop.org/show_bug.cgi?id=95023
is an example where we are doing the wrong thing with the current
i915_gem_init_seqno.
-Chris
--
Chris Wilson, Intel Open Source Technology Centre
More information about the Intel-gfx
mailing list