summaryrefslogtreecommitdiff
path: root/sys/dev/pci/drm/i915
diff options
context:
space:
mode:
authorMark Kettenis <kettenis@cvs.openbsd.org>2020-03-05 19:39:05 +0000
committerMark Kettenis <kettenis@cvs.openbsd.org>2020-03-05 19:39:05 +0000
commitb275b88126c8a25ca3eb3b3ba42e3a2ef2d8ff19 (patch)
treef8d6fb59dadab788d4b958d916cd9542ef0c7db6 /sys/dev/pci/drm/i915
parente1c3841d72132e5b15dadb52fe9e2c59841ca03a (diff)
The local_clock_us() function needs microsecond resolution so implement it
using microuptime(9). Avoids a hard hang when starting X on Intel Cherry Trail Atom processors. ok jsg@
Diffstat (limited to 'sys/dev/pci/drm/i915')
-rw-r--r--sys/dev/pci/drm/i915/i915_request.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/sys/dev/pci/drm/i915/i915_request.c b/sys/dev/pci/drm/i915/i915_request.c
index a65040e0452..714a3d842c7 100644
--- a/sys/dev/pci/drm/i915/i915_request.c
+++ b/sys/dev/pci/drm/i915/i915_request.c
@@ -1205,8 +1205,11 @@ static unsigned long local_clock_us(unsigned int *cpu)
#else
static unsigned long local_clock_us(unsigned *cpu)
{
+ struct timeval tv;
+
*cpu = cpu_number();
- return ticks * tick;
+ microuptime(&tv);
+ return tv.tv_sec * 1000000 + tv.tv_usec;
}
#endif