aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm
diff options
context:
space:
mode:
authorVille Syrjälä <ville.syrjala@linux.intel.com>2013-02-20 14:16:18 -0500
committerDaniel Vetter <daniel.vetter@ffwll.ch>2013-02-21 08:01:12 -0500
commit46c06a30dfd63b1200dda2337c145e262798b9cf (patch)
tree8b212acd2a74ac42b49c51a8a4aeb3898a0570ae /drivers/gpu/drm
parent90a72f8774b6060975f85687e9c8a60cfb68a72c (diff)
drm/i915: Kill pipestat[] cache
Caching the PIPESTAT enable bits has been deemed pointless. Just read them from the register itself. Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Reviewed-by: Jani Nikula <jani.nikula@intel.com> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Diffstat (limited to 'drivers/gpu/drm')
-rw-r--r--drivers/gpu/drm/i915/i915_drv.h1
-rw-r--r--drivers/gpu/drm/i915/i915_irq.c41
2 files changed, 17 insertions, 25 deletions
diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h
index e95337c97459..62b15f817792 100644
--- a/drivers/gpu/drm/i915/i915_drv.h
+++ b/drivers/gpu/drm/i915/i915_drv.h
@@ -905,7 +905,6 @@ typedef struct drm_i915_private {
905 struct mutex dpio_lock; 905 struct mutex dpio_lock;
906 906
907 /** Cached value of IMR to avoid reads in updating the bitfield */ 907 /** Cached value of IMR to avoid reads in updating the bitfield */
908 u32 pipestat[2];
909 u32 irq_mask; 908 u32 irq_mask;
910 u32 gt_irq_mask; 909 u32 gt_irq_mask;
911 910
diff --git a/drivers/gpu/drm/i915/i915_irq.c b/drivers/gpu/drm/i915/i915_irq.c
index 29037e0e38b0..4cbbbd688935 100644
--- a/drivers/gpu/drm/i915/i915_irq.c
+++ b/drivers/gpu/drm/i915/i915_irq.c
@@ -60,26 +60,30 @@ ironlake_disable_display_irq(drm_i915_private_t *dev_priv, u32 mask)
60void 60void
61i915_enable_pipestat(drm_i915_private_t *dev_priv, int pipe, u32 mask) 61i915_enable_pipestat(drm_i915_private_t *dev_priv, int pipe, u32 mask)
62{ 62{
63 if ((dev_priv->pipestat[pipe] & mask) != mask) { 63 u32 reg = PIPESTAT(pipe);
64 u32 reg = PIPESTAT(pipe); 64 u32 pipestat = I915_READ(reg) & 0x7fff0000;
65 65
66 dev_priv->pipestat[pipe] |= mask; 66 if ((pipestat & mask) == mask)
67 /* Enable the interrupt, clear any pending status */ 67 return;
68 I915_WRITE(reg, dev_priv->pipestat[pipe] | (mask >> 16)); 68
69 POSTING_READ(reg); 69 /* Enable the interrupt, clear any pending status */
70 } 70 pipestat |= mask | (mask >> 16);
71 I915_WRITE(reg, pipestat);
72 POSTING_READ(reg);
71} 73}
72 74
73void 75void
74i915_disable_pipestat(drm_i915_private_t *dev_priv, int pipe, u32 mask) 76i915_disable_pipestat(drm_i915_private_t *dev_priv, int pipe, u32 mask)
75{ 77{
76 if ((dev_priv->pipestat[pipe] & mask) != 0) { 78 u32 reg = PIPESTAT(pipe);
77 u32 reg = PIPESTAT(pipe); 79 u32 pipestat = I915_READ(reg) & 0x7fff0000;
78 80
79 dev_priv->pipestat[pipe] &= ~mask; 81 if ((pipestat & mask) == 0)
80 I915_WRITE(reg, dev_priv->pipestat[pipe]); 82 return;
81 POSTING_READ(reg); 83
82 } 84 pipestat &= ~mask;
85 I915_WRITE(reg, pipestat);
86 POSTING_READ(reg);
83} 87}
84 88
85/** 89/**
@@ -2069,9 +2073,6 @@ static int valleyview_irq_postinstall(struct drm_device *dev)
2069 I915_DISPLAY_PIPE_A_VBLANK_INTERRUPT | 2073 I915_DISPLAY_PIPE_A_VBLANK_INTERRUPT |
2070 I915_DISPLAY_PIPE_B_VBLANK_INTERRUPT; 2074 I915_DISPLAY_PIPE_B_VBLANK_INTERRUPT;
2071 2075
2072 dev_priv->pipestat[0] = 0;
2073 dev_priv->pipestat[1] = 0;
2074
2075 /* Hack for broken MSIs on VLV */ 2076 /* Hack for broken MSIs on VLV */
2076 pci_write_config_dword(dev_priv->dev->pdev, 0x94, 0xfee00000); 2077 pci_write_config_dword(dev_priv->dev->pdev, 0x94, 0xfee00000);
2077 pci_read_config_word(dev->pdev, 0x98, &msid); 2078 pci_read_config_word(dev->pdev, 0x98, &msid);
@@ -2201,9 +2202,6 @@ static int i8xx_irq_postinstall(struct drm_device *dev)
2201{ 2202{
2202 drm_i915_private_t *dev_priv = (drm_i915_private_t *) dev->dev_private; 2203 drm_i915_private_t *dev_priv = (drm_i915_private_t *) dev->dev_private;
2203 2204
2204 dev_priv->pipestat[0] = 0;
2205 dev_priv->pipestat[1] = 0;
2206
2207 I915_WRITE16(EMR, 2205 I915_WRITE16(EMR,
2208 ~(I915_ERROR_PAGE_TABLE | I915_ERROR_MEMORY_REFRESH)); 2206 ~(I915_ERROR_PAGE_TABLE | I915_ERROR_MEMORY_REFRESH));
2209 2207
@@ -2365,9 +2363,6 @@ static int i915_irq_postinstall(struct drm_device *dev)
2365 drm_i915_private_t *dev_priv = (drm_i915_private_t *) dev->dev_private; 2363 drm_i915_private_t *dev_priv = (drm_i915_private_t *) dev->dev_private;
2366 u32 enable_mask; 2364 u32 enable_mask;
2367 2365
2368 dev_priv->pipestat[0] = 0;
2369 dev_priv->pipestat[1] = 0;
2370
2371 I915_WRITE(EMR, ~(I915_ERROR_PAGE_TABLE | I915_ERROR_MEMORY_REFRESH)); 2366 I915_WRITE(EMR, ~(I915_ERROR_PAGE_TABLE | I915_ERROR_MEMORY_REFRESH));
2372 2367
2373 /* Unmask the interrupts that we always want on. */ 2368 /* Unmask the interrupts that we always want on. */
@@ -2634,8 +2629,6 @@ static int i965_irq_postinstall(struct drm_device *dev)
2634 if (IS_G4X(dev)) 2629 if (IS_G4X(dev))
2635 enable_mask |= I915_BSD_USER_INTERRUPT; 2630 enable_mask |= I915_BSD_USER_INTERRUPT;
2636 2631
2637 dev_priv->pipestat[0] = 0;
2638 dev_priv->pipestat[1] = 0;
2639 i915_enable_pipestat(dev_priv, 0, PIPE_GMBUS_EVENT_ENABLE); 2632 i915_enable_pipestat(dev_priv, 0, PIPE_GMBUS_EVENT_ENABLE);
2640 2633
2641 /* 2634 /*