[Intel-gfx] Polymorphic to_i915()
Daniel Vetter
daniel at ffwll.ch
Wed Apr 20 12:57:26 UTC 2016
On Mon, Apr 18, 2016 at 12:18:23PM +0300, Jani Nikula wrote:
> 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.
Not much more to add, but I'm not strongly opinionated here really. But I
do think that a trick of this magnitude needs much more enthusiastic
support from a bunch of people before we can merge it.
-Daniel
--
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
More information about the Intel-gfx
mailing list