From a64f784bb14a56bfdfad2dc397dd67e4564e3a29 Mon Sep 17 00:00:00 2001 From: Christian König Date: Fri, 19 Oct 2018 16:55:26 +0200 Subject: drm/ttm: initialize globals during device init (v2) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Reviewed-by: Junwei Zhang Signed-off-by: Alex Deucher --- include/drm/ttm/ttm_bo_driver.h | 41 +---------------------------------------- 1 file changed, 1 insertion(+), 40 deletions(-) (limited to 'include/drm/ttm') 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); void ttm_bo_mem_put_locked(struct ttm_buffer_object *bo, struct ttm_mem_reg *mem); -void ttm_bo_global_release(void); -int ttm_bo_global_init(void); - int ttm_bo_device_release(struct ttm_bo_device *bdev); /** @@ -589,7 +586,7 @@ int ttm_bo_device_release(struct ttm_bo_device *bdev); * Returns: * !0: Failure. */ -int ttm_bo_device_init(struct ttm_bo_device *bdev, struct ttm_bo_global *glob, +int ttm_bo_device_init(struct ttm_bo_device *bdev, struct ttm_bo_driver *driver, struct address_space *mapping, uint64_t file_page_offset, bool need_dma32); @@ -888,40 +885,4 @@ pgprot_t ttm_io_prot(uint32_t caching_flags, pgprot_t tmp); extern const struct ttm_mem_type_manager_func ttm_bo_manager_func; -/** - * struct ttm_bo_global_ref - Argument to initialize a struct ttm_bo_global. - */ - -struct ttm_bo_global_ref { - struct drm_global_reference ref; -}; - -/** - * ttm_bo_global_ref_init - * - * @ref: DRM global reference - * - * Helper function that initializes a struct ttm_bo_global. This function - * is used as init call-back function for DRM global references of type - * DRM_GLOBAL_TTM_BO_REF. - */ -static inline int ttm_bo_global_ref_init(struct drm_global_reference *ref) -{ - return ttm_bo_global_init(); -} - -/** - * ttm_bo_global_ref_release - * - * @ref: DRM global reference - * - * Helper function that releases a struct ttm_bo_global. This function - * is used as release call-back function for DRM global references of type - * DRM_GLOBAL_TTM_BO_REF. - */ -static inline void ttm_bo_global_ref_release(struct drm_global_reference *ref) -{ - ttm_bo_global_release(); -} - #endif -- cgit v1.2.3