aboutsummaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/i915/i915_sw_fence.h
diff options
context:
space:
mode:
authorGravatar Chris Wilson <chris@chris-wilson.co.uk> 2016-11-25 13:17:17 +0000
committerGravatar Jani Nikula <jani.nikula@intel.com> 2016-12-05 11:00:32 +0200
commit0e932c080cdee38e873476df92d7dc02bdb023bc (patch)
treed440312a93e4a5e9f766590545858cfe9c99d4fb /drivers/gpu/drm/i915/i915_sw_fence.h
parentdrm/i915/audio: fix hdmi audio noise issue (diff)
downloadlinux-0e932c080cdee38e873476df92d7dc02bdb023bc.tar.gz
linux-0e932c080cdee38e873476df92d7dc02bdb023bc.tar.bz2
linux-0e932c080cdee38e873476df92d7dc02bdb023bc.zip
drm/i915: Hold a reference on the request for its fence chain
Currently, we have an active reference for the request until it is retired. Though it cannot be retired before it has been executed by hardware, the request may be completed before we have finished processing the execute fence, i.e. we may continue to process that fence as we free the request. Fixes: 5590af3e115a ("drm/i915: Drive request submission through fence callbacks") Fixes: 23902e49c999 ("drm/i915: Split request submit/execute phase into two") Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Reviewed-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com> Link: http://patchwork.freedesktop.org/patch/msgid/20161125131718.20978-3-chris@chris-wilson.co.uk (cherry picked from commit 48bc2a4a427ad81578f887d71d45794619a77211) Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Diffstat (limited to 'drivers/gpu/drm/i915/i915_sw_fence.h')
-rw-r--r--drivers/gpu/drm/i915/i915_sw_fence.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/gpu/drm/i915/i915_sw_fence.h b/drivers/gpu/drm/i915/i915_sw_fence.h
index 7508d23f823b..0f3185ef7f4e 100644
--- a/drivers/gpu/drm/i915/i915_sw_fence.h
+++ b/drivers/gpu/drm/i915/i915_sw_fence.h
@@ -75,6 +75,11 @@ int i915_sw_fence_await_reservation(struct i915_sw_fence *fence,
unsigned long timeout,
gfp_t gfp);
+static inline bool i915_sw_fence_signaled(const struct i915_sw_fence *fence)
+{
+ return atomic_read(&fence->pending) <= 0;
+}
+
static inline bool i915_sw_fence_done(const struct i915_sw_fence *fence)
{
return atomic_read(&fence->pending) < 0;