aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBen Widawsky <benjamin.widawsky@intel.com>2012-12-18 13:31:26 -0500
committerDaniel Vetter <daniel.vetter@ffwll.ch>2012-12-20 10:28:42 -0500
commit06e5598fce5ce89fe8bf081398296e5b08d993dd (patch)
tree3c00031aed1df894613b53c3900192dd677ec367
parentd7e5008f7c2077d856e40a3af746f1a47028b5f2 (diff)
drm/i915: Move GSM mapping into dev_priv
This removes an unused field from the AGP structure and moves it into the dev_priv structure (with a slightly better name). This builds upon the kill-agp series already merged. GSM is a well defined term in the bspec: GSM: Graphics Stolen Memory GTT stolen space is defined for storage of the GFX GTT entries in physical memory. IA can not access GSM directly , it can only access via GTTMMADR. GT can access GSM directly or through GTTMMADR. This is not the entire stolen space. Signed-off-by: Ben Widawsky <ben@bwidawsk.net> Reviewed-by: Mika Kuoppala <mika.kuoppala@intel.com> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
-rw-r--r--drivers/char/agp/intel-gtt.c1
-rw-r--r--drivers/gpu/drm/i915/i915_drv.h3
-rw-r--r--drivers/gpu/drm/i915/i915_gem_gtt.c14
-rw-r--r--include/drm/intel-gtt.h2
4 files changed, 10 insertions, 10 deletions
diff --git a/drivers/char/agp/intel-gtt.c b/drivers/char/agp/intel-gtt.c
index dbd901e94ea6..c8d9dcb15db0 100644
--- a/drivers/char/agp/intel-gtt.c
+++ b/drivers/char/agp/intel-gtt.c
@@ -602,7 +602,6 @@ static int intel_gtt_init(void)
602 iounmap(intel_private.registers); 602 iounmap(intel_private.registers);
603 return -ENOMEM; 603 return -ENOMEM;
604 } 604 }
605 intel_private.base.gtt = intel_private.gtt;
606 605
607 global_cache_flush(); /* FIXME: ? */ 606 global_cache_flush(); /* FIXME: ? */
608 607
diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h
index 15799e783b7a..ae88d87be951 100644
--- a/drivers/gpu/drm/i915/i915_drv.h
+++ b/drivers/gpu/drm/i915/i915_drv.h
@@ -800,6 +800,9 @@ typedef struct drm_i915_private {
800 unsigned long gtt_end; 800 unsigned long gtt_end;
801 unsigned long stolen_base; /* limited to low memory (32-bit) */ 801 unsigned long stolen_base; /* limited to low memory (32-bit) */
802 802
803 /** "Graphics Stolen Memory" holds the global PTEs */
804 uint32_t __iomem *gsm;
805
803 struct io_mapping *gtt_mapping; 806 struct io_mapping *gtt_mapping;
804 phys_addr_t gtt_base_addr; 807 phys_addr_t gtt_base_addr;
805 int gtt_mtrr; 808 int gtt_mtrr;
diff --git a/drivers/gpu/drm/i915/i915_gem_gtt.c b/drivers/gpu/drm/i915/i915_gem_gtt.c
index 61b3e728be34..912389e38a7d 100644
--- a/drivers/gpu/drm/i915/i915_gem_gtt.c
+++ b/drivers/gpu/drm/i915/i915_gem_gtt.c
@@ -290,7 +290,7 @@ void i915_gem_init_ppgtt(struct drm_device *dev)
290 return; 290 return;
291 291
292 292
293 pd_addr = dev_priv->mm.gtt->gtt + ppgtt->pd_offset/sizeof(gtt_pte_t); 293 pd_addr = dev_priv->mm.gsm + ppgtt->pd_offset/sizeof(gtt_pte_t);
294 for (i = 0; i < ppgtt->num_pd_entries; i++) { 294 for (i = 0; i < ppgtt->num_pd_entries; i++) {
295 dma_addr_t pt_addr; 295 dma_addr_t pt_addr;
296 296
@@ -367,7 +367,7 @@ static void i915_ggtt_clear_range(struct drm_device *dev,
367{ 367{
368 struct drm_i915_private *dev_priv = dev->dev_private; 368 struct drm_i915_private *dev_priv = dev->dev_private;
369 gtt_pte_t scratch_pte; 369 gtt_pte_t scratch_pte;
370 gtt_pte_t __iomem *gtt_base = dev_priv->mm.gtt->gtt + first_entry; 370 gtt_pte_t __iomem *gtt_base = (gtt_pte_t __iomem *) dev_priv->mm.gsm + first_entry;
371 const int max_entries = dev_priv->mm.gtt->gtt_total_entries - first_entry; 371 const int max_entries = dev_priv->mm.gtt->gtt_total_entries - first_entry;
372 int i; 372 int i;
373 373
@@ -432,7 +432,7 @@ static void gen6_ggtt_bind_object(struct drm_i915_gem_object *obj,
432 struct scatterlist *sg = st->sgl; 432 struct scatterlist *sg = st->sgl;
433 const int first_entry = obj->gtt_space->start >> PAGE_SHIFT; 433 const int first_entry = obj->gtt_space->start >> PAGE_SHIFT;
434 const int max_entries = dev_priv->mm.gtt->gtt_total_entries - first_entry; 434 const int max_entries = dev_priv->mm.gtt->gtt_total_entries - first_entry;
435 gtt_pte_t __iomem *gtt_entries = dev_priv->mm.gtt->gtt + first_entry; 435 gtt_pte_t __iomem *gtt_entries = dev_priv->mm.gsm + first_entry;
436 int unused, i = 0; 436 int unused, i = 0;
437 unsigned int len, m = 0; 437 unsigned int len, m = 0;
438 dma_addr_t addr; 438 dma_addr_t addr;
@@ -747,9 +747,9 @@ int i915_gem_gtt_init(struct drm_device *dev)
747 goto err_out; 747 goto err_out;
748 } 748 }
749 749
750 dev_priv->mm.gtt->gtt = ioremap_wc(gtt_bus_addr, 750 dev_priv->mm.gsm = ioremap_wc(gtt_bus_addr,
751 dev_priv->mm.gtt->gtt_total_entries * sizeof(gtt_pte_t)); 751 dev_priv->mm.gtt->gtt_total_entries * sizeof(gtt_pte_t));
752 if (!dev_priv->mm.gtt->gtt) { 752 if (!dev_priv->mm.gsm) {
753 DRM_ERROR("Failed to map the gtt page table\n"); 753 DRM_ERROR("Failed to map the gtt page table\n");
754 teardown_scratch_page(dev); 754 teardown_scratch_page(dev);
755 ret = -ENOMEM; 755 ret = -ENOMEM;
@@ -773,7 +773,7 @@ err_out:
773void i915_gem_gtt_fini(struct drm_device *dev) 773void i915_gem_gtt_fini(struct drm_device *dev)
774{ 774{
775 struct drm_i915_private *dev_priv = dev->dev_private; 775 struct drm_i915_private *dev_priv = dev->dev_private;
776 iounmap(dev_priv->mm.gtt->gtt); 776 iounmap(dev_priv->mm.gsm);
777 teardown_scratch_page(dev); 777 teardown_scratch_page(dev);
778 if (INTEL_INFO(dev)->gen < 6) 778 if (INTEL_INFO(dev)->gen < 6)
779 intel_gmch_remove(); 779 intel_gmch_remove();
diff --git a/include/drm/intel-gtt.h b/include/drm/intel-gtt.h
index 6eb76a1f11ab..3e3a166a2690 100644
--- a/include/drm/intel-gtt.h
+++ b/include/drm/intel-gtt.h
@@ -18,8 +18,6 @@ struct intel_gtt {
18 /* Share the scratch page dma with ppgtts. */ 18 /* Share the scratch page dma with ppgtts. */
19 dma_addr_t scratch_page_dma; 19 dma_addr_t scratch_page_dma;
20 struct page *scratch_page; 20 struct page *scratch_page;
21 /* for ppgtt PDE access */
22 u32 __iomem *gtt;
23 /* needed for ioremap in drm/i915 */ 21 /* needed for ioremap in drm/i915 */
24 phys_addr_t gma_bus_addr; 22 phys_addr_t gma_bus_addr;
25} *intel_gtt_get(void); 23} *intel_gtt_get(void);