Lines Matching +full:1000 +full:base +full:- +full:x
37 #define FDO_BUG_URL "https://gitlab.freedesktop.org/drm/intel/-/wikis/How-to-file-i915-bugs"
42 #define WARN_ON(x) ({ \
43 bool __i915_warn_cond = (x); \
46 WARN(__i915_warn_cond, "WARN_ON(" #x ")"); })
48 #define WARN_ON(x) WARN((x), "%s", "WARN_ON(" __stringify(x) ")") argument
52 #define WARN_ON_ONCE(x) WARN_ONCE((x), "%s", "WARN_ON_ONCE(" __stringify(x) ")") argument
54 #define MISSING_CASE(x) WARN(1, "Missing case (%s == %ld)\n", \ argument
55 __stringify(x), (long)(x))
79 #define i915_inject_probe_failure(i915) i915_inject_probe_error((i915), -ENODEV)
105 start__ >= max__ || size__ > max__ - start__; \
117 start__ > max__ || size__ > max__ - start__; \
124 #define overflows_type(x, T) \ argument
125 (sizeof(x) > sizeof(T) && (x) >> BITS_PER_TYPE(T))
128 __check_struct_size(size_t base, size_t arr, size_t count, size_t *size) in __check_struct_size() argument
135 if (check_add_overflow(sz, base, &sz)) in __check_struct_size()
143 * check_struct_size() - Calculate size of structure with trailing array.
157 sizeof(*(p)->member) + __must_be_array((p)->member), \
162 (typeof(ptr))(__v & -BIT(n)); \
165 #define ptr_unmask_bits(ptr, n) ((unsigned long)(ptr) & (BIT(n) - 1))
169 *(bits) = __v & (BIT(n) - 1); \
170 (typeof(ptr))(__v & -BIT(n)); \
175 GEM_BUG_ON(__bits & -BIT(n)); \
181 (typeof(ptr))(__v - 1); \
194 #define struct_member(T, member) (((T *)0)->member)
206 return a - b; in ptrdiff()
220 ((type __user *)(__mptr - offsetof(type, member))); })
233 * Returns: -EFAULT if not accessible, -EINVAL if !zero, or 0 on success.
237 get_user(mbz__, (U)) ? -EFAULT : mbz__ ? -EINVAL : 0; \
245 #define u64_to_ptr(T, x) ({ \ argument
246 typecheck(u64, x); \
247 (T *)(uintptr_t)(x); \
251 int __idx = ffs(mask) - 1; \
258 return (n != 0 && ((n & (n - 1)) == 0)); in is_power_of_2_u64()
264 first->prev = head; in __list_del_many()
265 WRITE_ONCE(head->next, first); in __list_del_many()
271 return READ_ONCE(list->next) == head; in list_is_last_rcu()
282 * If you need to wait X milliseconds between events A and B, but event B
285 * pass the timestamp as the first argument, and X as the second argument.
293 * Don't re-read the value of "jiffies" every time since it may change in wait_remaining_ms_from_jiffies()
301 remaining_jiffies = target_jiffies - tmp_jiffies; in wait_remaining_ms_from_jiffies()
309 * __wait_for - magic wait macro
317 const ktime_t end__ = ktime_add_ns(ktime_get_raw(), 1000ll * (US)); \
331 ret__ = -ETIMEDOUT; \
343 #define wait_for(COND, MS) _wait_for((COND), (MS) * 1000, 10, 1000)
354 int cpu, ret, timeout = (US) * 1000; \
355 u64 base; \
361 base = local_clock(); \
372 if (now - base >= timeout) { \
373 ret = -ETIMEDOUT; \
380 timeout -= now - base; \
382 base = local_clock(); \
407 #define wait_for_atomic(COND, MS) wait_for_atomic_us((COND), (MS) * 1000)
409 #define KHz(x) (1000 * (x)) argument
410 #define MHz(x) KHz(1000 * (x)) argument
412 #define KBps(x) (1000 * (x)) argument
413 #define MBps(x) KBps(1000 * (x)) argument
414 #define GBps(x) ((u64)1000 * MBps((x))) argument
453 return READ_ONCE(t->expires); in timer_active()
463 * e.g. CONFIG_DRM_I915_SPIN_REQUEST, and evaluates whether it is non-zero
466 * issues in confusing logical-&& with bitwise-& for constants.