diff options
Diffstat (limited to 'include/drm/ttm')
-rw-r--r-- | include/drm/ttm/ttm_bo_driver.h | 23 | ||||
-rw-r--r-- | include/drm/ttm/ttm_memory.h | 4 |
2 files changed, 7 insertions, 20 deletions
diff --git a/include/drm/ttm/ttm_bo_driver.h b/include/drm/ttm/ttm_bo_driver.h index e4fee8e02559..1021106438b2 100644 --- a/include/drm/ttm/ttm_bo_driver.h +++ b/include/drm/ttm/ttm_bo_driver.h | |||
@@ -31,7 +31,6 @@ | |||
31 | #define _TTM_BO_DRIVER_H_ | 31 | #define _TTM_BO_DRIVER_H_ |
32 | 32 | ||
33 | #include <drm/drm_mm.h> | 33 | #include <drm/drm_mm.h> |
34 | #include <drm/drm_global.h> | ||
35 | #include <drm/drm_vma_manager.h> | 34 | #include <drm/drm_vma_manager.h> |
36 | #include <linux/workqueue.h> | 35 | #include <linux/workqueue.h> |
37 | #include <linux/fs.h> | 36 | #include <linux/fs.h> |
@@ -385,15 +384,6 @@ struct ttm_bo_driver { | |||
385 | }; | 384 | }; |
386 | 385 | ||
387 | /** | 386 | /** |
388 | * struct ttm_bo_global_ref - Argument to initialize a struct ttm_bo_global. | ||
389 | */ | ||
390 | |||
391 | struct ttm_bo_global_ref { | ||
392 | struct drm_global_reference ref; | ||
393 | struct ttm_mem_global *mem_glob; | ||
394 | }; | ||
395 | |||
396 | /** | ||
397 | * struct ttm_bo_global - Buffer object driver global data. | 387 | * struct ttm_bo_global - Buffer object driver global data. |
398 | * | 388 | * |
399 | * @mem_glob: Pointer to a struct ttm_mem_global object for accounting. | 389 | * @mem_glob: Pointer to a struct ttm_mem_global object for accounting. |
@@ -407,7 +397,7 @@ struct ttm_bo_global_ref { | |||
407 | * @swap_lru: Lru list of buffer objects used for swapping. | 397 | * @swap_lru: Lru list of buffer objects used for swapping. |
408 | */ | 398 | */ |
409 | 399 | ||
410 | struct ttm_bo_global { | 400 | extern struct ttm_bo_global { |
411 | 401 | ||
412 | /** | 402 | /** |
413 | * Constant after init. | 403 | * Constant after init. |
@@ -416,12 +406,12 @@ struct ttm_bo_global { | |||
416 | struct kobject kobj; | 406 | struct kobject kobj; |
417 | struct ttm_mem_global *mem_glob; | 407 | struct ttm_mem_global *mem_glob; |
418 | struct page *dummy_read_page; | 408 | struct page *dummy_read_page; |
419 | struct mutex device_list_mutex; | ||
420 | spinlock_t lru_lock; | 409 | spinlock_t lru_lock; |
421 | 410 | ||
422 | /** | 411 | /** |
423 | * Protected by device_list_mutex. | 412 | * Protected by ttm_global_mutex. |
424 | */ | 413 | */ |
414 | unsigned int use_count; | ||
425 | struct list_head device_list; | 415 | struct list_head device_list; |
426 | 416 | ||
427 | /** | 417 | /** |
@@ -433,7 +423,7 @@ struct ttm_bo_global { | |||
433 | * Internal protection. | 423 | * Internal protection. |
434 | */ | 424 | */ |
435 | atomic_t bo_count; | 425 | atomic_t bo_count; |
436 | }; | 426 | } ttm_bo_glob; |
437 | 427 | ||
438 | 428 | ||
439 | #define TTM_NUM_MEM_TYPES 8 | 429 | #define TTM_NUM_MEM_TYPES 8 |
@@ -578,9 +568,6 @@ void ttm_bo_mem_put(struct ttm_buffer_object *bo, struct ttm_mem_reg *mem); | |||
578 | void ttm_bo_mem_put_locked(struct ttm_buffer_object *bo, | 568 | void ttm_bo_mem_put_locked(struct ttm_buffer_object *bo, |
579 | struct ttm_mem_reg *mem); | 569 | struct ttm_mem_reg *mem); |
580 | 570 | ||
581 | void ttm_bo_global_release(struct drm_global_reference *ref); | ||
582 | int ttm_bo_global_init(struct drm_global_reference *ref); | ||
583 | |||
584 | int ttm_bo_device_release(struct ttm_bo_device *bdev); | 571 | int ttm_bo_device_release(struct ttm_bo_device *bdev); |
585 | 572 | ||
586 | /** | 573 | /** |
@@ -598,7 +585,7 @@ int ttm_bo_device_release(struct ttm_bo_device *bdev); | |||
598 | * Returns: | 585 | * Returns: |
599 | * !0: Failure. | 586 | * !0: Failure. |
600 | */ | 587 | */ |
601 | int ttm_bo_device_init(struct ttm_bo_device *bdev, struct ttm_bo_global *glob, | 588 | int ttm_bo_device_init(struct ttm_bo_device *bdev, |
602 | struct ttm_bo_driver *driver, | 589 | struct ttm_bo_driver *driver, |
603 | struct address_space *mapping, | 590 | struct address_space *mapping, |
604 | uint64_t file_page_offset, bool need_dma32); | 591 | uint64_t file_page_offset, bool need_dma32); |
diff --git a/include/drm/ttm/ttm_memory.h b/include/drm/ttm/ttm_memory.h index 737b5fed8003..3ff48a0a2d7b 100644 --- a/include/drm/ttm/ttm_memory.h +++ b/include/drm/ttm/ttm_memory.h | |||
@@ -63,7 +63,7 @@ | |||
63 | 63 | ||
64 | #define TTM_MEM_MAX_ZONES 2 | 64 | #define TTM_MEM_MAX_ZONES 2 |
65 | struct ttm_mem_zone; | 65 | struct ttm_mem_zone; |
66 | struct ttm_mem_global { | 66 | extern struct ttm_mem_global { |
67 | struct kobject kobj; | 67 | struct kobject kobj; |
68 | struct ttm_bo_global *bo_glob; | 68 | struct ttm_bo_global *bo_glob; |
69 | struct workqueue_struct *swap_queue; | 69 | struct workqueue_struct *swap_queue; |
@@ -78,7 +78,7 @@ struct ttm_mem_global { | |||
78 | #else | 78 | #else |
79 | struct ttm_mem_zone *zone_dma32; | 79 | struct ttm_mem_zone *zone_dma32; |
80 | #endif | 80 | #endif |
81 | }; | 81 | } ttm_mem_glob; |
82 | 82 | ||
83 | extern int ttm_mem_global_init(struct ttm_mem_global *glob); | 83 | extern int ttm_mem_global_init(struct ttm_mem_global *glob); |
84 | extern void ttm_mem_global_release(struct ttm_mem_global *glob); | 84 | extern void ttm_mem_global_release(struct ttm_mem_global *glob); |