diff options
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/gpu/drm/i915/i915_dma.c | 2 | ||||
-rw-r--r-- | drivers/gpu/drm/i915/i915_drv.c | 7 | ||||
-rw-r--r-- | drivers/gpu/drm/i915/i915_drv.h | 2 | ||||
-rw-r--r-- | drivers/gpu/drm/i915/i915_gem.c | 39 |
4 files changed, 49 insertions, 1 deletions
diff --git a/drivers/gpu/drm/i915/i915_dma.c b/drivers/gpu/drm/i915/i915_dma.c index 039fbf4fae10..40bfafa13b72 100644 --- a/drivers/gpu/drm/i915/i915_dma.c +++ b/drivers/gpu/drm/i915/i915_dma.c | |||
@@ -1196,7 +1196,7 @@ static int i915_load_gem_init(struct drm_device *dev) | |||
1196 | /* Basic memrange allocator for stolen space */ | 1196 | /* Basic memrange allocator for stolen space */ |
1197 | drm_mm_init(&dev_priv->mm.stolen, 0, prealloc_size); | 1197 | drm_mm_init(&dev_priv->mm.stolen, 0, prealloc_size); |
1198 | 1198 | ||
1199 | if (HAS_ALIASING_PPGTT(dev)) { | 1199 | if (i915_enable_ppgtt && HAS_ALIASING_PPGTT(dev)) { |
1200 | /* PPGTT pdes are stolen from global gtt ptes, so shrink the | 1200 | /* PPGTT pdes are stolen from global gtt ptes, so shrink the |
1201 | * aperture accordingly when using aliasing ppgtt. */ | 1201 | * aperture accordingly when using aliasing ppgtt. */ |
1202 | gtt_size -= I915_PPGTT_PD_ENTRIES*PAGE_SIZE; | 1202 | gtt_size -= I915_PPGTT_PD_ENTRIES*PAGE_SIZE; |
diff --git a/drivers/gpu/drm/i915/i915_drv.c b/drivers/gpu/drm/i915/i915_drv.c index 12ddf47b8187..d92c92dea4ec 100644 --- a/drivers/gpu/drm/i915/i915_drv.c +++ b/drivers/gpu/drm/i915/i915_drv.c | |||
@@ -103,6 +103,11 @@ MODULE_PARM_DESC(enable_hangcheck, | |||
103 | "WARNING: Disabling this can cause system wide hangs. " | 103 | "WARNING: Disabling this can cause system wide hangs. " |
104 | "(default: true)"); | 104 | "(default: true)"); |
105 | 105 | ||
106 | bool i915_enable_ppgtt __read_mostly = 1; | ||
107 | module_param_named(i915_enable_ppgtt, i915_enable_ppgtt, bool, 0600); | ||
108 | MODULE_PARM_DESC(i915_enable_ppgtt, | ||
109 | "Enable PPGTT (default: true)"); | ||
110 | |||
106 | static struct drm_driver driver; | 111 | static struct drm_driver driver; |
107 | extern int intel_agp_enabled; | 112 | extern int intel_agp_enabled; |
108 | 113 | ||
@@ -694,6 +699,8 @@ int i915_reset(struct drm_device *dev, u8 flags) | |||
694 | if (HAS_BLT(dev)) | 699 | if (HAS_BLT(dev)) |
695 | dev_priv->ring[BCS].init(&dev_priv->ring[BCS]); | 700 | dev_priv->ring[BCS].init(&dev_priv->ring[BCS]); |
696 | 701 | ||
702 | i915_gem_init_ppgtt(dev); | ||
703 | |||
697 | mutex_unlock(&dev->struct_mutex); | 704 | mutex_unlock(&dev->struct_mutex); |
698 | drm_irq_uninstall(dev); | 705 | drm_irq_uninstall(dev); |
699 | drm_mode_config_reset(dev); | 706 | drm_mode_config_reset(dev); |
diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h index 35c8b5316396..45b609e6b131 100644 --- a/drivers/gpu/drm/i915/i915_drv.h +++ b/drivers/gpu/drm/i915/i915_drv.h | |||
@@ -1032,6 +1032,7 @@ extern int i915_vbt_sdvo_panel_type __read_mostly; | |||
1032 | extern int i915_enable_rc6 __read_mostly; | 1032 | extern int i915_enable_rc6 __read_mostly; |
1033 | extern int i915_enable_fbc __read_mostly; | 1033 | extern int i915_enable_fbc __read_mostly; |
1034 | extern bool i915_enable_hangcheck __read_mostly; | 1034 | extern bool i915_enable_hangcheck __read_mostly; |
1035 | extern bool i915_enable_ppgtt __read_mostly; | ||
1035 | 1036 | ||
1036 | extern int i915_suspend(struct drm_device *dev, pm_message_t state); | 1037 | extern int i915_suspend(struct drm_device *dev, pm_message_t state); |
1037 | extern int i915_resume(struct drm_device *dev); | 1038 | extern int i915_resume(struct drm_device *dev); |
@@ -1210,6 +1211,7 @@ int __must_check i915_gem_object_set_domain(struct drm_i915_gem_object *obj, | |||
1210 | int __must_check i915_gem_object_finish_gpu(struct drm_i915_gem_object *obj); | 1211 | int __must_check i915_gem_object_finish_gpu(struct drm_i915_gem_object *obj); |
1211 | int __must_check i915_gem_init_hw(struct drm_device *dev); | 1212 | int __must_check i915_gem_init_hw(struct drm_device *dev); |
1212 | void i915_gem_init_swizzling(struct drm_device *dev); | 1213 | void i915_gem_init_swizzling(struct drm_device *dev); |
1214 | void i915_gem_init_ppgtt(struct drm_device *dev); | ||
1213 | void i915_gem_cleanup_ringbuffer(struct drm_device *dev); | 1215 | void i915_gem_cleanup_ringbuffer(struct drm_device *dev); |
1214 | void i915_gem_do_init(struct drm_device *dev, | 1216 | void i915_gem_do_init(struct drm_device *dev, |
1215 | unsigned long start, | 1217 | unsigned long start, |
diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c index 59092997bcfb..f1193b194331 100644 --- a/drivers/gpu/drm/i915/i915_gem.c +++ b/drivers/gpu/drm/i915/i915_gem.c | |||
@@ -3712,6 +3712,43 @@ void i915_gem_init_swizzling(struct drm_device *dev) | |||
3712 | else | 3712 | else |
3713 | I915_WRITE(ARB_MODE, ARB_MODE_ENABLE(ARB_MODE_SWIZZLE_IVB)); | 3713 | I915_WRITE(ARB_MODE, ARB_MODE_ENABLE(ARB_MODE_SWIZZLE_IVB)); |
3714 | } | 3714 | } |
3715 | |||
3716 | void i915_gem_init_ppgtt(struct drm_device *dev) | ||
3717 | { | ||
3718 | drm_i915_private_t *dev_priv = dev->dev_private; | ||
3719 | uint32_t pd_offset; | ||
3720 | struct intel_ring_buffer *ring; | ||
3721 | int i; | ||
3722 | |||
3723 | if (!dev_priv->mm.aliasing_ppgtt) | ||
3724 | return; | ||
3725 | |||
3726 | pd_offset = dev_priv->mm.aliasing_ppgtt->pd_offset; | ||
3727 | pd_offset /= 64; /* in cachelines, */ | ||
3728 | pd_offset <<= 16; | ||
3729 | |||
3730 | if (INTEL_INFO(dev)->gen == 6) { | ||
3731 | uint32_t ecochk = I915_READ(GAM_ECOCHK); | ||
3732 | I915_WRITE(GAM_ECOCHK, ecochk | ECOCHK_SNB_BIT | | ||
3733 | ECOCHK_PPGTT_CACHE64B); | ||
3734 | I915_WRITE(GFX_MODE, GFX_MODE_ENABLE(GFX_PPGTT_ENABLE)); | ||
3735 | } else if (INTEL_INFO(dev)->gen >= 7) { | ||
3736 | I915_WRITE(GAM_ECOCHK, ECOCHK_PPGTT_CACHE64B); | ||
3737 | /* GFX_MODE is per-ring on gen7+ */ | ||
3738 | } | ||
3739 | |||
3740 | for (i = 0; i < I915_NUM_RINGS; i++) { | ||
3741 | ring = &dev_priv->ring[i]; | ||
3742 | |||
3743 | if (INTEL_INFO(dev)->gen >= 7) | ||
3744 | I915_WRITE(RING_MODE_GEN7(ring), | ||
3745 | GFX_MODE_ENABLE(GFX_PPGTT_ENABLE)); | ||
3746 | |||
3747 | I915_WRITE(RING_PP_DIR_DCLV(ring), PP_DIR_DCLV_2G); | ||
3748 | I915_WRITE(RING_PP_DIR_BASE(ring), pd_offset); | ||
3749 | } | ||
3750 | } | ||
3751 | |||
3715 | int | 3752 | int |
3716 | i915_gem_init_hw(struct drm_device *dev) | 3753 | i915_gem_init_hw(struct drm_device *dev) |
3717 | { | 3754 | { |
@@ -3738,6 +3775,8 @@ i915_gem_init_hw(struct drm_device *dev) | |||
3738 | 3775 | ||
3739 | dev_priv->next_seqno = 1; | 3776 | dev_priv->next_seqno = 1; |
3740 | 3777 | ||
3778 | i915_gem_init_ppgtt(dev); | ||
3779 | |||
3741 | return 0; | 3780 | return 0; |
3742 | 3781 | ||
3743 | cleanup_bsd_ring: | 3782 | cleanup_bsd_ring: |