Re: [PATCH 24/51] drm/i915: Update deferred context creation to do explicit request management

Chris Wilson
2015-02-13T12:15:17Z

On Fri, Feb 13, 2015 at 11:48:33AM +0000, John.C.Harrison@Intel.com wrote:
> From: John Harrison <John.C.Harrison@Intel.com>
>
> In execlist mode, context initialisation is deferred until first use of the
> given context. This is because execlist mode has many more contexts than legacy
> mode and many are never actually used.

That's not correct. There are no more contexts in execlists than legacy.
There are more ringbuffers, or rather the contexts have an extra state
object associated with them.

> Previously, the initialisation commands
> were written to the ring and tagged with some random request structure via the
> OLR. This seemed to be causing a null pointer deference bug under certain
> circumstances (BZ:40112).
>
> This patch adds explicit request creation and submission to the deferred
> initialisation code path. Thus removing any reliance on or randomness caused by
> the OLR.

This is upside down though. The request should be referencing the
context (thus instantiating it on demand) and nothing in the context
allocation requires the request. The initialisation here should be during
i915_request_switch_context(), since it can be entirely shared with
legacy.
-Chris

--
Chris Wilson, Intel Open Source Technology Centre