Commit b2223497 authored by Chris Wilson's avatar Chris Wilson

drm/i915: Remove the confusing global waiting/irq seqno

Signed-off-by: default avatarChris Wilson <chris@chris-wilson.co.uk>
parent c2c347a9
......@@ -319,6 +319,19 @@ static int i915_gem_request_info(struct seq_file *m, void *data)
return 0;
}
static void i915_ring_seqno_info(struct seq_file *m,
struct intel_ring_buffer *ring)
{
if (ring->get_seqno) {
seq_printf(m, "Current sequence (%s): %d\n",
ring->name, ring->get_seqno(ring));
seq_printf(m, "Waiter sequence (%s): %d\n",
ring->name, ring->waiting_seqno);
seq_printf(m, "IRQ sequence (%s): %d\n",
ring->name, ring->irq_seqno);
}
}
static int i915_gem_seqno_info(struct seq_file *m, void *data)
{
struct drm_info_node *node = (struct drm_info_node *) m->private;
......@@ -330,15 +343,9 @@ static int i915_gem_seqno_info(struct seq_file *m, void *data)
if (ret)
return ret;
if (dev_priv->render_ring.status_page.page_addr != NULL) {
seq_printf(m, "Current sequence: %d\n",
dev_priv->render_ring.get_seqno(&dev_priv->render_ring));
} else {
seq_printf(m, "Current sequence: hws uninitialized\n");
}
seq_printf(m, "Waiter sequence: %d\n",
dev_priv->mm.waiting_gem_seqno);
seq_printf(m, "IRQ sequence: %d\n", dev_priv->mm.irq_gem_seqno);
i915_ring_seqno_info(m, &dev_priv->render_ring);
i915_ring_seqno_info(m, &dev_priv->bsd_ring);
i915_ring_seqno_info(m, &dev_priv->blt_ring);
mutex_unlock(&dev->struct_mutex);
......@@ -390,22 +397,9 @@ static int i915_interrupt_info(struct seq_file *m, void *data)
}
seq_printf(m, "Interrupts received: %d\n",
atomic_read(&dev_priv->irq_received));
if (dev_priv->render_ring.get_seqno) {
seq_printf(m, "Current sequence (render): %d\n",
dev_priv->render_ring.get_seqno(&dev_priv->render_ring));
}
if (dev_priv->bsd_ring.get_seqno) {
seq_printf(m, "Current sequence (BSD): %d\n",
dev_priv->bsd_ring.get_seqno(&dev_priv->bsd_ring));
}
if (dev_priv->blt_ring.get_seqno) {
seq_printf(m, "Current sequence (BLT): %d\n",
dev_priv->blt_ring.get_seqno(&dev_priv->blt_ring));
}
seq_printf(m, "Waiter sequence: %d\n",
dev_priv->mm.waiting_gem_seqno);
seq_printf(m, "IRQ sequence: %d\n",
dev_priv->mm.irq_gem_seqno);
i915_ring_seqno_info(m, &dev_priv->render_ring);
i915_ring_seqno_info(m, &dev_priv->bsd_ring);
i915_ring_seqno_info(m, &dev_priv->blt_ring);
mutex_unlock(&dev->struct_mutex);
return 0;
......
......@@ -608,16 +608,6 @@ typedef struct drm_i915_private {
*/
struct delayed_work retire_work;
/**
* Waiting sequence number, if any
*/
uint32_t waiting_gem_seqno;
/**
* Last seq seen at irq time
*/
uint32_t irq_gem_seqno;
/**
* Flag if the X Server, and thus DRM, is not currently in
* control of the device.
......
......@@ -1984,7 +1984,7 @@ i915_do_wait_request(struct drm_device *dev, uint32_t seqno,
trace_i915_gem_request_wait_begin(dev, seqno);
ring->waiting_gem_seqno = seqno;
ring->waiting_seqno = seqno;
ring->user_irq_get(ring);
if (interruptible)
ret = wait_event_interruptible(ring->irq_queue,
......@@ -1996,7 +1996,7 @@ i915_do_wait_request(struct drm_device *dev, uint32_t seqno,
|| atomic_read(&dev_priv->mm.wedged));
ring->user_irq_put(ring);
ring->waiting_gem_seqno = 0;
ring->waiting_seqno = 0;
trace_i915_gem_request_wait_end(dev, seqno);
}
......
......@@ -298,7 +298,7 @@ static void notify_ring(struct drm_device *dev,
{
struct drm_i915_private *dev_priv = dev->dev_private;
u32 seqno = ring->get_seqno(ring);
ring->irq_gem_seqno = seqno;
ring->irq_seqno = seqno;
trace_i915_gem_request_complete(dev, seqno);
wake_up_all(&ring->irq_queue);
dev_priv->hangcheck_count = 0;
......@@ -1319,10 +1319,10 @@ static bool i915_hangcheck_ring_idle(struct intel_ring_buffer *ring, bool *err)
if (list_empty(&ring->request_list) ||
i915_seqno_passed(ring->get_seqno(ring), ring_last_seqno(ring))) {
/* Issue a wake-up to catch stuck h/w. */
if (ring->waiting_gem_seqno && waitqueue_active(&ring->irq_queue)) {
if (ring->waiting_seqno && waitqueue_active(&ring->irq_queue)) {
DRM_ERROR("Hangcheck timer elapsed... %s idle [waiting on %d, at %d], missed IRQ?\n",
ring->name,
ring->waiting_gem_seqno,
ring->waiting_seqno,
ring->get_seqno(ring));
wake_up_all(&ring->irq_queue);
*err = true;
......
......@@ -35,8 +35,8 @@ struct intel_ring_buffer {
int size;
struct intel_hw_status_page status_page;
u32 irq_gem_seqno; /* last seq seem at irq time */
u32 waiting_gem_seqno;
u32 irq_seqno; /* last seq seem at irq time */
u32 waiting_seqno;
int user_irq_refcount;
void (*user_irq_get)(struct intel_ring_buffer *ring);
void (*user_irq_put)(struct intel_ring_buffer *ring);
......
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