diff options
author | Ville Syrjälä <ville.syrjala@linux.intel.com> | 2020-03-02 16:39:42 +0200 |
---|---|---|
committer | Ville Syrjälä <ville.syrjala@linux.intel.com> | 2020-05-14 20:04:02 +0300 |
commit | 802a5820fc0c0f12b40280db3dbaaf8359b07243 (patch) | |
tree | 2a3cdb0537a79899356f3e34de3e2aa1464dbdfa /drivers/gpu/drm/i915/i915_perf.c | |
parent | drm/i915: Store CS timestamp frequency in Hz (diff) | |
download | linux-dev-802a5820fc0c0f12b40280db3dbaaf8359b07243.tar.xz linux-dev-802a5820fc0c0f12b40280db3dbaaf8359b07243.zip |
drm/i915: Extract i915_cs_timestamp_{ns_to_ticks,tick_to_ns}()
Pull the code to do the CS timestamp ns<->ticks conversion into
helpers and use them all over.
The check in i915_perf_noa_delay_set() seems a bit dubious,
so we switch it to do what I assume it wanted to do all along
(ie. make sure the resulting delay in CS timestamp ticks
doesn't exceed 32bits)?
Cc: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20200302143943.32676-5-ville.syrjala@linux.intel.com
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'drivers/gpu/drm/i915/i915_perf.c')
-rw-r--r-- | drivers/gpu/drm/i915/i915_perf.c | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/drivers/gpu/drm/i915/i915_perf.c b/drivers/gpu/drm/i915/i915_perf.c index 205327c6c342..f35712d04ba4 100644 --- a/drivers/gpu/drm/i915/i915_perf.c +++ b/drivers/gpu/drm/i915/i915_perf.c @@ -1612,9 +1612,7 @@ static int alloc_noa_wait(struct i915_perf_stream *stream) struct drm_i915_gem_object *bo; struct i915_vma *vma; const u64 delay_ticks = 0xffffffffffffffff - - DIV_ROUND_UP_ULL(atomic64_read(&stream->perf->noa_programming_delay) * - RUNTIME_INFO(i915)->cs_timestamp_frequency_hz, - 1000000000); + i915_cs_timestamp_ns_to_ticks(i915, atomic64_read(&stream->perf->noa_programming_delay)); const u32 base = stream->engine->mmio_base; #define CS_GPR(x) GEN8_RING_CS_GPR(base, x) u32 *batch, *ts0, *cs, *jump; @@ -3484,8 +3482,7 @@ err: static u64 oa_exponent_to_ns(struct i915_perf *perf, int exponent) { - return div_u64(1000000000 * (2ULL << exponent), - RUNTIME_INFO(perf->i915)->cs_timestamp_frequency_hz); + return i915_cs_timestamp_ticks_to_ns(perf->i915, 2ULL << exponent); } /** |