aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2011-02-05 05:08:21 -0500
committerChris Wilson <chris@chris-wilson.co.uk>2011-03-01 12:33:38 -0500
commit8692d00e996ed2a6560702623e5cb646da0f9767 (patch)
tree43d541c3ec2c06473c7c607965d256251b349513
parent60c8bdf64a80ebb0132172ea97bd54d7c7d36611 (diff)
drm/i915: Replace vblank PM QoS with "Interrupt-Based AGPBUSY#"
I stumbled over this magic bit in the gen3 INSTPM: Bit11 Interrupt-Based AGPBUSY# Enable: ‘0’ = Pending GMCH interrupts will not cause AGPBUSY# assertion. ‘1’ = Pending GMCH interrupts will cause AGPBUSY# assertion and hence can cause the CPU to exit C3. There is no suppression of cacheable writes. Note that in either case in C3 the interrupts are not lost. They will be forwarded to the ICH when the GMCH is out of C3. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Tested-by: Daniel Vetter <daniel.vetter@ffwll.ch> Cc: stable@kernel.org
-rw-r--r--drivers/gpu/drm/i915/i915_irq.c9
-rw-r--r--drivers/gpu/drm/i915/i915_reg.h5
2 files changed, 13 insertions, 1 deletions
diff --git a/drivers/gpu/drm/i915/i915_irq.c b/drivers/gpu/drm/i915/i915_irq.c
index 39d7cd3bcfc7..188b497e5076 100644
--- a/drivers/gpu/drm/i915/i915_irq.c
+++ b/drivers/gpu/drm/i915/i915_irq.c
@@ -1353,7 +1353,12 @@ int i915_enable_vblank(struct drm_device *dev, int pipe)
1353 else 1353 else
1354 i915_enable_pipestat(dev_priv, pipe, 1354 i915_enable_pipestat(dev_priv, pipe,
1355 PIPE_VBLANK_INTERRUPT_ENABLE); 1355 PIPE_VBLANK_INTERRUPT_ENABLE);
1356
1357 /* maintain vblank delivery even in deep C-states */
1358 if (dev_priv->info->gen == 3)
1359 I915_WRITE(INSTPM, INSTPM_AGPBUSY_DIS << 16);
1356 spin_unlock_irqrestore(&dev_priv->irq_lock, irqflags); 1360 spin_unlock_irqrestore(&dev_priv->irq_lock, irqflags);
1361
1357 return 0; 1362 return 0;
1358} 1363}
1359 1364
@@ -1366,6 +1371,10 @@ void i915_disable_vblank(struct drm_device *dev, int pipe)
1366 unsigned long irqflags; 1371 unsigned long irqflags;
1367 1372
1368 spin_lock_irqsave(&dev_priv->irq_lock, irqflags); 1373 spin_lock_irqsave(&dev_priv->irq_lock, irqflags);
1374 if (dev_priv->info->gen == 3)
1375 I915_WRITE(INSTPM,
1376 INSTPM_AGPBUSY_DIS << 16 | INSTPM_AGPBUSY_DIS);
1377
1369 if (HAS_PCH_SPLIT(dev)) 1378 if (HAS_PCH_SPLIT(dev))
1370 ironlake_disable_display_irq(dev_priv, (pipe == 0) ? 1379 ironlake_disable_display_irq(dev_priv, (pipe == 0) ?
1371 DE_PIPEA_VBLANK: DE_PIPEB_VBLANK); 1380 DE_PIPEA_VBLANK: DE_PIPEB_VBLANK);
diff --git a/drivers/gpu/drm/i915/i915_reg.h b/drivers/gpu/drm/i915/i915_reg.h
index e1be98f799d8..368819a23f73 100644
--- a/drivers/gpu/drm/i915/i915_reg.h
+++ b/drivers/gpu/drm/i915/i915_reg.h
@@ -405,9 +405,12 @@
405#define I915_ERROR_INSTRUCTION (1<<0) 405#define I915_ERROR_INSTRUCTION (1<<0)
406#define INSTPM 0x020c0 406#define INSTPM 0x020c0
407#define INSTPM_SELF_EN (1<<12) /* 915GM only */ 407#define INSTPM_SELF_EN (1<<12) /* 915GM only */
408#define INSTPM_AGPBUSY_DIS (1<<11) /* gen3: when disabled, pending interrupts
409 will not assert AGPBUSY# and will only
410 be delivered when out of C3. */
408#define ACTHD 0x020c8 411#define ACTHD 0x020c8
409#define FW_BLC 0x020d8 412#define FW_BLC 0x020d8
410#define FW_BLC2 0x020dc 413#define FW_BLC2 0x020dc
411#define FW_BLC_SELF 0x020e0 /* 915+ only */ 414#define FW_BLC_SELF 0x020e0 /* 915+ only */
412#define FW_BLC_SELF_EN_MASK (1<<31) 415#define FW_BLC_SELF_EN_MASK (1<<31)
413#define FW_BLC_SELF_FIFO_MASK (1<<16) /* 945 only */ 416#define FW_BLC_SELF_FIFO_MASK (1<<16) /* 945 only */