Skip to content

Commit 2e27015

Browse files
committed
drm/i915: Nuke pointless div by 64bit
Bunch of places use a 64bit divisor needlessly. Switch to 32bit divisor. Cc: Lionel Landwerlin <[email protected]> Signed-off-by: Ville Syrjälä <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected] Reviewed-by: Chris Wilson <[email protected]>
1 parent 8ca6d02 commit 2e27015

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

drivers/gpu/drm/i915/i915_perf.c

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1612,10 +1612,9 @@ static int alloc_noa_wait(struct i915_perf_stream *stream)
16121612
struct drm_i915_gem_object *bo;
16131613
struct i915_vma *vma;
16141614
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);
16191618
const u32 base = stream->engine->mmio_base;
16201619
#define CS_GPR(x) GEN8_RING_CS_GPR(base, x)
16211620
u32 *batch, *ts0, *cs, *jump;
@@ -3485,8 +3484,8 @@ i915_perf_open_ioctl_locked(struct i915_perf *perf,
34853484

34863485
static u64 oa_exponent_to_ns(struct i915_perf *perf, int exponent)
34873486
{
3488-
return div64_u64(1000000000ULL * (2ULL << exponent),
3489-
1000ULL * RUNTIME_INFO(perf->i915)->cs_timestamp_frequency_khz);
3487+
return div_u64(1000000 * (2ULL << exponent),
3488+
RUNTIME_INFO(perf->i915)->cs_timestamp_frequency_khz);
34903489
}
34913490

34923491
/**

0 commit comments

Comments
 (0)