All of lore.kernel.org
 help / color / mirror / Atom feed
From: Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com>
To: Chris Wilson <chris@chris-wilson.co.uk>, Intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH resend for CI 2/2] drm/i915: Use shorter route to dev_private where possible
Date: Thu, 17 Mar 2016 13:47:31 +0000	[thread overview]
Message-ID: <56EAB573.6020101@linux.intel.com> (raw)
In-Reply-To: <20160317131759.GV14143@nuc-i3427.alporthouse.com>


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.

> 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?

That way churn would be one time only and the magic happens in the macro 
definition, as shortcuts are added or (re)moved.

Regards,

Tvrtko
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

  reply	other threads:[~2016-03-17 13:47 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 [this message]
2016-03-17 13:55       ` Chris Wilson
2016-03-21  9:25         ` Daniel Vetter
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=56EAB573.6020101@linux.intel.com \
    --to=tvrtko.ursulin@linux.intel.com \
    --cc=Intel-gfx@lists.freedesktop.org \
    --cc=chris@chris-wilson.co.uk \
    /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.