diff options
author | Jani Nikula <jani.nikula@intel.com> | 2023-01-16 15:56:16 +0300 |
---|---|---|
committer | Jani Nikula <jani.nikula@intel.com> | 2023-01-18 12:06:07 +0300 |
commit | 1af13bc6d0470e6c425c52944739fdc74f46ed02 (patch) | |
tree | b50f67a9208cefffe3e6232b69e5d59d80643c9c /drivers/gpu/drm/i915/display/intel_de.h | |
parent | 75018f47acd49ace947a2e99cb5c2114f0f68ebd (diff) | |
download | linux-1af13bc6d0470e6c425c52944739fdc74f46ed02.tar.xz |
drm/i915/vblank: add and use intel_de_read64_2x32() to read vblank counter
Add intel_de_read64_2x32() wrapper for the uncore version of the same,
and use it to read the high and low frame registers. Avoid duplicating
code for existing helpers.
The slight functional difference is checking that the entire high
register remains the same across two reads, instead of just the part
we're interested in. This should be of no consequence. (Unless those
bits function as a PRNG.)
Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/33853549adff82045b95af527e14cfdff5712470.1673873708.git.jani.nikula@intel.com
Diffstat (limited to 'drivers/gpu/drm/i915/display/intel_de.h')
-rw-r--r-- | drivers/gpu/drm/i915/display/intel_de.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/drivers/gpu/drm/i915/display/intel_de.h b/drivers/gpu/drm/i915/display/intel_de.h index 3dbd76fdabd6..42552d8c151e 100644 --- a/drivers/gpu/drm/i915/display/intel_de.h +++ b/drivers/gpu/drm/i915/display/intel_de.h @@ -22,6 +22,13 @@ intel_de_read8(struct drm_i915_private *i915, i915_reg_t reg) return intel_uncore_read8(&i915->uncore, reg); } +static inline u64 +intel_de_read64_2x32(struct drm_i915_private *i915, + i915_reg_t lower_reg, i915_reg_t upper_reg) +{ + return intel_uncore_read64_2x32(&i915->uncore, lower_reg, upper_reg); +} + static inline void intel_de_posting_read(struct drm_i915_private *i915, i915_reg_t reg) { |