diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2020-04-27 18:45:54 +0300 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2020-04-27 19:34:33 +0300 |
commit | 6dc0d028f53945ca8de3e61a149f103f100d42df (patch) | |
tree | 93738895ed51fceeb5b64cfbafa8b3031dde2a7d /drivers/gpu/drm/i915/gt/intel_gt_clock_utils.c | |
parent | 4243cd5388c82ae8942510f349b798c62f89825c (diff) | |
download | linux-6dc0d028f53945ca8de3e61a149f103f100d42df.tar.xz |
drm/i915/gt: Fix up clock frequency
The bspec lists both the clock frequency and the effective interval. The
interval corresponds to observed behaviour, so adjust the frequency to
match.
v2: Mika rightfully asked if we could measure the clock frequency from a
selftest.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Mika Kuoppala <mika.kuoppala@linux.intel.com>
Acked-by: Mika Kuoppala <mika.kuoppala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20200427154554.12736-1-chris@chris-wilson.co.uk
Diffstat (limited to 'drivers/gpu/drm/i915/gt/intel_gt_clock_utils.c')
-rw-r--r-- | drivers/gpu/drm/i915/gt/intel_gt_clock_utils.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/drivers/gpu/drm/i915/gt/intel_gt_clock_utils.c b/drivers/gpu/drm/i915/gt/intel_gt_clock_utils.c index 852a7d731b3b..999079686846 100644 --- a/drivers/gpu/drm/i915/gt/intel_gt_clock_utils.c +++ b/drivers/gpu/drm/i915/gt/intel_gt_clock_utils.c @@ -7,9 +7,9 @@ #include "intel_gt.h" #include "intel_gt_clock_utils.h" +#define MHZ_12 12000000 /* 12MHz (24MHz/2), 83.333ns */ +#define MHZ_12_5 12500000 /* 12.5MHz (25MHz/2), 80ns */ #define MHZ_19_2 19200000 /* 19.2MHz, 52.083ns */ -#define MHZ_24 24000000 /* 24MHz, 83.333ns */ -#define MHZ_25 25000000 /* 25MHz, 80ns */ static u32 read_clock_frequency(const struct intel_gt *gt) { @@ -21,19 +21,19 @@ static u32 read_clock_frequency(const struct intel_gt *gt) config >>= GEN11_RPM_CONFIG0_CRYSTAL_CLOCK_FREQ_SHIFT; switch (config) { - case 0: return MHZ_24; + case 0: return MHZ_12; case 1: case 2: return MHZ_19_2; default: - case 3: return MHZ_25; + case 3: return MHZ_12_5; } } else if (INTEL_GEN(gt->i915) >= 9) { if (IS_GEN9_LP(gt->i915)) return MHZ_19_2; else - return MHZ_24; + return MHZ_12; } else { - return MHZ_25; + return MHZ_12_5; } } |