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

Tvrtko Ursulin tursulin at ursulin.net
Thu Sep 29 15:35:43 UTC 2016


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

A bunch of cleaned up patches from one of my old branches. Just an idea I had
been toying about and probably more a RFC at this point. But it amazingly
passed trybot on (almost) the first try so I got tempted to post it.

Basically main motivation was to replace linear search comparison ladders in
all mmio accessors with something smarter - a binary search in this case.

Main enabler is moving the comparison ladders from the code into the data
tables. Then gradually, patch by patch, I was able to reduce the code and
end up with a total saving of approximately 14KiB for the series.

That is kind of nice, but whether the churn is worth it I leave open for
dicussion. It is slightly less code so perhaps more maintainable. Although
tastes will probably differ.

And I haven't been able to do any benchmarking to see if any performance
differece is at all detectable.

Tvrtko Ursulin (13):
  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

 drivers/gpu/drm/i915/i915_drv.h     |  13 +
 drivers/gpu/drm/i915/intel_uncore.c | 525 ++++++++++++++++--------------------
 2 files changed, 247 insertions(+), 291 deletions(-)

-- 
2.7.4



More information about the Intel-gfx mailing list