[Intel-gfx] [PATCH v2, 2/4] drm/i915: simplify testing for the global default context

Chris Wilson chris at chris-wilson.co.uk
Wed Dec 23 13:02:37 PST 2015


On Wed, Dec 23, 2015 at 07:33:53PM +0000, Dave Gordon wrote:
> There are quite a number of places where the driver tests whether
> a given context is or is not the global default context, usually by
> checking whether an engine's default_pointer points to the context.
> Now that we have a 'is_global_default' flag in the context itself,
> all these tests these can be rewritten to use it. This makes the
> logic more obvious, and usually saves at least one memory reference.
> In addition, with these uses eliminated, a future patch will be able
> to get rid of engine::default_context entirely.

All the execlists use of ctx != ring->default_context stems from a
misstep in execlists - if you stop treating that default_context as
special during request processing and just take the pin/unpin at
init/fini of the ring, they all disappear.

And please stop conflating is_global_context when we have already a very
good expression for when the context is owned by no file.
-Chris

-- 
Chris Wilson, Intel Open Source Technology Centre


More information about the Intel-gfx mailing list