From: Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com>
To: Chris Wilson <chris@chris-wilson.co.uk>,
Intel-gfx@lists.freedesktop.org,
Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Subject: Re: [PATCH] drm/i915: Small compaction of the engine init code
Date: Wed, 22 Jun 2016 17:21:01 +0100 [thread overview]
Message-ID: <576ABAED.4020303@linux.intel.com> (raw)
In-Reply-To: <20160622161031.GD22318@nuc-i3427.alporthouse.com>
On 22/06/16 17:10, Chris Wilson wrote:
> On Wed, Jun 22, 2016 at 04:55:51PM +0100, Tvrtko Ursulin wrote:
>> From: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
>>
>> Effectively removes one layer of indirection between the mask of
>> possible engines and the engine constructors. Instead of spelling
>> out in code the mapping of HAS_<engine> to constructors, makes
>> more use of the recently added data driven approach by putting
>> engine constructor vfuncs into the table as well.
>>
>> Effect is fewer lines of source and smaller binary.
>>
>> At the same time simplify the error handling since engine
>> destructors can run on unitialized engines anyway.
>>
>> Similar approach could be done for legacy submission is wanted.
>
> Yup, long term plan is to reduce as much as the needless duplication
> between the two/three (and kill of the dev_priv->gt.init_rings and
> friends). Muttering was even afoot to seperate the legacy submission
> code from the ring handling.
>
>> Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
>> Cc: Chris Wilson <chris@chris-wilson.co.uk>
> Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
>
>> ---
>> /**
>> * intel_logical_rings_init() - allocate, populate and init the Engine Command Streamers
>> * @dev: DRM device.
>> *
>> - * This function inits the engines for an Execlists submission style (the equivalent in the
>> - * legacy ringbuffer submission world would be i915_gem_init_engines). It does it only for
>> - * those engines that are present in the hardware.
>> + * This function inits the engines for an Execlists submission style (the
>> + * equivalent in the legacy ringbuffer submission world would be
>> + * i915_gem_init_engines). It does it only for those engines that are present in
>> + * the hardware.
>> *
>> * Return: non-zero if the initialization failed.
>> */
>> int intel_logical_rings_init(struct drm_device *dev)
>> {
>> struct drm_i915_private *dev_priv = dev->dev_private;
>> + struct intel_engine_cs *engine;
>> + unsigned int i;
>> int ret;
>>
>> - ret = logical_render_ring_init(dev);
>> - if (ret)
>> - return ret;
>> + BUILD_BUG_ON((1 << RCS) != RENDER_RING);
>> + BUILD_BUG_ON((1 << BCS) != BLT_RING);
>> + BUILD_BUG_ON((1 << VCS) != BSD_RING);
>> + BUILD_BUG_ON((1 << VCS2) != BSD2_RING);
>> + BUILD_BUG_ON((1 << VECS) != VEBOX_RING);
>
> Heh, isn't that the very definition of those in the header.
> Planning for some array compaction?
No I was trying to protect against someone changing the definitions of
RENDER_RING & co since the loop below this depends on that. Maybe it was
too paranoid. Or maybe better, I could add HAS_ENGINE(id) and cement
that in one place instead of this many BUILD_BUG_ONs.
I'll respin anyway to remove forward decls which can be avoided with
some reshuffle.
Regards,
Tvrtko
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
next prev parent reply other threads:[~2016-06-22 16:21 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-06-22 15:55 [PATCH] drm/i915: Small compaction of the engine init code Tvrtko Ursulin
2016-06-22 16:10 ` Chris Wilson
2016-06-22 16:21 ` Tvrtko Ursulin [this message]
2016-06-22 16:28 ` Chris Wilson
2016-06-22 16:35 ` [PATCH v2] " Tvrtko Ursulin
2016-06-22 16:59 ` Chris Wilson
2016-06-23 10:26 ` Tvrtko Ursulin
2016-06-23 10:47 ` Chris Wilson
2016-06-23 11:12 ` [PATCH v3] " Tvrtko Ursulin
2016-06-23 11:25 ` Chris Wilson
2016-06-23 11:46 ` Tvrtko Ursulin
2016-06-23 12:11 ` Chris Wilson
2016-06-23 13:16 ` Tvrtko Ursulin
2016-06-23 13:25 ` Chris Wilson
2016-06-23 13:52 ` [PATCH v4] " Tvrtko Ursulin
2016-06-23 14:03 ` Chris Wilson
2016-06-22 16:18 ` ✓ Ro.CI.BAT: success for " Patchwork
2016-06-22 17:09 ` ✗ Ro.CI.BAT: warning for drm/i915: Small compaction of the engine init code (rev2) Patchwork
2016-06-24 10:10 ` ✗ Ro.CI.BAT: failure for drm/i915: Small compaction of the engine init code (rev3) Patchwork
2016-06-24 10:11 ` ✗ Ro.CI.BAT: failure for drm/i915: Small compaction of the engine init code (rev4) Patchwork
2016-06-24 11:09 ` 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=576ABAED.4020303@linux.intel.com \
--to=tvrtko.ursulin@linux.intel.com \
--cc=Intel-gfx@lists.freedesktop.org \
--cc=chris@chris-wilson.co.uk \
--cc=tvrtko.ursulin@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