intel-gfx.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
From: Dave Gordon <david.s.gordon@intel.com>
To: intel-gfx@lists.freedesktop.org
Cc: jani.nikula@intel.com
Subject: [PATCH 0/2] Updating and simplifying for_each_engine()
Date: Wed, 23 Mar 2016 18:19:52 +0000	[thread overview]
Message-ID: <1458757194-17783-1-git-send-email-david.s.gordon@intel.com> (raw)
In-Reply-To: 20151210124235.GJ29974@nuc-i3427.alporthouse.com

Late last year, there were discussions on updating the for_each_ring()
macro -- now renamed for_each_engine() -- to eliminate the third
(index) parameter, which is mostly unused at the macro callsites.
In particular, Chris Wilson and Daniel Vetter mentioned that we would
like the flexibility to eventually move away from a linear indexed
array-of-engines to some more sophisticated structure.

So here's a patchset that does just that. First we locate all the places
where the third argument to the macro *is* used, and change the macro
to a new version "for_each_engine_id()", at the same time updating the
third argument from an (int) index (usually 'i') to an intel_engine_id.

This replacement makes no functional change in itself, because at present
(dev_priv->engine[i].id == i for all i in 0..I915_NUM_ENGINES-1), but it
opens the way to using something other than an embedded array in future.

Then, we can replace all remaining instances with a simpler two-parameter
version.  Along the way, all the engine-iterator macros are updated to
the form suggested by Chris Wilson, where the pointer into the array
(rather than the index variable) is used to compute loop termination,
and many redundant loop-counter variables are eliminated :)

Dave Gordon (2):
  drm/i915: introduce for_each_engine_id()
  drm/i915: replace for_each_engine()

 drivers/gpu/drm/i915/i915_debugfs.c        | 94 +++++++++++++++---------------
 drivers/gpu/drm/i915/i915_drv.h            | 28 ++++++---
 drivers/gpu/drm/i915/i915_gem.c            | 50 +++++++---------
 drivers/gpu/drm/i915/i915_gem_context.c    |  6 +-
 drivers/gpu/drm/i915/i915_gem_debug.c      |  3 +-
 drivers/gpu/drm/i915/i915_gem_gtt.c        |  9 +--
 drivers/gpu/drm/i915/i915_gpu_error.c      |  6 +-
 drivers/gpu/drm/i915/i915_guc_submission.c | 14 ++---
 drivers/gpu/drm/i915/i915_irq.c            | 24 ++++----
 drivers/gpu/drm/i915/intel_guc_loader.c    |  8 +--
 drivers/gpu/drm/i915/intel_lrc.c           |  3 +-
 drivers/gpu/drm/i915/intel_mocs.c          |  6 +-
 drivers/gpu/drm/i915/intel_pm.c            | 19 +++---
 drivers/gpu/drm/i915/intel_ringbuffer.c    | 21 ++++---
 14 files changed, 143 insertions(+), 148 deletions(-)

-- 
1.9.1

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

  reply	other threads:[~2016-03-23 18:20 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-11-24 17:36 [RFC PATCH] drm/i915: fix potential dangling else problems in for_each_ macros Jani Nikula
2015-11-24 17:38 ` Jani Nikula
2015-11-24 18:25 ` Daniel Vetter
2015-11-24 22:26 ` Chris Wilson
2015-11-24 23:47   ` Chris Wilson
2015-11-25  9:10     ` Jani Nikula
2015-11-25  9:23     ` Daniel Vetter
2015-12-02 13:29       ` Dave Gordon
2015-12-02 13:46         ` Chris Wilson
2015-12-02 14:51           ` Dave Gordon
2015-12-02 14:58             ` Chris Wilson
2015-12-02 18:18               ` Dave Gordon
2015-12-10 12:32       ` [RFC] drm/i915: for_each_engine() Dave Gordon
2015-12-10 12:42         ` Chris Wilson
2016-03-23 18:19           ` Dave Gordon [this message]
2016-03-23 18:19             ` [PATCH 1/2] drm/i915: introduce for_each_engine_id() Dave Gordon
2016-03-23 18:19             ` [PATCH 2/2] drm/i915: replace for_each_engine() Dave Gordon
2016-03-23 20:43               ` Chris Wilson
2016-03-24 11:20                 ` [PATCH 2/2 v2] " Dave Gordon
2016-03-24  9:06 ` ✗ Fi.CI.BAT: failure for drm/i915: fix potential dangling else problems in for_each_ macros (rev3) Patchwork
2016-03-24 11:38   ` Dave Gordon
2016-03-24 12:03 ` ✓ Fi.CI.BAT: success for drm/i915: fix potential dangling else problems in for_each_ macros (rev4) Patchwork
2016-03-24 14:35   ` 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=1458757194-17783-1-git-send-email-david.s.gordon@intel.com \
    --to=david.s.gordon@intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=jani.nikula@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;
as well as URLs for NNTP newsgroup(s).