1 #ifndef __NVIF_TIMER_H__
2 #define __NVIF_TIMER_H__
5 struct nvif_timer_wait {
6 struct nvif_device *device;
13 void nvif_timer_wait_init(struct nvif_device *, u64 nsec,
14 struct nvif_timer_wait *);
15 s64 nvif_timer_wait_test(struct nvif_timer_wait *);
17 /* Delay based on GPU time (ie. PTIMER).
19 * Will return -ETIMEDOUT unless the loop was terminated with 'break',
20 * where it will return the number of nanoseconds taken instead.
22 #define nvif_nsec(d,n,cond...) ({ \
23 struct nvif_timer_wait _wait; \
26 nvif_timer_wait_init((d), (n), &_wait); \
29 } while ((_taken = nvif_timer_wait_test(&_wait)) >= 0); \
33 #define nvif_usec(d,u,cond...) nvif_nsec((d), (u) * 1000, ##cond)
34 #define nvif_msec(d,m,cond...) nvif_usec((d), (m) * 1000, ##cond)