aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDaniel Vetter <daniel.vetter@ffwll.ch>2012-11-02 14:55:07 -0400
committerDaniel Vetter <daniel.vetter@ffwll.ch>2012-11-11 17:51:40 -0500
commita4da4fa4e55a8cea7fe603e7564e72db97b77a89 (patch)
tree2d8dc78dfdc218c5bf872477db79b6fd227d08fc
parent231f42a48f744c9a4f53752948fad2d793638937 (diff)
drm/i915: extract l3_parity substruct from dev_priv
Pretty astonishing how far apart these two members landed ... Especially since I've already removed almost 200 lines in between. Reviewed-by: Jesse Barnes <jbarnes@virtuousgeek.org> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
-rw-r--r--drivers/gpu/drm/i915/i915_drv.h10
-rw-r--r--drivers/gpu/drm/i915/i915_gem.c8
-rw-r--r--drivers/gpu/drm/i915/i915_irq.c6
-rw-r--r--drivers/gpu/drm/i915/i915_sysfs.c6
4 files changed, 17 insertions, 13 deletions
diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h
index ad3c4c134e2d..135b9db55279 100644
--- a/drivers/gpu/drm/i915/i915_drv.h
+++ b/drivers/gpu/drm/i915/i915_drv.h
@@ -599,6 +599,11 @@ struct i915_dri1_state {
599 uint32_t counter; 599 uint32_t counter;
600}; 600};
601 601
602struct intel_l3_parity {
603 u32 *remap_info;
604 struct work_struct error_work;
605};
606
602typedef struct drm_i915_private { 607typedef struct drm_i915_private {
603 struct drm_device *dev; 608 struct drm_device *dev;
604 609
@@ -760,8 +765,6 @@ typedef struct drm_i915_private {
760 /** PPGTT used for aliasing the PPGTT with the GTT */ 765 /** PPGTT used for aliasing the PPGTT with the GTT */
761 struct i915_hw_ppgtt *aliasing_ppgtt; 766 struct i915_hw_ppgtt *aliasing_ppgtt;
762 767
763 u32 *l3_remap_info;
764
765 struct shrinker inactive_shrinker; 768 struct shrinker inactive_shrinker;
766 769
767 /** 770 /**
@@ -865,6 +868,8 @@ typedef struct drm_i915_private {
865 868
866 bool mchbar_need_disable; 869 bool mchbar_need_disable;
867 870
871 struct intel_l3_parity l3_parity;
872
868 /* gen6+ rps state */ 873 /* gen6+ rps state */
869 struct intel_gen6_power_mgmt rps; 874 struct intel_gen6_power_mgmt rps;
870 875
@@ -887,7 +892,6 @@ typedef struct drm_i915_private {
887 struct drm_property *broadcast_rgb_property; 892 struct drm_property *broadcast_rgb_property;
888 struct drm_property *force_audio_property; 893 struct drm_property *force_audio_property;
889 894
890 struct work_struct parity_error_work;
891 bool hw_contexts_disabled; 895 bool hw_contexts_disabled;
892 uint32_t hw_context_size; 896 uint32_t hw_context_size;
893 897
diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c
index 7dd103447b42..d8eaebfea93e 100644
--- a/drivers/gpu/drm/i915/i915_gem.c
+++ b/drivers/gpu/drm/i915/i915_gem.c
@@ -3831,7 +3831,7 @@ void i915_gem_l3_remap(struct drm_device *dev)
3831 if (!IS_IVYBRIDGE(dev)) 3831 if (!IS_IVYBRIDGE(dev))
3832 return; 3832 return;
3833 3833
3834 if (!dev_priv->mm.l3_remap_info) 3834 if (!dev_priv->l3_parity.remap_info)
3835 return; 3835 return;
3836 3836
3837 misccpctl = I915_READ(GEN7_MISCCPCTL); 3837 misccpctl = I915_READ(GEN7_MISCCPCTL);
@@ -3840,12 +3840,12 @@ void i915_gem_l3_remap(struct drm_device *dev)
3840 3840
3841 for (i = 0; i < GEN7_L3LOG_SIZE; i += 4) { 3841 for (i = 0; i < GEN7_L3LOG_SIZE; i += 4) {
3842 u32 remap = I915_READ(GEN7_L3LOG_BASE + i); 3842 u32 remap = I915_READ(GEN7_L3LOG_BASE + i);
3843 if (remap && remap != dev_priv->mm.l3_remap_info[i/4]) 3843 if (remap && remap != dev_priv->l3_parity.remap_info[i/4])
3844 DRM_DEBUG("0x%x was already programmed to %x\n", 3844 DRM_DEBUG("0x%x was already programmed to %x\n",
3845 GEN7_L3LOG_BASE + i, remap); 3845 GEN7_L3LOG_BASE + i, remap);
3846 if (remap && !dev_priv->mm.l3_remap_info[i/4]) 3846 if (remap && !dev_priv->l3_parity.remap_info[i/4])
3847 DRM_DEBUG_DRIVER("Clearing remapped register\n"); 3847 DRM_DEBUG_DRIVER("Clearing remapped register\n");
3848 I915_WRITE(GEN7_L3LOG_BASE + i, dev_priv->mm.l3_remap_info[i/4]); 3848 I915_WRITE(GEN7_L3LOG_BASE + i, dev_priv->l3_parity.remap_info[i/4]);
3849 } 3849 }
3850 3850
3851 /* Make sure all the writes land before disabling dop clock gating */ 3851 /* Make sure all the writes land before disabling dop clock gating */
diff --git a/drivers/gpu/drm/i915/i915_irq.c b/drivers/gpu/drm/i915/i915_irq.c
index b92e6bfbb97c..2c40127573e2 100644
--- a/drivers/gpu/drm/i915/i915_irq.c
+++ b/drivers/gpu/drm/i915/i915_irq.c
@@ -409,7 +409,7 @@ static void gen6_pm_rps_work(struct work_struct *work)
409static void ivybridge_parity_work(struct work_struct *work) 409static void ivybridge_parity_work(struct work_struct *work)
410{ 410{
411 drm_i915_private_t *dev_priv = container_of(work, drm_i915_private_t, 411 drm_i915_private_t *dev_priv = container_of(work, drm_i915_private_t,
412 parity_error_work); 412 l3_parity.error_work);
413 u32 error_status, row, bank, subbank; 413 u32 error_status, row, bank, subbank;
414 char *parity_event[5]; 414 char *parity_event[5];
415 uint32_t misccpctl; 415 uint32_t misccpctl;
@@ -473,7 +473,7 @@ static void ivybridge_handle_parity_error(struct drm_device *dev)
473 I915_WRITE(GTIMR, dev_priv->gt_irq_mask); 473 I915_WRITE(GTIMR, dev_priv->gt_irq_mask);
474 spin_unlock_irqrestore(&dev_priv->irq_lock, flags); 474 spin_unlock_irqrestore(&dev_priv->irq_lock, flags);
475 475
476 queue_work(dev_priv->wq, &dev_priv->parity_error_work); 476 queue_work(dev_priv->wq, &dev_priv->l3_parity.error_work);
477} 477}
478 478
479static void snb_gt_irq_handler(struct drm_device *dev, 479static void snb_gt_irq_handler(struct drm_device *dev,
@@ -2681,7 +2681,7 @@ void intel_irq_init(struct drm_device *dev)
2681 INIT_WORK(&dev_priv->hotplug_work, i915_hotplug_work_func); 2681 INIT_WORK(&dev_priv->hotplug_work, i915_hotplug_work_func);
2682 INIT_WORK(&dev_priv->error_work, i915_error_work_func); 2682 INIT_WORK(&dev_priv->error_work, i915_error_work_func);
2683 INIT_WORK(&dev_priv->rps.work, gen6_pm_rps_work); 2683 INIT_WORK(&dev_priv->rps.work, gen6_pm_rps_work);
2684 INIT_WORK(&dev_priv->parity_error_work, ivybridge_parity_work); 2684 INIT_WORK(&dev_priv->l3_parity.error_work, ivybridge_parity_work);
2685 2685
2686 dev->driver->get_vblank_counter = i915_get_vblank_counter; 2686 dev->driver->get_vblank_counter = i915_get_vblank_counter;
2687 dev->max_vblank_count = 0xffffff; /* only 24 bits of frame count */ 2687 dev->max_vblank_count = 0xffffff; /* only 24 bits of frame count */
diff --git a/drivers/gpu/drm/i915/i915_sysfs.c b/drivers/gpu/drm/i915/i915_sysfs.c
index 903eebd2117a..9700ae96ec19 100644
--- a/drivers/gpu/drm/i915/i915_sysfs.c
+++ b/drivers/gpu/drm/i915/i915_sysfs.c
@@ -162,7 +162,7 @@ i915_l3_write(struct file *filp, struct kobject *kobj,
162 if (ret) 162 if (ret)
163 return ret; 163 return ret;
164 164
165 if (!dev_priv->mm.l3_remap_info) { 165 if (!dev_priv->l3_parity.remap_info) {
166 temp = kzalloc(GEN7_L3LOG_SIZE, GFP_KERNEL); 166 temp = kzalloc(GEN7_L3LOG_SIZE, GFP_KERNEL);
167 if (!temp) { 167 if (!temp) {
168 mutex_unlock(&drm_dev->struct_mutex); 168 mutex_unlock(&drm_dev->struct_mutex);
@@ -182,9 +182,9 @@ i915_l3_write(struct file *filp, struct kobject *kobj,
182 * at this point it is left as a TODO. 182 * at this point it is left as a TODO.
183 */ 183 */
184 if (temp) 184 if (temp)
185 dev_priv->mm.l3_remap_info = temp; 185 dev_priv->l3_parity.remap_info = temp;
186 186
187 memcpy(dev_priv->mm.l3_remap_info + (offset/4), 187 memcpy(dev_priv->l3_parity.remap_info + (offset/4),
188 buf + (offset/4), 188 buf + (offset/4),
189 count); 189 count);
190 190