summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/i915
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2010-10-27 15:27:33 +0100
committerChris Wilson <chris@chris-wilson.co.uk>2010-10-27 23:30:59 +0100
commitb2223497b44a4701d1be873d1e9453d7f720043b (patch)
tree7e7e014512c25e410e67095e662dd0428dfb9c74 /drivers/gpu/drm/i915
parentc2c347a9eeda1b9b69c8fc393fd933747fbb2e11 (diff)
drm/i915: Remove the confusing global waiting/irq seqno
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'drivers/gpu/drm/i915')
-rw-r--r--drivers/gpu/drm/i915/i915_debugfs.c44
-rw-r--r--drivers/gpu/drm/i915/i915_drv.h10
-rw-r--r--drivers/gpu/drm/i915/i915_gem.c4
-rw-r--r--drivers/gpu/drm/i915/i915_irq.c6
-rw-r--r--drivers/gpu/drm/i915/intel_ringbuffer.h4
5 files changed, 26 insertions, 42 deletions
diff --git a/drivers/gpu/drm/i915/i915_debugfs.c b/drivers/gpu/drm/i915/i915_debugfs.c
index c5aa6bee3ab..beb3de7921b 100644
--- a/drivers/gpu/drm/i915/i915_debugfs.c
+++ b/drivers/gpu/drm/i915/i915_debugfs.c
@@ -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;
diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h
index c241468c632..2af8e1604b4 100644
--- a/drivers/gpu/drm/i915/i915_drv.h
+++ b/drivers/gpu/drm/i915/i915_drv.h
@@ -609,16 +609,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.
*
diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c
index 580244c1e79..74f5525d156 100644
--- a/drivers/gpu/drm/i915/i915_gem.c
+++ b/drivers/gpu/drm/i915/i915_gem.c
@@ -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);
}
diff --git a/drivers/gpu/drm/i915/i915_irq.c b/drivers/gpu/drm/i915/i915_irq.c
index 23b28528c64..29cbcb33b92 100644
--- a/drivers/gpu/drm/i915/i915_irq.c
+++ b/drivers/gpu/drm/i915/i915_irq.c
@@ -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;
diff --git a/drivers/gpu/drm/i915/intel_ringbuffer.h b/drivers/gpu/drm/i915/intel_ringbuffer.h
index 84f6919de8e..7ad9e94220b 100644
--- a/drivers/gpu/drm/i915/intel_ringbuffer.h
+++ b/drivers/gpu/drm/i915/intel_ringbuffer.h
@@ -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);