summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/i915/i915_gem_gtt.c
diff options
context:
space:
mode:
authorBen Widawsky2013-12-06 23:11:14 +0100
committerDaniel Vetter2013-12-18 15:31:06 +0100
commit246cbfb5fb9a1ca0997fbb135464c1ff5bb9c549 (patch)
tree4871b92a07b8cd9ce086cbc0e9d65f199cc94dbf /drivers/gpu/drm/i915/i915_gem_gtt.c
parentdrm/i915: Generalize PPGTT init (diff)
downloadkernel-qcow2-linux-246cbfb5fb9a1ca0997fbb135464c1ff5bb9c549.tar.gz
kernel-qcow2-linux-246cbfb5fb9a1ca0997fbb135464c1ff5bb9c549.tar.xz
kernel-qcow2-linux-246cbfb5fb9a1ca0997fbb135464c1ff5bb9c549.zip
drm/i915: Reorganize intel_enable_ppgtt
This patch consolidates the way in which we handle the various supported PPGTT by module parameter in addition to what the hardware supports. It strives to make doing the right thing in the code as simple as possible, with the USES_ macros. I've opted to add the full PPGTT argument simply so one can see how I intend to use this function. It will not/cannot be used until later. Signed-off-by: Ben Widawsky <ben@bwidawsk.net> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Diffstat (limited to 'drivers/gpu/drm/i915/i915_gem_gtt.c')
-rw-r--r--drivers/gpu/drm/i915/i915_gem_gtt.c20
1 files changed, 2 insertions, 18 deletions
diff --git a/drivers/gpu/drm/i915/i915_gem_gtt.c b/drivers/gpu/drm/i915/i915_gem_gtt.c
index fdeed684bf5c..c69fa2c72c15 100644
--- a/drivers/gpu/drm/i915/i915_gem_gtt.c
+++ b/drivers/gpu/drm/i915/i915_gem_gtt.c
@@ -888,8 +888,7 @@ err_pt_alloc:
return ret;
}
-static int i915_gem_init_ppgtt(struct drm_device *dev,
- struct i915_hw_ppgtt *ppgtt)
+int i915_gem_init_ppgtt(struct drm_device *dev, struct i915_hw_ppgtt *ppgtt)
{
struct drm_i915_private *dev_priv = dev->dev_private;
int ret = 0;
@@ -1397,21 +1396,6 @@ void i915_gem_setup_global_gtt(struct drm_device *dev,
ggtt_vm->clear_range(ggtt_vm, end / PAGE_SIZE - 1, 1, true);
}
-static bool
-intel_enable_ppgtt(struct drm_device *dev)
-{
- if (i915_enable_ppgtt >= 0)
- return i915_enable_ppgtt;
-
-#ifdef CONFIG_INTEL_IOMMU
- /* Disable ppgtt on SNB if VT-d is on. */
- if (INTEL_INFO(dev)->gen == 6 && intel_iommu_gfx_mapped)
- return false;
-#endif
-
- return true;
-}
-
void i915_gem_init_global_gtt(struct drm_device *dev)
{
struct drm_i915_private *dev_priv = dev->dev_private;
@@ -1421,7 +1405,7 @@ void i915_gem_init_global_gtt(struct drm_device *dev)
mappable_size = dev_priv->gtt.mappable_end;
i915_gem_setup_global_gtt(dev, 0, mappable_size, gtt_size);
- if (intel_enable_ppgtt(dev) && HAS_ALIASING_PPGTT(dev)) {
+ if (USES_ALIASING_PPGTT(dev)) {
struct i915_hw_ppgtt *ppgtt;
int ret;