All of lore.kernel.org
 help / color / mirror / Atom feed
* [Intel-gfx] [PATCH 1/3] drm/i915: Check for error before calling cmpxchg()
@ 2019-12-06 16:04 Chris Wilson
  2019-12-06 16:04 ` [Intel-gfx] [PATCH 2/3] drm/i915: Propagate errors on awaiting already signaled fences Chris Wilson
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: Chris Wilson @ 2019-12-06 16:04 UTC (permalink / raw)
  To: intel-gfx

Only do the locked compare of the existing fence->error if we actually
need to set an error. As we tend to call i915_sw_fence_set_error_once()
unconditionally, it saves on typing to put the common has-error check
into the inline.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
---
 drivers/gpu/drm/i915/i915_sw_fence.h | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/i915/i915_sw_fence.h b/drivers/gpu/drm/i915/i915_sw_fence.h
index 1e90d9a51bd2..19e806ce43bc 100644
--- a/drivers/gpu/drm/i915/i915_sw_fence.h
+++ b/drivers/gpu/drm/i915/i915_sw_fence.h
@@ -112,7 +112,8 @@ static inline void i915_sw_fence_wait(struct i915_sw_fence *fence)
 static inline void
 i915_sw_fence_set_error_once(struct i915_sw_fence *fence, int error)
 {
-	cmpxchg(&fence->error, 0, error);
+	if (unlikely(error))
+		cmpxchg(&fence->error, 0, error);
 }
 
 #endif /* _I915_SW_FENCE_H_ */
-- 
2.24.0

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2019-12-07  5:54 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-12-06 16:04 [Intel-gfx] [PATCH 1/3] drm/i915: Check for error before calling cmpxchg() Chris Wilson
2019-12-06 16:04 ` [Intel-gfx] [PATCH 2/3] drm/i915: Propagate errors on awaiting already signaled fences Chris Wilson
2019-12-06 16:04 ` [Intel-gfx] [PATCH 3/3] drm/i915: Propagate errors on awaiting already signaled dma-fences Chris Wilson
2019-12-06 16:51 ` [Intel-gfx] ✓ Fi.CI.BAT: success for series starting with [1/3] drm/i915: Check for error before calling cmpxchg() Patchwork
2019-12-06 18:54 ` [Intel-gfx] [PATCH 1/3] " Matthew Auld
2019-12-07  5:54 ` [Intel-gfx] ✗ Fi.CI.IGT: failure for series starting with [1/3] " Patchwork

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.