aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/ttm
diff options
context:
space:
mode:
authorJerome Glisse <jglisse@redhat.com>2010-04-07 06:21:27 -0400
committerDave Airlie <airlied@redhat.com>2010-04-20 00:13:09 -0400
commit0c321c79627189204d7d0bf65ab19f5ac419abed (patch)
tree9df52ae46164bdca3dab6a36d5ec17360c60b9e4 /drivers/gpu/drm/ttm
parent96bf8b8778976a6e6a4fe4e6e0421d8ed7892798 (diff)
drm/ttm: remove io_ field from TTM V6
All TTM driver have been converted to new io_mem_reserve/free interface which allow driver to choose and return proper io base, offset to core TTM for ioremapping if necessary. This patch remove what is now deadcode. V2 adapt to match with change in first patch of the patchset V3 update after io_mem_reserve/io_mem_free callback balancing V4 adjust to minor cleanup V5 remove the needs ioremap flag V6 keep the ioremapping facility in TTM [airlied- squashed driver removals in here also] Signed-off-by: Jerome Glisse <jglisse@redhat.com> Reviewed-by: Thomas Hellstrom <thellstrom@vmware.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
Diffstat (limited to 'drivers/gpu/drm/ttm')
-rw-r--r--drivers/gpu/drm/ttm/ttm_bo.c22
-rw-r--r--drivers/gpu/drm/ttm/ttm_bo_util.c19
2 files changed, 4 insertions, 37 deletions
diff --git a/drivers/gpu/drm/ttm/ttm_bo.c b/drivers/gpu/drm/ttm/ttm_bo.c
index b42e3fae1bd5..3b5b094b1397 100644
--- a/drivers/gpu/drm/ttm/ttm_bo.c
+++ b/drivers/gpu/drm/ttm/ttm_bo.c
@@ -79,8 +79,6 @@ static void ttm_mem_type_debug(struct ttm_bo_device *bdev, int mem_type)
79 printk(KERN_ERR TTM_PFX " use_type: %d\n", man->use_type); 79 printk(KERN_ERR TTM_PFX " use_type: %d\n", man->use_type);
80 printk(KERN_ERR TTM_PFX " flags: 0x%08X\n", man->flags); 80 printk(KERN_ERR TTM_PFX " flags: 0x%08X\n", man->flags);
81 printk(KERN_ERR TTM_PFX " gpu_offset: 0x%08lX\n", man->gpu_offset); 81 printk(KERN_ERR TTM_PFX " gpu_offset: 0x%08lX\n", man->gpu_offset);
82 printk(KERN_ERR TTM_PFX " io_offset: 0x%08lX\n", man->io_offset);
83 printk(KERN_ERR TTM_PFX " io_size: %ld\n", man->io_size);
84 printk(KERN_ERR TTM_PFX " size: %llu\n", man->size); 82 printk(KERN_ERR TTM_PFX " size: %llu\n", man->size);
85 printk(KERN_ERR TTM_PFX " available_caching: 0x%08X\n", 83 printk(KERN_ERR TTM_PFX " available_caching: 0x%08X\n",
86 man->available_caching); 84 man->available_caching);
@@ -1563,26 +1561,6 @@ bool ttm_mem_reg_is_pci(struct ttm_bo_device *bdev, struct ttm_mem_reg *mem)
1563 return true; 1561 return true;
1564} 1562}
1565 1563
1566int ttm_bo_pci_offset(struct ttm_bo_device *bdev,
1567 struct ttm_mem_reg *mem,
1568 unsigned long *bus_base,
1569 unsigned long *bus_offset, unsigned long *bus_size)
1570{
1571 struct ttm_mem_type_manager *man = &bdev->man[mem->mem_type];
1572
1573 *bus_size = 0;
1574 if (!(man->flags & TTM_MEMTYPE_FLAG_MAPPABLE))
1575 return -EINVAL;
1576
1577 if (ttm_mem_reg_is_pci(bdev, mem)) {
1578 *bus_offset = mem->mm_node->start << PAGE_SHIFT;
1579 *bus_size = mem->num_pages << PAGE_SHIFT;
1580 *bus_base = man->io_offset + (uintptr_t)man->io_addr;
1581 }
1582
1583 return 0;
1584}
1585
1586void ttm_bo_unmap_virtual(struct ttm_buffer_object *bo) 1564void ttm_bo_unmap_virtual(struct ttm_buffer_object *bo)
1587{ 1565{
1588 struct ttm_bo_device *bdev = bo->bdev; 1566 struct ttm_bo_device *bdev = bo->bdev;
diff --git a/drivers/gpu/drm/ttm/ttm_bo_util.c b/drivers/gpu/drm/ttm/ttm_bo_util.c
index d58eeb5ed22b..333b401ca4c9 100644
--- a/drivers/gpu/drm/ttm/ttm_bo_util.c
+++ b/drivers/gpu/drm/ttm/ttm_bo_util.c
@@ -83,24 +83,13 @@ EXPORT_SYMBOL(ttm_bo_move_ttm);
83 83
84int ttm_mem_io_reserve(struct ttm_bo_device *bdev, struct ttm_mem_reg *mem) 84int ttm_mem_io_reserve(struct ttm_bo_device *bdev, struct ttm_mem_reg *mem)
85{ 85{
86 struct ttm_mem_type_manager *man = &bdev->man[mem->mem_type];
87 int ret; 86 int ret;
88 87
89 if (bdev->driver->io_mem_reserve) { 88 if (!mem->bus.io_reserved) {
90 if (!mem->bus.io_reserved) { 89 mem->bus.io_reserved = true;
91 mem->bus.io_reserved = true; 90 ret = bdev->driver->io_mem_reserve(bdev, mem);
92 ret = bdev->driver->io_mem_reserve(bdev, mem);
93 if (unlikely(ret != 0))
94 return ret;
95 }
96 } else {
97 ret = ttm_bo_pci_offset(bdev, mem, &mem->bus.base, &mem->bus.offset, &mem->bus.size);
98 if (unlikely(ret != 0)) 91 if (unlikely(ret != 0))
99 return ret; 92 return ret;
100 mem->bus.addr = NULL;
101 if (!(man->flags & TTM_MEMTYPE_FLAG_NEEDS_IOREMAP))
102 mem->bus.addr = (void *)(((u8 *)man->io_addr) + mem->bus.offset);
103 mem->bus.is_iomem = (mem->bus.size > 0) ? 1 : 0;
104 } 93 }
105 return 0; 94 return 0;
106} 95}
@@ -149,7 +138,7 @@ void ttm_mem_reg_iounmap(struct ttm_bo_device *bdev, struct ttm_mem_reg *mem,
149 138
150 man = &bdev->man[mem->mem_type]; 139 man = &bdev->man[mem->mem_type];
151 140
152 if (virtual && (man->flags & TTM_MEMTYPE_FLAG_NEEDS_IOREMAP || mem->bus.addr == NULL)) 141 if (virtual && mem->bus.addr == NULL)
153 iounmap(virtual); 142 iounmap(virtual);
154 ttm_mem_io_free(bdev, mem); 143 ttm_mem_io_free(bdev, mem);
155} 144}