intel-gfx.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
From: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
To: Chris Wilson <chris@chris-wilson.co.uk>
Cc: intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH 1/2] drm/i915: Split intel_engine allocation and initialisation
Date: Mon, 23 Jan 2017 14:08:08 +0200	[thread overview]
Message-ID: <1485173288.2790.22.camel@linux.intel.com> (raw)
In-Reply-To: <20170123095719.GN17136@nuc-i3427.alporthouse.com>

On ma, 2017-01-23 at 09:57 +0000, Chris Wilson wrote:
> On Mon, Jan 23, 2017 at 11:41:12AM +0200, Joonas Lahtinen wrote:
> > 
> > On la, 2017-01-21 at 14:50 +0000, Chris Wilson wrote:
> > > 
> > > In order to reset the GPU early on in the module load sequence, we need
> > > to allocate the basic engine structs (to populate the mmio offsets etc).
> > > Currently, the engine initialisation allocates both the base struct and
> > > also allocate auxiliary objects, which depend upon state setup quite
> > > late in the load sequence. We split off the allocation callback for
> > > later and allow ourselves to allocate the engine structs themselves
> > > early.
> > > 
> > > Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
> > 
> > <SNIP>
> > 
> > > 
> > > +int intel_engines_init(struct drm_i915_private *dev_priv)
> > > +{
> > 
> > <SNIP>
> > 
> > > 
> > > +	for_each_engine(engine, dev_priv, id) {
> > > +		int (*init)(struct intel_engine_cs *engine) = NULL;
> > > +
> > > +		if (!err) {
> > > +			if (i915.enable_execlists)
> > > +				init = intel_engines[id].init_execlists;
> > > +			else
> > > +				init = intel_engines[id].init_legacy;
> > > +		}
> > > +
> > > +		if (!init || (err = init(engine))) {
> > > +			kfree(engine);
> > > +			dev_priv->engine[id] = NULL;
> > > +			continue;
> > > +		}
> > > +
> > > +		mask |= ENGINE_MASK(id);
> > > +	}
> > 
> > As discussed in IRC, this loop is broken after first erroring init.
> 
> As answered, it is not.
> 
> After an err is set, it and all subsequent engines are freed, and then
> all previously initialised engines are run through the cleanup.

You're correct, I managed to ignore the declaration time initialization
a half a dozen times when going through it.

You could check the "!init" as "err" to make my next review round
easier :P

Regards, Joonas
-- 
Joonas Lahtinen
Open Source Technology Center
Intel Corporation
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

  reply	other threads:[~2017-01-23 12:08 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-01-21 14:50 [PATCH 1/2] drm/i915: Split intel_engine allocation and initialisation Chris Wilson
2017-01-21 14:50 ` [PATCH 2/2] drm/i915: Reset the gpu on takeover Chris Wilson
2017-01-23  9:39   ` Joonas Lahtinen
2017-01-21 15:24 ` ✓ Fi.CI.BAT: success for series starting with [1/2] drm/i915: Split intel_engine allocation and initialisation Patchwork
2017-01-23  9:26 ` [PATCH v2] " Chris Wilson
2017-01-23  9:41 ` [PATCH 1/2] " Joonas Lahtinen
2017-01-23  9:57   ` Chris Wilson
2017-01-23 12:08     ` Joonas Lahtinen [this message]
2017-01-23 10:54 ` ✓ Fi.CI.BAT: success for series starting with [v2] drm/i915: Split intel_engine allocation and initialisation (rev2) Patchwork

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1485173288.2790.22.camel@linux.intel.com \
    --to=joonas.lahtinen@linux.intel.com \
    --cc=chris@chris-wilson.co.uk \
    --cc=intel-gfx@lists.freedesktop.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).