OSDN Git Service

drm/i915: use vfuncs for reg_read/write_fw_domains
authorDaniele Ceraolo Spurio <daniele.ceraolospurio@intel.com>
Thu, 20 Jun 2019 01:00:16 +0000 (18:00 -0700)
committerTvrtko Ursulin <tvrtko.ursulin@intel.com>
Thu, 20 Jun 2019 15:34:52 +0000 (16:34 +0100)
commitccb2aceaaa5f9267ef7b485b41ae9be3f04b50d3
tree99ac8e94488d7e577c91d141fd854530eb4f3af7
parent09c5ab384f6fb30f834a5777888b4486dd7f015d
drm/i915: use vfuncs for reg_read/write_fw_domains

Instead of going through the if-else chain every time, let's save the
function in the uncore structure. Note that the new functions are
purposely not used from the reg read/write functions to keep the
inlining there.

While at it, use the new macro to call the old ones to clean the code a
bit.

v2: Rename macros for no-forcewake function assignment (Tvrtko)

Signed-off-by: Daniele Ceraolo Spurio <daniele.ceraolospurio@intel.com>
Cc: Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com>
Reviewed-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20190620010021.20637-2-daniele.ceraolospurio@intel.com
drivers/gpu/drm/i915/intel_uncore.c
drivers/gpu/drm/i915/intel_uncore.h
drivers/gpu/drm/i915/selftests/mock_uncore.c