diff options
author | Ben Widawsky <ben@bwidawsk.net> | 2013-01-17 15:45:15 -0500 |
---|---|---|
committer | Daniel Vetter <daniel.vetter@ffwll.ch> | 2013-01-17 16:33:56 -0500 |
commit | 5d4545aef561ad47f91bcf75814af20c104b5a9e (patch) | |
tree | b9a1c3d2226b56285b8de0e23b2bd7f0137c9336 /drivers | |
parent | 00fc2c3c53d7bfc9a29e5f4bdf2677f0c399f3bc (diff) |
drm/i915: Create a gtt structure
The purpose of the gtt structure is to help isolate our gtt specific
properties from the rest of the code (in doing so it help us finish the
isolation from the AGP connection).
The following members are pulled out (and renamed):
gtt_start
gtt_total
gtt_mappable_end
gtt_mappable
gtt_base_addr
gsm
The gtt structure will serve as a nice place to put gen specific gtt
routines in upcoming patches. As far as what else I feel belongs in this
structure: it is meant to encapsulate the GTT's physical properties.
This is why I've not added fields which track various drm_mm properties,
or things like gtt_mtrr (which is itself a pretty transient field).
Reviewed-by: Rodrigo Vivi <rodrigo.vivi@gmail.com>
[Ben modified commit messages]
Signed-off-by: Ben Widawsky <ben@bwidawsk.net>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/gpu/drm/i915/i915_debugfs.c | 4 | ||||
-rw-r--r-- | drivers/gpu/drm/i915/i915_dma.c | 20 | ||||
-rw-r--r-- | drivers/gpu/drm/i915/i915_drv.h | 29 | ||||
-rw-r--r-- | drivers/gpu/drm/i915/i915_gem.c | 14 | ||||
-rw-r--r-- | drivers/gpu/drm/i915/i915_gem_evict.c | 2 | ||||
-rw-r--r-- | drivers/gpu/drm/i915/i915_gem_execbuffer.c | 2 | ||||
-rw-r--r-- | drivers/gpu/drm/i915/i915_gem_gtt.c | 24 | ||||
-rw-r--r-- | drivers/gpu/drm/i915/i915_gem_tiling.c | 2 | ||||
-rw-r--r-- | drivers/gpu/drm/i915/i915_irq.c | 4 | ||||
-rw-r--r-- | drivers/gpu/drm/i915/intel_display.c | 2 | ||||
-rw-r--r-- | drivers/gpu/drm/i915/intel_fb.c | 2 | ||||
-rw-r--r-- | drivers/gpu/drm/i915/intel_overlay.c | 4 |
12 files changed, 61 insertions, 48 deletions
diff --git a/drivers/gpu/drm/i915/i915_debugfs.c b/drivers/gpu/drm/i915/i915_debugfs.c index 35d326d70fab..773b23ecc83b 100644 --- a/drivers/gpu/drm/i915/i915_debugfs.c +++ b/drivers/gpu/drm/i915/i915_debugfs.c | |||
@@ -259,8 +259,8 @@ static int i915_gem_object_info(struct seq_file *m, void* data) | |||
259 | count, size); | 259 | count, size); |
260 | 260 | ||
261 | seq_printf(m, "%zu [%zu] gtt total\n", | 261 | seq_printf(m, "%zu [%zu] gtt total\n", |
262 | dev_priv->mm.gtt_total, | 262 | dev_priv->gtt.total, |
263 | dev_priv->mm.gtt_mappable_end - dev_priv->mm.gtt_start); | 263 | dev_priv->gtt.mappable_end - dev_priv->gtt.start); |
264 | 264 | ||
265 | mutex_unlock(&dev->struct_mutex); | 265 | mutex_unlock(&dev->struct_mutex); |
266 | 266 | ||
diff --git a/drivers/gpu/drm/i915/i915_dma.c b/drivers/gpu/drm/i915/i915_dma.c index 442118293883..bb622135798a 100644 --- a/drivers/gpu/drm/i915/i915_dma.c +++ b/drivers/gpu/drm/i915/i915_dma.c | |||
@@ -1076,7 +1076,7 @@ static int i915_set_status_page(struct drm_device *dev, void *data, | |||
1076 | ring->status_page.gfx_addr = hws->addr & (0x1ffff<<12); | 1076 | ring->status_page.gfx_addr = hws->addr & (0x1ffff<<12); |
1077 | 1077 | ||
1078 | dev_priv->dri1.gfx_hws_cpu_addr = | 1078 | dev_priv->dri1.gfx_hws_cpu_addr = |
1079 | ioremap_wc(dev_priv->mm.gtt_base_addr + hws->addr, 4096); | 1079 | ioremap_wc(dev_priv->gtt.mappable_base + hws->addr, 4096); |
1080 | if (dev_priv->dri1.gfx_hws_cpu_addr == NULL) { | 1080 | if (dev_priv->dri1.gfx_hws_cpu_addr == NULL) { |
1081 | i915_dma_cleanup(dev); | 1081 | i915_dma_cleanup(dev); |
1082 | ring->status_page.gfx_addr = 0; | 1082 | ring->status_page.gfx_addr = 0; |
@@ -1543,17 +1543,17 @@ int i915_driver_load(struct drm_device *dev, unsigned long flags) | |||
1543 | } | 1543 | } |
1544 | 1544 | ||
1545 | aperture_size = dev_priv->mm.gtt->gtt_mappable_entries << PAGE_SHIFT; | 1545 | aperture_size = dev_priv->mm.gtt->gtt_mappable_entries << PAGE_SHIFT; |
1546 | dev_priv->mm.gtt_base_addr = dev_priv->mm.gtt->gma_bus_addr; | 1546 | dev_priv->gtt.mappable_base = dev_priv->mm.gtt->gma_bus_addr; |
1547 | 1547 | ||
1548 | dev_priv->mm.gtt_mapping = | 1548 | dev_priv->gtt.mappable = |
1549 | io_mapping_create_wc(dev_priv->mm.gtt_base_addr, | 1549 | io_mapping_create_wc(dev_priv->gtt.mappable_base, |
1550 | aperture_size); | 1550 | aperture_size); |
1551 | if (dev_priv->mm.gtt_mapping == NULL) { | 1551 | if (dev_priv->gtt.mappable == NULL) { |
1552 | ret = -EIO; | 1552 | ret = -EIO; |
1553 | goto out_rmmap; | 1553 | goto out_rmmap; |
1554 | } | 1554 | } |
1555 | 1555 | ||
1556 | i915_mtrr_setup(dev_priv, dev_priv->mm.gtt_base_addr, | 1556 | i915_mtrr_setup(dev_priv, dev_priv->gtt.mappable_base, |
1557 | aperture_size); | 1557 | aperture_size); |
1558 | 1558 | ||
1559 | /* The i915 workqueue is primarily used for batched retirement of | 1559 | /* The i915 workqueue is primarily used for batched retirement of |
@@ -1658,11 +1658,11 @@ out_gem_unload: | |||
1658 | out_mtrrfree: | 1658 | out_mtrrfree: |
1659 | if (dev_priv->mm.gtt_mtrr >= 0) { | 1659 | if (dev_priv->mm.gtt_mtrr >= 0) { |
1660 | mtrr_del(dev_priv->mm.gtt_mtrr, | 1660 | mtrr_del(dev_priv->mm.gtt_mtrr, |
1661 | dev_priv->mm.gtt_base_addr, | 1661 | dev_priv->gtt.mappable_base, |
1662 | aperture_size); | 1662 | aperture_size); |
1663 | dev_priv->mm.gtt_mtrr = -1; | 1663 | dev_priv->mm.gtt_mtrr = -1; |
1664 | } | 1664 | } |
1665 | io_mapping_free(dev_priv->mm.gtt_mapping); | 1665 | io_mapping_free(dev_priv->gtt.mappable); |
1666 | out_rmmap: | 1666 | out_rmmap: |
1667 | pci_iounmap(dev->pdev, dev_priv->regs); | 1667 | pci_iounmap(dev->pdev, dev_priv->regs); |
1668 | put_gmch: | 1668 | put_gmch: |
@@ -1696,10 +1696,10 @@ int i915_driver_unload(struct drm_device *dev) | |||
1696 | /* Cancel the retire work handler, which should be idle now. */ | 1696 | /* Cancel the retire work handler, which should be idle now. */ |
1697 | cancel_delayed_work_sync(&dev_priv->mm.retire_work); | 1697 | cancel_delayed_work_sync(&dev_priv->mm.retire_work); |
1698 | 1698 | ||
1699 | io_mapping_free(dev_priv->mm.gtt_mapping); | 1699 | io_mapping_free(dev_priv->gtt.mappable); |
1700 | if (dev_priv->mm.gtt_mtrr >= 0) { | 1700 | if (dev_priv->mm.gtt_mtrr >= 0) { |
1701 | mtrr_del(dev_priv->mm.gtt_mtrr, | 1701 | mtrr_del(dev_priv->mm.gtt_mtrr, |
1702 | dev_priv->mm.gtt_base_addr, | 1702 | dev_priv->gtt.mappable_base, |
1703 | dev_priv->mm.gtt->gtt_mappable_entries * PAGE_SIZE); | 1703 | dev_priv->mm.gtt->gtt_mappable_entries * PAGE_SIZE); |
1704 | dev_priv->mm.gtt_mtrr = -1; | 1704 | dev_priv->mm.gtt_mtrr = -1; |
1705 | } | 1705 | } |
diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h index 6e2c10b65c8d..f3f2e5e1393f 100644 --- a/drivers/gpu/drm/i915/i915_drv.h +++ b/drivers/gpu/drm/i915/i915_drv.h | |||
@@ -364,6 +364,25 @@ struct intel_device_info { | |||
364 | u8 has_llc:1; | 364 | u8 has_llc:1; |
365 | }; | 365 | }; |
366 | 366 | ||
367 | /* The Graphics Translation Table is the way in which GEN hardware translates a | ||
368 | * Graphics Virtual Address into a Physical Address. In addition to the normal | ||
369 | * collateral associated with any va->pa translations GEN hardware also has a | ||
370 | * portion of the GTT which can be mapped by the CPU and remain both coherent | ||
371 | * and correct (in cases like swizzling). That region is referred to as GMADR in | ||
372 | * the spec. | ||
373 | */ | ||
374 | struct i915_gtt { | ||
375 | unsigned long start; /* Start offset of used GTT */ | ||
376 | size_t total; /* Total size GTT can map */ | ||
377 | |||
378 | unsigned long mappable_end; /* End offset that we can CPU map */ | ||
379 | struct io_mapping *mappable; /* Mapping to our CPU mappable region */ | ||
380 | phys_addr_t mappable_base; /* PA of our GMADR */ | ||
381 | |||
382 | /** "Graphics Stolen Memory" holds the global PTEs */ | ||
383 | void __iomem *gsm; | ||
384 | }; | ||
385 | |||
367 | #define I915_PPGTT_PD_ENTRIES 512 | 386 | #define I915_PPGTT_PD_ENTRIES 512 |
368 | #define I915_PPGTT_PT_ENTRIES 1024 | 387 | #define I915_PPGTT_PT_ENTRIES 1024 |
369 | struct i915_hw_ppgtt { | 388 | struct i915_hw_ppgtt { |
@@ -781,6 +800,8 @@ typedef struct drm_i915_private { | |||
781 | /* Register state */ | 800 | /* Register state */ |
782 | bool modeset_on_lid; | 801 | bool modeset_on_lid; |
783 | 802 | ||
803 | struct i915_gtt gtt; | ||
804 | |||
784 | struct { | 805 | struct { |
785 | /** Bridge to intel-gtt-ko */ | 806 | /** Bridge to intel-gtt-ko */ |
786 | struct intel_gtt *gtt; | 807 | struct intel_gtt *gtt; |
@@ -799,15 +820,8 @@ typedef struct drm_i915_private { | |||
799 | struct list_head unbound_list; | 820 | struct list_head unbound_list; |
800 | 821 | ||
801 | /** Usable portion of the GTT for GEM */ | 822 | /** Usable portion of the GTT for GEM */ |
802 | unsigned long gtt_start; | ||
803 | unsigned long gtt_mappable_end; | ||
804 | unsigned long stolen_base; /* limited to low memory (32-bit) */ | 823 | unsigned long stolen_base; /* limited to low memory (32-bit) */ |
805 | 824 | ||
806 | /** "Graphics Stolen Memory" holds the global PTEs */ | ||
807 | void __iomem *gsm; | ||
808 | |||
809 | struct io_mapping *gtt_mapping; | ||
810 | phys_addr_t gtt_base_addr; | ||
811 | int gtt_mtrr; | 825 | int gtt_mtrr; |
812 | 826 | ||
813 | /** PPGTT used for aliasing the PPGTT with the GTT */ | 827 | /** PPGTT used for aliasing the PPGTT with the GTT */ |
@@ -885,7 +899,6 @@ typedef struct drm_i915_private { | |||
885 | struct drm_i915_gem_phys_object *phys_objs[I915_MAX_PHYS_OBJECT]; | 899 | struct drm_i915_gem_phys_object *phys_objs[I915_MAX_PHYS_OBJECT]; |
886 | 900 | ||
887 | /* accounting, useful for userland debugging */ | 901 | /* accounting, useful for userland debugging */ |
888 | size_t gtt_total; | ||
889 | size_t object_memory; | 902 | size_t object_memory; |
890 | u32 object_count; | 903 | u32 object_count; |
891 | } mm; | 904 | } mm; |
diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c index a2bb18914329..51fdf16181a7 100644 --- a/drivers/gpu/drm/i915/i915_gem.c +++ b/drivers/gpu/drm/i915/i915_gem.c | |||
@@ -186,7 +186,7 @@ i915_gem_get_aperture_ioctl(struct drm_device *dev, void *data, | |||
186 | pinned += obj->gtt_space->size; | 186 | pinned += obj->gtt_space->size; |
187 | mutex_unlock(&dev->struct_mutex); | 187 | mutex_unlock(&dev->struct_mutex); |
188 | 188 | ||
189 | args->aper_size = dev_priv->mm.gtt_total; | 189 | args->aper_size = dev_priv->gtt.total; |
190 | args->aper_available_size = args->aper_size - pinned; | 190 | args->aper_available_size = args->aper_size - pinned; |
191 | 191 | ||
192 | return 0; | 192 | return 0; |
@@ -637,7 +637,7 @@ i915_gem_gtt_pwrite_fast(struct drm_device *dev, | |||
637 | * source page isn't available. Return the error and we'll | 637 | * source page isn't available. Return the error and we'll |
638 | * retry in the slow path. | 638 | * retry in the slow path. |
639 | */ | 639 | */ |
640 | if (fast_user_write(dev_priv->mm.gtt_mapping, page_base, | 640 | if (fast_user_write(dev_priv->gtt.mappable, page_base, |
641 | page_offset, user_data, page_length)) { | 641 | page_offset, user_data, page_length)) { |
642 | ret = -EFAULT; | 642 | ret = -EFAULT; |
643 | goto out_unpin; | 643 | goto out_unpin; |
@@ -1362,7 +1362,7 @@ int i915_gem_fault(struct vm_area_struct *vma, struct vm_fault *vmf) | |||
1362 | 1362 | ||
1363 | obj->fault_mappable = true; | 1363 | obj->fault_mappable = true; |
1364 | 1364 | ||
1365 | pfn = ((dev_priv->mm.gtt_base_addr + obj->gtt_offset) >> PAGE_SHIFT) + | 1365 | pfn = ((dev_priv->gtt.mappable_base + obj->gtt_offset) >> PAGE_SHIFT) + |
1366 | page_offset; | 1366 | page_offset; |
1367 | 1367 | ||
1368 | /* Finally, remap it using the new GTT offset */ | 1368 | /* Finally, remap it using the new GTT offset */ |
@@ -1544,7 +1544,7 @@ i915_gem_mmap_gtt(struct drm_file *file, | |||
1544 | goto unlock; | 1544 | goto unlock; |
1545 | } | 1545 | } |
1546 | 1546 | ||
1547 | if (obj->base.size > dev_priv->mm.gtt_mappable_end) { | 1547 | if (obj->base.size > dev_priv->gtt.mappable_end) { |
1548 | ret = -E2BIG; | 1548 | ret = -E2BIG; |
1549 | goto out; | 1549 | goto out; |
1550 | } | 1550 | } |
@@ -2910,7 +2910,7 @@ i915_gem_object_bind_to_gtt(struct drm_i915_gem_object *obj, | |||
2910 | * before evicting everything in a vain attempt to find space. | 2910 | * before evicting everything in a vain attempt to find space. |
2911 | */ | 2911 | */ |
2912 | if (obj->base.size > | 2912 | if (obj->base.size > |
2913 | (map_and_fenceable ? dev_priv->mm.gtt_mappable_end : dev_priv->mm.gtt_total)) { | 2913 | (map_and_fenceable ? dev_priv->gtt.mappable_end : dev_priv->gtt.total)) { |
2914 | DRM_ERROR("Attempting to bind an object larger than the aperture\n"); | 2914 | DRM_ERROR("Attempting to bind an object larger than the aperture\n"); |
2915 | return -E2BIG; | 2915 | return -E2BIG; |
2916 | } | 2916 | } |
@@ -2931,7 +2931,7 @@ i915_gem_object_bind_to_gtt(struct drm_i915_gem_object *obj, | |||
2931 | if (map_and_fenceable) | 2931 | if (map_and_fenceable) |
2932 | ret = drm_mm_insert_node_in_range_generic(&dev_priv->mm.gtt_space, node, | 2932 | ret = drm_mm_insert_node_in_range_generic(&dev_priv->mm.gtt_space, node, |
2933 | size, alignment, obj->cache_level, | 2933 | size, alignment, obj->cache_level, |
2934 | 0, dev_priv->mm.gtt_mappable_end); | 2934 | 0, dev_priv->gtt.mappable_end); |
2935 | else | 2935 | else |
2936 | ret = drm_mm_insert_node_generic(&dev_priv->mm.gtt_space, node, | 2936 | ret = drm_mm_insert_node_generic(&dev_priv->mm.gtt_space, node, |
2937 | size, alignment, obj->cache_level); | 2937 | size, alignment, obj->cache_level); |
@@ -2971,7 +2971,7 @@ i915_gem_object_bind_to_gtt(struct drm_i915_gem_object *obj, | |||
2971 | (node->start & (fence_alignment - 1)) == 0; | 2971 | (node->start & (fence_alignment - 1)) == 0; |
2972 | 2972 | ||
2973 | mappable = | 2973 | mappable = |
2974 | obj->gtt_offset + obj->base.size <= dev_priv->mm.gtt_mappable_end; | 2974 | obj->gtt_offset + obj->base.size <= dev_priv->gtt.mappable_end; |
2975 | 2975 | ||
2976 | obj->map_and_fenceable = mappable && fenceable; | 2976 | obj->map_and_fenceable = mappable && fenceable; |
2977 | 2977 | ||
diff --git a/drivers/gpu/drm/i915/i915_gem_evict.c b/drivers/gpu/drm/i915/i915_gem_evict.c index 776a3225184c..c86d5d9356fd 100644 --- a/drivers/gpu/drm/i915/i915_gem_evict.c +++ b/drivers/gpu/drm/i915/i915_gem_evict.c | |||
@@ -80,7 +80,7 @@ i915_gem_evict_something(struct drm_device *dev, int min_size, | |||
80 | if (mappable) | 80 | if (mappable) |
81 | drm_mm_init_scan_with_range(&dev_priv->mm.gtt_space, | 81 | drm_mm_init_scan_with_range(&dev_priv->mm.gtt_space, |
82 | min_size, alignment, cache_level, | 82 | min_size, alignment, cache_level, |
83 | 0, dev_priv->mm.gtt_mappable_end); | 83 | 0, dev_priv->gtt.mappable_end); |
84 | else | 84 | else |
85 | drm_mm_init_scan(&dev_priv->mm.gtt_space, | 85 | drm_mm_init_scan(&dev_priv->mm.gtt_space, |
86 | min_size, alignment, cache_level); | 86 | min_size, alignment, cache_level); |
diff --git a/drivers/gpu/drm/i915/i915_gem_execbuffer.c b/drivers/gpu/drm/i915/i915_gem_execbuffer.c index f5a11ecf5494..27269103b621 100644 --- a/drivers/gpu/drm/i915/i915_gem_execbuffer.c +++ b/drivers/gpu/drm/i915/i915_gem_execbuffer.c | |||
@@ -281,7 +281,7 @@ i915_gem_execbuffer_relocate_entry(struct drm_i915_gem_object *obj, | |||
281 | 281 | ||
282 | /* Map the page containing the relocation we're going to perform. */ | 282 | /* Map the page containing the relocation we're going to perform. */ |
283 | reloc->offset += obj->gtt_offset; | 283 | reloc->offset += obj->gtt_offset; |
284 | reloc_page = io_mapping_map_atomic_wc(dev_priv->mm.gtt_mapping, | 284 | reloc_page = io_mapping_map_atomic_wc(dev_priv->gtt.mappable, |
285 | reloc->offset & PAGE_MASK); | 285 | reloc->offset & PAGE_MASK); |
286 | reloc_entry = (uint32_t __iomem *) | 286 | reloc_entry = (uint32_t __iomem *) |
287 | (reloc_page + (reloc->offset & ~PAGE_MASK)); | 287 | (reloc_page + (reloc->offset & ~PAGE_MASK)); |
diff --git a/drivers/gpu/drm/i915/i915_gem_gtt.c b/drivers/gpu/drm/i915/i915_gem_gtt.c index 8c42ddd467b6..61bfb12e1016 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 = (gtt_pte_t __iomem*)dev_priv->mm.gsm + ppgtt->pd_offset/sizeof(gtt_pte_t); | 293 | pd_addr = (gtt_pte_t __iomem*)dev_priv->gtt.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 = (gtt_pte_t __iomem *) dev_priv->mm.gsm + first_entry; | 370 | gtt_pte_t __iomem *gtt_base = (gtt_pte_t __iomem *) dev_priv->gtt.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 | ||
@@ -393,8 +393,8 @@ void i915_gem_restore_gtt_mappings(struct drm_device *dev) | |||
393 | struct drm_i915_gem_object *obj; | 393 | struct drm_i915_gem_object *obj; |
394 | 394 | ||
395 | /* First fill our portion of the GTT with scratch pages */ | 395 | /* First fill our portion of the GTT with scratch pages */ |
396 | i915_ggtt_clear_range(dev, dev_priv->mm.gtt_start / PAGE_SIZE, | 396 | i915_ggtt_clear_range(dev, dev_priv->gtt.start / PAGE_SIZE, |
397 | dev_priv->mm.gtt_total / PAGE_SIZE); | 397 | dev_priv->gtt.total / PAGE_SIZE); |
398 | 398 | ||
399 | list_for_each_entry(obj, &dev_priv->mm.bound_list, gtt_list) { | 399 | list_for_each_entry(obj, &dev_priv->mm.bound_list, gtt_list) { |
400 | i915_gem_clflush_object(obj); | 400 | i915_gem_clflush_object(obj); |
@@ -433,7 +433,7 @@ static void gen6_ggtt_bind_object(struct drm_i915_gem_object *obj, | |||
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 = | 435 | gtt_pte_t __iomem *gtt_entries = |
436 | (gtt_pte_t __iomem *)dev_priv->mm.gsm + first_entry; | 436 | (gtt_pte_t __iomem *)dev_priv->gtt.gsm + first_entry; |
437 | int unused, i = 0; | 437 | int unused, i = 0; |
438 | unsigned int len, m = 0; | 438 | unsigned int len, m = 0; |
439 | dma_addr_t addr; | 439 | dma_addr_t addr; |
@@ -556,9 +556,9 @@ void i915_gem_setup_global_gtt(struct drm_device *dev, | |||
556 | obj->has_global_gtt_mapping = 1; | 556 | obj->has_global_gtt_mapping = 1; |
557 | } | 557 | } |
558 | 558 | ||
559 | dev_priv->mm.gtt_start = start; | 559 | dev_priv->gtt.start = start; |
560 | dev_priv->mm.gtt_mappable_end = mappable_end; | 560 | dev_priv->gtt.mappable_end = mappable_end; |
561 | dev_priv->mm.gtt_total = end - start; | 561 | dev_priv->gtt.total = end - start; |
562 | 562 | ||
563 | /* Clear any non-preallocated blocks */ | 563 | /* Clear any non-preallocated blocks */ |
564 | drm_mm_for_each_hole(entry, &dev_priv->mm.gtt_space, | 564 | drm_mm_for_each_hole(entry, &dev_priv->mm.gtt_space, |
@@ -752,9 +752,9 @@ int i915_gem_gtt_init(struct drm_device *dev) | |||
752 | goto err_out; | 752 | goto err_out; |
753 | } | 753 | } |
754 | 754 | ||
755 | dev_priv->mm.gsm = ioremap_wc(gtt_bus_addr, | 755 | dev_priv->gtt.gsm = ioremap_wc(gtt_bus_addr, |
756 | dev_priv->mm.gtt->gtt_total_entries * sizeof(gtt_pte_t)); | 756 | dev_priv->mm.gtt->gtt_total_entries * sizeof(gtt_pte_t)); |
757 | if (!dev_priv->mm.gsm) { | 757 | if (!dev_priv->gtt.gsm) { |
758 | DRM_ERROR("Failed to map the gtt page table\n"); | 758 | DRM_ERROR("Failed to map the gtt page table\n"); |
759 | teardown_scratch_page(dev); | 759 | teardown_scratch_page(dev); |
760 | ret = -ENOMEM; | 760 | ret = -ENOMEM; |
@@ -778,7 +778,7 @@ err_out: | |||
778 | void i915_gem_gtt_fini(struct drm_device *dev) | 778 | void i915_gem_gtt_fini(struct drm_device *dev) |
779 | { | 779 | { |
780 | struct drm_i915_private *dev_priv = dev->dev_private; | 780 | struct drm_i915_private *dev_priv = dev->dev_private; |
781 | iounmap(dev_priv->mm.gsm); | 781 | iounmap(dev_priv->gtt.gsm); |
782 | teardown_scratch_page(dev); | 782 | teardown_scratch_page(dev); |
783 | if (INTEL_INFO(dev)->gen < 6) | 783 | if (INTEL_INFO(dev)->gen < 6) |
784 | intel_gmch_remove(); | 784 | intel_gmch_remove(); |
diff --git a/drivers/gpu/drm/i915/i915_gem_tiling.c b/drivers/gpu/drm/i915/i915_gem_tiling.c index e76f0d8470a1..abcba2f5a788 100644 --- a/drivers/gpu/drm/i915/i915_gem_tiling.c +++ b/drivers/gpu/drm/i915/i915_gem_tiling.c | |||
@@ -357,7 +357,7 @@ i915_gem_set_tiling(struct drm_device *dev, void *data, | |||
357 | 357 | ||
358 | obj->map_and_fenceable = | 358 | obj->map_and_fenceable = |
359 | obj->gtt_space == NULL || | 359 | obj->gtt_space == NULL || |
360 | (obj->gtt_offset + obj->base.size <= dev_priv->mm.gtt_mappable_end && | 360 | (obj->gtt_offset + obj->base.size <= dev_priv->gtt.mappable_end && |
361 | i915_gem_object_fence_ok(obj, args->tiling_mode)); | 361 | i915_gem_object_fence_ok(obj, args->tiling_mode)); |
362 | 362 | ||
363 | /* Rebind if we need a change of alignment */ | 363 | /* Rebind if we need a change of alignment */ |
diff --git a/drivers/gpu/drm/i915/i915_irq.c b/drivers/gpu/drm/i915/i915_irq.c index 202813128441..cc49a6ddc052 100644 --- a/drivers/gpu/drm/i915/i915_irq.c +++ b/drivers/gpu/drm/i915/i915_irq.c | |||
@@ -939,7 +939,7 @@ i915_error_object_create(struct drm_i915_private *dev_priv, | |||
939 | goto unwind; | 939 | goto unwind; |
940 | 940 | ||
941 | local_irq_save(flags); | 941 | local_irq_save(flags); |
942 | if (reloc_offset < dev_priv->mm.gtt_mappable_end && | 942 | if (reloc_offset < dev_priv->gtt.mappable_end && |
943 | src->has_global_gtt_mapping) { | 943 | src->has_global_gtt_mapping) { |
944 | void __iomem *s; | 944 | void __iomem *s; |
945 | 945 | ||
@@ -948,7 +948,7 @@ i915_error_object_create(struct drm_i915_private *dev_priv, | |||
948 | * captures what the GPU read. | 948 | * captures what the GPU read. |
949 | */ | 949 | */ |
950 | 950 | ||
951 | s = io_mapping_map_atomic_wc(dev_priv->mm.gtt_mapping, | 951 | s = io_mapping_map_atomic_wc(dev_priv->gtt.mappable, |
952 | reloc_offset); | 952 | reloc_offset); |
953 | memcpy_fromio(d, s, PAGE_SIZE); | 953 | memcpy_fromio(d, s, PAGE_SIZE); |
954 | io_mapping_unmap_atomic(s); | 954 | io_mapping_unmap_atomic(s); |
diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c index 40b6b5e9d6ef..e4c5067a54d3 100644 --- a/drivers/gpu/drm/i915/intel_display.c +++ b/drivers/gpu/drm/i915/intel_display.c | |||
@@ -8687,7 +8687,7 @@ void intel_modeset_init(struct drm_device *dev) | |||
8687 | dev->mode_config.max_width = 8192; | 8687 | dev->mode_config.max_width = 8192; |
8688 | dev->mode_config.max_height = 8192; | 8688 | dev->mode_config.max_height = 8192; |
8689 | } | 8689 | } |
8690 | dev->mode_config.fb_base = dev_priv->mm.gtt_base_addr; | 8690 | dev->mode_config.fb_base = dev_priv->gtt.mappable_base; |
8691 | 8691 | ||
8692 | DRM_DEBUG_KMS("%d display pipe%s available.\n", | 8692 | DRM_DEBUG_KMS("%d display pipe%s available.\n", |
8693 | dev_priv->num_pipe, dev_priv->num_pipe > 1 ? "s" : ""); | 8693 | dev_priv->num_pipe, dev_priv->num_pipe > 1 ? "s" : ""); |
diff --git a/drivers/gpu/drm/i915/intel_fb.c b/drivers/gpu/drm/i915/intel_fb.c index 71d55801c0d9..ce02af8ca96e 100644 --- a/drivers/gpu/drm/i915/intel_fb.c +++ b/drivers/gpu/drm/i915/intel_fb.c | |||
@@ -142,7 +142,7 @@ static int intelfb_create(struct intel_fbdev *ifbdev, | |||
142 | info->fix.smem_len = size; | 142 | info->fix.smem_len = size; |
143 | 143 | ||
144 | info->screen_base = | 144 | info->screen_base = |
145 | ioremap_wc(dev_priv->mm.gtt_base_addr + obj->gtt_offset, | 145 | ioremap_wc(dev_priv->gtt.mappable_base + obj->gtt_offset, |
146 | size); | 146 | size); |
147 | if (!info->screen_base) { | 147 | if (!info->screen_base) { |
148 | ret = -ENOSPC; | 148 | ret = -ENOSPC; |
diff --git a/drivers/gpu/drm/i915/intel_overlay.c b/drivers/gpu/drm/i915/intel_overlay.c index fabe0acf808d..ba978bf93a2e 100644 --- a/drivers/gpu/drm/i915/intel_overlay.c +++ b/drivers/gpu/drm/i915/intel_overlay.c | |||
@@ -195,7 +195,7 @@ intel_overlay_map_regs(struct intel_overlay *overlay) | |||
195 | if (OVERLAY_NEEDS_PHYSICAL(overlay->dev)) | 195 | if (OVERLAY_NEEDS_PHYSICAL(overlay->dev)) |
196 | regs = (struct overlay_registers __iomem *)overlay->reg_bo->phys_obj->handle->vaddr; | 196 | regs = (struct overlay_registers __iomem *)overlay->reg_bo->phys_obj->handle->vaddr; |
197 | else | 197 | else |
198 | regs = io_mapping_map_wc(dev_priv->mm.gtt_mapping, | 198 | regs = io_mapping_map_wc(dev_priv->gtt.mappable, |
199 | overlay->reg_bo->gtt_offset); | 199 | overlay->reg_bo->gtt_offset); |
200 | 200 | ||
201 | return regs; | 201 | return regs; |
@@ -1434,7 +1434,7 @@ intel_overlay_map_regs_atomic(struct intel_overlay *overlay) | |||
1434 | regs = (struct overlay_registers __iomem *) | 1434 | regs = (struct overlay_registers __iomem *) |
1435 | overlay->reg_bo->phys_obj->handle->vaddr; | 1435 | overlay->reg_bo->phys_obj->handle->vaddr; |
1436 | else | 1436 | else |
1437 | regs = io_mapping_map_atomic_wc(dev_priv->mm.gtt_mapping, | 1437 | regs = io_mapping_map_atomic_wc(dev_priv->gtt.mappable, |
1438 | overlay->reg_bo->gtt_offset); | 1438 | overlay->reg_bo->gtt_offset); |
1439 | 1439 | ||
1440 | return regs; | 1440 | return regs; |