From: Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com>
To: Chris Wilson <chris@chris-wilson.co.uk>,
intel-gfx@lists.freedesktop.org,
Dave Gordon <david.s.gordon@intel.com>
Subject: Re: [PATCH v2] drm/i915/execlists: Refactor common engine setup
Date: Fri, 29 Apr 2016 11:11:20 +0100 [thread overview]
Message-ID: <57233348.9090508@linux.intel.com> (raw)
In-Reply-To: <20160429100002.GH30680@nuc-i3427.alporthouse.com>
On 29/04/16 11:00, Chris Wilson wrote:
> 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.
How come it becomes irrelevant? Will there not be
intel_engine_initialized? Because as long as there is, imho it makes
sense not to use engine->dev for it.
Regards,
Tvrtko
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
next prev parent reply other threads:[~2016-04-29 10:11 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
2016-04-29 10:11 ` Tvrtko Ursulin [this message]
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=57233348.9090508@linux.intel.com \
--to=tvrtko.ursulin@linux.intel.com \
--cc=chris@chris-wilson.co.uk \
--cc=david.s.gordon@intel.com \
--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