]> git.baikalelectronics.ru Git - kernel.git/commit
drm/i915: Simplify for_each_fw_domain iterators
authorTvrtko Ursulin <tvrtko.ursulin@intel.com>
Thu, 7 Apr 2016 16:04:33 +0000 (17:04 +0100)
committerTvrtko Ursulin <tvrtko.ursulin@intel.com>
Tue, 12 Apr 2016 13:30:41 +0000 (14:30 +0100)
commit1f20aee3d00e0be494999ab2adfc90c8b3d56556
tree9503dbb00bfd29c1b43572f7e4e9ece68c2b0208
parent78888c106c1ad5027a3cc7b7771ac627c3db6b44
drm/i915: Simplify for_each_fw_domain iterators

As the vast majority of users do not use the domain id variable,
we can eliminate it from the iterator and also change the latter
using the same principle as was recently done for for_each_engine.

For a couple of callers which do need the domain mask, store it
in the domain array (which already has the domain id), then both
can be retrieved thence.

Result is clearer code and smaller generated binary, especially
in the tight fw get/put loops. Also, relationship between domain
id and mask is no longer assumed in the macro.

v2: Improve grammar in the commit message and rename the
    iterator to for_each_fw_domain_masked for consistency.
    (Dave Gordon)

Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
Reviewed-by: Dave Gordon <david.s.gordon@intel.com>
drivers/gpu/drm/i915/i915_debugfs.c
drivers/gpu/drm/i915/i915_drv.h
drivers/gpu/drm/i915/intel_uncore.c