]> git.baikalelectronics.ru Git - kernel.git/commit
drm/i915: tweak gen6_for_{each_pde, all_pdes} macros
authorDave Gordon <david.s.gordon@intel.com>
Fri, 24 Jun 2016 18:37:46 +0000 (19:37 +0100)
committerTvrtko Ursulin <tvrtko.ursulin@intel.com>
Mon, 27 Jun 2016 12:13:53 +0000 (13:13 +0100)
commit832396aa5a353808952a8efaddfcfee07d9e0141
tree911ae74dcd65d6512344bf0752c27f9733e84d29
parent3cdc958daf9ec68d6a8e597518f46ec86a0cfa69
drm/i915: tweak gen6_for_{each_pde, all_pdes} macros

Gen8 versions of these macros were updated a few months ago
(d8aed86 drm/i915: eliminate 'temp' in gen8_for_each macros)
originally because at least one iterator could generate an
out of bounds access, but also because eliminating the 'temp'
parameter generated smaller and faster code.

Matthew Auld recently noticed the same problem with the gen6
versions and provided a patch
https://lists.freedesktop.org/archives/intel-gfx/2016-June/099334.html
but while we're changing these, we might as well make them as
much like the gen8 versions as possible, including the style
of using "&& (..., true)" rather than ": (..., 1) : 0", and
of course eliminating the redundant 'temp'.

Furthermore, the "all_pdes" version is only used in one place,
so we can improve code efficiency by changing both the macro
parameters and the calling code to reduce extra dereferences.

Signed-off-by: Dave Gordon <david.s.gordon@intel.com>
Cc: Matthew Auld <matthew.auld@intel.com>
Cc: Chris Wilson <chris@chris-wilson.co.uk>
Reviewed-by: Matthew Auld <matthew.auld@intel.com>
Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Link: http://patchwork.freedesktop.org/patch/msgid/1466793466-23500-1-git-send-email-david.s.gordon@intel.com
drivers/gpu/drm/i915/i915_gem_gtt.c
drivers/gpu/drm/i915/i915_gem_gtt.h