Commit 44cdd6d2 authored by John Harrison's avatar John Harrison Committed by Daniel Vetter

drm/i915: Convert 'ring_idle()' to use requests not seqnos

More seqno value to request structure conversions. Note, this change temporarily
moves the 'get_seqno()' call inside ring_idle() but this will disappear again in
a later patch when i915_seqno_passed() itself is converted.

For: VIZ-4377
Signed-off-by: default avatarJohn Harrison <John.C.Harrison@Intel.com>
Reviewed-by: default avatarThomas Daniel <Thomas.Daniel@intel.com>
Signed-off-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
parent 74328ee5
...@@ -2749,18 +2749,19 @@ static void gen8_disable_vblank(struct drm_device *dev, int pipe) ...@@ -2749,18 +2749,19 @@ static void gen8_disable_vblank(struct drm_device *dev, int pipe)
spin_unlock_irqrestore(&dev_priv->irq_lock, irqflags); spin_unlock_irqrestore(&dev_priv->irq_lock, irqflags);
} }
static u32 static struct drm_i915_gem_request *
ring_last_seqno(struct intel_engine_cs *ring) ring_last_request(struct intel_engine_cs *ring)
{ {
return list_entry(ring->request_list.prev, return list_entry(ring->request_list.prev,
struct drm_i915_gem_request, list)->seqno; struct drm_i915_gem_request, list);
} }
static bool static bool
ring_idle(struct intel_engine_cs *ring, u32 seqno) ring_idle(struct intel_engine_cs *ring)
{ {
return (list_empty(&ring->request_list) || return (list_empty(&ring->request_list) ||
i915_seqno_passed(seqno, ring_last_seqno(ring))); i915_seqno_passed(ring->get_seqno(ring, false),
i915_gem_request_get_seqno(ring_last_request(ring))));
} }
static bool static bool
...@@ -2980,7 +2981,7 @@ static void i915_hangcheck_elapsed(unsigned long data) ...@@ -2980,7 +2981,7 @@ static void i915_hangcheck_elapsed(unsigned long data)
acthd = intel_ring_get_active_head(ring); acthd = intel_ring_get_active_head(ring);
if (ring->hangcheck.seqno == seqno) { if (ring->hangcheck.seqno == seqno) {
if (ring_idle(ring, seqno)) { if (ring_idle(ring)) {
ring->hangcheck.action = HANGCHECK_IDLE; ring->hangcheck.action = HANGCHECK_IDLE;
if (waitqueue_active(&ring->irq_queue)) { if (waitqueue_active(&ring->irq_queue)) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment