drm/i915: Avoid potential division-by-zero in computing CS timestamp period
authorChris Wilson <chris@chris-wilson.co.uk>
Sun, 16 Feb 2020 16:17:46 +0000 (16:17 +0000)
committerChris Wilson <chris@chris-wilson.co.uk>
Sun, 16 Feb 2020 17:17:28 +0000 (17:17 +0000)
commitd194314da04eb965c651dcef6d692dc83821a414
tree8b47f5bc57b7ea0f5881bbeea37f3cbff487f32a
parent1883a0a4658eaba354db2179b4d3395247d27582
drm/i915: Avoid potential division-by-zero in computing CS timestamp period

Since we use a HW readback or estimation of the CS timestamp frequency,
sometimes it may result in 0. Avoid the division-by-zero in computing
its reciprocal, the timestamp period.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Acked-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20200216161746.500258-1-chris@chris-wilson.co.uk
drivers/gpu/drm/i915/intel_device_info.c