[Intel-gfx] [PATCH v2 00/14] Forcewake binary search & code shrink

Tvrtko Ursulin tursulin at ursulin.net
Fri Sep 30 17:48:35 UTC 2016


From: Tvrtko Ursulin <tvrtko.ursulin at intel.com>

Motivation was to replace linear search comparison if-else ladders in MMIO
accessors with a data driven approach.

These lookups are needed to determine to correct forcewake domains to take
when reading and writing to MMIO registers.

Going data driven and keeping the tables sorted enabled binary search to be
used. Followed by gradual extraction of commonality between existing functions,
accompanying code reduction, and the end result is around 15KiB less code
generated and also some saving in the source code lines.

v2:
 * Updated cover letter given feedback.
 * Some rework for review comments.
 * New patch in the series (14) to inline the binary search.

Tvrtko Ursulin (14):
  drm/i915: Remove redundant hsw_write* mmio functions
  drm/i915: Keep track of active forcewake domains in a bitmask
  drm/i915: Do not inline forcewake taking in mmio accessors
  drm/i915: Data driven register to forcewake domains lookup
  drm/i915: Sort forcewake mapping tables
  drm/i915: Use binary search when looking up forcewake domains
  drm/i915: Eliminate Gen9 special case
  drm/i915: Store the active forcewake range table pointer
  drm/i915: Remove identical macros
  drm/i915: Remove identical mmio read functions
  drm/i915: Remove identical write mmmio functions
  drm/i915: Sort the shadow register table
  drm/i915: Use binary search when looking for shadowed registers
  drm/i915: Inline binary search

 drivers/gpu/drm/i915/i915_drv.h     |  12 +
 drivers/gpu/drm/i915/intel_uncore.c | 600 ++++++++++++++++--------------------
 2 files changed, 276 insertions(+), 336 deletions(-)

-- 
2.7.4



More information about the Intel-gfx mailing list