aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm
diff options
context:
space:
mode:
authorBen Widawsky <ben@bwidawsk.net>2012-05-25 19:56:24 -0400
committerDaniel Vetter <daniel.vetter@ffwll.ch>2012-05-31 06:11:29 -0400
commitb9524a1e1c48cf461768914345ec94be6a15e710 (patch)
tree9edfe87c98ae909dff23b230364cf7011d5d058a /drivers/gpu/drm
parent15b9f80e008f584d1a3835bb5eba194080e4e750 (diff)
drm/i915: remap l3 on hw init
If any l3 rows have been previously remapped, we must remap them after GPU reset/resume too. v2: Just return (no warn) on remapping init if not IVB (Jesse) Move the check of schizo userspace to i915_gem_l3_remap (Jesse) Signed-off-by: Ben Widawsky <ben@bwidawsk.net> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Diffstat (limited to 'drivers/gpu/drm')
-rw-r--r--drivers/gpu/drm/i915/i915_drv.h3
-rw-r--r--drivers/gpu/drm/i915/i915_gem.c34
-rw-r--r--drivers/gpu/drm/i915/i915_reg.h3
3 files changed, 40 insertions, 0 deletions
diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h
index 504f53ee2f8a..470c73219e6b 100644
--- a/drivers/gpu/drm/i915/i915_drv.h
+++ b/drivers/gpu/drm/i915/i915_drv.h
@@ -656,6 +656,8 @@ typedef struct drm_i915_private {
656 /** PPGTT used for aliasing the PPGTT with the GTT */ 656 /** PPGTT used for aliasing the PPGTT with the GTT */
657 struct i915_hw_ppgtt *aliasing_ppgtt; 657 struct i915_hw_ppgtt *aliasing_ppgtt;
658 658
659 u32 *l3_remap_info;
660
659 struct shrinker inactive_shrinker; 661 struct shrinker inactive_shrinker;
660 662
661 /** 663 /**
@@ -1309,6 +1311,7 @@ int __must_check i915_gem_object_set_domain(struct drm_i915_gem_object *obj,
1309int __must_check i915_gem_object_finish_gpu(struct drm_i915_gem_object *obj); 1311int __must_check i915_gem_object_finish_gpu(struct drm_i915_gem_object *obj);
1310int __must_check i915_gem_init(struct drm_device *dev); 1312int __must_check i915_gem_init(struct drm_device *dev);
1311int __must_check i915_gem_init_hw(struct drm_device *dev); 1313int __must_check i915_gem_init_hw(struct drm_device *dev);
1314void i915_gem_l3_remap(struct drm_device *dev);
1312void i915_gem_init_swizzling(struct drm_device *dev); 1315void i915_gem_init_swizzling(struct drm_device *dev);
1313void i915_gem_init_ppgtt(struct drm_device *dev); 1316void i915_gem_init_ppgtt(struct drm_device *dev);
1314void i915_gem_cleanup_ringbuffer(struct drm_device *dev); 1317void i915_gem_cleanup_ringbuffer(struct drm_device *dev);
diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c
index d2eaa008573b..1c08e0900eff 100644
--- a/drivers/gpu/drm/i915/i915_gem.c
+++ b/drivers/gpu/drm/i915/i915_gem.c
@@ -3527,6 +3527,38 @@ i915_gem_idle(struct drm_device *dev)
3527 return 0; 3527 return 0;
3528} 3528}
3529 3529
3530void i915_gem_l3_remap(struct drm_device *dev)
3531{
3532 drm_i915_private_t *dev_priv = dev->dev_private;
3533 u32 misccpctl;
3534 int i;
3535
3536 if (!IS_IVYBRIDGE(dev))
3537 return;
3538
3539 if (!dev_priv->mm.l3_remap_info)
3540 return;
3541
3542 misccpctl = I915_READ(GEN7_MISCCPCTL);
3543 I915_WRITE(GEN7_MISCCPCTL, misccpctl & ~GEN7_DOP_CLOCK_GATE_ENABLE);
3544 POSTING_READ(GEN7_MISCCPCTL);
3545
3546 for (i = 0; i < GEN7_L3LOG_SIZE; i += 4) {
3547 u32 remap = I915_READ(GEN7_L3LOG_BASE + i);
3548 if (remap && remap != dev_priv->mm.l3_remap_info[i/4])
3549 DRM_DEBUG("0x%x was already programmed to %x\n",
3550 GEN7_L3LOG_BASE + i, remap);
3551 if (remap && !dev_priv->mm.l3_remap_info[i/4])
3552 DRM_DEBUG_DRIVER("Clearing remapped register\n");
3553 I915_WRITE(GEN7_L3LOG_BASE + i, dev_priv->mm.l3_remap_info[i/4]);
3554 }
3555
3556 /* Make sure all the writes land before disabling dop clock gating */
3557 POSTING_READ(GEN7_L3LOG_BASE);
3558
3559 I915_WRITE(GEN7_MISCCPCTL, misccpctl);
3560}
3561
3530void i915_gem_init_swizzling(struct drm_device *dev) 3562void i915_gem_init_swizzling(struct drm_device *dev)
3531{ 3563{
3532 drm_i915_private_t *dev_priv = dev->dev_private; 3564 drm_i915_private_t *dev_priv = dev->dev_private;
@@ -3616,6 +3648,8 @@ i915_gem_init_hw(struct drm_device *dev)
3616 drm_i915_private_t *dev_priv = dev->dev_private; 3648 drm_i915_private_t *dev_priv = dev->dev_private;
3617 int ret; 3649 int ret;
3618 3650
3651 i915_gem_l3_remap(dev);
3652
3619 i915_gem_init_swizzling(dev); 3653 i915_gem_init_swizzling(dev);
3620 3654
3621 ret = intel_init_render_ring_buffer(dev); 3655 ret = intel_init_render_ring_buffer(dev);
diff --git a/drivers/gpu/drm/i915/i915_reg.h b/drivers/gpu/drm/i915/i915_reg.h
index 2f31df0dde48..7dcc04f2143e 100644
--- a/drivers/gpu/drm/i915/i915_reg.h
+++ b/drivers/gpu/drm/i915/i915_reg.h
@@ -4111,6 +4111,9 @@
4111 ((reg & GEN7_L3CDERRST1_SUBBANK_MASK) >> 8) 4111 ((reg & GEN7_L3CDERRST1_SUBBANK_MASK) >> 8)
4112#define GEN7_L3CDERRST1_ENABLE (1<<7) 4112#define GEN7_L3CDERRST1_ENABLE (1<<7)
4113 4113
4114#define GEN7_L3LOG_BASE 0xB070
4115#define GEN7_L3LOG_SIZE 0x80
4116
4114#define G4X_AUD_VID_DID 0x62020 4117#define G4X_AUD_VID_DID 0x62020
4115#define INTEL_AUDIO_DEVCL 0x808629FB 4118#define INTEL_AUDIO_DEVCL 0x808629FB
4116#define INTEL_AUDIO_DEVBLC 0x80862801 4119#define INTEL_AUDIO_DEVBLC 0x80862801