for file in `ls drivers/gpu/drm/i915/*.c` ; do sed -i "s/mm.gtt_mtrr/gtt.mtrr/" $file; done Signed-off-by: Ben Widawsky <ben at bwidawsk.net> --- drivers/gpu/drm/i915/i915_dma.c | 18 +++++++++--------- drivers/gpu/drm/i915/i915_drv.h | 4 ++-- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/drivers/gpu/drm/i915/i915_dma.c b/drivers/gpu/drm/i915/i915_dma.c index 9745fe0..c823e1c 100644 --- a/drivers/gpu/drm/i915/i915_dma.c +++ b/drivers/gpu/drm/i915/i915_dma.c @@ -1402,7 +1402,7 @@ static void i915_mtrr_setup(struct drm_i915_private *dev_priv, unsigned long base, unsigned long size) { - dev_priv->mm.gtt_mtrr = -1; + dev_priv->gtt.mtrr = -1; #if defined(CONFIG_X86_PAT) if (cpu_has_pat) @@ -1414,8 +1414,8 @@ i915_mtrr_setup(struct drm_i915_private *dev_priv, unsigned long base, * generation Core chips because WC PAT gets overridden by a UC * MTRR if present. Even if a UC MTRR isn't present. */ - dev_priv->mm.gtt_mtrr = mtrr_add(base, size, MTRR_TYPE_WRCOMB, 1); - if (dev_priv->mm.gtt_mtrr < 0) { + dev_priv->gtt.mtrr = mtrr_add(base, size, MTRR_TYPE_WRCOMB, 1); + if (dev_priv->gtt.mtrr < 0) { DRM_INFO("MTRR allocation failed. Graphics " "performance may suffer.\n"); } @@ -1685,11 +1685,11 @@ out_gem_unload: intel_teardown_mchbar(dev); destroy_workqueue(dev_priv->wq); out_mtrrfree: - if (dev_priv->mm.gtt_mtrr >= 0) { - mtrr_del(dev_priv->mm.gtt_mtrr, + if (dev_priv->gtt.mtrr >= 0) { + mtrr_del(dev_priv->gtt.mtrr, dev_priv->gtt.mappable_base, aperture_size); - dev_priv->mm.gtt_mtrr = -1; + dev_priv->gtt.mtrr = -1; } io_mapping_free(dev_priv->gtt.mappable); dev_priv->gtt.gtt_remove(dev); @@ -1725,11 +1725,11 @@ int i915_driver_unload(struct drm_device *dev) cancel_delayed_work_sync(&dev_priv->mm.retire_work); io_mapping_free(dev_priv->gtt.mappable); - if (dev_priv->mm.gtt_mtrr >= 0) { - mtrr_del(dev_priv->mm.gtt_mtrr, + if (dev_priv->gtt.mtrr >= 0) { + mtrr_del(dev_priv->gtt.mtrr, dev_priv->gtt.mappable_base, dev_priv->gtt.mappable_end); - dev_priv->mm.gtt_mtrr = -1; + dev_priv->gtt.mtrr = -1; } acpi_video_unregister(); diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h index 4261258..ae10e28 100644 --- a/drivers/gpu/drm/i915/i915_drv.h +++ b/drivers/gpu/drm/i915/i915_drv.h @@ -445,6 +445,8 @@ struct i915_gtt { struct page *page; } scratch; + int mtrr; + /* global gtt ops */ int (*gtt_probe)(struct drm_device *dev, size_t *gtt_total, size_t *stolen, phys_addr_t *mappable_base, @@ -785,8 +787,6 @@ struct i915_gem_mm { /** Usable portion of the GTT for GEM */ unsigned long stolen_base; /* limited to low memory (32-bit) */ - int gtt_mtrr; - /** PPGTT used for aliasing the PPGTT with the GTT */ struct i915_hw_ppgtt *aliasing_ppgtt; -- 1.8.2.3