diff options
author | Daniel Vetter <daniel.vetter@ffwll.ch> | 2013-11-07 05:05:46 -0500 |
---|---|---|
committer | Daniel Vetter <daniel.vetter@ffwll.ch> | 2013-11-08 12:10:13 -0500 |
commit | 38d83c96a3f67ba2cfb7454f310791a3c58e71ad (patch) | |
tree | 446e13738c1949e6a113a9288ec447213f59c3df /drivers/gpu | |
parent | 7167d7c677ef066c56df276dc35b044c4840151a (diff) |
drm/i915: Wire up cpu fifo underrun reporting support for bdw
HW engineers have listened and given us again a real interrupt with
masking and status regs. Yay!
For consistency with other platforms call the #define FIFO_UNDERRUN.
Eventually we also might need to have some enable/disable functions
for bdw display interrupts, but for now open-coding seems to be good
enough.
Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Diffstat (limited to 'drivers/gpu')
-rw-r--r-- | drivers/gpu/drm/i915/i915_irq.c | 25 | ||||
-rw-r--r-- | drivers/gpu/drm/i915/i915_reg.h | 2 |
2 files changed, 26 insertions, 1 deletions
diff --git a/drivers/gpu/drm/i915/i915_irq.c b/drivers/gpu/drm/i915/i915_irq.c index 9ea0df2c7109..bf71e352fd74 100644 --- a/drivers/gpu/drm/i915/i915_irq.c +++ b/drivers/gpu/drm/i915/i915_irq.c | |||
@@ -270,6 +270,21 @@ static void ivybridge_set_fifo_underrun_reporting(struct drm_device *dev, | |||
270 | } | 270 | } |
271 | } | 271 | } |
272 | 272 | ||
273 | static void broadwell_set_fifo_underrun_reporting(struct drm_device *dev, | ||
274 | enum pipe pipe, bool enable) | ||
275 | { | ||
276 | struct drm_i915_private *dev_priv = dev->dev_private; | ||
277 | |||
278 | assert_spin_locked(&dev_priv->irq_lock); | ||
279 | |||
280 | if (enable) | ||
281 | dev_priv->de_irq_mask[pipe] &= ~GEN8_PIPE_FIFO_UNDERRUN; | ||
282 | else | ||
283 | dev_priv->de_irq_mask[pipe] |= GEN8_PIPE_FIFO_UNDERRUN; | ||
284 | I915_WRITE(GEN8_DE_PIPE_IMR(pipe), dev_priv->de_irq_mask[pipe]); | ||
285 | POSTING_READ(GEN8_DE_PIPE_IMR(pipe)); | ||
286 | } | ||
287 | |||
273 | /** | 288 | /** |
274 | * ibx_display_interrupt_update - update SDEIMR | 289 | * ibx_display_interrupt_update - update SDEIMR |
275 | * @dev_priv: driver private | 290 | * @dev_priv: driver private |
@@ -382,6 +397,8 @@ bool intel_set_cpu_fifo_underrun_reporting(struct drm_device *dev, | |||
382 | ironlake_set_fifo_underrun_reporting(dev, pipe, enable); | 397 | ironlake_set_fifo_underrun_reporting(dev, pipe, enable); |
383 | else if (IS_GEN7(dev)) | 398 | else if (IS_GEN7(dev)) |
384 | ivybridge_set_fifo_underrun_reporting(dev, pipe, enable); | 399 | ivybridge_set_fifo_underrun_reporting(dev, pipe, enable); |
400 | else if (IS_GEN8(dev)) | ||
401 | broadwell_set_fifo_underrun_reporting(dev, pipe, enable); | ||
385 | 402 | ||
386 | done: | 403 | done: |
387 | spin_unlock_irqrestore(&dev_priv->irq_lock, flags); | 404 | spin_unlock_irqrestore(&dev_priv->irq_lock, flags); |
@@ -1811,6 +1828,13 @@ static irqreturn_t gen8_irq_handler(int irq, void *arg) | |||
1811 | if (pipe_iir & GEN8_PIPE_CDCLK_CRC_DONE) | 1828 | if (pipe_iir & GEN8_PIPE_CDCLK_CRC_DONE) |
1812 | hsw_pipe_crc_irq_handler(dev, pipe); | 1829 | hsw_pipe_crc_irq_handler(dev, pipe); |
1813 | 1830 | ||
1831 | if (pipe_iir & GEN8_PIPE_FIFO_UNDERRUN) { | ||
1832 | if (intel_set_cpu_fifo_underrun_reporting(dev, pipe, | ||
1833 | false)) | ||
1834 | DRM_DEBUG_DRIVER("Pipe %c FIFO underrun\n", | ||
1835 | pipe_name(pipe)); | ||
1836 | } | ||
1837 | |||
1814 | if (pipe_iir & GEN8_DE_PIPE_IRQ_FAULT_ERRORS) { | 1838 | if (pipe_iir & GEN8_DE_PIPE_IRQ_FAULT_ERRORS) { |
1815 | DRM_ERROR("Fault errors on pipe %c\n: 0x%08x", | 1839 | DRM_ERROR("Fault errors on pipe %c\n: 0x%08x", |
1816 | pipe_name(pipe), | 1840 | pipe_name(pipe), |
@@ -2896,6 +2920,7 @@ static void gen8_de_irq_postinstall(struct drm_i915_private *dev_priv) | |||
2896 | uint32_t de_pipe_enables = GEN8_PIPE_FLIP_DONE | | 2920 | uint32_t de_pipe_enables = GEN8_PIPE_FLIP_DONE | |
2897 | GEN8_PIPE_VBLANK | | 2921 | GEN8_PIPE_VBLANK | |
2898 | GEN8_PIPE_CDCLK_CRC_DONE | | 2922 | GEN8_PIPE_CDCLK_CRC_DONE | |
2923 | GEN8_PIPE_FIFO_UNDERRUN | | ||
2899 | GEN8_DE_PIPE_IRQ_FAULT_ERRORS; | 2924 | GEN8_DE_PIPE_IRQ_FAULT_ERRORS; |
2900 | int pipe; | 2925 | int pipe; |
2901 | dev_priv->de_irq_mask[PIPE_A] = ~de_pipe_enables; | 2926 | dev_priv->de_irq_mask[PIPE_A] = ~de_pipe_enables; |
diff --git a/drivers/gpu/drm/i915/i915_reg.h b/drivers/gpu/drm/i915/i915_reg.h index fe8cb4cc0296..40fe67b539d4 100644 --- a/drivers/gpu/drm/i915/i915_reg.h +++ b/drivers/gpu/drm/i915/i915_reg.h | |||
@@ -4053,7 +4053,7 @@ | |||
4053 | #define GEN8_DE_PIPE_IMR(pipe) (0x44404 + (0x10 * (pipe))) | 4053 | #define GEN8_DE_PIPE_IMR(pipe) (0x44404 + (0x10 * (pipe))) |
4054 | #define GEN8_DE_PIPE_IIR(pipe) (0x44408 + (0x10 * (pipe))) | 4054 | #define GEN8_DE_PIPE_IIR(pipe) (0x44408 + (0x10 * (pipe))) |
4055 | #define GEN8_DE_PIPE_IER(pipe) (0x4440c + (0x10 * (pipe))) | 4055 | #define GEN8_DE_PIPE_IER(pipe) (0x4440c + (0x10 * (pipe))) |
4056 | #define GEN8_PIPE_UNDERRUN (1 << 31) | 4056 | #define GEN8_PIPE_FIFO_UNDERRUN (1 << 31) |
4057 | #define GEN8_PIPE_CDCLK_CRC_ERROR (1 << 29) | 4057 | #define GEN8_PIPE_CDCLK_CRC_ERROR (1 << 29) |
4058 | #define GEN8_PIPE_CDCLK_CRC_DONE (1 << 28) | 4058 | #define GEN8_PIPE_CDCLK_CRC_DONE (1 << 28) |
4059 | #define GEN8_PIPE_CURSOR_FAULT (1 << 10) | 4059 | #define GEN8_PIPE_CURSOR_FAULT (1 << 10) |