On Wed, Aug 19, 2009 at 12:51 AM, Thomas Hellstrom<[email protected]> wrote:
> Common resources, like memory accounting and swap lists should be
> global and not per device. Introduce a struct ttm_bo_global to
> accomodate this, and register it with sysfs. Add a small sysfs interface
> to return the number of active buffer objects.
It seems to end up calling spin_lock_init on glob->lru_lock twice.
>
> +
> +int ttm_bo_global_init(struct ttm_global_reference *ref)
> +{
> + struct ttm_bo_global_ref *bo_ref =
> + container_of(ref, struct ttm_bo_global_ref, ref);
> + struct ttm_bo_global *glob = ref->object;
> + int ret;
> +
> + mutex_init(&glob->device_list_mutex);
> + spin_lock_init(&glob->lru_lock);
once here.
> + glob->mem_glob = bo_ref->mem_glob;
> + glob->dummy_read_page = alloc_page(__GFP_ZERO | GFP_DMA32);
> +
> + if (unlikely(glob->dummy_read_page == NULL)) {
> + ret = -ENOMEM;
> + goto out_no_drp;
<snip>
> int ttm_bo_device_init(struct ttm_bo_device *bdev,
> - struct ttm_mem_global *mem_glob,
> - struct ttm_bo_driver *driver, uint64_t
> file_page_offset)
> + struct ttm_bo_global *glob,
> + struct ttm_bo_driver *driver,
> + uint64_t file_page_offset)
> {
> int ret = -EINVAL;
>
> - bdev->dummy_read_page = NULL;
> rwlock_init(&bdev->vm_lock);
> - spin_lock_init(&bdev->lru_lock);
> + spin_lock_init(&glob->lru_lock);
and once here.
Doesn't seem right.
Dave.
------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now. http://p.sf.net/sfu/bobj-july
--
_______________________________________________
Dri-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/dri-devel