drm/i915/vblank: add and use intel_de_read64_2x32() to read vblank counter
authorJani Nikula <jani.nikula@intel.com>
Mon, 16 Jan 2023 12:56:16 +0000 (14:56 +0200)
committerJani Nikula <jani.nikula@intel.com>
Wed, 18 Jan 2023 09:06:07 +0000 (11:06 +0200)
commit1af13bc6d0470e6c425c52944739fdc74f46ed02
treeb50f67a9208cefffe3e6232b69e5d59d80643c9c
parent75018f47acd49ace947a2e99cb5c2114f0f68ebd
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
drivers/gpu/drm/i915/display/intel_de.h
drivers/gpu/drm/i915/display/intel_vblank.c