[Intel-gfx] [PATCH 1/6] drm/i915: mark the global default (intel_)context as such

Dave Gordon david.s.gordon at intel.com
Tue Dec 22 03:26:53 PST 2015


On 22/12/15 09:08, Chris Wilson wrote:
> On Mon, Dec 21, 2015 at 04:04:40PM +0000, Dave Gordon wrote:
>> Some of the LRC-specific context-destruction code has to special-case
>> the global default context, bacause the HWSP is part of that context. At
>> present it deduces it indirectly by checking for the backpointer from
>> the engine to the context, but that's an unsafe assumption if the setup
>> and teardown code is reorganised. (It could also test ctx->file_priv ==
>> NULL, but again that's a detail that might be subject to change).
>>
>> So here we explicitly flag the default context at the point of creation,
>> and then reorganise the code in intel_lr_context_free() not to rely on
>> the ring->default_pointer (still) being set up; to iterate over engines
>> in reverse, as this is teardown code; and to reduce the nesting
>> level so it's easier to read.
>
> I still strongly disagree with the confusion inherent here.
> -Chris

I'm not sure that anything could be *less* confusing than indicating the 
global default context with a flag called "is_global_default".

There may indeed be all sorts of confusion in the LRC code, but I'm not 
trying to fix all of that in one go. This is just an enabler so that one 
small piece of that confusion can be replaced by something clear and 
explicit. Once that's done, we'll move on and see what else can also be 
clarified.

.Dave.


More information about the Intel-gfx mailing list