All of lore.kernel.org
 help / color / mirror / Atom feed
From: Chris Wilson <chris@chris-wilson.co.uk>
To: Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com>
Cc: intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH v2] drm/i915/execlists: Refactor common engine setup
Date: Fri, 29 Apr 2016 11:00:02 +0100	[thread overview]
Message-ID: <20160429100002.GH30680@nuc-i3427.alporthouse.com> (raw)
In-Reply-To: <57232E4A.4030502@linux.intel.com>

On Fri, Apr 29, 2016 at 10:50:02AM +0100, Tvrtko Ursulin wrote:
> 
> On 29/04/16 10:39, Chris Wilson wrote:
> >On Fri, Apr 29, 2016 at 10:25:41AM +0100, Tvrtko Ursulin wrote:
> >>On 29/04/16 10:15, Chris Wilson wrote:
> >>>diff --git a/drivers/gpu/drm/i915/intel_lrc.c b/drivers/gpu/drm/i915/intel_lrc.c
> >>>index 2e0eaa9fa240..2c94072ab085 100644
> >>>--- a/drivers/gpu/drm/i915/intel_lrc.c
> >>>+++ b/drivers/gpu/drm/i915/intel_lrc.c
> >>>@@ -2016,14 +2016,17 @@ logical_ring_setup(struct drm_device *dev, enum intel_engine_id id)
> >>>         struct intel_engine_cs *engine = &dev_priv->engine[id];
> >>>         enum forcewake_domains fw_domains;
> >>>
> >>>-       engine->dev = dev;
> >>>-
> >>>         engine->id = id;
> >>>         engine->name = info->name;
> >>>         engine->exec_id = info->exec_id;
> >>>         engine->guc_id = info->guc_id;
> >>>         engine->mmio_base = info->mmio_base;
> >>>
> >>>+       /* disable interrupts to this engine before we install ourselves*/
> >>>+       I915_WRITE_IMR(engine, ~0);
> >>>+
> >>>+       engine->dev = dev;
> >>>+
> >>>         /* Intentionally left blank. */
> >>>         engine->buffer = NULL;
> >>>
> >>>Make sense?
> >>
> >>Not the most elegant because all the hw access we have so far is in
> >>engine->init_hw. Why can't we just make intel_engine_initialized
> >>return false until the very last thing in engine constructors?
> >
> >In my defence sanitizing the hw before we are ready is common practice
> >across the driver. The unfun part is that irq install is before gem_init
> >(because modeset init wants irq enabled for GMBUS/dp-aux). gem init
> >itself could be split up and moved around so that the setup and init_hw
> >phases are separate (which would be next on the init ordering hitlist I
> >hope).
> >
> >I want engine->dev/engine->i915 set early so we can use it during setup
> >and init-hw and so that for_each_engine() works as expected in that
> >time.
> 
> Why wouldn't an explicit engine->initialized flag solve that? You
> could keep setting engine->dev early (as it should be) and then set
> engine->initialized at the end of per-engine constructors.

Because it becomes irrelevant very shortly. The only interesting
question remaining is whether or not we should be sanitizing the IMR
first. It has been suggested elsewhere (in Ville's review of the GT
interrupt handling) that doing the sanitization would be useful.
-Chris

-- 
Chris Wilson, Intel Open Source Technology Centre
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

  reply	other threads:[~2016-04-29 10:00 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-04-28 13:47 [PATCH] drm/i915/execlists: Refactor common engine setup Chris Wilson
2016-04-28 14:17 ` ✗ Fi.CI.BAT: warning for " Patchwork
2016-04-28 15:10 ` [PATCH] " Tvrtko Ursulin
2016-04-28 15:26   ` Chris Wilson
2016-04-28 16:12 ` Dave Gordon
2016-04-28 17:04   ` Chris Wilson
2016-04-28 17:35 ` [PATCH v2] " Chris Wilson
2016-04-29  9:04   ` Tvrtko Ursulin
2016-04-29  9:15     ` Chris Wilson
2016-04-29  9:25       ` Tvrtko Ursulin
2016-04-29  9:39         ` Chris Wilson
2016-04-29  9:50           ` Tvrtko Ursulin
2016-04-29 10:00             ` Chris Wilson [this message]
2016-04-29 10:11               ` Tvrtko Ursulin
2016-04-29 10:22                 ` Chris Wilson
2016-05-02  8:51                   ` Daniel Vetter
2016-05-02 10:58                     ` Chris Wilson
2016-05-09  7:02                       ` Daniel Vetter
2016-05-09  7:45                         ` Chris Wilson
2016-05-09  7:58                           ` Daniel Vetter
2016-05-09 10:41                             ` Chris Wilson
2016-05-10  7:46                               ` Daniel Vetter
2016-05-10  7:50                                 ` Chris Wilson
2016-04-29  9:42         ` Chris Wilson

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=20160429100002.GH30680@nuc-i3427.alporthouse.com \
    --to=chris@chris-wilson.co.uk \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=tvrtko.ursulin@linux.intel.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.