* Unmappable VRAM patchset V4 @ 2010-02-25 17:01 Jerome Glisse 2010-02-25 17:01 ` [PATCH 1/9] drm/ttm: ttm_fault callback to allow driver to handle bo placement V2 Jerome Glisse 2010-03-01 5:44 ` Unmappable VRAM patchset V4 Dave Airlie 0 siblings, 2 replies; 16+ messages in thread From: Jerome Glisse @ 2010-02-25 17:01 UTC (permalink / raw) To: airlied; +Cc: thellstrom, skeggsb, dri-devel Updated patchset, to apply cleanly on top of TTM split no_wait argument. Compile tested for nouveau+vmwgfx, test in progress for radeon. So with the new change radeon won't wait for bo reserving other bo in fault path but will wait the GPU (hoping it doesn't lockup ;)) This should address concern about the wait/locking issue. Cheers, Jerome ------------------------------------------------------------------------------ Download Intel® Parallel Studio Eval Try the new software tools for yourself. Speed compiling, find bugs proactively, and fine-tune applications for parallel performance. See why Intel Parallel Studio got high marks during beta. http://p.sf.net/sfu/intel-sw-dev -- ^ permalink raw reply [flat|nested] 16+ messages in thread
* [PATCH 1/9] drm/ttm: ttm_fault callback to allow driver to handle bo placement V2 2010-02-25 17:01 Unmappable VRAM patchset V4 Jerome Glisse @ 2010-02-25 17:01 ` Jerome Glisse 2010-02-25 17:01 ` [PATCH 2/9] drm/radeon/kms: add support for new fault callback V3 Jerome Glisse 2010-03-01 5:44 ` Unmappable VRAM patchset V4 Dave Airlie 1 sibling, 1 reply; 16+ messages in thread From: Jerome Glisse @ 2010-02-25 17:01 UTC (permalink / raw) To: airlied; +Cc: thellstrom, skeggsb, Jerome Glisse, dri-devel On fault the driver is given the opportunity to perform any operation it sees fit in order to place the buffer into a CPU visible area of memory. This patch doesn't break TTM users, nouveau, vmwgfx and radeon should keep working properly. Future patch will take advantage of this infrastructure and remove the old path from TTM once driver are converted. V2 return VM_FAULT_NOPAGE if callback return -EBUSY or -ERESTARTSYS Signed-off-by: Jerome Glisse <jglisse@redhat.com> --- drivers/gpu/drm/ttm/ttm_bo.c | 3 +- drivers/gpu/drm/ttm/ttm_bo_util.c | 92 +++++++++++++++++-------------------- drivers/gpu/drm/ttm/ttm_bo_vm.c | 56 ++++++++++++---------- include/drm/ttm/ttm_bo_api.h | 1 + include/drm/ttm/ttm_bo_driver.h | 30 ++++++++++++ 5 files changed, 105 insertions(+), 77 deletions(-) diff --git a/drivers/gpu/drm/ttm/ttm_bo.c b/drivers/gpu/drm/ttm/ttm_bo.c index d2b2482..2a808fc 100644 --- a/drivers/gpu/drm/ttm/ttm_bo.c +++ b/drivers/gpu/drm/ttm/ttm_bo.c @@ -1588,7 +1588,8 @@ void ttm_bo_unmap_virtual(struct ttm_buffer_object *bo) if (!bdev->dev_mapping) return; - + if (bdev->driver->io_mem_free) + bdev->driver->io_mem_free(bdev, &bo->mem); unmap_mapping_range(bdev->dev_mapping, offset, holelen, 1); } EXPORT_SYMBOL(ttm_bo_unmap_virtual); diff --git a/drivers/gpu/drm/ttm/ttm_bo_util.c b/drivers/gpu/drm/ttm/ttm_bo_util.c index db43b30..efce42c 100644 --- a/drivers/gpu/drm/ttm/ttm_bo_util.c +++ b/drivers/gpu/drm/ttm/ttm_bo_util.c @@ -85,26 +85,36 @@ int ttm_mem_reg_ioremap(struct ttm_bo_device *bdev, struct ttm_mem_reg *mem, void **virtual) { struct ttm_mem_type_manager *man = &bdev->man[mem->mem_type]; - unsigned long bus_offset; - unsigned long bus_size; - unsigned long bus_base; + struct ttm_bus_placement pl; int ret; void *addr; *virtual = NULL; - ret = ttm_bo_pci_offset(bdev, mem, &bus_base, &bus_offset, &bus_size); - if (ret || bus_size == 0) - return ret; + if (bdev->driver->io_mem_reserve) { + ret = bdev->driver->io_mem_reserve(bdev, mem, &pl); + if (unlikely(ret != 0)) { + return ret; + } + } else { + ret = ttm_bo_pci_offset(bdev, mem, &pl.base, &pl.offset, &pl.size); + if (unlikely(ret != 0) || pl.size == 0) { + return ret; + } + pl.is_iomem = (pl.size != 0); + } if (!(man->flags & TTM_MEMTYPE_FLAG_NEEDS_IOREMAP)) - addr = (void *)(((u8 *) man->io_addr) + bus_offset); + addr = (void *)(pl.base + pl.offset); else { if (mem->placement & TTM_PL_FLAG_WC) - addr = ioremap_wc(bus_base + bus_offset, bus_size); + addr = ioremap_wc(pl.base + pl.offset, pl.size); else - addr = ioremap_nocache(bus_base + bus_offset, bus_size); - if (!addr) + addr = ioremap_nocache(pl.base + pl.offset, pl.size); + if (!addr) { + if (bdev->driver->io_mem_free) + bdev->driver->io_mem_free(bdev, mem); return -ENOMEM; + } } *virtual = addr; return 0; @@ -119,6 +129,8 @@ void ttm_mem_reg_iounmap(struct ttm_bo_device *bdev, struct ttm_mem_reg *mem, if (virtual && (man->flags & TTM_MEMTYPE_FLAG_NEEDS_IOREMAP)) iounmap(virtual); + if (bdev->driver->io_mem_free) + bdev->driver->io_mem_free(bdev, mem); } static int ttm_copy_io_page(void *dst, void *src, unsigned long page) @@ -442,13 +454,12 @@ int ttm_bo_kmap(struct ttm_buffer_object *bo, unsigned long start_page, unsigned long num_pages, struct ttm_bo_kmap_obj *map) { + struct ttm_bus_placement pl; int ret; - unsigned long bus_base; - unsigned long bus_offset; - unsigned long bus_size; BUG_ON(!list_empty(&bo->swap)); map->virtual = NULL; + map->bo = bo; if (num_pages > bo->num_pages) return -EINVAL; if (start_page > bo->num_pages) @@ -457,16 +468,24 @@ int ttm_bo_kmap(struct ttm_buffer_object *bo, if (num_pages > 1 && !DRM_SUSER(DRM_CURPROC)) return -EPERM; #endif - ret = ttm_bo_pci_offset(bo->bdev, &bo->mem, &bus_base, - &bus_offset, &bus_size); - if (ret) - return ret; - if (bus_size == 0) { + if (bo->bdev->driver->io_mem_reserve) { + ret = bo->bdev->driver->io_mem_reserve(bo->bdev, &bo->mem, &pl); + if (unlikely(ret != 0)) { + return ret; + } + } else { + ret = ttm_bo_pci_offset(bo->bdev, &bo->mem, &pl.base, &pl.offset, &pl.size); + if (unlikely(ret != 0)) { + return ret; + } + pl.is_iomem = (pl.size != 0); + } + if (!pl.is_iomem) { return ttm_bo_kmap_ttm(bo, start_page, num_pages, map); } else { - bus_offset += start_page << PAGE_SHIFT; - bus_size = num_pages << PAGE_SHIFT; - return ttm_bo_ioremap(bo, bus_base, bus_offset, bus_size, map); + pl.offset += start_page << PAGE_SHIFT; + pl.size = num_pages << PAGE_SHIFT; + return ttm_bo_ioremap(bo, pl.base, pl.offset, pl.size, map); } } EXPORT_SYMBOL(ttm_bo_kmap); @@ -478,6 +497,8 @@ void ttm_bo_kunmap(struct ttm_bo_kmap_obj *map) switch (map->bo_kmap_type) { case ttm_bo_map_iomap: iounmap(map->virtual); + if (map->bo->bdev->driver->io_mem_free) + map->bo->bdev->driver->io_mem_free(map->bo->bdev, &map->bo->mem); break; case ttm_bo_map_vmap: vunmap(map->virtual); @@ -495,35 +516,6 @@ void ttm_bo_kunmap(struct ttm_bo_kmap_obj *map) } EXPORT_SYMBOL(ttm_bo_kunmap); -int ttm_bo_pfn_prot(struct ttm_buffer_object *bo, - unsigned long dst_offset, - unsigned long *pfn, pgprot_t *prot) -{ - struct ttm_mem_reg *mem = &bo->mem; - struct ttm_bo_device *bdev = bo->bdev; - unsigned long bus_offset; - unsigned long bus_size; - unsigned long bus_base; - int ret; - ret = ttm_bo_pci_offset(bdev, mem, &bus_base, &bus_offset, - &bus_size); - if (ret) - return -EINVAL; - if (bus_size != 0) - *pfn = (bus_base + bus_offset + dst_offset) >> PAGE_SHIFT; - else - if (!bo->ttm) - return -EINVAL; - else - *pfn = page_to_pfn(ttm_tt_get_page(bo->ttm, - dst_offset >> - PAGE_SHIFT)); - *prot = (mem->placement & TTM_PL_FLAG_CACHED) ? - PAGE_KERNEL : ttm_io_prot(mem->placement, PAGE_KERNEL); - - return 0; -} - int ttm_bo_move_accel_cleanup(struct ttm_buffer_object *bo, void *sync_obj, void *sync_obj_arg, diff --git a/drivers/gpu/drm/ttm/ttm_bo_vm.c b/drivers/gpu/drm/ttm/ttm_bo_vm.c index 668dbe8..fe4ac95 100644 --- a/drivers/gpu/drm/ttm/ttm_bo_vm.c +++ b/drivers/gpu/drm/ttm/ttm_bo_vm.c @@ -74,9 +74,7 @@ static int ttm_bo_vm_fault(struct vm_area_struct *vma, struct vm_fault *vmf) struct ttm_buffer_object *bo = (struct ttm_buffer_object *) vma->vm_private_data; struct ttm_bo_device *bdev = bo->bdev; - unsigned long bus_base; - unsigned long bus_offset; - unsigned long bus_size; + struct ttm_bus_placement pl; unsigned long page_offset; unsigned long page_last; unsigned long pfn; @@ -84,7 +82,6 @@ static int ttm_bo_vm_fault(struct vm_area_struct *vma, struct vm_fault *vmf) struct page *page; int ret; int i; - bool is_iomem; unsigned long address = (unsigned long)vmf->virtual_address; int retval = VM_FAULT_NOPAGE; @@ -104,11 +101,33 @@ static int ttm_bo_vm_fault(struct vm_area_struct *vma, struct vm_fault *vmf) if (bdev->driver->fault_reserve_notify) bdev->driver->fault_reserve_notify(bo); + if (bdev->driver->fault_reserve) { + ret = bdev->driver->fault_reserve(bo, &pl); + switch (ret) { + case 0: + break; + case -EBUSY: + set_need_resched(); + case -ERESTARTSYS: + retval = VM_FAULT_NOPAGE; + goto out_unlock; + default: + retval = VM_FAULT_SIGBUS; + goto out_unlock; + } + } else { + ret = ttm_bo_pci_offset(bdev, &bo->mem, &pl.base, &pl.offset, &pl.size); + if (unlikely(ret != 0)) { + retval = VM_FAULT_SIGBUS; + goto out_unlock; + } + pl.is_iomem = (pl.size != 0); + } + /* * Wait for buffer data in transit, due to a pipelined * move. */ - spin_lock(&bo->lock); if (test_bit(TTM_BO_PRIV_FLAG_MOVING, &bo->priv_flags)) { ret = ttm_bo_wait(bo, false, true, false); @@ -122,20 +141,10 @@ static int ttm_bo_vm_fault(struct vm_area_struct *vma, struct vm_fault *vmf) spin_unlock(&bo->lock); - ret = ttm_bo_pci_offset(bdev, &bo->mem, &bus_base, &bus_offset, - &bus_size); - if (unlikely(ret != 0)) { - retval = VM_FAULT_SIGBUS; - goto out_unlock; - } - - is_iomem = (bus_size != 0); - page_offset = ((address - vma->vm_start) >> PAGE_SHIFT) + bo->vm_node->start - vma->vm_pgoff; page_last = ((vma->vm_end - vma->vm_start) >> PAGE_SHIFT) + bo->vm_node->start - vma->vm_pgoff; - if (unlikely(page_offset >= bo->num_pages)) { retval = VM_FAULT_SIGBUS; goto out_unlock; @@ -154,8 +163,7 @@ static int ttm_bo_vm_fault(struct vm_area_struct *vma, struct vm_fault *vmf) * vma->vm_page_prot when the object changes caching policy, with * the correct locks held. */ - - if (is_iomem) { + if (pl.is_iomem) { vma->vm_page_prot = ttm_io_prot(bo->mem.placement, vma->vm_page_prot); } else { @@ -169,12 +177,9 @@ static int ttm_bo_vm_fault(struct vm_area_struct *vma, struct vm_fault *vmf) * Speculatively prefault a number of pages. Only error on * first page. */ - for (i = 0; i < TTM_BO_VM_NUM_PREFAULT; ++i) { - - if (is_iomem) - pfn = ((bus_base + bus_offset) >> PAGE_SHIFT) + - page_offset; + if (pl.is_iomem) + pfn = ((pl.base + pl.offset) >> PAGE_SHIFT) + page_offset; else { page = ttm_tt_get_page(ttm, page_offset); if (unlikely(!page && i == 0)) { @@ -191,14 +196,12 @@ static int ttm_bo_vm_fault(struct vm_area_struct *vma, struct vm_fault *vmf) * Somebody beat us to this PTE or prefaulting to * an already populated PTE, or prefaulting error. */ - if (unlikely((ret == -EBUSY) || (ret != 0 && i > 0))) break; else if (unlikely(ret != 0)) { retval = (ret == -ENOMEM) ? VM_FAULT_OOM : VM_FAULT_SIGBUS; goto out_unlock; - } address += PAGE_SIZE; @@ -221,9 +224,10 @@ static void ttm_bo_vm_open(struct vm_area_struct *vma) static void ttm_bo_vm_close(struct vm_area_struct *vma) { - struct ttm_buffer_object *bo = - (struct ttm_buffer_object *)vma->vm_private_data; + struct ttm_buffer_object *bo = (struct ttm_buffer_object *)vma->vm_private_data; + if (bo->bdev->driver->io_mem_free) + bo->bdev->driver->io_mem_free(bo->bdev, &bo->mem); ttm_bo_unref(&bo); vma->vm_private_data = NULL; } diff --git a/include/drm/ttm/ttm_bo_api.h b/include/drm/ttm/ttm_bo_api.h index 8c8005e..ed3ee54 100644 --- a/include/drm/ttm/ttm_bo_api.h +++ b/include/drm/ttm/ttm_bo_api.h @@ -274,6 +274,7 @@ struct ttm_bo_kmap_obj { ttm_bo_map_kmap = 3, ttm_bo_map_premapped = 4 | TTM_BO_MAP_IOMEM_MASK, } bo_kmap_type; + struct ttm_buffer_object *bo; }; /** diff --git a/include/drm/ttm/ttm_bo_driver.h b/include/drm/ttm/ttm_bo_driver.h index 999fbcb..1deb2dd 100644 --- a/include/drm/ttm/ttm_bo_driver.h +++ b/include/drm/ttm/ttm_bo_driver.h @@ -240,6 +240,23 @@ struct ttm_mem_type_manager { }; /** + * struct ttm_bus_placement + * + * @base: bus base address + * @is_iomem: is this io memory ? + * @size: size in byte + * @offset: offset from the base address + * + * Structure indicating the bus placement of an object. + */ +struct ttm_bus_placement { + unsigned long base; + unsigned long size; + unsigned long offset; + bool is_iomem; +}; + +/** * struct ttm_bo_driver * * @create_ttm_backend_entry: Callback to create a struct ttm_backend. @@ -359,6 +376,19 @@ struct ttm_bo_driver { * notify the driver that we're about to swap out this bo */ void (*swap_notify) (struct ttm_buffer_object *bo); + + /** + * Driver callback on bo fault, driver is responsible to fill the + * bus placement and has the opportunity to move the buffer into + * visible space. + */ + int (*fault_reserve)(struct ttm_buffer_object *bo, struct ttm_bus_placement *pl); + /** + * Driver callback on when mapping io memory (for bo_move_memcpy for instance). + * TTM will take care to call io_mem_free whenever the mapping is not use anymore. + */ + int (*io_mem_reserve)(struct ttm_bo_device *bdev, struct ttm_mem_reg *mem, struct ttm_bus_placement *pl); + void (*io_mem_free)(struct ttm_bo_device *bdev, struct ttm_mem_reg *mem); }; /** -- 1.6.6 ------------------------------------------------------------------------------ Download Intel® Parallel Studio Eval Try the new software tools for yourself. Speed compiling, find bugs proactively, and fine-tune applications for parallel performance. See why Intel Parallel Studio got high marks during beta. http://p.sf.net/sfu/intel-sw-dev -- ^ permalink raw reply related [flat|nested] 16+ messages in thread
* [PATCH 2/9] drm/radeon/kms: add support for new fault callback V3 2010-02-25 17:01 ` [PATCH 1/9] drm/ttm: ttm_fault callback to allow driver to handle bo placement V2 Jerome Glisse @ 2010-02-25 17:01 ` Jerome Glisse 2010-02-25 17:01 ` [PATCH 3/9] drm/nouveau/kms: add support for new TTM fault callback V2 Jerome Glisse 0 siblings, 1 reply; 16+ messages in thread From: Jerome Glisse @ 2010-02-25 17:01 UTC (permalink / raw) To: airlied; +Cc: thellstrom, skeggsb, Jerome Glisse, dri-devel This add the support for the new fault callback and also the infrastructure for supporting unmappable VRAM. V2 validate BO with no_wait = true V3 don't derefence bo->mem.mm_node as it's not NULL only for VRAM or GTT V4 update to splitted no_wait ttm change Signed-off-by: Jerome Glisse <jglisse@redhat.com> --- drivers/gpu/drm/radeon/radeon_ttm.c | 103 ++++++++++++++++++++++++++++++++++- 1 files changed, 102 insertions(+), 1 deletions(-) diff --git a/drivers/gpu/drm/radeon/radeon_ttm.c b/drivers/gpu/drm/radeon/radeon_ttm.c index 9d9dfe7..1280ca4 100644 --- a/drivers/gpu/drm/radeon/radeon_ttm.c +++ b/drivers/gpu/drm/radeon/radeon_ttm.c @@ -437,10 +437,108 @@ static int radeon_bo_move(struct ttm_buffer_object *bo, memcpy: r = ttm_bo_move_memcpy(bo, evict, no_wait_reserve, no_wait_gpu, new_mem); } - return r; } +static int radeon_ttm_io_mem_reserve(struct ttm_bo_device *bdev, struct ttm_mem_reg *mem, struct ttm_bus_placement *pl) +{ + struct ttm_mem_type_manager *man = &bdev->man[mem->mem_type]; + struct radeon_device *rdev = radeon_get_rdev(bdev); + + pl->offset = 0; + pl->size = mem->num_pages << PAGE_SHIFT; + pl->base = 0; + pl->is_iomem = false; + if (!(man->flags & TTM_MEMTYPE_FLAG_MAPPABLE)) + return -EINVAL; + switch (mem->mem_type) { + case TTM_PL_SYSTEM: + /* system memory */ + return 0; + case TTM_PL_TT: + pl->offset = mem->mm_node->start << PAGE_SHIFT; +#if __OS_HAS_AGP + if (rdev->flags & RADEON_IS_AGP) { + /* RADEON_IS_AGP is set only if AGP is active */ + pl->base = rdev->mc.agp_base; + pl->is_iomem = true; + } +#endif + return 0; + case TTM_PL_VRAM: + pl->offset = mem->mm_node->start << PAGE_SHIFT; + /* check if it's visible */ + if ((pl->offset + pl->size) > rdev->mc.visible_vram_size) + return -EINVAL; + pl->base = rdev->mc.aper_base; + pl->is_iomem = true; + break; + default: + return -EINVAL; + } + return 0; +} + +static void radeon_ttm_io_mem_free(struct ttm_bo_device *bdev, struct ttm_mem_reg *mem) +{ + /* hopefully will be usefull soon */ +} + +static int radeon_ttm_fault_callback(struct ttm_buffer_object *bo, struct ttm_bus_placement *pl) +{ + struct ttm_mem_type_manager *man = &bo->bdev->man[bo->mem.mem_type]; + struct radeon_bo *rbo; + struct radeon_device *rdev; + int r; + + pl->offset = 0; + pl->size = bo->mem.num_pages << PAGE_SHIFT; + pl->base = 0; + pl->is_iomem = false; + if (!radeon_ttm_bo_is_radeon_bo(bo)) + /* FIXME should we return 0 ? we don't know about this BO */ + return -EINVAL; + if (!(man->flags & TTM_MEMTYPE_FLAG_MAPPABLE)) + return -EINVAL; + rbo = container_of(bo, struct radeon_bo, tbo); + rdev = rbo->rdev; + switch (bo->mem.mem_type) { + case TTM_PL_SYSTEM: + /* System memory */ + return 0; + case TTM_PL_TT: + pl->offset = bo->mem.mm_node->start << PAGE_SHIFT; +#if __OS_HAS_AGP + if (rdev->flags & RADEON_IS_AGP) { + /* RADEON_IS_AGP is set only if AGP is active */ + pl->base = rdev->mc.agp_base; + pl->is_iomem = true; + } +#endif + return 0; + case TTM_PL_VRAM: + pl->offset = bo->mem.mm_node->start << PAGE_SHIFT; + if ((pl->offset + pl->size) > rdev->mc.visible_vram_size) { + /* hurrah the memory is not visible ! */ + radeon_ttm_placement_from_domain(rbo, RADEON_GEM_DOMAIN_VRAM); + rbo->placement.lpfn = rdev->mc.visible_vram_size >> PAGE_SHIFT; + r = ttm_bo_validate(bo, &rbo->placement, false, true, false); + if (unlikely(r != 0)) + return r; + pl->offset = bo->mem.mm_node->start << PAGE_SHIFT; + /* this should not happen */ + if ((pl->offset + pl->size) > rdev->mc.visible_vram_size) + return -EINVAL; + } + pl->base = rdev->mc.aper_base; + pl->is_iomem = true; + break; + default: + return -EINVAL; + } + return 0; +} + static int radeon_sync_obj_wait(void *sync_obj, void *sync_arg, bool lazy, bool interruptible) { @@ -481,6 +579,9 @@ static struct ttm_bo_driver radeon_bo_driver = { .sync_obj_ref = &radeon_sync_obj_ref, .move_notify = &radeon_bo_move_notify, .fault_reserve_notify = &radeon_bo_fault_reserve_notify, + .fault_reserve = &radeon_ttm_fault_callback, + .io_mem_reserve = &radeon_ttm_io_mem_reserve, + .io_mem_free = &radeon_ttm_io_mem_free, }; int radeon_ttm_init(struct radeon_device *rdev) -- 1.6.6 ------------------------------------------------------------------------------ Download Intel® Parallel Studio Eval Try the new software tools for yourself. Speed compiling, find bugs proactively, and fine-tune applications for parallel performance. See why Intel Parallel Studio got high marks during beta. http://p.sf.net/sfu/intel-sw-dev -- ^ permalink raw reply related [flat|nested] 16+ messages in thread
* [PATCH 3/9] drm/nouveau/kms: add support for new TTM fault callback V2 2010-02-25 17:01 ` [PATCH 2/9] drm/radeon/kms: add support for new fault callback V3 Jerome Glisse @ 2010-02-25 17:01 ` Jerome Glisse 2010-02-25 17:01 ` [PATCH 4/9] drm/vmwgfx: " Jerome Glisse 0 siblings, 1 reply; 16+ messages in thread From: Jerome Glisse @ 2010-02-25 17:01 UTC (permalink / raw) To: airlied; +Cc: thellstrom, skeggsb, Jerome Glisse, dri-devel This add the support for the new fault callback, does change anything from driver point of view, thought it should allow nouveau to add support for unmappable VRAM. Improvement: store the aperture base in a variable so that we don't call a function to get it on each fault. Patch hasn't been tested on any hw. V2 don't derefence bo->mem.mm_node as it's not NULL only for VRAM or GTT Signed-off-by: Jerome Glisse <jglisse@redhat.com> --- drivers/gpu/drm/nouveau/nouveau_bo.c | 46 ++++++++++++++++++++++++++++++++++ 1 files changed, 46 insertions(+), 0 deletions(-) diff --git a/drivers/gpu/drm/nouveau/nouveau_bo.c b/drivers/gpu/drm/nouveau/nouveau_bo.c index f53558b..850e3d8 100644 --- a/drivers/gpu/drm/nouveau/nouveau_bo.c +++ b/drivers/gpu/drm/nouveau/nouveau_bo.c @@ -762,6 +762,49 @@ nouveau_bo_verify_access(struct ttm_buffer_object *bo, struct file *filp) return 0; } +static int +nouveau_ttm_io_mem_reserve(struct ttm_bo_device *bdev, struct ttm_mem_reg *mem, struct ttm_bus_placement *pl) +{ + struct ttm_mem_type_manager *man = &bdev->man[mem->mem_type]; + struct drm_nouveau_private *dev_priv = nouveau_bdev(bdev); + struct drm_device *dev = dev_priv->dev; + + pl->offset = 0; + pl->size = mem->num_pages << PAGE_SHIFT; + pl->base = 0; + pl->is_iomem = false; + if (!(man->flags & TTM_MEMTYPE_FLAG_MAPPABLE)) + return -EINVAL; + switch (mem->mem_type) { + case TTM_PL_SYSTEM: + /* System memory */ + return 0; + case TTM_PL_TT: + pl->offset = mem->mm_node->start << PAGE_SHIFT; +#if __OS_HAS_AGP + if (dev_priv->gart_info.type == NOUVEAU_GART_AGP) { + pl->base = dev_priv->gart_info.aper_base; + pl->is_iomem = true; + } +#endif + return 0; + case TTM_PL_VRAM: + pl->offset = mem->mm_node->start << PAGE_SHIFT; + pl->base = drm_get_resource_start(dev, 1); + pl->is_iomem = true; + break; + default: + return -EINVAL; + } + return 0; +} + +static int +nouveau_ttm_fault(struct ttm_buffer_object *bo, struct ttm_bus_placement *pl) +{ + return nouveau_ttm_io_mem_reserve(bo->bdev, &bo->mem, pl); +} + struct ttm_bo_driver nouveau_bo_driver = { .create_ttm_backend_entry = nouveau_bo_create_ttm_backend_entry, .invalidate_caches = nouveau_bo_invalidate_caches, @@ -774,5 +817,8 @@ struct ttm_bo_driver nouveau_bo_driver = { .sync_obj_flush = nouveau_fence_flush, .sync_obj_unref = nouveau_fence_unref, .sync_obj_ref = nouveau_fence_ref, + .fault_reserve = &nouveau_ttm_fault, + .io_mem_reserve = &nouveau_ttm_io_mem_reserve, + .io_mem_free = NULL, }; -- 1.6.6 ------------------------------------------------------------------------------ Download Intel® Parallel Studio Eval Try the new software tools for yourself. Speed compiling, find bugs proactively, and fine-tune applications for parallel performance. See why Intel Parallel Studio got high marks during beta. http://p.sf.net/sfu/intel-sw-dev -- ^ permalink raw reply related [flat|nested] 16+ messages in thread
* [PATCH 4/9] drm/vmwgfx: add support for new TTM fault callback V2 2010-02-25 17:01 ` [PATCH 3/9] drm/nouveau/kms: add support for new TTM fault callback V2 Jerome Glisse @ 2010-02-25 17:01 ` Jerome Glisse 2010-02-25 17:01 ` [PATCH 5/9] drm/radeon/kms: don't initialize TTM io memory manager field Jerome Glisse 0 siblings, 1 reply; 16+ messages in thread From: Jerome Glisse @ 2010-02-25 17:01 UTC (permalink / raw) To: airlied; +Cc: thellstrom, skeggsb, Jerome Glisse, dri-devel This add the support for the new fault callback, does change anything from driver point of view. Improvement: store the aperture base in a variable so that we don't call a function to get it on each fault. Patch hasn't been tested. V2 don't derefence bo->mem.mm_node as it's not NULL only for VRAM or GTT Signed-off-by: Jerome Glisse <jglisse@redhat.com> --- drivers/gpu/drm/vmwgfx/vmwgfx_buffer.c | 36 +++++++++++++++++++++++++++++++- 1 files changed, 35 insertions(+), 1 deletions(-) diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_buffer.c b/drivers/gpu/drm/vmwgfx/vmwgfx_buffer.c index 825ebe3..aa09062 100644 --- a/drivers/gpu/drm/vmwgfx/vmwgfx_buffer.c +++ b/drivers/gpu/drm/vmwgfx/vmwgfx_buffer.c @@ -193,6 +193,37 @@ static void vmw_swap_notify(struct ttm_buffer_object *bo) vmw_dmabuf_gmr_unbind(bo); } +static int vmw_ttm_io_mem_reserve(struct ttm_bo_device *bdev, struct ttm_mem_reg *mem, struct ttm_bus_placement *pl) +{ + struct ttm_mem_type_manager *man = &bdev->man[mem->mem_type]; + struct vmw_private *dev_priv = container_of(bdev, struct vmw_private, bdev); + + pl->is_iomem = false; + pl->offset = 0; + pl->size = mem->num_pages << PAGE_SHIFT; + pl->base = 0; + if (!(man->flags & TTM_MEMTYPE_FLAG_MAPPABLE)) + return -EINVAL; + switch (mem->mem_type) { + case TTM_PL_SYSTEM: + /* System memory */ + return 0; + case TTM_PL_VRAM: + pl->offset = mem->mm_node->start << PAGE_SHIFT; + pl->base = dev_priv->vram_start; + pl->is_iomem = true; + break; + default: + return -EINVAL; + } + return 0; +} + +static int vmw_ttm_fault(struct ttm_buffer_object *bo, struct ttm_bus_placement *pl) +{ + return vmw_ttm_io_mem_reserve(bo->bdev, &bo->mem, pl); +} + /** * FIXME: We're using the old vmware polling method to sync. * Do this with fences instead. @@ -248,5 +279,8 @@ struct ttm_bo_driver vmw_bo_driver = { .sync_obj_unref = vmw_sync_obj_unref, .sync_obj_ref = vmw_sync_obj_ref, .move_notify = vmw_move_notify, - .swap_notify = vmw_swap_notify + .swap_notify = vmw_swap_notify, + .fault_reserve = vmw_ttm_fault, + .io_mem_reserve = &vmw_ttm_io_mem_reserve, + .io_mem_free = NULL, }; -- 1.6.6 ------------------------------------------------------------------------------ Download Intel® Parallel Studio Eval Try the new software tools for yourself. Speed compiling, find bugs proactively, and fine-tune applications for parallel performance. See why Intel Parallel Studio got high marks during beta. http://p.sf.net/sfu/intel-sw-dev -- ^ permalink raw reply related [flat|nested] 16+ messages in thread
* [PATCH 5/9] drm/radeon/kms: don't initialize TTM io memory manager field 2010-02-25 17:01 ` [PATCH 4/9] drm/vmwgfx: " Jerome Glisse @ 2010-02-25 17:01 ` Jerome Glisse 2010-02-25 17:01 ` [PATCH 6/9] drm/nouveau/kms: " Jerome Glisse 0 siblings, 1 reply; 16+ messages in thread From: Jerome Glisse @ 2010-02-25 17:01 UTC (permalink / raw) To: airlied; +Cc: thellstrom, skeggsb, Jerome Glisse, dri-devel This isn't needed anymore with the new TTM fault callback Signed-off-by: Jerome Glisse <jglisse@redhat.com> --- drivers/gpu/drm/radeon/radeon_ttm.c | 13 +------------ 1 files changed, 1 insertions(+), 12 deletions(-) diff --git a/drivers/gpu/drm/radeon/radeon_ttm.c b/drivers/gpu/drm/radeon/radeon_ttm.c index 1280ca4..43b17f0 100644 --- a/drivers/gpu/drm/radeon/radeon_ttm.c +++ b/drivers/gpu/drm/radeon/radeon_ttm.c @@ -161,22 +161,14 @@ static int radeon_init_mem_type(struct ttm_bo_device *bdev, uint32_t type, (unsigned)type); return -EINVAL; } - man->io_offset = rdev->mc.agp_base; - man->io_size = rdev->mc.gtt_size; - man->io_addr = NULL; if (!rdev->ddev->agp->cant_use_aperture) man->flags = TTM_MEMTYPE_FLAG_NEEDS_IOREMAP | TTM_MEMTYPE_FLAG_MAPPABLE; man->available_caching = TTM_PL_FLAG_UNCACHED | TTM_PL_FLAG_WC; man->default_caching = TTM_PL_FLAG_WC; - } else -#endif - { - man->io_offset = 0; - man->io_size = 0; - man->io_addr = NULL; } +#endif break; case TTM_PL_VRAM: /* "On-card" video ram */ @@ -186,9 +178,6 @@ static int radeon_init_mem_type(struct ttm_bo_device *bdev, uint32_t type, TTM_MEMTYPE_FLAG_MAPPABLE; man->available_caching = TTM_PL_FLAG_UNCACHED | TTM_PL_FLAG_WC; man->default_caching = TTM_PL_FLAG_WC; - man->io_addr = NULL; - man->io_offset = rdev->mc.aper_base; - man->io_size = rdev->mc.aper_size; break; default: DRM_ERROR("Unsupported memory type %u\n", (unsigned)type); -- 1.6.6 ------------------------------------------------------------------------------ Download Intel® Parallel Studio Eval Try the new software tools for yourself. Speed compiling, find bugs proactively, and fine-tune applications for parallel performance. See why Intel Parallel Studio got high marks during beta. http://p.sf.net/sfu/intel-sw-dev -- ^ permalink raw reply related [flat|nested] 16+ messages in thread
* [PATCH 6/9] drm/nouveau/kms: don't initialize TTM io memory manager field 2010-02-25 17:01 ` [PATCH 5/9] drm/radeon/kms: don't initialize TTM io memory manager field Jerome Glisse @ 2010-02-25 17:01 ` Jerome Glisse 2010-02-25 17:01 ` [PATCH 7/9] drm/vmwgfx: " Jerome Glisse 0 siblings, 1 reply; 16+ messages in thread From: Jerome Glisse @ 2010-02-25 17:01 UTC (permalink / raw) To: airlied; +Cc: thellstrom, skeggsb, Jerome Glisse, dri-devel This isn't needed anymore with the new TTM fault callback Signed-off-by: Jerome Glisse <jglisse@redhat.com> --- drivers/gpu/drm/nouveau/nouveau_bo.c | 11 ----------- 1 files changed, 0 insertions(+), 11 deletions(-) diff --git a/drivers/gpu/drm/nouveau/nouveau_bo.c b/drivers/gpu/drm/nouveau/nouveau_bo.c index 850e3d8..d67c6ec 100644 --- a/drivers/gpu/drm/nouveau/nouveau_bo.c +++ b/drivers/gpu/drm/nouveau/nouveau_bo.c @@ -391,13 +391,6 @@ nouveau_bo_init_mem_type(struct ttm_bo_device *bdev, uint32_t type, man->available_caching = TTM_PL_FLAG_UNCACHED | TTM_PL_FLAG_WC; man->default_caching = TTM_PL_FLAG_WC; - - man->io_addr = NULL; - man->io_offset = drm_get_resource_start(dev, 1); - man->io_size = drm_get_resource_len(dev, 1); - if (man->io_size > nouveau_mem_fb_amount(dev)) - man->io_size = nouveau_mem_fb_amount(dev); - man->gpu_offset = dev_priv->vm_vram_base; break; case TTM_PL_TT: @@ -419,10 +412,6 @@ nouveau_bo_init_mem_type(struct ttm_bo_device *bdev, uint32_t type, dev_priv->gart_info.type); return -EINVAL; } - - man->io_offset = dev_priv->gart_info.aper_base; - man->io_size = dev_priv->gart_info.aper_size; - man->io_addr = NULL; man->gpu_offset = dev_priv->vm_gart_base; break; default: -- 1.6.6 ------------------------------------------------------------------------------ Download Intel® Parallel Studio Eval Try the new software tools for yourself. Speed compiling, find bugs proactively, and fine-tune applications for parallel performance. See why Intel Parallel Studio got high marks during beta. http://p.sf.net/sfu/intel-sw-dev -- ^ permalink raw reply related [flat|nested] 16+ messages in thread
* [PATCH 7/9] drm/vmwgfx: don't initialize TTM io memory manager field 2010-02-25 17:01 ` [PATCH 6/9] drm/nouveau/kms: " Jerome Glisse @ 2010-02-25 17:01 ` Jerome Glisse 2010-02-25 17:01 ` [PATCH 8/9] drm/ttm: remove io_ field from TTM V2 Jerome Glisse 0 siblings, 1 reply; 16+ messages in thread From: Jerome Glisse @ 2010-02-25 17:01 UTC (permalink / raw) To: airlied; +Cc: thellstrom, skeggsb, Jerome Glisse, dri-devel This isn't needed anymore with the new TTM fault callback Signed-off-by: Jerome Glisse <jglisse@redhat.com> --- drivers/gpu/drm/vmwgfx/vmwgfx_buffer.c | 6 ------ 1 files changed, 0 insertions(+), 6 deletions(-) diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_buffer.c b/drivers/gpu/drm/vmwgfx/vmwgfx_buffer.c index aa09062..53dc3af 100644 --- a/drivers/gpu/drm/vmwgfx/vmwgfx_buffer.c +++ b/drivers/gpu/drm/vmwgfx/vmwgfx_buffer.c @@ -137,9 +137,6 @@ int vmw_invalidate_caches(struct ttm_bo_device *bdev, uint32_t flags) int vmw_init_mem_type(struct ttm_bo_device *bdev, uint32_t type, struct ttm_mem_type_manager *man) { - struct vmw_private *dev_priv = - container_of(bdev, struct vmw_private, bdev); - switch (type) { case TTM_PL_SYSTEM: /* System memory */ @@ -151,11 +148,8 @@ int vmw_init_mem_type(struct ttm_bo_device *bdev, uint32_t type, case TTM_PL_VRAM: /* "On-card" video ram */ man->gpu_offset = 0; - man->io_offset = dev_priv->vram_start; - man->io_size = dev_priv->vram_size; man->flags = TTM_MEMTYPE_FLAG_FIXED | TTM_MEMTYPE_FLAG_NEEDS_IOREMAP | TTM_MEMTYPE_FLAG_MAPPABLE; - man->io_addr = NULL; man->available_caching = TTM_PL_MASK_CACHING; man->default_caching = TTM_PL_FLAG_WC; break; -- 1.6.6 ------------------------------------------------------------------------------ Download Intel® Parallel Studio Eval Try the new software tools for yourself. Speed compiling, find bugs proactively, and fine-tune applications for parallel performance. See why Intel Parallel Studio got high marks during beta. http://p.sf.net/sfu/intel-sw-dev -- ^ permalink raw reply related [flat|nested] 16+ messages in thread
* [PATCH 8/9] drm/ttm: remove io_ field from TTM V2 2010-02-25 17:01 ` [PATCH 7/9] drm/vmwgfx: " Jerome Glisse @ 2010-02-25 17:01 ` Jerome Glisse 2010-02-25 17:01 ` [PATCH 9/9] drm/radeon/kms: enable use of unmappable VRAM Jerome Glisse 0 siblings, 1 reply; 16+ messages in thread From: Jerome Glisse @ 2010-02-25 17:01 UTC (permalink / raw) To: airlied; +Cc: thellstrom, skeggsb, Jerome Glisse, dri-devel 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 Signed-off-by: Jerome Glisse <jglisse@redhat.com> --- drivers/gpu/drm/ttm/ttm_bo.c | 22 ---------------------- drivers/gpu/drm/ttm/ttm_bo_util.c | 30 +++++++----------------------- drivers/gpu/drm/ttm/ttm_bo_vm.c | 33 ++++++++++++--------------------- include/drm/ttm/ttm_bo_driver.h | 10 ---------- 4 files changed, 19 insertions(+), 76 deletions(-) diff --git a/drivers/gpu/drm/ttm/ttm_bo.c b/drivers/gpu/drm/ttm/ttm_bo.c index 2a808fc..3bdd44d 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) printk(KERN_ERR TTM_PFX " use_type: %d\n", man->use_type); printk(KERN_ERR TTM_PFX " flags: 0x%08X\n", man->flags); printk(KERN_ERR TTM_PFX " gpu_offset: 0x%08lX\n", man->gpu_offset); - printk(KERN_ERR TTM_PFX " io_offset: 0x%08lX\n", man->io_offset); - printk(KERN_ERR TTM_PFX " io_size: %ld\n", man->io_size); printk(KERN_ERR TTM_PFX " size: %llu\n", man->size); printk(KERN_ERR TTM_PFX " available_caching: 0x%08X\n", man->available_caching); @@ -1560,26 +1558,6 @@ bool ttm_mem_reg_is_pci(struct ttm_bo_device *bdev, struct ttm_mem_reg *mem) return true; } -int ttm_bo_pci_offset(struct ttm_bo_device *bdev, - struct ttm_mem_reg *mem, - unsigned long *bus_base, - unsigned long *bus_offset, unsigned long *bus_size) -{ - struct ttm_mem_type_manager *man = &bdev->man[mem->mem_type]; - - *bus_size = 0; - if (!(man->flags & TTM_MEMTYPE_FLAG_MAPPABLE)) - return -EINVAL; - - if (ttm_mem_reg_is_pci(bdev, mem)) { - *bus_offset = mem->mm_node->start << PAGE_SHIFT; - *bus_size = mem->num_pages << PAGE_SHIFT; - *bus_base = man->io_offset; - } - - return 0; -} - void ttm_bo_unmap_virtual(struct ttm_buffer_object *bo) { 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 efce42c..9d601c3 100644 --- a/drivers/gpu/drm/ttm/ttm_bo_util.c +++ b/drivers/gpu/drm/ttm/ttm_bo_util.c @@ -90,17 +90,9 @@ int ttm_mem_reg_ioremap(struct ttm_bo_device *bdev, struct ttm_mem_reg *mem, void *addr; *virtual = NULL; - if (bdev->driver->io_mem_reserve) { - ret = bdev->driver->io_mem_reserve(bdev, mem, &pl); - if (unlikely(ret != 0)) { - return ret; - } - } else { - ret = ttm_bo_pci_offset(bdev, mem, &pl.base, &pl.offset, &pl.size); - if (unlikely(ret != 0) || pl.size == 0) { - return ret; - } - pl.is_iomem = (pl.size != 0); + ret = bdev->driver->io_mem_reserve(bdev, mem, &pl); + if (unlikely(ret != 0)) { + return ret; } if (!(man->flags & TTM_MEMTYPE_FLAG_NEEDS_IOREMAP)) @@ -393,7 +385,7 @@ static int ttm_bo_ioremap(struct ttm_buffer_object *bo, if (!(man->flags & TTM_MEMTYPE_FLAG_NEEDS_IOREMAP)) { map->bo_kmap_type = ttm_bo_map_premapped; - map->virtual = (void *)(((u8 *) man->io_addr) + bus_offset); + map->virtual = (void *)(bus_base + bus_offset); } else { map->bo_kmap_type = ttm_bo_map_iomap; if (mem->placement & TTM_PL_FLAG_WC) @@ -468,17 +460,9 @@ int ttm_bo_kmap(struct ttm_buffer_object *bo, if (num_pages > 1 && !DRM_SUSER(DRM_CURPROC)) return -EPERM; #endif - if (bo->bdev->driver->io_mem_reserve) { - ret = bo->bdev->driver->io_mem_reserve(bo->bdev, &bo->mem, &pl); - if (unlikely(ret != 0)) { - return ret; - } - } else { - ret = ttm_bo_pci_offset(bo->bdev, &bo->mem, &pl.base, &pl.offset, &pl.size); - if (unlikely(ret != 0)) { - return ret; - } - pl.is_iomem = (pl.size != 0); + ret = bo->bdev->driver->io_mem_reserve(bo->bdev, &bo->mem, &pl); + if (unlikely(ret != 0)) { + return ret; } if (!pl.is_iomem) { return ttm_bo_kmap_ttm(bo, start_page, num_pages, map); diff --git a/drivers/gpu/drm/ttm/ttm_bo_vm.c b/drivers/gpu/drm/ttm/ttm_bo_vm.c index fe4ac95..7afe239 100644 --- a/drivers/gpu/drm/ttm/ttm_bo_vm.c +++ b/drivers/gpu/drm/ttm/ttm_bo_vm.c @@ -101,27 +101,18 @@ static int ttm_bo_vm_fault(struct vm_area_struct *vma, struct vm_fault *vmf) if (bdev->driver->fault_reserve_notify) bdev->driver->fault_reserve_notify(bo); - if (bdev->driver->fault_reserve) { - ret = bdev->driver->fault_reserve(bo, &pl); - switch (ret) { - case 0: - break; - case -EBUSY: - set_need_resched(); - case -ERESTARTSYS: - retval = VM_FAULT_NOPAGE; - goto out_unlock; - default: - retval = VM_FAULT_SIGBUS; - goto out_unlock; - } - } else { - ret = ttm_bo_pci_offset(bdev, &bo->mem, &pl.base, &pl.offset, &pl.size); - if (unlikely(ret != 0)) { - retval = VM_FAULT_SIGBUS; - goto out_unlock; - } - pl.is_iomem = (pl.size != 0); + ret = bdev->driver->fault_reserve(bo, &pl); + switch (ret) { + case 0: + break; + case -EBUSY: + set_need_resched(); + case -ERESTARTSYS: + retval = VM_FAULT_NOPAGE; + goto out_unlock; + default: + retval = VM_FAULT_SIGBUS; + goto out_unlock; } /* diff --git a/include/drm/ttm/ttm_bo_driver.h b/include/drm/ttm/ttm_bo_driver.h index 1deb2dd..ad13108 100644 --- a/include/drm/ttm/ttm_bo_driver.h +++ b/include/drm/ttm/ttm_bo_driver.h @@ -190,13 +190,6 @@ struct ttm_tt { * managed by this memory type. * @gpu_offset: If used, the GPU offset of the first managed page of * fixed memory or the first managed location in an aperture. - * @io_offset: The io_offset of the first managed page of IO memory or - * the first managed location in an aperture. For TTM_MEMTYPE_FLAG_CMA - * memory, this should be set to NULL. - * @io_size: The size of a managed IO region (fixed memory or aperture). - * @io_addr: Virtual kernel address if the io region is pre-mapped. For - * TTM_MEMTYPE_FLAG_NEEDS_IOREMAP there is no pre-mapped io map and - * @io_addr should be set to NULL. * @size: Size of the managed region. * @available_caching: A mask of available caching types, TTM_PL_FLAG_XX, * as defined in ttm_placement_common.h @@ -222,9 +215,6 @@ struct ttm_mem_type_manager { bool use_type; uint32_t flags; unsigned long gpu_offset; - unsigned long io_offset; - unsigned long io_size; - void *io_addr; uint64_t size; uint32_t available_caching; uint32_t default_caching; -- 1.6.6 ------------------------------------------------------------------------------ Download Intel® Parallel Studio Eval Try the new software tools for yourself. Speed compiling, find bugs proactively, and fine-tune applications for parallel performance. See why Intel Parallel Studio got high marks during beta. http://p.sf.net/sfu/intel-sw-dev -- ^ permalink raw reply related [flat|nested] 16+ messages in thread
* [PATCH 9/9] drm/radeon/kms: enable use of unmappable VRAM 2010-02-25 17:01 ` [PATCH 8/9] drm/ttm: remove io_ field from TTM V2 Jerome Glisse @ 2010-02-25 17:01 ` Jerome Glisse 0 siblings, 0 replies; 16+ messages in thread From: Jerome Glisse @ 2010-02-25 17:01 UTC (permalink / raw) To: airlied; +Cc: thellstrom, skeggsb, Jerome Glisse, dri-devel This patch enable the use of unmappable VRAM thanks to previous TTM infrastructure change. Signed-off-by: Jerome Glisse <jglisse@redhat.com> --- drivers/gpu/drm/radeon/evergreen.c | 5 ----- drivers/gpu/drm/radeon/r100.c | 5 ----- drivers/gpu/drm/radeon/r600.c | 5 ----- drivers/gpu/drm/radeon/rv770.c | 5 ----- 4 files changed, 0 insertions(+), 20 deletions(-) diff --git a/drivers/gpu/drm/radeon/evergreen.c b/drivers/gpu/drm/radeon/evergreen.c index bd2e7aa..abab06e 100644 --- a/drivers/gpu/drm/radeon/evergreen.c +++ b/drivers/gpu/drm/radeon/evergreen.c @@ -475,11 +475,6 @@ int evergreen_mc_init(struct radeon_device *rdev) rdev->mc.mc_vram_size = RREG32(CONFIG_MEMSIZE) * 1024 * 1024; rdev->mc.real_vram_size = RREG32(CONFIG_MEMSIZE) * 1024 * 1024; rdev->mc.visible_vram_size = rdev->mc.aper_size; - /* FIXME remove this once we support unmappable VRAM */ - if (rdev->mc.mc_vram_size > rdev->mc.aper_size) { - rdev->mc.mc_vram_size = rdev->mc.aper_size; - rdev->mc.real_vram_size = rdev->mc.aper_size; - } r600_vram_gtt_location(rdev, &rdev->mc); /* FIXME: we should enforce default clock in case GPU is not in * default setup diff --git a/drivers/gpu/drm/radeon/r100.c b/drivers/gpu/drm/radeon/r100.c index 03f3b2f..2095ab2 100644 --- a/drivers/gpu/drm/radeon/r100.c +++ b/drivers/gpu/drm/radeon/r100.c @@ -1991,11 +1991,6 @@ void r100_vram_init_sizes(struct radeon_device *rdev) else rdev->mc.mc_vram_size = rdev->mc.real_vram_size; } - /* FIXME remove this once we support unmappable VRAM */ - if (rdev->mc.mc_vram_size > rdev->mc.aper_size) { - rdev->mc.mc_vram_size = rdev->mc.aper_size; - rdev->mc.real_vram_size = rdev->mc.aper_size; - } } void r100_vga_set_state(struct radeon_device *rdev, bool state) diff --git a/drivers/gpu/drm/radeon/r600.c b/drivers/gpu/drm/radeon/r600.c index b70479f..b960ada 100644 --- a/drivers/gpu/drm/radeon/r600.c +++ b/drivers/gpu/drm/radeon/r600.c @@ -715,11 +715,6 @@ int r600_mc_init(struct radeon_device *rdev) rdev->mc.mc_vram_size = RREG32(CONFIG_MEMSIZE); rdev->mc.real_vram_size = RREG32(CONFIG_MEMSIZE); rdev->mc.visible_vram_size = rdev->mc.aper_size; - /* FIXME remove this once we support unmappable VRAM */ - if (rdev->mc.mc_vram_size > rdev->mc.aper_size) { - rdev->mc.mc_vram_size = rdev->mc.aper_size; - rdev->mc.real_vram_size = rdev->mc.aper_size; - } r600_vram_gtt_location(rdev, &rdev->mc); /* FIXME: we should enforce default clock in case GPU is not in * default setup diff --git a/drivers/gpu/drm/radeon/rv770.c b/drivers/gpu/drm/radeon/rv770.c index 37887de..1213d14 100644 --- a/drivers/gpu/drm/radeon/rv770.c +++ b/drivers/gpu/drm/radeon/rv770.c @@ -902,11 +902,6 @@ int rv770_mc_init(struct radeon_device *rdev) rdev->mc.mc_vram_size = RREG32(CONFIG_MEMSIZE); rdev->mc.real_vram_size = RREG32(CONFIG_MEMSIZE); rdev->mc.visible_vram_size = rdev->mc.aper_size; - /* FIXME remove this once we support unmappable VRAM */ - if (rdev->mc.mc_vram_size > rdev->mc.aper_size) { - rdev->mc.mc_vram_size = rdev->mc.aper_size; - rdev->mc.real_vram_size = rdev->mc.aper_size; - } r600_vram_gtt_location(rdev, &rdev->mc); /* FIXME: we should enforce default clock in case GPU is not in * default setup -- 1.6.6 ------------------------------------------------------------------------------ Download Intel® Parallel Studio Eval Try the new software tools for yourself. Speed compiling, find bugs proactively, and fine-tune applications for parallel performance. See why Intel Parallel Studio got high marks during beta. http://p.sf.net/sfu/intel-sw-dev -- ^ permalink raw reply related [flat|nested] 16+ messages in thread
* Re: Unmappable VRAM patchset V4 2010-02-25 17:01 Unmappable VRAM patchset V4 Jerome Glisse 2010-02-25 17:01 ` [PATCH 1/9] drm/ttm: ttm_fault callback to allow driver to handle bo placement V2 Jerome Glisse @ 2010-03-01 5:44 ` Dave Airlie 2010-03-01 12:03 ` Thomas Hellstrom 1 sibling, 1 reply; 16+ messages in thread From: Dave Airlie @ 2010-03-01 5:44 UTC (permalink / raw) To: Jerome Glisse; +Cc: thellstrom, skeggsb, dri-devel On Fri, Feb 26, 2010 at 3:01 AM, Jerome Glisse <jglisse@redhat.com> wrote: > Updated patchset, to apply cleanly on top of TTM split no_wait argument. > Compile tested for nouveau+vmwgfx, test in progress for radeon. > > So with the new change radeon won't wait for bo reserving other bo > in fault path but will wait the GPU (hoping it doesn't lockup ;)) > This should address concern about the wait/locking issue. Thomas any time for this yet? I'd like to pull this in obviously, but it would be nice to know if Jerome has addressed all concerns. Dave. ------------------------------------------------------------------------------ Download Intel® Parallel Studio Eval Try the new software tools for yourself. Speed compiling, find bugs proactively, and fine-tune applications for parallel performance. See why Intel Parallel Studio got high marks during beta. http://p.sf.net/sfu/intel-sw-dev -- ^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: Unmappable VRAM patchset V4 2010-03-01 5:44 ` Unmappable VRAM patchset V4 Dave Airlie @ 2010-03-01 12:03 ` Thomas Hellstrom 2010-03-17 10:05 ` Jerome Glisse 0 siblings, 1 reply; 16+ messages in thread From: Thomas Hellstrom @ 2010-03-01 12:03 UTC (permalink / raw) To: Dave Airlie; +Cc: Jerome Glisse, skeggsb@gmail.com, dri-devel@lists.sf.net Dave Airlie wrote: > On Fri, Feb 26, 2010 at 3:01 AM, Jerome Glisse <jglisse@redhat.com> wrote: > >> Updated patchset, to apply cleanly on top of TTM split no_wait argument. >> Compile tested for nouveau+vmwgfx, test in progress for radeon. >> >> So with the new change radeon won't wait for bo reserving other bo >> in fault path but will wait the GPU (hoping it doesn't lockup ;)) >> This should address concern about the wait/locking issue. >> > > Thomas any time for this yet? I'd like to pull this in obviously, but > it would be nice to know if Jerome has addressed all concerns. > > Dave. > Hi Dave! My schedule is currently a bit tight. I think the immediate deadlock concerns are met, but I'd to take a deeper look at some things that look a bit suspicious, but I think the overall approach is ok. I'll hopefully be able to do a review on wednesday. /Thomas ------------------------------------------------------------------------------ Download Intel® Parallel Studio Eval Try the new software tools for yourself. Speed compiling, find bugs proactively, and fine-tune applications for parallel performance. See why Intel Parallel Studio got high marks during beta. http://p.sf.net/sfu/intel-sw-dev -- ^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: Unmappable VRAM patchset V4 2010-03-01 12:03 ` Thomas Hellstrom @ 2010-03-17 10:05 ` Jerome Glisse 2010-03-17 13:01 ` Thomas Hellstrom 0 siblings, 1 reply; 16+ messages in thread From: Jerome Glisse @ 2010-03-17 10:05 UTC (permalink / raw) To: Thomas Hellstrom; +Cc: skeggsb@gmail.com, Jerome Glisse, dri-devel@lists.sf.net On Mon, Mar 01, 2010 at 01:03:38PM +0100, Thomas Hellstrom wrote: > Dave Airlie wrote: > > On Fri, Feb 26, 2010 at 3:01 AM, Jerome Glisse <jglisse@redhat.com> wrote: > > > >> Updated patchset, to apply cleanly on top of TTM split no_wait argument. > >> Compile tested for nouveau+vmwgfx, test in progress for radeon. > >> > >> So with the new change radeon won't wait for bo reserving other bo > >> in fault path but will wait the GPU (hoping it doesn't lockup ;)) > >> This should address concern about the wait/locking issue. > >> > > > > Thomas any time for this yet? I'd like to pull this in obviously, but > > it would be nice to know if Jerome has addressed all concerns. > > > > Dave. > > > Hi Dave! > My schedule is currently a bit tight. I think the immediate deadlock > concerns are met, but I'd to take a deeper look at some things that look > a bit suspicious, but I think the overall approach is ok. > I'll hopefully be able to do a review on wednesday. > > /Thomas > Thomas any chance to review this ? NVidia patch already need update and i would like to avoid having this bitrot too much. Cheers, Jerome ------------------------------------------------------------------------------ Download Intel® Parallel Studio Eval Try the new software tools for yourself. Speed compiling, find bugs proactively, and fine-tune applications for parallel performance. See why Intel Parallel Studio got high marks during beta. http://p.sf.net/sfu/intel-sw-dev -- ^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: Unmappable VRAM patchset V4 2010-03-17 10:05 ` Jerome Glisse @ 2010-03-17 13:01 ` Thomas Hellstrom 2010-03-17 15:52 ` Jerome Glisse 0 siblings, 1 reply; 16+ messages in thread From: Thomas Hellstrom @ 2010-03-17 13:01 UTC (permalink / raw) To: Jerome Glisse; +Cc: skeggsb@gmail.com, Jerome Glisse, dri-devel@lists.sf.net Jerome Glisse wrote: > On Mon, Mar 01, 2010 at 01:03:38PM +0100, Thomas Hellstrom wrote: > >> Dave Airlie wrote: >> >>> On Fri, Feb 26, 2010 at 3:01 AM, Jerome Glisse <jglisse@redhat.com> wrote: >>> >>> >>>> Updated patchset, to apply cleanly on top of TTM split no_wait argument. >>>> Compile tested for nouveau+vmwgfx, test in progress for radeon. >>>> >>>> So with the new change radeon won't wait for bo reserving other bo >>>> in fault path but will wait the GPU (hoping it doesn't lockup ;)) >>>> This should address concern about the wait/locking issue. >>>> >>>> >>> Thomas any time for this yet? I'd like to pull this in obviously, but >>> it would be nice to know if Jerome has addressed all concerns. >>> >>> Dave. >>> >>> >> Hi Dave! >> My schedule is currently a bit tight. I think the immediate deadlock >> concerns are met, but I'd to take a deeper look at some things that look >> a bit suspicious, but I think the overall approach is ok. >> I'll hopefully be able to do a review on wednesday. >> >> /Thomas >> >> > > Thomas any chance to review this ? NVidia patch already need update > and i would like to avoid having this bitrot too much. > > Cheers, > Jerome > Jerome, I've reviewed the TTM patch, see previous mail. I'll look at the vmware patch and briefly the other ones as soon as we've sorted out how to address the issues raised in the review. Thanks, /Thomas ------------------------------------------------------------------------------ Download Intel® Parallel Studio Eval Try the new software tools for yourself. Speed compiling, find bugs proactively, and fine-tune applications for parallel performance. See why Intel Parallel Studio got high marks during beta. http://p.sf.net/sfu/intel-sw-dev -- ^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: Unmappable VRAM patchset V4 2010-03-17 13:01 ` Thomas Hellstrom @ 2010-03-17 15:52 ` Jerome Glisse 0 siblings, 0 replies; 16+ messages in thread From: Jerome Glisse @ 2010-03-17 15:52 UTC (permalink / raw) To: Thomas Hellstrom; +Cc: skeggsb@gmail.com, Jerome Glisse, dri-devel@lists.sf.net On Wed, Mar 17, 2010 at 02:01:47PM +0100, Thomas Hellstrom wrote: > Jerome Glisse wrote: > >On Mon, Mar 01, 2010 at 01:03:38PM +0100, Thomas Hellstrom wrote: > >>Dave Airlie wrote: > >>>On Fri, Feb 26, 2010 at 3:01 AM, Jerome Glisse <jglisse@redhat.com> wrote: > >>>>Updated patchset, to apply cleanly on top of TTM split no_wait argument. > >>>>Compile tested for nouveau+vmwgfx, test in progress for radeon. > >>>> > >>>>So with the new change radeon won't wait for bo reserving other bo > >>>>in fault path but will wait the GPU (hoping it doesn't lockup ;)) > >>>>This should address concern about the wait/locking issue. > >>>Thomas any time for this yet? I'd like to pull this in obviously, but > >>>it would be nice to know if Jerome has addressed all concerns. > >>> > >>>Dave. > >>Hi Dave! > >>My schedule is currently a bit tight. I think the immediate > >>deadlock concerns are met, but I'd to take a deeper look at some > >>things that look a bit suspicious, but I think the overall > >>approach is ok. > >>I'll hopefully be able to do a review on wednesday. > >> > >>/Thomas > >> > > > >Thomas any chance to review this ? NVidia patch already need update > >and i would like to avoid having this bitrot too much. > > > >Cheers, > >Jerome > Jerome, > > I've reviewed the TTM patch, see previous mail. I'll look at the > vmware patch and briefly the other ones as soon as we've sorted out > how to address the issues raised in the review. > > Thanks, > /Thomas > Will redo a patch tomorrow to try to address issue you pointed. Cheers, Jerome ------------------------------------------------------------------------------ Download Intel® Parallel Studio Eval Try the new software tools for yourself. Speed compiling, find bugs proactively, and fine-tune applications for parallel performance. See why Intel Parallel Studio got high marks during beta. http://p.sf.net/sfu/intel-sw-dev -- ^ permalink raw reply [flat|nested] 16+ messages in thread
* Unmappable VRAM patchset V4 @ 2010-02-23 14:40 Jerome Glisse 0 siblings, 0 replies; 16+ messages in thread From: Jerome Glisse @ 2010-02-23 14:40 UTC (permalink / raw) To: airlied; +Cc: thellstrom, skeggsb, dri-devel Correct dereferencing of null ptr in path 2,3,4. Still doing testing on radeon but so far beside this null ptr it seems stable. Cheers, Jerome ------------------------------------------------------------------------------ Download Intel® Parallel Studio Eval Try the new software tools for yourself. Speed compiling, find bugs proactively, and fine-tune applications for parallel performance. See why Intel Parallel Studio got high marks during beta. http://p.sf.net/sfu/intel-sw-dev -- ^ permalink raw reply [flat|nested] 16+ messages in thread
end of thread, other threads:[~2010-03-17 15:52 UTC | newest] Thread overview: 16+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2010-02-25 17:01 Unmappable VRAM patchset V4 Jerome Glisse 2010-02-25 17:01 ` [PATCH 1/9] drm/ttm: ttm_fault callback to allow driver to handle bo placement V2 Jerome Glisse 2010-02-25 17:01 ` [PATCH 2/9] drm/radeon/kms: add support for new fault callback V3 Jerome Glisse 2010-02-25 17:01 ` [PATCH 3/9] drm/nouveau/kms: add support for new TTM fault callback V2 Jerome Glisse 2010-02-25 17:01 ` [PATCH 4/9] drm/vmwgfx: " Jerome Glisse 2010-02-25 17:01 ` [PATCH 5/9] drm/radeon/kms: don't initialize TTM io memory manager field Jerome Glisse 2010-02-25 17:01 ` [PATCH 6/9] drm/nouveau/kms: " Jerome Glisse 2010-02-25 17:01 ` [PATCH 7/9] drm/vmwgfx: " Jerome Glisse 2010-02-25 17:01 ` [PATCH 8/9] drm/ttm: remove io_ field from TTM V2 Jerome Glisse 2010-02-25 17:01 ` [PATCH 9/9] drm/radeon/kms: enable use of unmappable VRAM Jerome Glisse 2010-03-01 5:44 ` Unmappable VRAM patchset V4 Dave Airlie 2010-03-01 12:03 ` Thomas Hellstrom 2010-03-17 10:05 ` Jerome Glisse 2010-03-17 13:01 ` Thomas Hellstrom 2010-03-17 15:52 ` Jerome Glisse -- strict thread matches above, loose matches on Subject: below -- 2010-02-23 14:40 Jerome Glisse
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.