[Intel-gfx] Polymorphic to_i915()

Jani Nikula jani.nikula at linux.intel.com
Mon Apr 18 09:18:23 UTC 2016


On Fri, 15 Apr 2016, Chris Wilson <chris at chris-wilson.co.uk> wrote:
> Final canvas for opinions for using a magic macro to reduce typing in
> the common operation of getting our drm_i915_private from the object.
>
> 	21 files changed, 333 insertions(+), 392 deletions(-)
>
> Not to mention the ease it makes for later patches to reduce the pointer
> dance.

I've expressed my reservations about this the last time.

My compromise proposal is this: let's add the to_i915()
"superconvenience macro", but let's not embed that into other
macros. Instead, move away from convenience macros in them, explicitly
requiring dev_priv.

This would make just one macro special, and would keep the rest less
surprising and "C-like". We already need dev_priv all over the place, so
I don't think having a local variable or an explicit to_i915() is a big
burden.


BR,
Jani.


-- 
Jani Nikula, Intel Open Source Technology Center


More information about the Intel-gfx mailing list