diff options
author | Ben Widawsky <ben@bwidawsk.net> | 2012-04-26 19:03:00 -0400 |
---|---|---|
committer | Daniel Vetter <daniel.vetter@ffwll.ch> | 2012-05-03 05:18:21 -0400 |
commit | be998e2e3945d97ffad3c800ef52fd487868b3e9 (patch) | |
tree | 7a8fe85e1220512b9731438ee917d38f8e0a2b20 /drivers | |
parent | b2da9fe5d5994a104bbae154590070d698279919 (diff) |
drm/i915: move vbetool invoked ier stuff
This extra bit of interrupt enabling code doesn't belong in the wait
seqno function. If anything we should pull it out to a helper so the
throttle code can also use it. The history is a bit vague, but I am
going to attempt to just dump it, unless someone can argue otherwise.
Removing this allows for a shared lock free wait seqno function. To keep
tabs on this issue though, the IER value is stored on error capture
(recommended by Chris Wilson)
v2: fixed typo EIR->IER (Ben)
Fix some white space (Ben)
Move IER capture to globally instead of per ring (Ben)
Signed-off-by: Ben Widawsky <ben@bwidawsk.net>
[danvet: ier is a 16 bit reg on gen2!]
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/gpu/drm/i915/i915_debugfs.c | 1 | ||||
-rw-r--r-- | drivers/gpu/drm/i915/i915_drv.h | 1 | ||||
-rw-r--r-- | drivers/gpu/drm/i915/i915_gem.c | 14 | ||||
-rw-r--r-- | drivers/gpu/drm/i915/i915_irq.c | 10 |
4 files changed, 12 insertions, 14 deletions
diff --git a/drivers/gpu/drm/i915/i915_debugfs.c b/drivers/gpu/drm/i915/i915_debugfs.c index 120db4687a2f..8ed034233e38 100644 --- a/drivers/gpu/drm/i915/i915_debugfs.c +++ b/drivers/gpu/drm/i915/i915_debugfs.c | |||
@@ -712,6 +712,7 @@ static int i915_error_state(struct seq_file *m, void *unused) | |||
712 | error->time.tv_usec); | 712 | error->time.tv_usec); |
713 | seq_printf(m, "PCI ID: 0x%04x\n", dev->pci_device); | 713 | seq_printf(m, "PCI ID: 0x%04x\n", dev->pci_device); |
714 | seq_printf(m, "EIR: 0x%08x\n", error->eir); | 714 | seq_printf(m, "EIR: 0x%08x\n", error->eir); |
715 | seq_printf(m, "IER: 0x%08x\n", error->ier); | ||
715 | seq_printf(m, "PGTBL_ER: 0x%08x\n", error->pgtbl_er); | 716 | seq_printf(m, "PGTBL_ER: 0x%08x\n", error->pgtbl_er); |
716 | 717 | ||
717 | for (i = 0; i < dev_priv->num_fence_regs; i++) | 718 | for (i = 0; i < dev_priv->num_fence_regs; i++) |
diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h index 2113a1ab9625..e719522cb40b 100644 --- a/drivers/gpu/drm/i915/i915_drv.h +++ b/drivers/gpu/drm/i915/i915_drv.h | |||
@@ -173,6 +173,7 @@ struct intel_display_error_state; | |||
173 | struct drm_i915_error_state { | 173 | struct drm_i915_error_state { |
174 | u32 eir; | 174 | u32 eir; |
175 | u32 pgtbl_er; | 175 | u32 pgtbl_er; |
176 | u32 ier; | ||
176 | u32 pipestat[I915_MAX_PIPES]; | 177 | u32 pipestat[I915_MAX_PIPES]; |
177 | u32 tail[I915_NUM_RINGS]; | 178 | u32 tail[I915_NUM_RINGS]; |
178 | u32 head[I915_NUM_RINGS]; | 179 | u32 head[I915_NUM_RINGS]; |
diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c index e378204970fd..f194603140c0 100644 --- a/drivers/gpu/drm/i915/i915_gem.c +++ b/drivers/gpu/drm/i915/i915_gem.c | |||
@@ -1828,7 +1828,6 @@ i915_wait_request(struct intel_ring_buffer *ring, | |||
1828 | uint32_t seqno) | 1828 | uint32_t seqno) |
1829 | { | 1829 | { |
1830 | drm_i915_private_t *dev_priv = ring->dev->dev_private; | 1830 | drm_i915_private_t *dev_priv = ring->dev->dev_private; |
1831 | u32 ier; | ||
1832 | int ret = 0; | 1831 | int ret = 0; |
1833 | 1832 | ||
1834 | BUG_ON(seqno == 0); | 1833 | BUG_ON(seqno == 0); |
@@ -1863,19 +1862,6 @@ i915_wait_request(struct intel_ring_buffer *ring, | |||
1863 | } | 1862 | } |
1864 | 1863 | ||
1865 | if (!i915_seqno_passed(ring->get_seqno(ring), seqno)) { | 1864 | if (!i915_seqno_passed(ring->get_seqno(ring), seqno)) { |
1866 | if (HAS_PCH_SPLIT(ring->dev)) | ||
1867 | ier = I915_READ(DEIER) | I915_READ(GTIER); | ||
1868 | else if (IS_VALLEYVIEW(ring->dev)) | ||
1869 | ier = I915_READ(GTIER) | I915_READ(VLV_IER); | ||
1870 | else | ||
1871 | ier = I915_READ(IER); | ||
1872 | if (!ier) { | ||
1873 | DRM_ERROR("something (likely vbetool) disabled " | ||
1874 | "interrupts, re-enabling\n"); | ||
1875 | ring->dev->driver->irq_preinstall(ring->dev); | ||
1876 | ring->dev->driver->irq_postinstall(ring->dev); | ||
1877 | } | ||
1878 | |||
1879 | trace_i915_gem_request_wait_begin(ring, seqno); | 1865 | trace_i915_gem_request_wait_begin(ring, seqno); |
1880 | 1866 | ||
1881 | ring->waiting_seqno = seqno; | 1867 | ring->waiting_seqno = seqno; |
diff --git a/drivers/gpu/drm/i915/i915_irq.c b/drivers/gpu/drm/i915/i915_irq.c index 5c360eeb371b..0acadc5e02d2 100644 --- a/drivers/gpu/drm/i915/i915_irq.c +++ b/drivers/gpu/drm/i915/i915_irq.c | |||
@@ -1122,6 +1122,16 @@ static void i915_capture_error_state(struct drm_device *dev) | |||
1122 | 1122 | ||
1123 | error->eir = I915_READ(EIR); | 1123 | error->eir = I915_READ(EIR); |
1124 | error->pgtbl_er = I915_READ(PGTBL_ER); | 1124 | error->pgtbl_er = I915_READ(PGTBL_ER); |
1125 | |||
1126 | if (HAS_PCH_SPLIT(dev)) | ||
1127 | error->ier = I915_READ(DEIER) | I915_READ(GTIER); | ||
1128 | else if (IS_VALLEYVIEW(dev)) | ||
1129 | error->ier = I915_READ(GTIER) | I915_READ(VLV_IER); | ||
1130 | else if (IS_GEN2(dev)) | ||
1131 | error->ier = I915_READ16(IER); | ||
1132 | else | ||
1133 | error->ier = I915_READ(IER); | ||
1134 | |||
1125 | for_each_pipe(pipe) | 1135 | for_each_pipe(pipe) |
1126 | error->pipestat[pipe] = I915_READ(PIPESTAT(pipe)); | 1136 | error->pipestat[pipe] = I915_READ(PIPESTAT(pipe)); |
1127 | 1137 | ||