Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

drm/i915: Nuke pointless div by 64bit

Bunch of places use a 64bit divisor needlessly. Switch
to 32bit divisor.

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-1-ville.syrjala@linux.intel.com
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>

+5 -6
+5 -6
drivers/gpu/drm/i915/i915_perf.c
··· 1612 1612 struct drm_i915_gem_object *bo; 1613 1613 struct i915_vma *vma; 1614 1614 const u64 delay_ticks = 0xffffffffffffffff - 1615 - DIV64_U64_ROUND_UP( 1616 - atomic64_read(&stream->perf->noa_programming_delay) * 1617 - RUNTIME_INFO(i915)->cs_timestamp_frequency_khz, 1618 - 1000000ull); 1615 + DIV_ROUND_UP_ULL(atomic64_read(&stream->perf->noa_programming_delay) * 1616 + RUNTIME_INFO(i915)->cs_timestamp_frequency_khz, 1617 + 1000000); 1619 1618 const u32 base = stream->engine->mmio_base; 1620 1619 #define CS_GPR(x) GEN8_RING_CS_GPR(base, x) 1621 1620 u32 *batch, *ts0, *cs, *jump; ··· 3484 3485 3485 3486 static u64 oa_exponent_to_ns(struct i915_perf *perf, int exponent) 3486 3487 { 3487 - return div64_u64(1000000000ULL * (2ULL << exponent), 3488 - 1000ULL * RUNTIME_INFO(perf->i915)->cs_timestamp_frequency_khz); 3488 + return div_u64(1000000 * (2ULL << exponent), 3489 + RUNTIME_INFO(perf->i915)->cs_timestamp_frequency_khz); 3489 3490 } 3490 3491 3491 3492 /**