aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/fence.h
diff options
context:
space:
mode:
authorDaniel Vetter <daniel.vetter@ffwll.ch>2015-11-23 03:04:05 -0500
committerDaniel Vetter <daniel.vetter@ffwll.ch>2015-11-23 03:04:05 -0500
commit92907cbbef8625bb3998d1eb385fc88f23c97a3f (patch)
tree15626ff9287e37c3cb81c7286d6db5a7fd77c854 /include/linux/fence.h
parent15fbfccfe92c62ae8d1ecc647c44157ed01ac02e (diff)
parent1ec218373b8ebda821aec00bb156a9c94fad9cd4 (diff)
Merge tag 'v4.4-rc2' into drm-intel-next-queued
Linux 4.4-rc2 Backmerge to get at commit 1b0e3a049efe471c399674fd954500ce97438d30 Author: Imre Deak <imre.deak@intel.com> Date: Thu Nov 5 23:04:11 2015 +0200 drm/i915/skl: disable display side power well support for now so that we can proplery re-eanble skl power wells in -next. Conflicts are just adjacent lines changed, except for intel_fbdev.c where we need to interleave the changs. Nothing nefarious. Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
Diffstat (limited to 'include/linux/fence.h')
-rw-r--r--include/linux/fence.h25
1 files changed, 21 insertions, 4 deletions
diff --git a/include/linux/fence.h b/include/linux/fence.h
index 39efee130d2b..bb522011383b 100644
--- a/include/linux/fence.h
+++ b/include/linux/fence.h
@@ -280,6 +280,22 @@ fence_is_signaled(struct fence *fence)
280} 280}
281 281
282/** 282/**
283 * fence_is_later - return if f1 is chronologically later than f2
284 * @f1: [in] the first fence from the same context
285 * @f2: [in] the second fence from the same context
286 *
287 * Returns true if f1 is chronologically later than f2. Both fences must be
288 * from the same context, since a seqno is not re-used across contexts.
289 */
290static inline bool fence_is_later(struct fence *f1, struct fence *f2)
291{
292 if (WARN_ON(f1->context != f2->context))
293 return false;
294
295 return f1->seqno - f2->seqno < INT_MAX;
296}
297
298/**
283 * fence_later - return the chronologically later fence 299 * fence_later - return the chronologically later fence
284 * @f1: [in] the first fence from the same context 300 * @f1: [in] the first fence from the same context
285 * @f2: [in] the second fence from the same context 301 * @f2: [in] the second fence from the same context
@@ -298,14 +314,15 @@ static inline struct fence *fence_later(struct fence *f1, struct fence *f2)
298 * set if enable_signaling wasn't called, and enabling that here is 314 * set if enable_signaling wasn't called, and enabling that here is
299 * overkill. 315 * overkill.
300 */ 316 */
301 if (f2->seqno - f1->seqno <= INT_MAX) 317 if (fence_is_later(f1, f2))
302 return fence_is_signaled(f2) ? NULL : f2;
303 else
304 return fence_is_signaled(f1) ? NULL : f1; 318 return fence_is_signaled(f1) ? NULL : f1;
319 else
320 return fence_is_signaled(f2) ? NULL : f2;
305} 321}
306 322
307signed long fence_wait_timeout(struct fence *, bool intr, signed long timeout); 323signed long fence_wait_timeout(struct fence *, bool intr, signed long timeout);
308 324signed long fence_wait_any_timeout(struct fence **fences, uint32_t count,
325 bool intr, signed long timeout);
309 326
310/** 327/**
311 * fence_wait - sleep until the fence gets signaled 328 * fence_wait - sleep until the fence gets signaled