Lines Matching +full:1000 +full:base +full:- +full:t
43 #define FDO_BUG_URL "https://drm.pages.freedesktop.org/intel-docs/how-to-file-i915-bugs.html"
63 #define i915_inject_probe_failure(i915) i915_inject_probe_error((i915), -ENODEV)
67 drm_dbg(&(i915)->drm, fmt, ##__VA_ARGS__); \
69 drm_err(&(i915)->drm, fmt, ##__VA_ARGS__); \
78 start__ >= max__ || size__ > max__ - start__; \
90 start__ > max__ || size__ > max__ - start__; \
98 (typeof(ptr))(__v & -BIT(n)); \
101 #define ptr_unmask_bits(ptr, n) ((unsigned long)(ptr) & (BIT(n) - 1))
105 *(bits) = __v & (BIT(n) - 1); \
106 (typeof(ptr))(__v & -BIT(n)); \
111 GEM_BUG_ON(__bits & -BIT(n)); \
117 (typeof(ptr))(__v - 1); \
138 return a - b; in ptrdiff()
152 ((type __user *)(__mptr - offsetof(type, member))); })
165 * Returns: -EFAULT if not accessible, -EINVAL if !zero, or 0 on success.
169 get_user(mbz__, (U)) ? -EFAULT : mbz__ ? -EINVAL : 0; \
172 #define u64_to_ptr(T, x) ({ \ argument
174 (T *)(uintptr_t)(x); \
178 int __idx = ffs(mask) - 1; \
185 return (n != 0 && ((n & (n - 1)) == 0)); in is_power_of_2_u64()
191 first->prev = head; in __list_del_many()
192 WRITE_ONCE(head->next, first); in __list_del_many()
198 return READ_ONCE(list->next) == head; in list_is_last_rcu()
210 * doesn't happen exactly after event A, you record the timestamp (jiffies) of
220 * Don't re-read the value of "jiffies" every time since it may change in wait_remaining_ms_from_jiffies()
228 remaining_jiffies = target_jiffies - tmp_jiffies; in wait_remaining_ms_from_jiffies()
236 * __wait_for - magic wait macro
244 const ktime_t end__ = ktime_add_ns(ktime_get_raw(), 1000ll * (US)); \
258 ret__ = -ETIMEDOUT; \
270 #define wait_for(COND, MS) _wait_for((COND), (MS) * 1000, 10, 1000)
281 int cpu, ret, timeout = (US) * 1000; \
282 u64 base; \
288 base = local_clock(); \
299 if (now - base >= timeout) { \
300 ret = -ETIMEDOUT; \
307 timeout -= now - base; \
309 base = local_clock(); \
334 #define wait_for_atomic(COND, MS) wait_for_atomic_us((COND), (MS) * 1000)
336 #define KHz(x) (1000 * (x))
337 #define MHz(x) KHz(1000 * (x))
351 void cancel_timer(struct timer_list *t);
352 void set_timer_ms(struct timer_list *t, unsigned long timeout);
354 static inline bool timer_active(const struct timer_list *t) in timer_active() argument
356 return READ_ONCE(t->expires); in timer_active()
359 static inline bool timer_expired(const struct timer_list *t) in timer_expired() argument
361 return timer_active(t) && !timer_pending(t); in timer_expired()