Intel-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Daniel Vetter <daniel@ffwll.ch>
To: Chris Wilson <chris@chris-wilson.co.uk>,
	Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com>,
	Intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH resend for CI 2/2] drm/i915: Use shorter route to dev_private where possible
Date: Mon, 21 Mar 2016 10:25:05 +0100	[thread overview]
Message-ID: <20160321092505.GH28483@phenom.ffwll.local> (raw)
In-Reply-To: <20160317135557.GZ14143@nuc-i3427.alporthouse.com>

On Thu, Mar 17, 2016 at 01:55:57PM +0000, Chris Wilson wrote:
> On Thu, Mar 17, 2016 at 01:47:31PM +0000, Tvrtko Ursulin wrote:
> > 
> > On 17/03/16 13:17, Chris Wilson wrote:
> > >On Thu, Mar 17, 2016 at 01:04:10PM +0000, Tvrtko Ursulin wrote:
> > >>From: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
> > >>
> > >>Where we have a request we can use req->i915 directly instead
> > >>of going through the engine and device. Coccinelle script:
> > >>
> > >>@@
> > >>function f;
> > >>identifier r;
> > >>@@
> > >>f(..., struct drm_i915_gem_request *r, ...)
> > >>{
> > >>...
> > >>- engine->dev->dev_private
> > >>+ r->i915
> > >>...
> > >>}
> > >>@@
> > >>struct drm_i915_gem_request *req;
> > >>@@
> > >>(
> > >>   req->
> > >>- engine->dev->dev_private
> > >>+ i915
> > >>)
> > >
> > >struct intel_engine_cs *e;
> > >- e->dev->dev_private
> > >+ e->i915
> > >
> > >Pretty please?
> > 
> > There is no e->i915 yet as far as I can see.
> 
> Oh, you have seen it. It might be over there instead :|
> 
> > >INTEL_INFO(engine->dev) (IS_GEN, HAS_ etc)
> > >if r: INTEL_INFO(r->i915)
> > >if e: INTEL_INFO(e->i915)
> > >?
> > 
> > I have a patch to do:
> > 
> > - dev->dev_private
> > + to_i915(dev)
> > 
> > But that is huge and to little gain.
> > 
> > Maybe we should have:
> > 
> > to_i915(req)
> > to_i915(engine)
> > to_i915(dev)
> > 
> > And a smart macro which does the right thing at compile time?
> 
> Tempting. Should look nice and consistent and such magic would improve
> the look of many opening stanzas.

This is imo a bit too much magic ... reg_to_i915, engine_to_i915 and
to_i915 all sound like good ideas (we have lots of examples where we avoid
the superclass, e.g. to_hdmi or similar).
-Daniel
-- 
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

  reply	other threads:[~2016-03-21  9:24 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-03-17 13:04 [PATCH resend for CI 1/2] drm/i915: Remove unused variable in i915_gem_request_add_to_client Tvrtko Ursulin
2016-03-17 13:04 ` [PATCH resend for CI 2/2] drm/i915: Use shorter route to dev_private where possible Tvrtko Ursulin
2016-03-17 13:17   ` Chris Wilson
2016-03-17 13:47     ` Tvrtko Ursulin
2016-03-17 13:55       ` Chris Wilson
2016-03-21  9:25         ` Daniel Vetter [this message]
2016-03-18  7:03 ` ✗ Fi.CI.BAT: failure for series starting with [resend,for,CI,1/2] drm/i915: Remove unused variable in i915_gem_request_add_to_client Patchwork
2016-03-18  9:57   ` Tvrtko Ursulin

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=20160321092505.GH28483@phenom.ffwll.local \
    --to=daniel@ffwll.ch \
    --cc=Intel-gfx@lists.freedesktop.org \
    --cc=chris@chris-wilson.co.uk \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox