diff options
author | Christian König <christian.koenig@amd.com> | 2018-10-19 07:49:05 -0400 |
---|---|---|
committer | Alex Deucher <alexander.deucher@amd.com> | 2018-11-05 14:21:18 -0500 |
commit | 27eb1fa9130a98edd2b321d4dbce5c8b244ee7af (patch) | |
tree | b94c90b1cec5a325161051012797155964ce0331 /drivers/gpu/drm/ttm/ttm_memory.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_memory.c')
-rw-r--r-- | drivers/gpu/drm/ttm/ttm_memory.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/gpu/drm/ttm/ttm_memory.c b/drivers/gpu/drm/ttm/ttm_memory.c index 450387c92b63..7704e17c402f 100644 --- a/drivers/gpu/drm/ttm/ttm_memory.c +++ b/drivers/gpu/drm/ttm/ttm_memory.c | |||
@@ -41,6 +41,9 @@ | |||
41 | 41 | ||
42 | #define TTM_MEMORY_ALLOC_RETRIES 4 | 42 | #define TTM_MEMORY_ALLOC_RETRIES 4 |
43 | 43 | ||
44 | struct ttm_mem_global ttm_mem_glob; | ||
45 | EXPORT_SYMBOL(ttm_mem_glob); | ||
46 | |||
44 | struct ttm_mem_zone { | 47 | struct ttm_mem_zone { |
45 | struct kobject kobj; | 48 | struct kobject kobj; |
46 | struct ttm_mem_global *glob; | 49 | struct ttm_mem_global *glob; |
@@ -464,7 +467,6 @@ out_no_zone: | |||
464 | ttm_mem_global_release(glob); | 467 | ttm_mem_global_release(glob); |
465 | return ret; | 468 | return ret; |
466 | } | 469 | } |
467 | EXPORT_SYMBOL(ttm_mem_global_init); | ||
468 | 470 | ||
469 | void ttm_mem_global_release(struct ttm_mem_global *glob) | 471 | void ttm_mem_global_release(struct ttm_mem_global *glob) |
470 | { | 472 | { |
@@ -486,7 +488,6 @@ void ttm_mem_global_release(struct ttm_mem_global *glob) | |||
486 | kobject_del(&glob->kobj); | 488 | kobject_del(&glob->kobj); |
487 | kobject_put(&glob->kobj); | 489 | kobject_put(&glob->kobj); |
488 | } | 490 | } |
489 | EXPORT_SYMBOL(ttm_mem_global_release); | ||
490 | 491 | ||
491 | static void ttm_check_swapping(struct ttm_mem_global *glob) | 492 | static void ttm_check_swapping(struct ttm_mem_global *glob) |
492 | { | 493 | { |