Commit be998e2e authored by Ben Widawsky's avatar Ben Widawsky Committed by Daniel Vetter

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: default avatarBen Widawsky <ben@bwidawsk.net>
[danvet: ier is a 16 bit reg on gen2!]
Signed-off-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
parent b2da9fe5
...@@ -712,6 +712,7 @@ static int i915_error_state(struct seq_file *m, void *unused) ...@@ -712,6 +712,7 @@ static int i915_error_state(struct seq_file *m, void *unused)
error->time.tv_usec); error->time.tv_usec);
seq_printf(m, "PCI ID: 0x%04x\n", dev->pci_device); seq_printf(m, "PCI ID: 0x%04x\n", dev->pci_device);
seq_printf(m, "EIR: 0x%08x\n", error->eir); seq_printf(m, "EIR: 0x%08x\n", error->eir);
seq_printf(m, "IER: 0x%08x\n", error->ier);
seq_printf(m, "PGTBL_ER: 0x%08x\n", error->pgtbl_er); seq_printf(m, "PGTBL_ER: 0x%08x\n", error->pgtbl_er);
for (i = 0; i < dev_priv->num_fence_regs; i++) for (i = 0; i < dev_priv->num_fence_regs; i++)
......
...@@ -173,6 +173,7 @@ struct intel_display_error_state; ...@@ -173,6 +173,7 @@ struct intel_display_error_state;
struct drm_i915_error_state { struct drm_i915_error_state {
u32 eir; u32 eir;
u32 pgtbl_er; u32 pgtbl_er;
u32 ier;
u32 pipestat[I915_MAX_PIPES]; u32 pipestat[I915_MAX_PIPES];
u32 tail[I915_NUM_RINGS]; u32 tail[I915_NUM_RINGS];
u32 head[I915_NUM_RINGS]; u32 head[I915_NUM_RINGS];
......
...@@ -1828,7 +1828,6 @@ i915_wait_request(struct intel_ring_buffer *ring, ...@@ -1828,7 +1828,6 @@ i915_wait_request(struct intel_ring_buffer *ring,
uint32_t seqno) uint32_t seqno)
{ {
drm_i915_private_t *dev_priv = ring->dev->dev_private; drm_i915_private_t *dev_priv = ring->dev->dev_private;
u32 ier;
int ret = 0; int ret = 0;
BUG_ON(seqno == 0); BUG_ON(seqno == 0);
...@@ -1863,19 +1862,6 @@ i915_wait_request(struct intel_ring_buffer *ring, ...@@ -1863,19 +1862,6 @@ i915_wait_request(struct intel_ring_buffer *ring,
} }
if (!i915_seqno_passed(ring->get_seqno(ring), seqno)) { if (!i915_seqno_passed(ring->get_seqno(ring), seqno)) {
if (HAS_PCH_SPLIT(ring->dev))
ier = I915_READ(DEIER) | I915_READ(GTIER);
else if (IS_VALLEYVIEW(ring->dev))
ier = I915_READ(GTIER) | I915_READ(VLV_IER);
else
ier = I915_READ(IER);
if (!ier) {
DRM_ERROR("something (likely vbetool) disabled "
"interrupts, re-enabling\n");
ring->dev->driver->irq_preinstall(ring->dev);
ring->dev->driver->irq_postinstall(ring->dev);
}
trace_i915_gem_request_wait_begin(ring, seqno); trace_i915_gem_request_wait_begin(ring, seqno);
ring->waiting_seqno = seqno; ring->waiting_seqno = seqno;
......
...@@ -1122,6 +1122,16 @@ static void i915_capture_error_state(struct drm_device *dev) ...@@ -1122,6 +1122,16 @@ static void i915_capture_error_state(struct drm_device *dev)
error->eir = I915_READ(EIR); error->eir = I915_READ(EIR);
error->pgtbl_er = I915_READ(PGTBL_ER); error->pgtbl_er = I915_READ(PGTBL_ER);
if (HAS_PCH_SPLIT(dev))
error->ier = I915_READ(DEIER) | I915_READ(GTIER);
else if (IS_VALLEYVIEW(dev))
error->ier = I915_READ(GTIER) | I915_READ(VLV_IER);
else if (IS_GEN2(dev))
error->ier = I915_READ16(IER);
else
error->ier = I915_READ(IER);
for_each_pipe(pipe) for_each_pipe(pipe)
error->pipestat[pipe] = I915_READ(PIPESTAT(pipe)); error->pipestat[pipe] = I915_READ(PIPESTAT(pipe));
......
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