[Intel-gfx] [PATCH v2] drm/i915: Name the anonymous per-engine context struct
Dave Gordon
david.s.gordon at intel.com
Mon Mar 21 15:23:57 UTC 2016
On 18/03/16 17:26, Tvrtko Ursulin wrote:
> From: Tvrtko Ursulin <tvrtko.ursulin at intel.com>
>
> This anonymous struct was causing a good amount of overly
> verbose code. Also, if we name it and cache the pointer locally
> when there are multiple accesses to it, not only the code is
> more readable, but the compiler manages to generate smaller
> binary.
>
> Along the way I also shortened access to dev_priv and eliminated
> some unused variables and cached some where I spotted the
> opportunity.
>
> Name for the structure, intel_context_engine, and the local
> variable name were borrowed from a similar patch by Chris Wilson.
>
> v2: Hate the engine->dev surprises, really do.
>
> Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin at intel.com>
> Cc: Chris Wilson <chris at chris-wilson.co.uk>
> ---
> drivers/gpu/drm/i915/i915_drv.h | 2 +-
> drivers/gpu/drm/i915/intel_lrc.c | 94 +++++++++++++++++++++-------------------
> 2 files changed, 50 insertions(+), 46 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h
> index 00c41a4bde2a..480639c39543 100644
> --- a/drivers/gpu/drm/i915/i915_drv.h
> +++ b/drivers/gpu/drm/i915/i915_drv.h
> @@ -840,7 +840,7 @@ struct intel_context {
> } legacy_hw_ctx;
>
> /* Execlists */
> - struct {
> + struct intel_context_engine {
Good idea, I had a version of this too, derived from Chris' patch
[157/190] drm/i915: Tidy execlists by using intel_context_engine locals.
The only thing to disagree with is the actual name; it should be
"intel_engine_context" (or some abbreviation thereof), because in
English (and German) the noun at the *end* of a compound noun-phrase
is what it actually *is*, with all the others qualifying it. So a
"railway bridge" is a type of bridge, not a type of railway, and
"eine Straßenbahnhaltestelle" (street-train-stopping-place => tram stop)
is not a street.
[aside] My favourite in English is "Space Civilisation Power Struggle
Game" (five nouns in a row!) describing a certain boxed game -- anyone
recognise that? [/aside]
I'll post a version following that naming convention shortly ...
.Dave.
More information about the Intel-gfx
mailing list