diff options
author | Christian König <christian.koenig@amd.com> | 2018-10-19 13:49:05 +0200 |
---|---|---|
committer | Alex Deucher <alexander.deucher@amd.com> | 2018-11-05 14:21:18 -0500 |
commit | 27eb1fa9130a98edd2b321d4dbce5c8b244ee7af (patch) | |
tree | b94c90b1cec5a325161051012797155964ce0331 /drivers/gpu/drm/ttm/ttm_bo.c | |
parent | 7e07834c12b96214e95a473f7b14fc03b20e2e7a (diff) |
drm/ttm: use a static ttm_mem_global instance
As the name says we only need one global instance of ttm_mem_global.
Drop all the driver initialization and just use a single exported
instance which is initialized during BO global initialization.
Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Junwei Zhang <Jerry.Zhang@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu/drm/ttm/ttm_bo.c')
-rw-r--r-- | drivers/gpu/drm/ttm/ttm_bo.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/drivers/gpu/drm/ttm/ttm_bo.c b/drivers/gpu/drm/ttm/ttm_bo.c index 9edece6510d3..3006050b1720 100644 --- a/drivers/gpu/drm/ttm/ttm_bo.c +++ b/drivers/gpu/drm/ttm/ttm_bo.c @@ -1526,18 +1526,22 @@ void ttm_bo_global_release(struct ttm_bo_global *glob) { kobject_del(&glob->kobj); kobject_put(&glob->kobj); + ttm_mem_global_release(&ttm_mem_glob); } EXPORT_SYMBOL(ttm_bo_global_release); -int ttm_bo_global_init(struct ttm_bo_global *glob, - struct ttm_mem_global *mem_glob) +int ttm_bo_global_init(struct ttm_bo_global *glob) { int ret; unsigned i; + ret = ttm_mem_global_init(&ttm_mem_glob); + if (ret) + return ret; + mutex_init(&glob->device_list_mutex); spin_lock_init(&glob->lru_lock); - glob->mem_glob = mem_glob; + glob->mem_glob = &ttm_mem_glob; glob->mem_glob->bo_glob = glob; glob->dummy_read_page = alloc_page(__GFP_ZERO | GFP_DMA32); |