diff options
author | Ben Widawsky <ben@bwidawsk.net> | 2012-04-26 19:03:01 -0400 |
---|---|---|
committer | Daniel Vetter <daniel.vetter@ffwll.ch> | 2012-05-03 05:18:21 -0400 |
commit | 9574b3fe29ba9064c03e8db0e399f5fe356ee03b (patch) | |
tree | 7617da0bd5422f715afd9f19e84eaa90465712eb /drivers/gpu/drm | |
parent | be998e2e3945d97ffad3c800ef52fd487868b3e9 (diff) |
drm/i915: kill waiting_seqno
The waiting_seqno is not terribly useful, and as such we can remove it
so that we'll be able to extract lockless code.
v2: Keep the information for error_state (Chris)
Check if ring is initialized in hangcheck (Chris)
Capture the waiting ring (Chris)
Signed-off-by: Ben Widawsky <ben@bwidawsk.net>
[danvet: add some bikeshed to clarify a comment.]
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Diffstat (limited to 'drivers/gpu/drm')
-rw-r--r-- | drivers/gpu/drm/i915/i915_debugfs.c | 3 | ||||
-rw-r--r-- | drivers/gpu/drm/i915/i915_drv.h | 1 | ||||
-rw-r--r-- | drivers/gpu/drm/i915/i915_gem.c | 2 | ||||
-rw-r--r-- | drivers/gpu/drm/i915/i915_irq.c | 14 | ||||
-rw-r--r-- | drivers/gpu/drm/i915/intel_ringbuffer.h | 1 |
5 files changed, 11 insertions, 10 deletions
diff --git a/drivers/gpu/drm/i915/i915_debugfs.c b/drivers/gpu/drm/i915/i915_debugfs.c index 8ed034233e38..9d4bf6bfc46a 100644 --- a/drivers/gpu/drm/i915/i915_debugfs.c +++ b/drivers/gpu/drm/i915/i915_debugfs.c | |||
@@ -414,8 +414,6 @@ static void i915_ring_seqno_info(struct seq_file *m, | |||
414 | if (ring->get_seqno) { | 414 | if (ring->get_seqno) { |
415 | seq_printf(m, "Current sequence (%s): %d\n", | 415 | seq_printf(m, "Current sequence (%s): %d\n", |
416 | ring->name, ring->get_seqno(ring)); | 416 | ring->name, ring->get_seqno(ring)); |
417 | seq_printf(m, "Waiter sequence (%s): %d\n", | ||
418 | ring->name, ring->waiting_seqno); | ||
419 | seq_printf(m, "IRQ sequence (%s): %d\n", | 417 | seq_printf(m, "IRQ sequence (%s): %d\n", |
420 | ring->name, ring->irq_seqno); | 418 | ring->name, ring->irq_seqno); |
421 | } | 419 | } |
@@ -687,6 +685,7 @@ static void i915_ring_error_state(struct seq_file *m, | |||
687 | error->semaphore_mboxes[ring][1]); | 685 | error->semaphore_mboxes[ring][1]); |
688 | } | 686 | } |
689 | seq_printf(m, " seqno: 0x%08x\n", error->seqno[ring]); | 687 | seq_printf(m, " seqno: 0x%08x\n", error->seqno[ring]); |
688 | seq_printf(m, " waiting: %s\n", yesno(error->waiting[ring])); | ||
690 | seq_printf(m, " ring->head: 0x%08x\n", error->cpu_ring_head[ring]); | 689 | seq_printf(m, " ring->head: 0x%08x\n", error->cpu_ring_head[ring]); |
691 | seq_printf(m, " ring->tail: 0x%08x\n", error->cpu_ring_tail[ring]); | 690 | seq_printf(m, " ring->tail: 0x%08x\n", error->cpu_ring_tail[ring]); |
692 | } | 691 | } |
diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h index e719522cb40b..ca13098c7573 100644 --- a/drivers/gpu/drm/i915/i915_drv.h +++ b/drivers/gpu/drm/i915/i915_drv.h | |||
@@ -174,6 +174,7 @@ struct drm_i915_error_state { | |||
174 | u32 eir; | 174 | u32 eir; |
175 | u32 pgtbl_er; | 175 | u32 pgtbl_er; |
176 | u32 ier; | 176 | u32 ier; |
177 | bool waiting[I915_NUM_RINGS]; | ||
177 | u32 pipestat[I915_MAX_PIPES]; | 178 | u32 pipestat[I915_MAX_PIPES]; |
178 | u32 tail[I915_NUM_RINGS]; | 179 | u32 tail[I915_NUM_RINGS]; |
179 | u32 head[I915_NUM_RINGS]; | 180 | u32 head[I915_NUM_RINGS]; |
diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c index f194603140c0..292b4a9e7bab 100644 --- a/drivers/gpu/drm/i915/i915_gem.c +++ b/drivers/gpu/drm/i915/i915_gem.c | |||
@@ -1864,7 +1864,6 @@ i915_wait_request(struct intel_ring_buffer *ring, | |||
1864 | if (!i915_seqno_passed(ring->get_seqno(ring), seqno)) { | 1864 | if (!i915_seqno_passed(ring->get_seqno(ring), seqno)) { |
1865 | trace_i915_gem_request_wait_begin(ring, seqno); | 1865 | trace_i915_gem_request_wait_begin(ring, seqno); |
1866 | 1866 | ||
1867 | ring->waiting_seqno = seqno; | ||
1868 | if (ring->irq_get(ring)) { | 1867 | if (ring->irq_get(ring)) { |
1869 | if (dev_priv->mm.interruptible) | 1868 | if (dev_priv->mm.interruptible) |
1870 | ret = wait_event_interruptible(ring->irq_queue, | 1869 | ret = wait_event_interruptible(ring->irq_queue, |
@@ -1880,7 +1879,6 @@ i915_wait_request(struct intel_ring_buffer *ring, | |||
1880 | seqno) || | 1879 | seqno) || |
1881 | atomic_read(&dev_priv->mm.wedged), 3000)) | 1880 | atomic_read(&dev_priv->mm.wedged), 3000)) |
1882 | ret = -EBUSY; | 1881 | ret = -EBUSY; |
1883 | ring->waiting_seqno = 0; | ||
1884 | 1882 | ||
1885 | trace_i915_gem_request_wait_end(ring, seqno); | 1883 | trace_i915_gem_request_wait_end(ring, seqno); |
1886 | } | 1884 | } |
diff --git a/drivers/gpu/drm/i915/i915_irq.c b/drivers/gpu/drm/i915/i915_irq.c index 0acadc5e02d2..a0129cfc3b31 100644 --- a/drivers/gpu/drm/i915/i915_irq.c +++ b/drivers/gpu/drm/i915/i915_irq.c | |||
@@ -1031,6 +1031,7 @@ static void i915_record_ring_state(struct drm_device *dev, | |||
1031 | error->instdone[ring->id] = I915_READ(INSTDONE); | 1031 | error->instdone[ring->id] = I915_READ(INSTDONE); |
1032 | } | 1032 | } |
1033 | 1033 | ||
1034 | error->waiting[ring->id] = waitqueue_active(&ring->irq_queue); | ||
1034 | error->instpm[ring->id] = I915_READ(RING_INSTPM(ring->mmio_base)); | 1035 | error->instpm[ring->id] = I915_READ(RING_INSTPM(ring->mmio_base)); |
1035 | error->seqno[ring->id] = ring->get_seqno(ring); | 1036 | error->seqno[ring->id] = ring->get_seqno(ring); |
1036 | error->acthd[ring->id] = intel_ring_get_active_head(ring); | 1037 | error->acthd[ring->id] = intel_ring_get_active_head(ring); |
@@ -1708,14 +1709,17 @@ ring_last_seqno(struct intel_ring_buffer *ring) | |||
1708 | 1709 | ||
1709 | static bool i915_hangcheck_ring_idle(struct intel_ring_buffer *ring, bool *err) | 1710 | static bool i915_hangcheck_ring_idle(struct intel_ring_buffer *ring, bool *err) |
1710 | { | 1711 | { |
1712 | /* We don't check whether the ring even exists before calling this | ||
1713 | * function. Hence check whether it's initialized. */ | ||
1714 | if (ring->obj == NULL) | ||
1715 | return true; | ||
1716 | |||
1711 | if (list_empty(&ring->request_list) || | 1717 | if (list_empty(&ring->request_list) || |
1712 | i915_seqno_passed(ring->get_seqno(ring), ring_last_seqno(ring))) { | 1718 | i915_seqno_passed(ring->get_seqno(ring), ring_last_seqno(ring))) { |
1713 | /* Issue a wake-up to catch stuck h/w. */ | 1719 | /* Issue a wake-up to catch stuck h/w. */ |
1714 | if (ring->waiting_seqno && waitqueue_active(&ring->irq_queue)) { | 1720 | if (waitqueue_active(&ring->irq_queue)) { |
1715 | DRM_ERROR("Hangcheck timer elapsed... %s idle [waiting on %d, at %d], missed IRQ?\n", | 1721 | DRM_ERROR("Hangcheck timer elapsed... %s idle\n", |
1716 | ring->name, | 1722 | ring->name); |
1717 | ring->waiting_seqno, | ||
1718 | ring->get_seqno(ring)); | ||
1719 | wake_up_all(&ring->irq_queue); | 1723 | wake_up_all(&ring->irq_queue); |
1720 | *err = true; | 1724 | *err = true; |
1721 | } | 1725 | } |
diff --git a/drivers/gpu/drm/i915/intel_ringbuffer.h b/drivers/gpu/drm/i915/intel_ringbuffer.h index e0b25bb2fb5d..d3bf2595589f 100644 --- a/drivers/gpu/drm/i915/intel_ringbuffer.h +++ b/drivers/gpu/drm/i915/intel_ringbuffer.h | |||
@@ -60,7 +60,6 @@ struct intel_ring_buffer { | |||
60 | u32 irq_enable_mask; /* bitmask to enable ring interrupt */ | 60 | u32 irq_enable_mask; /* bitmask to enable ring interrupt */ |
61 | u32 irq_seqno; /* last seq seem at irq time */ | 61 | u32 irq_seqno; /* last seq seem at irq time */ |
62 | u32 trace_irq_seqno; | 62 | u32 trace_irq_seqno; |
63 | u32 waiting_seqno; | ||
64 | u32 sync_seqno[I915_NUM_RINGS-1]; | 63 | u32 sync_seqno[I915_NUM_RINGS-1]; |
65 | bool __must_check (*irq_get)(struct intel_ring_buffer *ring); | 64 | bool __must_check (*irq_get)(struct intel_ring_buffer *ring); |
66 | void (*irq_put)(struct intel_ring_buffer *ring); | 65 | void (*irq_put)(struct intel_ring_buffer *ring); |