summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/i915/i915_irq.c
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2016-04-07 07:29:17 +0100
committerChris Wilson <chris@chris-wilson.co.uk>2016-04-08 11:44:48 +0100
commit7c90b7de7372fcd634fa0cffea6e580fb32e6b85 (patch)
tree5b924c17a0ecd9af5e7f907e0961f6b392398783 /drivers/gpu/drm/i915/i915_irq.c
parent01347126f4e2a346bf37fe264570563b0fab6618 (diff)
downloadlwn-7c90b7de7372fcd634fa0cffea6e580fb32e6b85.tar.gz
lwn-7c90b7de7372fcd634fa0cffea6e580fb32e6b85.zip
drm/i915: Apply a mb between emitting the request and hangcheck
Seal the request and mark it as pending execution before we submit it to hardware. We assume that the actual submission cannot fail (that guarantee is provided by preallocating space in the request for the submission). As we may inspect this state without holding any locks during hangcheck we should apply a barrier to ensure that we do not see a more recent value in the HWS than we are tracking. Based on a patch by Mika Kuoppala. Suggested-by: Mika Kuoppala <mika.kuoppala@linux.intel.com> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Cc: Mika Kuoppala <mika.kuoppala@linux.intel.com> Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com> Link: http://patchwork.freedesktop.org/patch/msgid/1460010558-10705-8-git-send-email-chris@chris-wilson.co.uk Reviewed-by: Mika Kuoppala <mika.kuoppala@linux.intel.com>
Diffstat (limited to 'drivers/gpu/drm/i915/i915_irq.c')
-rw-r--r--drivers/gpu/drm/i915/i915_irq.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/gpu/drm/i915/i915_irq.c b/drivers/gpu/drm/i915/i915_irq.c
index c36aa64bb107..cc9081249836 100644
--- a/drivers/gpu/drm/i915/i915_irq.c
+++ b/drivers/gpu/drm/i915/i915_irq.c
@@ -2806,7 +2806,8 @@ static bool
ring_idle(struct intel_engine_cs *engine, u32 seqno)
{
return (list_empty(&engine->request_list) ||
- i915_seqno_passed(seqno, engine->last_submitted_seqno));
+ i915_seqno_passed(seqno,
+ READ_ONCE(engine->last_submitted_seqno)));
}
static bool