From: Dave Gordon <david.s.gordon@intel.com>
To: Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com>,
Intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH v2] drm/i915: Name the anonymous per-engine context struct
Date: Mon, 21 Mar 2016 15:23:57 +0000 [thread overview]
Message-ID: <56F0120D.201@intel.com> (raw)
In-Reply-To: <1458321994-12212-1-git-send-email-tvrtko.ursulin@linux.intel.com>
On 18/03/16 17:26, Tvrtko Ursulin wrote:
> From: Tvrtko Ursulin <tvrtko.ursulin@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@intel.com>
> Cc: Chris Wilson <chris@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.
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
next prev parent reply other threads:[~2016-03-21 15:23 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-03-18 15:00 [PATCH] drm/i915: Name the anonymous per-engine context struct Tvrtko Ursulin
2016-03-18 15:14 ` Chris Wilson
2016-03-18 17:26 ` [PATCH v2] " Tvrtko Ursulin
2016-03-21 15:23 ` Dave Gordon [this message]
2016-03-22 9:28 ` Chris Wilson
2016-03-22 11:20 ` Dave Gordon
2016-03-22 11:47 ` Tvrtko Ursulin
2016-03-22 11:48 ` [PATCH v3 1/2] drm/i915: name " Dave Gordon
2016-03-22 11:48 ` [PATCH v3 2/2] drm/i915: tidy up a few more references to engine[] Dave Gordon
2016-03-21 11:22 ` ✗ Fi.CI.BAT: warning for drm/i915: Name the anonymous per-engine context struct (rev2) Patchwork
2016-03-22 9:53 ` Tvrtko Ursulin
2016-03-22 10:07 ` Chris Wilson
2016-03-22 10:27 ` Tvrtko Ursulin
2016-03-22 10:32 ` 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=56F0120D.201@intel.com \
--to=david.s.gordon@intel.com \
--cc=Intel-gfx@lists.freedesktop.org \
--cc=tvrtko.ursulin@linux.intel.com \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.