diff options
author | Christian König <christian.koenig@amd.com> | 2018-10-19 10:55:26 -0400 |
---|---|---|
committer | Alex Deucher <alexander.deucher@amd.com> | 2018-11-05 14:21:21 -0500 |
commit | a64f784bb14a56bfdfad2dc397dd67e4564e3a29 (patch) | |
tree | f2e55af233d82fc8365c4a39d59a897998c3081a /include/drm/ttm | |
parent | 62b53b37e4b1500d4eb4624a44ad861cf8d3cd18 (diff) |
drm/ttm: initialize globals during device init (v2)
Make sure that the global BO state is always correctly initialized.
This allows removing all the device code to initialize it.
v2: fix up vbox (Alex)
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 'include/drm/ttm')
-rw-r--r-- | include/drm/ttm/ttm_bo_driver.h | 41 |
1 files changed, 1 insertions, 40 deletions
diff --git a/include/drm/ttm/ttm_bo_driver.h b/include/drm/ttm/ttm_bo_driver.h index 26be74939f10..6fb589f64633 100644 --- a/include/drm/ttm/ttm_bo_driver.h +++ b/include/drm/ttm/ttm_bo_driver.h | |||
@@ -569,9 +569,6 @@ void ttm_bo_mem_put(struct ttm_buffer_object *bo, struct ttm_mem_reg *mem); | |||
569 | void ttm_bo_mem_put_locked(struct ttm_buffer_object *bo, | 569 | void ttm_bo_mem_put_locked(struct ttm_buffer_object *bo, |
570 | struct ttm_mem_reg *mem); | 570 | struct ttm_mem_reg *mem); |
571 | 571 | ||
572 | void ttm_bo_global_release(void); | ||
573 | int ttm_bo_global_init(void); | ||
574 | |||
575 | int ttm_bo_device_release(struct ttm_bo_device *bdev); | 572 | int ttm_bo_device_release(struct ttm_bo_device *bdev); |
576 | 573 | ||
577 | /** | 574 | /** |
@@ -589,7 +586,7 @@ int ttm_bo_device_release(struct ttm_bo_device *bdev); | |||
589 | * Returns: | 586 | * Returns: |
590 | * !0: Failure. | 587 | * !0: Failure. |
591 | */ | 588 | */ |
592 | int ttm_bo_device_init(struct ttm_bo_device *bdev, struct ttm_bo_global *glob, | 589 | int ttm_bo_device_init(struct ttm_bo_device *bdev, |
593 | struct ttm_bo_driver *driver, | 590 | struct ttm_bo_driver *driver, |
594 | struct address_space *mapping, | 591 | struct address_space *mapping, |
595 | uint64_t file_page_offset, bool need_dma32); | 592 | uint64_t file_page_offset, bool need_dma32); |
@@ -888,40 +885,4 @@ pgprot_t ttm_io_prot(uint32_t caching_flags, pgprot_t tmp); | |||
888 | 885 | ||
889 | extern const struct ttm_mem_type_manager_func ttm_bo_manager_func; | 886 | extern const struct ttm_mem_type_manager_func ttm_bo_manager_func; |
890 | 887 | ||
891 | /** | ||
892 | * struct ttm_bo_global_ref - Argument to initialize a struct ttm_bo_global. | ||
893 | */ | ||
894 | |||
895 | struct ttm_bo_global_ref { | ||
896 | struct drm_global_reference ref; | ||
897 | }; | ||
898 | |||
899 | /** | ||
900 | * ttm_bo_global_ref_init | ||
901 | * | ||
902 | * @ref: DRM global reference | ||
903 | * | ||
904 | * Helper function that initializes a struct ttm_bo_global. This function | ||
905 | * is used as init call-back function for DRM global references of type | ||
906 | * DRM_GLOBAL_TTM_BO_REF. | ||
907 | */ | ||
908 | static inline int ttm_bo_global_ref_init(struct drm_global_reference *ref) | ||
909 | { | ||
910 | return ttm_bo_global_init(); | ||
911 | } | ||
912 | |||
913 | /** | ||
914 | * ttm_bo_global_ref_release | ||
915 | * | ||
916 | * @ref: DRM global reference | ||
917 | * | ||
918 | * Helper function that releases a struct ttm_bo_global. This function | ||
919 | * is used as release call-back function for DRM global references of type | ||
920 | * DRM_GLOBAL_TTM_BO_REF. | ||
921 | */ | ||
922 | static inline void ttm_bo_global_ref_release(struct drm_global_reference *ref) | ||
923 | { | ||
924 | ttm_bo_global_release(); | ||
925 | } | ||
926 | |||
927 | #endif | 888 | #endif |