aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/gpu/drm/i915/i915_debugfs.c2
-rw-r--r--drivers/gpu/drm/i915/i915_drv.h2
-rw-r--r--drivers/gpu/drm/i915/i915_gem.c2
-rw-r--r--drivers/gpu/drm/i915/i915_irq.c16
-rw-r--r--drivers/gpu/drm/i915/intel_display.c2
-rw-r--r--drivers/gpu/drm/i915/intel_drv.h10
-rw-r--r--drivers/gpu/drm/i915/intel_pm.c6
7 files changed, 24 insertions, 16 deletions
diff --git a/drivers/gpu/drm/i915/i915_debugfs.c b/drivers/gpu/drm/i915/i915_debugfs.c
index fc39610fe12d..7e72800c5d17 100644
--- a/drivers/gpu/drm/i915/i915_debugfs.c
+++ b/drivers/gpu/drm/i915/i915_debugfs.c
@@ -1996,7 +1996,7 @@ static int i915_pc8_status(struct seq_file *m, void *unused)
1996 1996
1997 seq_printf(m, "GPU idle: %s\n", yesno(!dev_priv->mm.busy)); 1997 seq_printf(m, "GPU idle: %s\n", yesno(!dev_priv->mm.busy));
1998 seq_printf(m, "IRQs disabled: %s\n", 1998 seq_printf(m, "IRQs disabled: %s\n",
1999 yesno(dev_priv->pm.irqs_disabled)); 1999 yesno(!intel_irqs_enabled(dev_priv)));
2000 2000
2001 return 0; 2001 return 0;
2002} 2002}
diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h
index 7f4f2b745925..8b781f8ad3a9 100644
--- a/drivers/gpu/drm/i915/i915_drv.h
+++ b/drivers/gpu/drm/i915/i915_drv.h
@@ -1339,7 +1339,7 @@ struct ilk_wm_values {
1339 */ 1339 */
1340struct i915_runtime_pm { 1340struct i915_runtime_pm {
1341 bool suspended; 1341 bool suspended;
1342 bool irqs_disabled; 1342 bool _irqs_disabled;
1343}; 1343};
1344 1344
1345enum intel_pipe_crc_source { 1345enum intel_pipe_crc_source {
diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c
index ef047bce008d..ed0b5fc4b6b0 100644
--- a/drivers/gpu/drm/i915/i915_gem.c
+++ b/drivers/gpu/drm/i915/i915_gem.c
@@ -1161,7 +1161,7 @@ static int __wait_seqno(struct intel_engine_cs *ring, u32 seqno,
1161 unsigned long timeout_expire; 1161 unsigned long timeout_expire;
1162 int ret; 1162 int ret;
1163 1163
1164 WARN(dev_priv->pm.irqs_disabled, "IRQs disabled\n"); 1164 WARN(!intel_irqs_enabled(dev_priv), "IRQs disabled");
1165 1165
1166 if (i915_seqno_passed(ring->get_seqno(ring, true), seqno)) 1166 if (i915_seqno_passed(ring->get_seqno(ring, true), seqno))
1167 return 0; 1167 return 0;
diff --git a/drivers/gpu/drm/i915/i915_irq.c b/drivers/gpu/drm/i915/i915_irq.c
index 3ae33e7e9d09..6774f88479ec 100644
--- a/drivers/gpu/drm/i915/i915_irq.c
+++ b/drivers/gpu/drm/i915/i915_irq.c
@@ -136,7 +136,7 @@ ironlake_enable_display_irq(struct drm_i915_private *dev_priv, u32 mask)
136{ 136{
137 assert_spin_locked(&dev_priv->irq_lock); 137 assert_spin_locked(&dev_priv->irq_lock);
138 138
139 if (WARN_ON(dev_priv->pm.irqs_disabled)) 139 if (WARN_ON(!intel_irqs_enabled(dev_priv)))
140 return; 140 return;
141 141
142 if ((dev_priv->irq_mask & mask) != 0) { 142 if ((dev_priv->irq_mask & mask) != 0) {
@@ -151,7 +151,7 @@ ironlake_disable_display_irq(struct drm_i915_private *dev_priv, u32 mask)
151{ 151{
152 assert_spin_locked(&dev_priv->irq_lock); 152 assert_spin_locked(&dev_priv->irq_lock);
153 153
154 if (dev_priv->pm.irqs_disabled) 154 if (!intel_irqs_enabled(dev_priv))
155 return; 155 return;
156 156
157 if ((dev_priv->irq_mask & mask) != mask) { 157 if ((dev_priv->irq_mask & mask) != mask) {
@@ -173,7 +173,7 @@ static void ilk_update_gt_irq(struct drm_i915_private *dev_priv,
173{ 173{
174 assert_spin_locked(&dev_priv->irq_lock); 174 assert_spin_locked(&dev_priv->irq_lock);
175 175
176 if (WARN_ON(dev_priv->pm.irqs_disabled)) 176 if (WARN_ON(!intel_irqs_enabled(dev_priv)))
177 return; 177 return;
178 178
179 dev_priv->gt_irq_mask &= ~interrupt_mask; 179 dev_priv->gt_irq_mask &= ~interrupt_mask;
@@ -206,7 +206,7 @@ static void snb_update_pm_irq(struct drm_i915_private *dev_priv,
206 206
207 assert_spin_locked(&dev_priv->irq_lock); 207 assert_spin_locked(&dev_priv->irq_lock);
208 208
209 if (WARN_ON(dev_priv->pm.irqs_disabled)) 209 if (WARN_ON(!intel_irqs_enabled(dev_priv)))
210 return; 210 return;
211 211
212 new_val = dev_priv->pm_irq_mask; 212 new_val = dev_priv->pm_irq_mask;
@@ -264,7 +264,7 @@ static void bdw_update_pm_irq(struct drm_i915_private *dev_priv,
264 264
265 assert_spin_locked(&dev_priv->irq_lock); 265 assert_spin_locked(&dev_priv->irq_lock);
266 266
267 if (WARN_ON(dev_priv->pm.irqs_disabled)) 267 if (WARN_ON(!intel_irqs_enabled(dev_priv)))
268 return; 268 return;
269 269
270 new_val = dev_priv->pm_irq_mask; 270 new_val = dev_priv->pm_irq_mask;
@@ -420,7 +420,7 @@ static void ibx_display_interrupt_update(struct drm_i915_private *dev_priv,
420 420
421 assert_spin_locked(&dev_priv->irq_lock); 421 assert_spin_locked(&dev_priv->irq_lock);
422 422
423 if (WARN_ON(dev_priv->pm.irqs_disabled)) 423 if (WARN_ON(!intel_irqs_enabled(dev_priv)))
424 return; 424 return;
425 425
426 I915_WRITE(SDEIMR, sdeimr); 426 I915_WRITE(SDEIMR, sdeimr);
@@ -4774,7 +4774,7 @@ void intel_runtime_pm_disable_interrupts(struct drm_device *dev)
4774 struct drm_i915_private *dev_priv = dev->dev_private; 4774 struct drm_i915_private *dev_priv = dev->dev_private;
4775 4775
4776 dev->driver->irq_uninstall(dev); 4776 dev->driver->irq_uninstall(dev);
4777 dev_priv->pm.irqs_disabled = true; 4777 dev_priv->pm._irqs_disabled = true;
4778} 4778}
4779 4779
4780/* Restore interrupts so we can recover from runtime PM. */ 4780/* Restore interrupts so we can recover from runtime PM. */
@@ -4782,7 +4782,7 @@ void intel_runtime_pm_restore_interrupts(struct drm_device *dev)
4782{ 4782{
4783 struct drm_i915_private *dev_priv = dev->dev_private; 4783 struct drm_i915_private *dev_priv = dev->dev_private;
4784 4784
4785 dev_priv->pm.irqs_disabled = false; 4785 dev_priv->pm._irqs_disabled = false;
4786 dev->driver->irq_preinstall(dev); 4786 dev->driver->irq_preinstall(dev);
4787 dev->driver->irq_postinstall(dev); 4787 dev->driver->irq_postinstall(dev);
4788} 4788}
diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
index 06566d6c328f..1cdd1c16d983 100644
--- a/drivers/gpu/drm/i915/intel_display.c
+++ b/drivers/gpu/drm/i915/intel_display.c
@@ -7341,7 +7341,7 @@ static void assert_can_disable_lcpll(struct drm_i915_private *dev_priv)
7341 * gen-specific and since we only disable LCPLL after we fully disable 7341 * gen-specific and since we only disable LCPLL after we fully disable
7342 * the interrupts, the check below should be enough. 7342 * the interrupts, the check below should be enough.
7343 */ 7343 */
7344 WARN(!dev_priv->pm.irqs_disabled, "IRQs enabled\n"); 7344 WARN(intel_irqs_enabled(dev_priv), "IRQs enabled\n");
7345} 7345}
7346 7346
7347static uint32_t hsw_read_dcomp(struct drm_i915_private *dev_priv) 7347static uint32_t hsw_read_dcomp(struct drm_i915_private *dev_priv)
diff --git a/drivers/gpu/drm/i915/intel_drv.h b/drivers/gpu/drm/i915/intel_drv.h
index bf415df11389..8fc68c783228 100644
--- a/drivers/gpu/drm/i915/intel_drv.h
+++ b/drivers/gpu/drm/i915/intel_drv.h
@@ -691,11 +691,19 @@ void gen8_enable_pm_irq(struct drm_i915_private *dev_priv, uint32_t mask);
691void gen8_disable_pm_irq(struct drm_i915_private *dev_priv, uint32_t mask); 691void gen8_disable_pm_irq(struct drm_i915_private *dev_priv, uint32_t mask);
692void intel_runtime_pm_disable_interrupts(struct drm_device *dev); 692void intel_runtime_pm_disable_interrupts(struct drm_device *dev);
693void intel_runtime_pm_restore_interrupts(struct drm_device *dev); 693void intel_runtime_pm_restore_interrupts(struct drm_device *dev);
694static inline bool intel_irqs_enabled(struct drm_i915_private *dev_priv)
695{
696 /*
697 * We only use drm_irq_uninstall() at unload and VT switch, so
698 * this is the only thing we need to check.
699 */
700 return !dev_priv->pm._irqs_disabled;
701}
702
694int intel_get_crtc_scanline(struct intel_crtc *crtc); 703int intel_get_crtc_scanline(struct intel_crtc *crtc);
695void i9xx_check_fifo_underruns(struct drm_device *dev); 704void i9xx_check_fifo_underruns(struct drm_device *dev);
696void gen8_irq_power_well_post_enable(struct drm_i915_private *dev_priv); 705void gen8_irq_power_well_post_enable(struct drm_i915_private *dev_priv);
697 706
698
699/* intel_crt.c */ 707/* intel_crt.c */
700void intel_crt_init(struct drm_device *dev); 708void intel_crt_init(struct drm_device *dev);
701 709
diff --git a/drivers/gpu/drm/i915/intel_pm.c b/drivers/gpu/drm/i915/intel_pm.c
index d23ba37e6ab9..3f88f29a98c0 100644
--- a/drivers/gpu/drm/i915/intel_pm.c
+++ b/drivers/gpu/drm/i915/intel_pm.c
@@ -4976,7 +4976,7 @@ void intel_suspend_gt_powersave(struct drm_device *dev)
4976 struct drm_i915_private *dev_priv = dev->dev_private; 4976 struct drm_i915_private *dev_priv = dev->dev_private;
4977 4977
4978 /* Interrupts should be disabled already to avoid re-arming. */ 4978 /* Interrupts should be disabled already to avoid re-arming. */
4979 WARN_ON(dev->irq_enabled && !dev_priv->pm.irqs_disabled); 4979 WARN_ON(intel_irqs_enabled(dev_priv));
4980 4980
4981 flush_delayed_work(&dev_priv->rps.delayed_resume_work); 4981 flush_delayed_work(&dev_priv->rps.delayed_resume_work);
4982 4982
@@ -4991,7 +4991,7 @@ void intel_disable_gt_powersave(struct drm_device *dev)
4991 struct drm_i915_private *dev_priv = dev->dev_private; 4991 struct drm_i915_private *dev_priv = dev->dev_private;
4992 4992
4993 /* Interrupts should be disabled already to avoid re-arming. */ 4993 /* Interrupts should be disabled already to avoid re-arming. */
4994 WARN_ON(dev->irq_enabled && !dev_priv->pm.irqs_disabled); 4994 WARN_ON(intel_irqs_enabled(dev_priv));
4995 4995
4996 if (IS_IRONLAKE_M(dev)) { 4996 if (IS_IRONLAKE_M(dev)) {
4997 ironlake_disable_drps(dev); 4997 ironlake_disable_drps(dev);
@@ -7069,5 +7069,5 @@ void intel_pm_setup(struct drm_device *dev)
7069 intel_gen6_powersave_work); 7069 intel_gen6_powersave_work);
7070 7070
7071 dev_priv->pm.suspended = false; 7071 dev_priv->pm.suspended = false;
7072 dev_priv->pm.irqs_disabled = false; 7072 dev_priv->pm._irqs_disabled = false;
7073} 7073}