From: Mika Kuoppala <mika.kuoppala@linux.intel.com>
To: Daniel Vetter <daniel@ffwll.ch>,
Jani Nikula <jani.nikula@linux.intel.com>
Cc: intel-gfx@lists.freedesktop.org
Subject: Re: Polymorphic to_i915()
Date: Wed, 20 Apr 2016 18:26:56 +0300 [thread overview]
Message-ID: <87r3e0xpvj.fsf@gaia.fi.intel.com> (raw)
In-Reply-To: <20160420125726.GZ2510@phenom.ffwll.local>
Daniel Vetter <daniel@ffwll.ch> writes:
> [ text/plain ]
> On Mon, Apr 18, 2016 at 12:18:23PM +0300, Jani Nikula wrote:
>> On Fri, 15 Apr 2016, Chris Wilson <chris@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.
This reduces boilerplate code. And compiler watches our back?
I fail to see the traps underneath, so I am leaning on the
supporting side.
Perhaps I need to reread the reservations post that Jani mentioned.
-Mika
> -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
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
prev parent reply other threads:[~2016-04-20 15:29 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-04-15 17:45 Polymorphic to_i915() Chris Wilson
2016-04-15 17:46 ` [PATCH 1/6] drm/i915: Rename the magic polymorphic macro __I915__ Chris Wilson
2016-04-20 14:27 ` Dave Gordon
2016-04-15 17:46 ` [PATCH 2/6] drm/i915: Allow passing any known pointer to for_each_engine() Chris Wilson
2016-04-15 17:46 ` [PATCH 3/6] drm/i915: Extend magic to_i915() to work with drm_i915_gem_object Chris Wilson
2016-04-15 17:46 ` [PATCH 4/6] drm/i915: Use to_i915() instead of guc_to_i915() Chris Wilson
2016-04-15 17:46 ` [PATCH 5/6] drm/i915: Teach to_i915() how to extract drm_i915_private from requests Chris Wilson
2016-04-15 17:46 ` [PATCH 6/6] drm/i915: Teach to_i915() how to extract drm_i915_private from engines Chris Wilson
2016-04-18 9:18 ` Polymorphic to_i915() Jani Nikula
2016-04-18 11:11 ` Dave Gordon
2016-04-18 11:49 ` Jani Nikula
2016-04-18 12:09 ` Chris Wilson
2016-04-20 12:57 ` Daniel Vetter
2016-04-20 14:29 ` Dave Gordon
2016-04-20 15:26 ` Mika Kuoppala [this message]
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=87r3e0xpvj.fsf@gaia.fi.intel.com \
--to=mika.kuoppala@linux.intel.com \
--cc=daniel@ffwll.ch \
--cc=intel-gfx@lists.freedesktop.org \
--cc=jani.nikula@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.