drm/i915: Convert i915_reset.c over to using uncore mmio
authorChris Wilson <chris@chris-wilson.co.uk>
Fri, 5 Apr 2019 20:24:19 +0000 (21:24 +0100)
committerChris Wilson <chris@chris-wilson.co.uk>
Fri, 5 Apr 2019 21:03:24 +0000 (22:03 +0100)
commit95007efbe608fe888469b5c22d01c54c4d2b3bf1
tree4189c78ee1682fcc2e094717b24c415db4465ca3
parentfdc4e9267f9b7bcfafb9d95940a8765c538fb507
drm/i915: Convert i915_reset.c over to using uncore mmio

Currently i915_reset.c mixes calls to intel_uncore, pci and our old
style I915_READ mmio interfaces. Cast aside the old implicit macros,
and harmonise on using uncore throughout.

add/remove: 1/1 grow/shrink: 0/4 up/down: 65/-207 (-142)
Function                                     old     new   delta
rmw_register                                   -      65     +65
gen8_reset_engines                           945     942      -3
g4x_do_reset                                 407     376     -31
intel_gpu_reset                              545     509     -36
clear_register                                63       -     -63
i915_clear_error_registers                   461     387     -74

A little bit of pointer dancing elimination works wonders.

v2: Roll up the helpers into intel_uncore for general use

With the helpers gcc was a little more eager to inline:
add/remove: 0/1 grow/shrink: 1/3 up/down: 99/-133 (-34)
Function                                     old     new   delta
i915_clear_error_registers                   461     560     +99
gen8_reset_engines                           945     942      -3
g4x_do_reset                                 407     376     -31
intel_gpu_reset                              545     509     -36
clear_register                                63       -     -63
Total: Before=1544400, After=1544366, chg -0.00%

Win some, lose some, gcc is gcc.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Daniele Ceraolo Spurio <daniele.ceraolospurio@intel.com>
Cc: Paulo Zanoni <paulo.r.zanoni@intel.com>
Reviewed-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20190405202419.3093-1-chris@chris-wilson.co.uk
drivers/gpu/drm/i915/i915_reset.c
drivers/gpu/drm/i915/intel_uncore.h