summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/i915/i915_perf.c
diff options
context:
space:
mode:
authorVille Syrjälä <ville.syrjala@linux.intel.com>2020-03-02 16:39:39 +0200
committerVille Syrjälä <ville.syrjala@linux.intel.com>2020-05-14 19:59:53 +0300
commit56f1b31f1dd60db4b02024a13eea45b5bbccc44e (patch)
tree4a4425bfa32f95cb3ba2230d141b9279cf8b4fc0 /drivers/gpu/drm/i915/i915_perf.c
parent2e2701582a8039b2f8a2fa811237ac8ec98355fa (diff)
downloadlinux-56f1b31f1dd60db4b02024a13eea45b5bbccc44e.tar.gz
drm/i915: Store CS timestamp frequency in Hz
kHz isn't accurate enough for storing the CS timestamp frequency on some of the platforms. Store the value in Hz instead. 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-2-ville.syrjala@linux.intel.com Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk> Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Diffstat (limited to 'drivers/gpu/drm/i915/i915_perf.c')
-rw-r--r--drivers/gpu/drm/i915/i915_perf.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/drivers/gpu/drm/i915/i915_perf.c b/drivers/gpu/drm/i915/i915_perf.c
index 2e611551d809..205327c6c342 100644
--- a/drivers/gpu/drm/i915/i915_perf.c
+++ b/drivers/gpu/drm/i915/i915_perf.c
@@ -1613,8 +1613,8 @@ static int alloc_noa_wait(struct i915_perf_stream *stream)
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_khz,
- 1000000);
+ RUNTIME_INFO(i915)->cs_timestamp_frequency_hz,
+ 1000000000);
const u32 base = stream->engine->mmio_base;
#define CS_GPR(x) GEN8_RING_CS_GPR(base, x)
u32 *batch, *ts0, *cs, *jump;
@@ -3484,8 +3484,8 @@ err:
static u64 oa_exponent_to_ns(struct i915_perf *perf, int exponent)
{
- return div_u64(1000000 * (2ULL << exponent),
- RUNTIME_INFO(perf->i915)->cs_timestamp_frequency_khz);
+ return div_u64(1000000000 * (2ULL << exponent),
+ RUNTIME_INFO(perf->i915)->cs_timestamp_frequency_hz);
}
/**
@@ -4343,8 +4343,8 @@ void i915_perf_init(struct drm_i915_private *i915)
if (perf->ops.enable_metric_set) {
mutex_init(&perf->lock);
- oa_sample_rate_hard_limit = 1000 *
- (RUNTIME_INFO(i915)->cs_timestamp_frequency_khz / 2);
+ oa_sample_rate_hard_limit =
+ RUNTIME_INFO(i915)->cs_timestamp_frequency_hz / 2;
mutex_init(&perf->metrics_lock);
idr_init(&perf->metrics_idr);